/* =========================================================
   Scardini — Portfolio
   Design tokens, base, layout, components, animations, media
   ========================================================= */

/* ---------- Design Tokens ---------- */
:root {
  /* Color system: 3 neutrals + 1 accent */
  --paper: #f1ede4;        /* warm ivory background */
  --paper-2: #e9e4d8;      /* slightly deeper surface */
  --ink: #16150f;          /* near-black foreground */
  --ink-soft: #2a2822;     /* dark surface */
  --muted: #726b5e;        /* warm gray text */
  --accent: #ef4a11;       /* signal orange-red */
  --accent-ink: #ffffff;   /* text on accent */

  --line: rgba(22, 21, 15, 0.14);
  --line-strong: rgba(22, 21, 15, 0.28);

  /* On dark sections */
  --paper-on-dark: #f1ede4;
  --muted-on-dark: #a49c8c;
  --line-on-dark: rgba(241, 237, 228, 0.16);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --radius: 18px;
  --radius-sm: 12px;

  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--paper);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; }
p { margin: 0; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(4.5rem, 10vw, 9rem);
  position: relative;
}

.section-dark {
  background: var(--ink);
  color: var(--paper-on-dark);
}
.section-dark .section-index { color: var(--muted-on-dark); border-color: var(--line-on-dark); }
.section-dark .section-title { color: var(--paper-on-dark); }

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: -60px;
  left: 1rem;
  z-index: 999;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  border-radius: 8px;
  transition: top 0.25s var(--ease);
}
.skip-link:focus { top: 1rem; }

/* ---------- Scroll progress ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: var(--accent);
  z-index: 200;
  transition: width 0.1s linear;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.98rem;
  padding: 0.9rem 1.5rem;
  border-radius: 100px;
  border: 1.5px solid var(--ink);
  transition: transform 0.35s var(--ease), background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
  will-change: transform;
}
.btn-sm { padding: 0.6rem 1.1rem; font-size: 0.9rem; }
.btn-solid { background: var(--ink); color: var(--paper); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translateY(-3px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px); }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  transition: transform 0.4s var(--ease), background 0.4s var(--ease), border-color 0.4s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header.hide { transform: translateY(-110%); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { border-radius: 8px; }
.brand-dot { color: var(--accent); }

.nav { display: flex; gap: 2rem; }
.nav a {
  font-size: 0.95rem;
  color: var(--muted);
  position: relative;
  transition: color 0.3s var(--ease);
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { transform: scaleX(1); }

.menu-toggle { display: none; width: 44px; height: 44px; border-radius: 10px; position: relative; }
.menu-toggle span {
  position: absolute;
  left: 11px; width: 22px; height: 2px; background: var(--ink);
  transition: transform 0.35s var(--ease), opacity 0.25s var(--ease);
}
.menu-toggle span:nth-child(1) { top: 18px; }
.menu-toggle span:nth-child(2) { top: 25px; }
.menu-toggle.open span:nth-child(1) { transform: translateY(3.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { transform: translateY(-3.5px) rotate(-45deg); }

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--paper);
  padding: 100px var(--gutter) 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateY(-100%);
  transition: transform 0.5s var(--ease);
  visibility: hidden;
}
.mobile-menu.open { transform: translateY(0); visibility: visible; }
.mobile-nav { display: flex; flex-direction: column; gap: 0.4rem; }
.mobile-nav a {
  font-family: var(--font-display);
  font-size: clamp(2rem, 9vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 1rem;
  transition: color 0.3s var(--ease), padding-left 0.3s var(--ease);
}
.mobile-nav a:hover { color: var(--accent); padding-left: 0.75rem; }
.mobile-nav .idx { font-size: 0.9rem; color: var(--muted); font-weight: 400; }

/* ---------- Eyebrow / labels ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.dot-live {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 120px;
  overflow: hidden;
}
.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: clamp(60px, 9vw, 120px) clamp(60px, 9vw, 120px);
  -webkit-mask-image: radial-gradient(120% 90% at 60% 20%, #000 40%, transparent 78%);
          mask-image: radial-gradient(120% 90% at 60% 20%, #000 40%, transparent 78%);
  opacity: 0.55;
  pointer-events: none;
}
.hero-inner { position: relative; padding-bottom: clamp(2rem, 5vw, 4rem); }

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
}
.hero-loc { color: var(--ink); }

.hero-title {
  font-size: clamp(3.2rem, 13vw, 11rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.92;
  margin-bottom: clamp(1.8rem, 5vw, 3.5rem);
}
.hero-title .line { display: block; }
.hero-title .line-accent { color: var(--accent); }
.hero-title .word { display: inline-block; }

.hero-bottom {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  align-items: end;
}
.hero-lead {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  color: var(--muted);
  max-width: 46ch;
  line-height: 1.5;
}
.hero-actions { display: flex; gap: 0.9rem; flex-wrap: wrap; justify-self: end; }

.hero-shape {
  position: absolute;
  top: clamp(80px, 12vw, 140px);
  right: 0;
  width: clamp(120px, 20vw, 260px);
  height: clamp(120px, 20vw, 260px);
  pointer-events: none;
}
.shape-ring {
  position: absolute; inset: 0;
  border: 2px solid var(--ink);
  border-radius: 50%;
  animation: float 7s ease-in-out infinite;
}
.shape-square {
  position: absolute;
  right: 8%; bottom: -6%;
  width: 46%; height: 46%;
  background: var(--accent);
  border-radius: 8px;
  animation: float 5.5s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-16px) rotate(6deg); }
}

/* Marquee */
.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding-block: 1rem;
  margin-top: clamp(2rem, 5vw, 3.5rem);
}
.marquee-track {
  display: inline-flex;
  gap: 2.5rem;
  white-space: nowrap;
  animation: scroll-x 28s linear infinite;
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.4rem);
  font-weight: 500;
  align-items: center;
}
.marquee-track .sep { color: var(--accent); }
@keyframes scroll-x {
  to { transform: translateX(-50%); }
}

/* ---------- Section head ---------- */
.section-head { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-index {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.section-title { font-size: clamp(2.1rem, 6vw, 4rem); font-weight: 700; letter-spacing: -0.035em; }
.section-sub { margin-top: 1rem; color: var(--muted); max-width: 50ch; font-size: 1.05rem; }
.section-dark .section-sub { color: var(--muted-on-dark); }

/* ---------- ABOUT ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}
.about-photo {
  margin: 0;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.about-photo img {
  width: 100%;
  height: auto;
  object-fit: cover;
  filter: grayscale(1) contrast(1.03);
  transition: filter 0.6s var(--ease), transform 0.8s var(--ease);
}
.about-photo:hover img { filter: grayscale(0); transform: scale(1.03); }
.about-photo figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 1.5rem 1.25rem 1rem;
  font-family: var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--paper);
  background: linear-gradient(to top, rgba(22,21,15,0.85), transparent);
}
.about-lead { font-size: clamp(1.2rem, 2.2vw, 1.6rem); line-height: 1.4; color: var(--ink); margin-bottom: 1.25rem; font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.about-body p { color: var(--muted); margin-bottom: 1.25rem; }
.about-body strong { color: var(--ink); font-weight: 600; }

.about-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.5rem;
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.stat { display: flex; flex-direction: column; }
.stat-num, .stat-plus {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}
.stat-plus { color: var(--accent); display: inline; }
.stat-num { display: inline; }
.stat-label { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* ---------- SKILLS ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}
.skill-card {
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  transition: transform 0.5s var(--ease), background 0.5s var(--ease), border-color 0.5s var(--ease);
  background: color-mix(in srgb, var(--paper) 4%, transparent);
}
.skill-card:hover {
  transform: translateY(-8px);
  background: color-mix(in srgb, var(--paper) 8%, transparent);
  border-color: var(--accent);
}
.skill-num {
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.9rem;
  letter-spacing: 0.06em;
}
.skill-card h3 { font-size: clamp(1.4rem, 2.5vw, 1.9rem); margin: 1.2rem 0 0.75rem; }
.skill-card p { color: var(--muted-on-dark); margin-bottom: 1.5rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag-list li {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-on-dark);
  border-radius: 100px;
  color: var(--paper-on-dark);
}
.section:not(.section-dark) .tag-list li { border-color: var(--line); color: var(--ink); }

/* ---------- WORK ---------- */
.work-list { display: flex; flex-direction: column; gap: clamp(1.5rem, 3vw, 2.5rem); }
.project-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), border-color 0.5s var(--ease);
  transform-style: preserve-3d;
}
.project-card:hover {
  border-color: var(--ink);
  box-shadow: 14px 14px 0 var(--ink);
  transform: translate(-2px, -2px);
}
.project-card:nth-child(even) .project-media { order: 2; }

.project-media {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(1.5rem, 4vw, 3rem);
}
.project-media img {
  width: auto;
  height: auto;
  max-width: 78%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.6s var(--ease);
}
.project-card:hover .project-media img { transform: scale(1.06) rotate(-2deg); }
.project-media--lively { background: #eafae8; }
.project-media--urban { background: #fdf4ee; }
.project-media--adrimar { background: #0f2542; }

.project-top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.project-title { font-size: clamp(1.6rem, 3.5vw, 2.6rem); font-weight: 700; }
.project-year { font-family: var(--font-display); color: var(--muted); font-size: 0.9rem; }
.project-desc { color: var(--muted); margin: 1rem 0 1.25rem; max-width: 44ch; }
.project-info .tag-list { margin-bottom: 1.75rem; }
.project-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 500;
  padding: 0.7rem 1.3rem;
  border: 1.5px solid var(--ink);
  border-radius: 100px;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), gap 0.35s var(--ease);
}
.project-link:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); gap: 0.9rem; }
.project-link svg { transition: transform 0.35s var(--ease); }
.project-link:hover svg { transform: translate(2px, -2px); }

/* ---------- PROCESS ---------- */
.process-list { display: grid; gap: 0; }
.process-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1rem, 4vw, 3rem);
  align-items: baseline;
  padding: clamp(1.5rem, 3vw, 2.25rem) 0;
  border-top: 1px solid var(--line-on-dark);
  transition: padding-left 0.4s var(--ease);
}
.process-list .process-step:last-child { border-bottom: 1px solid var(--line-on-dark); }
.process-step:hover { padding-left: 0.75rem; }
.step-num {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 700;
  color: var(--accent);
}
.process-step h3 { font-size: clamp(1.5rem, 4vw, 2.6rem); font-weight: 600; margin-bottom: 0.5rem; }
.process-step p { color: var(--muted-on-dark); max-width: 60ch; }

/* ---------- CONTACT ---------- */
.contact-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact .section-head { margin-bottom: 1.5rem; }
.contact .section-index { border: none; }
.contact-lead { color: var(--muted); font-size: 1.15rem; max-width: 52ch; margin-bottom: 2.5rem; }
.contact-mail {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 6vw, 4rem);
  letter-spacing: -0.03em;
  position: relative;
  transition: color 0.4s var(--ease);
  word-break: break-word;
}
.contact-mail::after {
  content: "";
  position: absolute; left: 0; bottom: 4px;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s var(--ease);
}
.contact-mail:hover { color: var(--accent); }
.contact-mail:hover::after { transform: scaleX(1); }

.contact-socials { display: flex; gap: 2rem; margin-top: 2.5rem; flex-wrap: wrap; justify-content: center; }
.contact-socials a {
  font-family: var(--font-display);
  color: var(--muted);
  position: relative;
  transition: color 0.3s var(--ease);
}
.contact-socials a:hover { color: var(--ink); }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; }
.footer-copy { color: var(--muted); font-size: 0.9rem; }
.to-top {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-display); font-size: 0.9rem;
  padding: 0.6rem 1.1rem; border: 1.5px solid var(--ink); border-radius: 100px;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), transform 0.3s var(--ease);
}
.to-top:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px); }

/* ---------- Reveal animations ---------- */
.reveal, .reveal-word {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal-word { transform: translateY(100%); }
.reveal.is-visible, .reveal-word.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-photo { max-width: 420px; }
  .skills-grid { grid-template-columns: 1fr; }
  .project-card { grid-template-columns: 1fr; }
  .project-card:nth-child(even) .project-media { order: 0; }
  .project-media { aspect-ratio: 4 / 3; }
}

@media (max-width: 760px) {
  .nav, .header-cta { display: none; }
  .menu-toggle { display: block; }
  .hero-bottom { grid-template-columns: 1fr; align-items: start; }
  .hero-actions { justify-self: start; }
  .hero-shape { display: none; }
  .project-card:hover { box-shadow: 8px 8px 0 var(--ink); }
  .footer-inner { flex-direction: column; align-items: flex-start; }
  #about-photo { display: none; }
}

@media (max-width: 420px) {
  .hero-actions .btn { flex: 1; justify-content: center; }
  .about-stats { gap: 1.5rem 2rem; }
  #btn-diminuir{
    white-space: nowrap;
  }
  #link-diminuir{
    font-size: 1.3rem;
  }
}
