/* ==========================================================
   Heloísa Nogueira — estilos v2 (dark / cinematic)
   Base estática e legível; .motion/.motion-ready adicionam
   o comportamento animado (ver js/motion.js).
   ========================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  interpolate-size: allow-keywords;
}
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
em { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }

::selection { background: var(--accent-hi); color: #fff; }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; border-radius: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--gutter); top: -100px; z-index: 100;
  padding: .75rem 1rem; background: var(--paper); color: var(--bg); font-weight: 600;
}
.skip-link:focus { top: 1rem; }

/* Link com "roll": o texto sobe e dá lugar à versão em serifa itálica */
.roll {
  display: inline-block; overflow: hidden; vertical-align: bottom;
  line-height: 1.2; text-decoration: none;
}
.roll > span { position: relative; display: block; transition: transform .5s var(--ease-out); }
.roll > span::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 100%;
  font-family: var(--font-serif); font-style: italic; font-weight: 400; text-transform: none; letter-spacing: 0;
  white-space: nowrap;
}
.roll:hover > span, .roll:focus-visible > span { transform: translateY(-100%); }

.section-label {
  margin-bottom: clamp(2.5rem, 2rem + 3vw, 5rem);
  font-size: .8rem; font-weight: 500; letter-spacing: .01em;
}
.section-label span { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h); padding-inline: var(--gutter);
  color: #fff;
  background: linear-gradient(to bottom, rgb(10 10 12 / .85), rgb(10 10 12 / 0));
  pointer-events: none;
}
.site-header a { pointer-events: auto; }
.logo { font-size: 1.05rem; font-weight: 600; letter-spacing: -.02em; text-decoration: none; }
.logo span { font-family: var(--font-serif); font-style: italic; font-weight: 400; font-size: 1.15em; }
.header-nav { display: flex; gap: clamp(.9rem, 2vw, 2rem); }
.header-nav a, .hero-bar, .footer-bottom { font-size: .72rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

/* ---------- Trilho de progresso ---------- */
.rail { display: none; }
@media (min-width: 900px) {
  .motion-ready .rail { display: block; }
  .rail-count {
    position: fixed; left: var(--gutter); top: 50%; z-index: 55;
    font-size: .68rem; font-weight: 500; color: var(--muted);
  }
  .rail-bar {
    position: fixed; right: var(--gutter); top: 50%; z-index: 55;
    width: 1px; height: 28vh; transform: translateY(-50%);
    background: rgb(255 255 255 / .14);
  }
  .rail-thumb { position: absolute; left: 0; top: 0; width: 1px; height: 22%; background: #fff; }
  .rail-label {
    position: fixed; right: calc(var(--gutter) + .75rem); top: calc(50% + 14vh - 1rem); z-index: 55;
    font-size: .68rem; font-weight: 500; color: var(--muted);
  }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  height: 100svh; min-height: 560px;
  background: var(--bg);
}
.hero-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.hero-bg::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgb(10 10 12 / .65) 70%, var(--bg) 95%);
}
.blob { position: absolute; border-radius: 50%; will-change: transform; }
.blob-1 { width: 90vw; height: 110vh; left: 12%; top: -45%; background: radial-gradient(closest-side, var(--accent-hi) 20%, rgb(247 37 133 / 0)); }
.blob-2 { width: 70vw; height: 100vh; left: -20%; top: -20%; background: radial-gradient(closest-side, #b8005f 15%, rgb(184 0 95 / 0)); }
.blob-3 { width: 55vw; height: 80vh; right: -12%; top: -35%; background: radial-gradient(closest-side, rgb(255 150 130 / .9) 10%, rgb(255 150 130 / 0)); }
@media (prefers-reduced-motion: no-preference) {
  .blob-1 { animation: drift-a 16s ease-in-out infinite alternate; }
  .blob-2 { animation: drift-b 20s ease-in-out infinite alternate; }
  .blob-3 { animation: drift-c 14s ease-in-out infinite alternate; }
}
@keyframes drift-a { to { transform: translate(-12vw, 8vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(14vw, -6vh) scale(.9); } }
@keyframes drift-c { to { transform: translate(-8vw, 10vh) scale(1.2); } }

/* Luz que segue o cursor + campo de estrelas (js/motion.js) */
.hero-light {
  position: absolute; left: 0; top: 0;
  width: 70vmax; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, rgb(247 37 133 / .5), rgb(255 150 130 / .12) 55%, rgb(247 37 133 / 0));
  mix-blend-mode: screen; pointer-events: none;
  opacity: 0; transition: opacity .8s;
}
.motion-ready .hero-light { opacity: 1; }
.hero-stars { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-intro {
  position: absolute; z-index: 4; left: var(--gutter); top: calc(var(--header-h) + .75rem);
  max-width: 32ch; font-size: .8rem; line-height: 1.4; color: rgb(242 241 238 / .85);
}
.hero-intro em { font-size: 1.12em; }

.hero-name {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 5.5rem;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; column-gap: .15em;
  font-size: 18.5vw; font-weight: 400; line-height: .88; letter-spacing: -.055em;
}
.name-first { position: relative; z-index: 1; color: #f6eef1; }
@media (prefers-reduced-motion: no-preference) {
  .motion .name-first, .motion .name-last { animation: name-in 1.6s cubic-bezier(.16, 1, .3, 1) .1s backwards; }
  .motion .name-last { animation-delay: .2s; }
}
@keyframes name-in { from { translate: 0 45%; opacity: 0; } }
@media (max-width: 899.98px) {
  .name-first { z-index: 3; text-shadow: 0 2px 30px rgb(10 10 12 / .6); }
}
.name-last {
  position: relative; z-index: 3;
  width: 100%; text-align: right;
  font-family: var(--font-serif); font-style: italic; letter-spacing: -.02em;
  padding: 0 .06em .1em 0;
  background: linear-gradient(100deg, var(--glow) 10%, var(--glow-pale) 55%, #fff 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (min-width: 900px) {
  .hero-name { flex-wrap: nowrap; font-size: min(10.4vw, 17vh + 4vw); bottom: 5rem; }
  .name-last { width: auto; }
}

.hero-bar {
  position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: .9rem; border-top: 1px solid rgb(242 241 238 / .3);
}
.hero-social { display: none; gap: .75rem; }
.hero-social li[aria-hidden] { color: var(--muted); }
@media (min-width: 700px) {
  .hero-bar { display: grid; grid-template-columns: 1fr auto 1fr; }
  .hero-social { display: flex; }
  .hero-cv { justify-self: end; }
}

/* ---------- Statement ---------- */
.statement {
  position: relative; overflow: hidden; isolation: isolate;
  height: 100svh; min-height: 560px;
  display: grid; place-items: center;
  background: #000;
}
.statement-moon {
  position: absolute; z-index: -1;
  width: min(70vw, 620px); aspect-ratio: 1; right: -30%; top: -22%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 38% 34%, rgb(200 90 130 / .45), transparent 14%),
    radial-gradient(circle at 58% 28%, rgb(200 90 130 / .35), transparent 10%),
    radial-gradient(circle at 30% 58%, rgb(200 90 130 / .4), transparent 18%),
    radial-gradient(circle at 62% 62%, rgb(200 90 130 / .25), transparent 12%),
    radial-gradient(circle at 30% 30%, #fff3f7 0%, var(--glow) 45%, #c2507f 100%);
  box-shadow: inset -9vw -6vw 12vw rgb(0 0 0 / .92), 0 0 12vw rgb(255 179 207 / .18);
}
@media (min-width: 900px) { .statement-moon { right: -10%; top: -30%; } }
.constellation { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; }
.const-line { fill: none; stroke: var(--glow); stroke-width: 1; opacity: .55; vector-effect: non-scaling-stroke; }
.const-stars circle { fill: var(--glow-pale); }
.statement-text {
  max-width: 14ch; padding-inline: var(--gutter);
  font-family: var(--font-serif); font-size: clamp(2rem, 1.3rem + 2.6vw, 3.6rem); line-height: 1.05;
  text-align: center; letter-spacing: -.01em;
}
.statement-text em { color: var(--glow); }
.statement-photo {
  position: absolute; z-index: 0; margin: 0; bottom: 0; left: -8vw;
  height: min(58svh, 520px); pointer-events: none;
}
.statement-photo img {
  width: auto; height: 100%; display: block;
  filter: drop-shadow(0 0 60px rgb(247 37 133 / .3));
}
.statement-text { position: relative; z-index: 1; align-self: start; margin-top: 30svh; text-shadow: 0 2px 30px rgb(0 0 0 / .7); }
@media (min-width: 900px) {
  .statement { place-items: center end; }
  .statement-photo { left: 6vw; height: 88svh; max-height: 900px; }
  .statement-text { align-self: center; margin-top: 0; margin-right: 8vw; text-align: left; padding-inline: 0; }
}

/* ---------- Sobre ---------- */
.about { padding: var(--section) var(--gutter); }
.about-grid { display: grid; gap: 3rem; }
.about-lead { font-size: var(--fs-lead); font-weight: 400; line-height: 1.1; letter-spacing: -.035em; }
.about-lead em { color: var(--glow); }
.about-text { max-width: 36ch; color: rgb(242 241 238 / .78); }
.about-text p + p { margin-top: 1em; }
.about-text strong { color: var(--paper); font-weight: 500; }
.about-cta { margin-top: 2rem; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--paper); }

@media (min-width: 900px) {
  .about-grid { grid-template-columns: 1fr 1fr; column-gap: 5vw; row-gap: 5rem; align-items: start; }
  .about-lead { grid-column: 1 / -1; max-width: 22ch; }
  .about-text { grid-column: 2; }
}

/* Revelação palavra a palavra */
.motion-ready [data-words] .w { opacity: .16; }

/* ---------- Projetos ---------- */
.work { position: relative; overflow: hidden; }
.ribbon { display: none; }
.work-inner { position: relative; z-index: 1; padding: var(--section) var(--gutter); }
.work-list { display: none; }
.work-cards { display: grid; gap: 4.5rem; }
.card-meta {
  display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .75rem;
  font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; color: var(--muted);
}
.work-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; background: var(--bg-2); }
.work-card h3 { margin-top: 1.25rem; font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); font-weight: 400; letter-spacing: -.035em; line-height: 1.05; }
.work-card h3 + p { margin-top: .6rem; color: rgb(242 241 238 / .72); }
.card-tech { margin-top: .9rem; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--glow); }
.card-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1rem; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }

@media (min-width: 960px) {
  .motion-ready .work { height: 100svh; }
  .motion-ready .ribbon {
    display: block; position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%;
    pointer-events: none;
  }
  .ribbon path {
    fill: none; stroke: var(--accent-hi); stroke-width: max(56px, 6.5vw); stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 0 999999;
  }
  .motion-ready .work-inner {
    height: 100%;
    display: grid; grid-template-columns: 1fr minmax(300px, 30vw); align-items: center; column-gap: 4vw;
    padding: 0 8vw 0 calc(var(--gutter) + 5vw);
  }
  .motion-ready .work .section-label { position: absolute; left: calc(var(--gutter) + 5vw); top: calc(var(--header-h) + 2rem); }
  .motion-ready .work-list { display: block; }
  .work-list li { width: fit-content; min-width: 24vw; border-bottom: 1px solid var(--line); }
  .work-list li:nth-child(2) { margin-left: 1.4vw; }
  .work-list li:nth-child(3) { margin-left: 2.8vw; }
  .work-list li:nth-child(4) { margin-left: 4.2vw; }
  .work-list li:nth-child(5) { margin-left: 5.6vw; }
  .work-list li:nth-child(6) { margin-left: 7vw; }
  .work-list li:nth-child(7) { margin-left: 8.4vw; }
  .work-list button {
    display: block; padding: .55rem 0;
    background: none; border: 0; cursor: pointer; text-align: left;
    font-size: clamp(1.8rem, 2.7vw, 3.1rem); letter-spacing: -.035em; line-height: 1.05;
    color: var(--dim);
    transition: color .4s, transform .6s var(--ease-out);
  }
  .work-list button:hover { color: #9a9aa6; }
  .work-list .is-active button { color: var(--paper); transform: translateX(-1.2vw); }

  .motion-ready .work-cards { display: grid; gap: 0; }
  .motion-ready .work-card {
    grid-area: 1 / 1; opacity: 0; pointer-events: none;
    transition: opacity .5s var(--ease-out);
  }
  .motion-ready .work-card.is-active { opacity: 1; pointer-events: auto; }
  .motion-ready .work-card img { clip-path: inset(0 0 100% 0); transition: clip-path .8s var(--ease-out); }
  .motion-ready .work-card.is-active img { clip-path: inset(0 0 0 0); }
  .motion-ready .work-card h3 { font-size: 1.6rem; }
  .motion-ready .work-card h3 + p { font-size: .95rem; }
}

/* ---------- Galeria 3D ---------- */
.gallery {
  position: relative; overflow: hidden;
  height: 100svh; min-height: 560px;
  display: grid; place-items: center;
}
.ring-stage { position: absolute; inset: 0; display: grid; place-items: center; perspective: 1400px; }
.ring {
  --r: 58vw;
  position: relative; width: 34vw; aspect-ratio: 4 / 3;
  transform-style: preserve-3d;
  transform: rotateX(-7deg) rotateY(var(--ry, -20deg));
}
.ring img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 2px;
  transform: rotateY(calc(var(--i) * 30deg)) translateZ(var(--r));
}
.ring img:nth-child(1) { --i: 0; }  .ring img:nth-child(2) { --i: 1; }  .ring img:nth-child(3) { --i: 2; }
.ring img:nth-child(4) { --i: 3; }  .ring img:nth-child(5) { --i: 4; }  .ring img:nth-child(6) { --i: 5; }
.ring img:nth-child(7) { --i: 6; }  .ring img:nth-child(8) { --i: 7; }  .ring img:nth-child(9) { --i: 8; }
.ring img:nth-child(10) { --i: 9; } .ring img:nth-child(11) { --i: 10; } .ring img:nth-child(12) { --i: 11; }
@media (min-width: 900px) { .ring { --r: 36vw; width: 17vw; } }

.gallery-text {
  position: relative; z-index: 2; max-width: 16ch; padding-inline: var(--gutter);
  font-size: clamp(1.8rem, 1.2rem + 2vw, 3rem); line-height: 1.08; letter-spacing: -.03em; text-align: center;
  text-shadow: 0 4px 40px rgb(0 0 0 / .9);
}
.gallery-text em { color: var(--glow); }

/* ---------- Trajetória ---------- */
.track { padding: var(--section) var(--gutter); }
.track-list li {
  display: grid; gap: .25rem;
  padding-block: 1.4rem; border-top: 1px solid var(--line);
  transition: padding-left .5s var(--ease-out);
}
.track-list li:last-child { border-bottom: 1px solid var(--line); }
.track-org { font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2.1rem); letter-spacing: -.03em; line-height: 1.1; }
.track-what { font-family: var(--font-serif); font-style: italic; font-size: 1.3rem; color: var(--glow); }
.track-detail { color: var(--muted); font-size: .95rem; max-width: 52ch; }
.track-tag { font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase; color: var(--muted); }
@media (min-width: 900px) {
  .track-list li { grid-template-columns: 1.1fr .8fr 1.5fr 7rem; gap: 2rem; align-items: baseline; }
  .track-tag { text-align: right; }
  .track-list li:hover { padding-left: 1.25rem; }
}

/* ---------- Stack ---------- */
.skills { padding: var(--section) var(--gutter); }
.skills-grid { display: grid; gap: 3rem; }
.skills-statement {
  max-width: 18ch;
  font-size: clamp(1.8rem, 1.2rem + 2.2vw, 3.2rem); font-weight: 600; line-height: 1; letter-spacing: -.035em;
  text-transform: uppercase;
}
.accordion details { border-top: 1px solid var(--line); }
.accordion details:last-child { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding-block: 1rem; cursor: pointer; list-style: none;
  font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.6rem); letter-spacing: -.035em; line-height: 1.1;
  transition: color .3s;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; font-family: var(--font-mono); font-size: 1.1rem; color: var(--muted); }
.accordion details[open] summary::after { content: "—"; }
.accordion summary:hover { color: var(--glow); }
.accordion ul { display: flex; flex-wrap: wrap; gap: .4rem 1.6rem; padding-bottom: 1.6rem; color: rgb(242 241 238 / .75); }
.accordion ul.dated { display: grid; gap: 0; }
.accordion ul.dated li { display: flex; justify-content: space-between; gap: 1.5rem; padding-block: .55rem; border-bottom: 1px dashed var(--line); }
.accordion ul.dated li:last-child { border-bottom: 0; }
.accordion ul.dated li span:last-child { flex: none; font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--muted); text-transform: uppercase; }
@media (min-width: 900px) { .skills-grid { grid-template-columns: 1fr 1.15fr; gap: 6vw; align-items: start; } }

@media (prefers-reduced-motion: no-preference) {
  @supports selector(::details-content) {
    .accordion details::details-content {
      block-size: 0; overflow: hidden;
      transition: block-size .45s var(--ease-out), content-visibility .45s allow-discrete;
    }
    .accordion details[open]::details-content { block-size: auto; }
  }
}

/* ---------- Contato ---------- */
.contact { padding: var(--section) var(--gutter) 4rem; }
.contact-grid { display: grid; gap: 2rem; }
.contact-lead { font-size: var(--fs-lead); line-height: 1.1; letter-spacing: -.035em; }
.contact-lead em { color: var(--glow); }
.contact-sub { max-width: 36ch; color: var(--muted); }
.contact-links { display: flex; flex-wrap: wrap; gap: 0 4vw; margin-top: clamp(3rem, 2rem + 4vw, 6rem); }
.contact-links a { font-size: clamp(2.6rem, 1.2rem + 6.4vw, 8rem); letter-spacing: -.05em; line-height: 1.05; }
.contact-mail { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin-top: 2.5rem; }
.contact-mail > a { font-size: clamp(1rem, .9rem + .5vw, 1.35rem); overflow-wrap: anywhere; }
.copy-email {
  padding: .45rem .9rem; min-height: 36px;
  background: none; border: 1px solid rgb(242 241 238 / .4); border-radius: 999px; cursor: pointer;
  font-family: var(--font-mono); font-size: var(--fs-micro); text-transform: uppercase;
  transition: background-color .25s, color .25s;
}
.copy-email:hover, .copy-email.is-copied { background: var(--paper); color: var(--bg); }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.5fr 1fr; gap: 6vw; align-items: end; } }

/* ---------- Footer ---------- */
.site-footer { overflow: hidden; }
.footer-name {
  padding-inline: var(--gutter);
  font-size: 12.4vw; line-height: .9; letter-spacing: -.055em; white-space: nowrap;
  color: #f6eef1;
}
.footer-name em {
  padding-right: .06em; letter-spacing: -.02em;
  background: linear-gradient(100deg, var(--glow) 10%, var(--glow-pale) 55%, #fff 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 1.5rem;
  margin: 1.5rem var(--gutter) 0; padding: 1.1rem 0 6rem;
  border-top: 1px solid var(--line); color: var(--muted);
}
@media (min-width: 600px) { .footer-bottom { padding-bottom: 1.5rem; padding-right: 11rem; } }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .001ms !important; }
}
