/* FILE MAP
   file: css/main.css
   site: UMBRA — Ezon Brand Evolution (variação A da HORIZON SERIES)
   contract: DIRECTIONS-BRAND.md — VARIANCE 7 · MOTION 7 · DENSITY 3
   invariantes: Sora + Montserrat; tokens ezon-partners (palette/semantic);
                logo oficial SVG; teal 1x por viewport.
   assinatura: seções alternam dark ↔ .theme-light como fases de eclipse;
               orbe Starlight com corona canvas; anéis concêntricos finos.
   NENHUM hex fora de css/tokens/ — somente var().
*/
@import "tokens/palette.css";
@import "tokens/semantic.css";

/* ---------- site tokens (deriva, não inventa) ---------- */
:root {
  --font-heading: 'Sora', sans-serif;
  --font-body: 'Montserrat', sans-serif;

  /* type scale — typography.md */
  --fs-hero: clamp(2.5rem, 1.2rem + 6.4vw, 6rem);        /* 40→96px */
  --fs-h1: clamp(2rem, 1.4rem + 2.6vw, 3.5rem);           /* 32→56px */
  --fs-h2: clamp(1.5rem, 1.2rem + 1.6vw, 2.5rem);         /* 24→40px */
  --fs-h3: clamp(1.25rem, 1.1rem + 0.8vw, 1.75rem);
  --fs-lede: clamp(1.0625rem, 1rem + 0.4vw, 1.125rem);
  --fs-body: 1rem;
  --fs-caption: 0.75rem;

  --track-hero: -0.026em;   /* ≈ -2.5px @96px */
  --track-h1: -0.027em;     /* ≈ -1.5px @56px */
  --track-h2: -0.025em;
  --track-h3: -0.02em;
  --track-caps: 0.025em;    /* ≈ +0.3px @12px */

  --edge: clamp(1.5rem, 6vw, 6rem);
  --measure: 34rem;
  --ring: var(--border-default);
  --orb: var(--color-starlight);
  --halo: 0 0 140px 30px rgba(245,243,240,0.22); /* starlight glow */
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--surface-base);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.1;
  text-wrap: balance;
}
p { max-width: var(--measure); }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
::selection { background: var(--accent-soft); color: var(--text-primary); }

/* ---------- utilities ---------- */
.caps {
  font-family: var(--font-body);
  font-size: var(--fs-caption);
  font-weight: 500;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.gradient-teal { /* em dark: termina em Quasar Cyan — fim em profundo é ilegível sobre deep-space */
  background: linear-gradient(45deg, var(--color-pulsar-teal) 0%, var(--color-quasar-cyan) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.theme-light .gradient-teal {
  background: linear-gradient(45deg, var(--color-teal-ink) 0%, var(--color-teal-profundo) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem var(--edge);
  transition: background .4s ease, box-shadow .4s ease;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--color-deep-space) 82%, transparent);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 var(--border-subtle);
}
.nav__logo svg, .nav__logo img { height: 30px; width: auto; }
.nav__links { display: flex; gap: 2rem; align-items: center; }
.nav__links a {
  font-size: 0.875rem; font-weight: 500; color: var(--text-tertiary);
  transition: color .25s ease;
}
.nav__links a:hover { color: var(--text-primary); }
.nav__cta {
  font-weight: 600; font-size: 0.875rem;
  color: var(--accent-contrast) !important;
  background: var(--accent);
  padding: 0.6rem 1.25rem; border-radius: 999px;
  transition: background .25s ease, transform .25s ease;
}
.nav__cta:hover { background: var(--accent-strong); transform: translateY(-1px); color: var(--accent-contrast) !important; }
@media (max-width: 720px) { .nav__links a:not(.nav__cta) { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: grid; place-items: center;
  text-align: center; padding: 6.5rem var(--edge) 9rem; /* respiro p/ o scroll cue absoluto */
  isolation: isolate; overflow: hidden;
}
.hero__canvas { position: absolute; inset: 0; z-index: -2; }
.hero__orb { /* em fluxo, acima do texto — protagonista, não pano de fundo */
  position: relative;
  width: min(52vw, 300px); aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-deep-space);
  box-shadow: inset 0 0 0 1px var(--border-strong), var(--halo);
  margin-bottom: .75rem;
}
.hero__orb::after { /* corona rim — starlight crescente */
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: radial-gradient(circle at 50% 30%,
    rgba(245,243,240,0.95) 0%, rgba(245,243,240,0.45) 12%,
    rgba(245,243,240,0.08) 34%, transparent 55%);
  mix-blend-mode: screen;
  filter: blur(1.5px);
}
.hero__content { position: relative; display: grid; gap: 1.5rem; justify-items: center; }
.hero__kicker { color: var(--text-tertiary); }
.hero h1 {
  font-size: var(--fs-hero); font-weight: 800;
  letter-spacing: var(--track-hero);
  max-width: 13ch;
}
.hero__lede {
  font-size: var(--fs-lede); color: var(--text-secondary);
  max-width: 38ch;
}
.hero__scroll {
  position: absolute; bottom: 2rem; left: 50%; translate: -50% 0;
  display: grid; justify-items: center; gap: .5rem;
}
.hero__scroll::after {
  content: ""; width: 1px; height: 48px;
  background: linear-gradient(var(--text-tertiary), transparent);
  animation: drop 2.4s ease-in-out infinite;
}
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 45% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- fases (timeline de eclipse) ---------- */
.phases {
  border-block: 1px solid var(--ring);
  padding: 3rem var(--edge);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem;
}
.phase { display: grid; gap: .9rem; justify-items: start; }
.phase__disc {
  width: 56px; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--border-strong);
  position: relative; overflow: hidden;
  background: radial-gradient(circle at 50% 40%,
    rgba(245,243,240,.95) 0%, rgba(245,243,240,.5) 55%,
    rgba(245,243,240,.25) 78%, rgba(245,243,240,.08) 100%);
}
.phase__disc::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--color-deep-space);
  translate: var(--occlude, -70%) 0;
  box-shadow: 0 0 0 1px var(--border-strong);
}
.phase:nth-child(1) .phase__disc::after { --occlude: -70%; }
.phase:nth-child(2) .phase__disc::after { --occlude: -35%; }
.phase:nth-child(3) .phase__disc::after { --occlude: 0%; inset: 8%; } /* totalidade: anel de corona visível */
.phase:nth-child(4) .phase__disc::after { --occlude: 42%; }
.phase h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: var(--track-h3); }
.phase p { font-size: .875rem; color: var(--text-tertiary); }
@media (max-width: 900px) { .phases { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .phases { grid-template-columns: 1fr; } }

/* ---------- section chrome ---------- */
.section { padding: clamp(4.5rem, 10vw, 8.5rem) var(--edge); position: relative; }
.section--light { background: var(--surface-base); } /* re-tokenizado pelo .theme-light */
.section__head { display: grid; gap: 1rem; margin-bottom: 3.25rem; max-width: 46rem; }
.section__head h2 {
  font-size: var(--fs-h2); font-weight: 700; letter-spacing: var(--track-h2);
}
.section__index { color: var(--text-tertiary); display: flex; gap: .75rem; align-items: center; }
.section__index::after { content: ""; height: 1px; width: 56px; background: var(--border-strong); }

/* ---------- manifesto ---------- */
.manifesto { display: grid; gap: 2.5rem; justify-items: center; text-align: center; }
.manifesto blockquote {
  font-family: var(--font-heading);
  font-size: var(--fs-h1); font-weight: 700; letter-spacing: var(--track-h1);
  color: var(--text-primary); line-height: 1.15;
  max-width: 22ch; text-wrap: balance;
}
.manifesto blockquote em { font-style: normal; }
.manifesto figcaption { color: var(--text-tertiary); }

/* ---------- rings decor (concentric) ---------- */
.rings {
  position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none;
}
.rings span {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  border: 1px solid var(--ring); border-radius: 50%;
  width: var(--d); aspect-ratio: 1;
}
.section > *:not(.rings) { position: relative; z-index: 1; }

/* ---------- sub-marcas (theme-light) ---------- */
.orbits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.orbit {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 18px;
  padding: 2rem;
  display: grid; gap: 1rem; align-content: start;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}
.orbit:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 48px -28px rgba(26,26,26,0.35);
}
.orbit__badge {
  width: 44px; aspect-ratio: 1; border-radius: 50%;
  border: 1px solid var(--border-strong);
  display: grid; place-items: center;
  font-family: var(--font-heading); font-weight: 700; font-size: .9375rem;
  color: var(--text-primary);
}
.orbit h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: var(--track-h3); }
.orbit p { font-size: .9375rem; color: var(--text-tertiary); }
.orbit__link { font-weight: 600; font-size: .875rem; color: var(--link); }
.orbit__link:hover { color: var(--link-hover); }
@media (max-width: 900px) { .orbits { grid-template-columns: 1fr; } }

/* ---------- números ---------- */
.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem 2rem; }
.metric { display: grid; gap: .5rem; }
.metric strong {
  font-family: var(--font-heading); font-weight: 800;
  color: var(--text-primary);
  font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem);
  letter-spacing: var(--track-h1); line-height: 1;
}
.metric span { color: var(--text-tertiary); font-size: .9375rem; max-width: 24ch; }
@media (max-width: 720px) { .metrics { grid-template-columns: 1fr; gap: 2.25rem; } }

/* ---------- CTA final ---------- */
.finale {
  min-height: 80svh; display: grid; place-items: center; text-align: center;
  position: relative; isolation: isolate; overflow: hidden;
  padding: 6rem var(--edge);
}
.finale__content { display: grid; gap: 1.75rem; justify-items: center; }
.finale h2 {
  font-size: var(--fs-hero); font-weight: 800; letter-spacing: var(--track-hero);
  max-width: 14ch;
}
.finale p { color: var(--text-secondary); max-width: 36ch; }
.btn {
  display: inline-flex; align-items: center; gap: .6rem;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  color: var(--accent-contrast); background: var(--accent);
  padding: 1rem 2rem; border-radius: 999px; border: 0; cursor: pointer;
  transition: background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.btn:hover {
  background: var(--accent-strong); transform: translateY(-2px);
  box-shadow: 0 16px 40px -16px rgba(78,205,196,0.45);
}

/* ---------- footer ---------- */
.footer {
  background: var(--surface-footer);
  border-top: 1px solid var(--border-subtle);
  padding: 3.5rem var(--edge) 2.5rem;
  display: grid; gap: 2.5rem;
}
.footer__row { display: flex; justify-content: space-between; align-items: center; gap: 2rem; flex-wrap: wrap; }
.footer__logo img, .footer__logo svg { height: 44px; width: auto; } /* tagline do lockup legível */
.footer__meta { color: var(--text-tertiary); font-size: .8125rem; }
.footer nav { display: flex; gap: 1.5rem; }
.footer nav a { font-size: .875rem; color: var(--text-tertiary); }
.footer nav a:hover { color: var(--text-primary); }

/* ---------- reveal choreography (fail-open: só esconde com html.js) ---------- */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .8s ease, transform .8s ease; }
html.js .reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .hero__scroll::after { animation: none; }
}
