/* ALURYA — landing page
   Tokens em assets/tokens.css (design system v0.1.0), carregado por <link> no HTML
   para baixar em paralelo com este arquivo. Nenhum hex direto aqui. */

/* ---------- Escala tipográfica (Brand Book, pág. 06) ---------- */
:root {
  --al-type-display: clamp(2.25rem, 1.4rem + 4.2vw, 3.5rem);    /* 36 → 56 · só o H1 */
  --al-type-editorial: clamp(1.75rem, 1.15rem + 3vw, 2.5rem);   /* 28 → 40 · H2, degrau real */
  --al-type-editorial-lh: 1.12;
  --al-sec-y: var(--al-space-64);
  --al-type-figure: clamp(1.75rem, 1.2rem + 2vw, 2rem);
  --al-type-h1: clamp(1.5rem, 1.2rem + 1.4vw, 1.75rem);          /* 24 → 28 */
  --al-type-section: 1.25rem;                                     /* 20/28 */
  --al-type-body: 1rem;                                           /* 16/24 */
  --al-type-ui: 0.875rem;                                         /* 14/20 */
  --al-type-aux: 0.75rem;                                         /* 12/16 */
  --al-measure: 64ch;
  --al-page: 72rem;
}

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

:where([id]) { scroll-margin-top: calc(var(--al-space-64) + var(--al-space-24)); }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--al-canvas);
  color: var(--al-text);
  font-family: var(--al-font-ui);
  font-size: var(--al-type-body);
  line-height: 1.5;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; font-weight: 500; }
p { margin: 0; }
img, svg { max-width: 100%; height: auto; display: block; }

.wrap {
  width: 100%;
  max-width: var(--al-page);
  margin-inline: auto;
  padding-inline: var(--al-space-24);
}

section { padding-block: var(--al-sec-y); }
@media (min-width: 48rem) { :root { --al-sec-y: var(--al-space-96); } }
/* Ritmo narrativo: abertura respira, tensão respira mais, apoio comprime, fecho acelera. */
.hero { padding-block: var(--al-space-48) calc(var(--al-sec-y) + var(--al-space-48)); }
.dark { padding-block: calc(var(--al-sec-y) + var(--al-space-40)); }
.sec-tight { padding-block: calc(var(--al-sec-y) - var(--al-space-24)); }
#cta { padding-block: var(--al-space-48) calc(var(--al-sec-y) + var(--al-space-32)); }

.eyebrow {
  font-size: var(--al-type-aux);
  line-height: 1.33;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--al-muted);
  margin-bottom: var(--al-space-16);
}

.editorial {
  font-family: var(--al-font-editorial);
  font-weight: 400;
}
h1.editorial {
  font-size: var(--al-type-display);
  line-height: 1.05;
  letter-spacing: -.018em;
  max-width: 17ch;
}
h2.editorial {
  font-size: var(--al-type-editorial);
  line-height: var(--al-type-editorial-lh);
  letter-spacing: -.008em;
  max-width: 22ch;
}

.lede { font-size: 1.125rem; line-height: 1.55; max-width: var(--al-measure); }
.body { max-width: var(--al-measure); }
.body + .body { margin-top: var(--al-space-16); }
.muted { color: var(--al-muted); }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--al-canvas) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--al-border);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--al-space-16);
  padding-block: var(--al-space-12);
}
.topbar img { width: 132px; }
.topbar .logo-inverse { display: none; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; /* WCAG 2.2 target size */
  padding: var(--al-space-12) var(--al-space-24);
  border-radius: var(--al-radius-999);
  font-size: var(--al-type-ui); font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--al-duration) var(--al-ease),
              border-color var(--al-duration) var(--al-ease);
}
.btn-primary { background: var(--al-primary); color: var(--al-on-primary); }
.btn-primary:hover { background: var(--al-primary-hover); }
.btn-ghost { border-color: var(--al-control-border); color: var(--al-text); }
.btn-ghost:hover { background: var(--al-subtle); }

:where(a, button, summary):focus-visible {
  outline: 2px solid var(--al-focus);
  outline-offset: 3px;
  border-radius: var(--al-radius-4);
}

/* ---------- Hero ---------- */
.hero { padding-top: var(--al-space-48); }
.hero-grid { display: grid; gap: var(--al-space-40); }
@media (min-width: 60rem) {
  .hero-grid { grid-template-columns: 1.15fr .85fr; align-items: start; gap: var(--al-space-64); }
  .portrait { margin-top: var(--al-space-8); }
}
@media (max-width: 59.99rem) {
  .portrait { aspect-ratio: 3 / 2; max-height: 20rem; border-radius: var(--al-radius-16); }
}
.hero .editorial { margin-bottom: var(--al-space-24); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--al-space-12); margin-top: var(--al-space-32); }

.portrait {
  position: relative;
  border-radius: var(--al-radius-24);
  overflow: hidden;
  box-shadow: var(--al-shadow-lg);
  aspect-ratio: 4 / 5;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 24%; }
.portrait figcaption {
  position: absolute; inset-inline: 0; bottom: 0;
  padding: var(--al-space-16);
  font-size: var(--al-type-aux); line-height: 1.33;
  color: var(--al-on-scrim);
  background: linear-gradient(
    to top,
    color-mix(in srgb, var(--al-scrim) 90%, transparent) 0%,
    color-mix(in srgb, var(--al-scrim) 52%, transparent) 46%,
    transparent 100%);
}

/* ---------- Números ---------- */
.stats {
  display: grid; gap: var(--al-space-24);
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: var(--al-space-48);
  padding-top: var(--al-space-32);
  border-top: 1px solid var(--al-border);
}
@media (min-width: 48rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stat-num {
  font-family: var(--al-font-ui);
  font-size: var(--al-type-h1); line-height: 1.15;
  font-weight: 500;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--al-primary);
}
.stat-label { font-size: var(--al-type-aux); line-height: 1.33; color: var(--al-muted); margin-top: var(--al-space-4); }

/* ---------- Seção escura ---------- */
.dark {
  background: var(--al-text);
  color: var(--al-canvas);
  --al-muted:  color-mix(in srgb, var(--al-canvas) 78%, var(--al-text));
  --al-border: color-mix(in srgb, var(--al-canvas) 26%, var(--al-text));
}
[data-theme="dark"] .dark {
  background: var(--al-raised);
  color: var(--al-text);
  --al-muted:  color-mix(in srgb, var(--al-text) 78%, var(--al-raised));
  --al-border: color-mix(in srgb, var(--al-text) 26%, var(--al-raised));
}
.dark .muted, .dark .eyebrow { color: var(--al-muted); }
.dark .rule { border-color: var(--al-border); }
/* Acento por peso + régua decorativa. Champagne nunca como texto funcional. */
.dark .accent {
  color: inherit;
  font-weight: 500;
  box-shadow: inset 0 -.08em 0 color-mix(in srgb, var(--al-primary) 60%, transparent);
}

/* ---------- Cards ---------- */
.cards { display: grid; gap: var(--al-space-24); margin-top: var(--al-space-48); }
@media (min-width: 52rem) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card {
  background-color: var(--al-raised);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-16);
  padding: var(--al-space-32);
  box-shadow: var(--al-shadow-sm);
}
.card h3 { font-size: var(--al-type-section); line-height: 1.4; margin-bottom: var(--al-space-12); }
.card p { font-size: var(--al-type-ui); line-height: 1.55; color: var(--al-muted); }
.card-index {
  font-family: var(--al-font-ui);
  font-size: var(--al-type-aux);
  font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: .14em;
  color: var(--al-muted);
  margin-bottom: var(--al-space-20);
  padding-bottom: var(--al-space-12);
  border-bottom: 1px solid color-mix(in srgb, var(--al-primary) 45%, transparent);
  width: max-content;
  min-width: var(--al-space-40);
}

/* ---------- Transparência ---------- */
.status-list { display: grid; gap: var(--al-space-16); margin-top: var(--al-space-40); }
@media (min-width: 60rem) {
  .status-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--al-space-20) var(--al-space-24); }
  /* Só o primeiro bloco ocupa a linha inteira — quebra a monotonia da grade. */
  .status:first-child { grid-column: 1 / -1; padding: var(--al-space-24) var(--al-space-32); }
}
.status p, .status .status-title { max-width: 58ch; }
.status-title { grid-column: 2; font-size: var(--al-type-body); line-height: 1.5; font-weight: 500; letter-spacing: -.005em; margin: 0; }
.status {
  display: grid; gap: var(--al-space-8);
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: var(--al-space-20);
  border-radius: var(--al-radius-12);
  border: 1px solid var(--al-border);
}
.status p { grid-column: 2; font-size: var(--al-type-ui); line-height: 1.55; }
.status strong { grid-column: 2; font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: var(--al-radius-999); margin-top: .45rem; grid-row: 1 / span 2; }
.is-real { background-color: var(--al-raised); border-color: var(--al-border); }
.is-real .dot { background: var(--al-success); }
.status-list .is-real:first-child { border-color: color-mix(in srgb, var(--al-success) 45%, var(--al-border)); }

/* ---------- FAQ ---------- */
.faq { margin-top: var(--al-space-40); max-width: var(--al-measure); }
.faq details { border-bottom: 1px solid var(--al-border); }
.faq summary {
  cursor: pointer; list-style: none;
  padding-block: var(--al-space-20);
  font-size: var(--al-type-section); line-height: 1.4;
  display: flex; justify-content: space-between; gap: var(--al-space-16);
  min-height: 44px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--al-primary); font-size: 1.5rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: var(--al-space-24); color: var(--al-muted); font-size: var(--al-type-ui); line-height: 1.6; }

/* ---------- CTA ---------- */
.cta-card {
  background: var(--al-sage-soft);
  border: 1px solid var(--al-sage);
  border-radius: var(--al-radius-24);
  padding: var(--al-space-48) var(--al-space-32);
  text-align: center;
}
.cta-card .editorial { margin-inline: auto; margin-bottom: var(--al-space-16); }
.cta-card .body { margin-inline: auto; }
.cta-card .btn { margin-top: var(--al-space-32); }

/* ---------- Rodapé ---------- */
footer { background: var(--al-text); color: var(--al-border); padding-block: var(--al-space-48); }
footer img { width: 120px; margin-bottom: var(--al-space-24); }
footer p { font-size: var(--al-type-aux); line-height: 1.6; max-width: 62ch; }
footer p + p { margin-top: var(--al-space-12); }

/* ---------- Tema escuro ---------- */
[data-theme="dark"] .topbar .logo-inverse { display: block; }
[data-theme="dark"] .topbar .logo-principal { display: none; }
[data-theme="dark"] footer { background: var(--al-raised); color: var(--al-muted); }
[data-theme="dark"] .card {
  box-shadow: none;
  border-color: color-mix(in srgb, var(--al-text) 22%, var(--al-raised));
}
[data-theme="dark"] .cta-card {
  background: var(--al-sage-soft); border-color: var(--al-sage); color: var(--al-text);
  --al-muted: var(--al-muted-on-sage); /* 6.52 -> 8.29 sobre sage-soft */
}

/* Mesmas regras quando o escuro vem do sistema e nao do botao. Os tokens ja
   fazem isso em assets/tokens.css; estas dependem do seletor, entao repetem. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .dark {
    background: var(--al-raised);
    color: var(--al-text);
    --al-muted:  color-mix(in srgb, var(--al-text) 78%, var(--al-raised));
    --al-border: color-mix(in srgb, var(--al-text) 26%, var(--al-raised));
  }
  :root:not([data-theme="light"]) .topbar .logo-inverse { display: block; }
  :root:not([data-theme="light"]) .topbar .logo-principal { display: none; }
  :root:not([data-theme="light"]) footer { background: var(--al-raised); color: var(--al-muted); }
  :root:not([data-theme="light"]) .card {
    box-shadow: none;
    border-color: color-mix(in srgb, var(--al-text) 22%, var(--al-raised));
  }
  :root:not([data-theme="light"]) .cta-card {
    background: var(--al-sage-soft); border-color: var(--al-sage); color: var(--al-text);
    --al-muted: var(--al-muted-on-sage);
  }
}

.theme-toggle {
  background: none; border: 1px solid var(--al-control-border);
  color: var(--al-text);
  border-radius: var(--al-radius-999);
  min-height: 40px; min-width: 40px;
  padding: 0 var(--al-space-16);
  font-size: var(--al-type-aux); cursor: pointer;
  font-family: inherit;
}
.theme-toggle:hover { background: var(--al-subtle); }

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* A legenda usa --al-scrim/--al-on-scrim, que nao invertem entre os temas:
   o veu e sempre escuro e o texto sempre claro, nos dois modos. */

/* ---------- Utilitários (substituem os style= inline) ---------- */
.mt-16 { margin-top: var(--al-space-16); }
.mt-24 { margin-top: var(--al-space-24); }
.mt-32 { margin-top: var(--al-space-32); }
.mt-40 { margin-top: var(--al-space-40); }
.sec-subtle { background: var(--al-subtle); }
.center { margin-inline: auto; }
.small { font-size: var(--al-type-ui); }
.tiny { font-size: var(--al-type-aux); line-height: 1.5; }

/* ---------- Link de texto (CTA secundário, sem competir) ---------- */
.link-inline {
  color: var(--al-text);
  font-size: var(--al-type-ui);
  text-decoration: underline;
  text-underline-offset: .28em;
  text-decoration-color: color-mix(in srgb, var(--al-text) 35%, transparent);
  align-self: center;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.link-inline:hover { text-decoration-color: currentColor; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute; left: var(--al-space-16); top: -4rem;
  background: var(--al-primary); color: var(--al-on-primary);
  padding: var(--al-space-12) var(--al-space-20);
  border-radius: var(--al-radius-8); z-index: 20;
  transition: top var(--al-duration) var(--al-ease);
}
.skip-link:focus { top: var(--al-space-16); }

/* ---------- Botões empilhados no telefone ---------- */
@media (max-width: 30rem) {
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
}

/* ---------- Bloco de transcrição (a prova) ---------- */
.transcript {
  max-width: 46rem;
  margin-top: var(--al-space-40);
  background-color: var(--al-raised);
  border: 1px solid var(--al-border);
  border-radius: var(--al-radius-16);
  overflow: hidden;
}
.transcript-head {
  display: flex; flex-wrap: wrap; gap: var(--al-space-8) var(--al-space-16);
  align-items: baseline; justify-content: space-between;
  padding: var(--al-space-16) var(--al-space-24);
  border-bottom: 1px solid var(--al-border);
  background-color: color-mix(in srgb, var(--al-canvas) 50%, var(--al-raised));
  font-size: var(--al-type-aux); color: var(--al-muted);
}
.transcript-body { padding: var(--al-space-24); display: grid; gap: var(--al-space-16); }
.msg { max-width: 46ch; font-size: var(--al-type-ui); line-height: 1.55; }
.msg-who { display: block; font-size: var(--al-type-aux); color: var(--al-muted); margin-bottom: var(--al-space-4); }
.msg-text {
  display: block; padding: var(--al-space-12) var(--al-space-16);
  border-radius: var(--al-radius-12);
  background-color: color-mix(in srgb, var(--al-canvas) 50%, var(--al-raised));
  border: 1px solid color-mix(in srgb, var(--al-text) 20%, transparent);
}
.msg.from-ai { justify-self: start; }
.msg.from-ai .msg-text {
  background: var(--al-ai-bg);
  border: 1px solid color-mix(in srgb, var(--al-ai) 30%, transparent);
}
.msg.from-lead { justify-self: end; text-align: right; }
.msg.from-lead .msg-text { text-align: left; }
.transcript-foot {
  padding: var(--al-space-16) var(--al-space-24);
  border-top: 1px solid var(--al-border);
  font-size: var(--al-type-aux); color: var(--al-muted);
}

/* ---------- Preço ---------- */
.price-row { display: grid; gap: var(--al-space-32); margin-top: var(--al-space-40); }
@media (min-width: 52rem) { .price-row { grid-template-columns: auto 1fr; align-items: start; gap: var(--al-space-64); } }
.price-figure { font-size: var(--al-type-figure); line-height: 1.1; font-weight: 500; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.02em; }
.price-note { font-size: var(--al-type-aux); color: var(--al-muted); margin-top: var(--al-space-8); }
.price-list { max-width: 62ch; margin: 0; padding: 0; list-style: none; display: grid; gap: var(--al-space-12); }
.price-list li { max-width: 60ch; padding-left: var(--al-space-24); position: relative; font-size: var(--al-type-ui); line-height: 1.55; }
.price-list li::before {
  content: ""; position: absolute; left: 0; top: .6em;
  width: var(--al-space-12); height: 1px; background: var(--al-primary);
}

/* ---------- Movimento discreto ---------- */
/* O conteudo e visivel por padrao. So esconde quando o JS assumiu o controle
   (html.js) — sem JS, JS quebrado ou observer que nao dispara, nada some. */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(8px); transition: opacity 420ms var(--al-ease), transform 420ms var(--al-ease); }
  .js .reveal.is-in { opacity: 1; transform: none; }
  .card, .faq summary { transition: border-color var(--al-duration) var(--al-ease), background var(--al-duration) var(--al-ease); }
  .card:hover { border-color: color-mix(in srgb, var(--al-primary) 55%, var(--al-border)); }
}

/* Alvos de toque: logo e toggle chegavam a 35px e 40px (WCAG 2.2 alvo mínimo). */
.topbar .wrap > a { display: inline-flex; align-items: center; min-height: 44px; }
.theme-toggle { min-height: 44px; }

/* ---------- Fluxo (diagrama de etapas) ---------- */
.flow { margin-top: var(--al-space-48); }
.flow-steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--al-space-32);
  counter-reset: step;
}
.flow-step { position: relative; counter-increment: step; padding-left: var(--al-space-40); }
.flow-step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-size: var(--al-type-aux); font-weight: 500;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: .12em; color: var(--al-primary);
}
/* Trilho vertical no telefone */
.flow-step::after {
  content: ""; position: absolute; left: 6px; top: var(--al-space-20);
  width: 1px; height: calc(100% + var(--al-space-32) - var(--al-space-20));
  background: color-mix(in srgb, var(--al-primary) 35%, transparent);
}
.flow-step:last-child::after { display: none; }
.flow-step h3 { font-size: var(--al-type-body); line-height: 1.5; font-weight: 500; letter-spacing: -.005em; margin-bottom: var(--al-space-8); }
.flow-step p { font-size: var(--al-type-ui); line-height: 1.55; color: var(--al-muted); max-width: 40ch; }
.flow-branch {
  display: inline-block; margin-top: var(--al-space-8);
  font-size: var(--al-type-aux); color: var(--al-muted);
  padding-left: var(--al-space-16); position: relative;
}
.flow-branch::before {
  content: "↳"; position: absolute; left: 0; color: var(--al-primary);
}

/* Horizontal a partir do tablet: seis colunas com seta entre elas */
@media (min-width: 56rem) {
  .flow-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--al-space-48) var(--al-space-32);
  }
  /* trilho e seta param no fim de cada fileira */
  .flow-step:nth-child(3n) .flow-arrow,
  .flow-step:nth-child(3n)::after { display: none; }
  .flow-step { padding-left: 0; padding-top: var(--al-space-40); }
  .flow-step::before { top: 0; }
  /* Trilho: comeca depois do numero e para antes da ponta da seta. */
  .flow-step::after {
    left: var(--al-space-24); top: 7px; right: auto; transform: none;
    width: calc(100% - var(--al-space-24) + var(--al-space-16));
    height: 1px;
  }
  /* Ponta desenhada com borda, centrada no vao entre colunas. */
  .flow-arrow {
    position: absolute; top: 4px; left: calc(100% + var(--al-space-16));
    width: 6px; height: 6px;
    border-top: 1.5px solid var(--al-primary);
    border-right: 1.5px solid var(--al-primary);
    transform: rotate(45deg);
    font-size: 0;
  }
  .flow-step:last-child .flow-arrow { display: none; }
}
@media (max-width: 55.99rem) { .flow-arrow { display: none; } }

.flow-note {
  margin-top: var(--al-space-40);
  padding: var(--al-space-20) var(--al-space-24);
  border: 1px solid color-mix(in srgb, var(--al-text) 20%, transparent);
  border-left: 2px solid var(--al-primary);
  background-color: color-mix(in srgb, var(--al-canvas) 50%, var(--al-raised));
  border-radius: 0 var(--al-radius-12) var(--al-radius-12) 0;
  font-size: var(--al-type-ui); line-height: 1.55;
  max-width: 68ch;
}

/* ---------- Navegacao do topo ---------- */
/* No telefone o menu sai: tres links nao cabem ao lado da marca e do toggle,
   e a pagina ja e uma leitura continua. Os ids seguem alcancaveis por rolagem. */
.topnav { display: none; }
@media (min-width: 48rem) {
  .topnav { display: flex; gap: var(--al-space-24); }
  .topnav a {
    display: inline-flex; align-items: center; min-height: 44px;
    color: var(--al-text); text-decoration: none;
    font-size: var(--al-type-ui);
  }
  .topnav a:hover { text-decoration: underline; text-underline-offset: .28em; }
}
