/* ============================================================================
   tokens.css — fonte única de verdade visual
   Contrato: docs/DESIGN-SYSTEM.md (§3 cor, §4 tipo, §5 espaço, §6 forma, §8 movimento)
   Fontes self-hosted em ../assets/fonts/ (SIL OFL 1.1)
   Nenhum hex solto nas telas: só var(--token).
   ========================================================================== */

/* ---------- 1. Fontes ---------- */

@font-face {
  font-family: "Sora";
  src: url("../assets/fonts/sora-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sora";
  src: url("../assets/fonts/sora-latin-ext.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Lexend";
  src: url("../assets/fonts/lexend-latin.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lexend";
  src: url("../assets/fonts/lexend-latin-ext.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Dancing Script";
  src: url("../assets/fonts/dancing-script-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Dancing Script";
  src: url("../assets/fonts/dancing-script-latin-ext.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 2. Cor ---------- */

:root,
[data-theme="light"] {
  color-scheme: light;

  --bg:            oklch(0.984 0.003 247.9); /* #f8fafc */
  --surface:       #ffffff;
  --surface-2:     #eef2f7;

  --ink:           oklch(0.169 0.025 265.2); /* #0a0f1a */
  --ink-2:         oklch(0.372 0.039 257.3); /* #334155 */
  --muted:         oklch(0.446 0.037 257.3); /* #475569 */

  --border:        oklch(0.869 0.020 252.9); /* #cbd5e1 */
  --border-strong: #94a3b8;

  --accent:        oklch(0.727 0.114 83.4);  /* #c9a04b — dourado */
  --accent-hover:  #b8903f;
  --accent-strong: #8a6a1f;                  /* dourado para texto pequeno (4.82:1) */
  --accent-ink:    oklch(0.169 0.025 265.2);

  --brand:         oklch(0.379 0.138 265.5); /* #1e3a8a — marinho */
  --brand-2:       oklch(0.508 0.105 165.6); /* #047857 — verde lousa */
  --brand-2-strong: #035c42;

  --success: #047857;  --success-bg: #ecfdf5;
  --warning: #b45309;  --warning-bg: #fffbeb;
  --danger:  #991b1b;  --danger-bg:  #fef2f2;
  --info:    #1e40af;  --info-bg:    #eff6ff;

  --focus: #1e3a8a;

  /* superfícies sobre campo verde/marinho */
  --on-strong:      #f4f7f5;
  --on-strong-muted: #c9dcd3;
  --hairline:       color-mix(in oklab, var(--ink) 12%, transparent);
  --sombra-tinta:   rgba(10, 15, 26, 0.06);

  /* campos de identidade (fundo de seção, nunca cor de texto) */
  --campo-verde:    #047857;
  --campo-marinho:  #1e3a8a;
  --campo-texto:    #f8fafc;   /* 5.24:1 no verde · 9.90:1 no marinho */
  --campo-texto-suave: #e8f3ee; /* 4.83:1 no verde · 8.18:1 no marinho */
  --campo-painel:   color-mix(in oklab, var(--campo-verde) 84%, #000 16%);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg:            oklch(0.176 0.014 258.4); /* #0d1117 */
  --surface:       oklch(0.220 0.016 256.8); /* #161b22 */
  --surface-2:     #1f2630;

  --ink:           oklch(0.943 0.011 243.7); /* #e6edf3 */
  --ink-2:         oklch(0.662 0.018 250.9); /* #8b949e */
  --muted:         #7d8590;

  --border:        oklch(0.330 0.015 252.3); /* #30363d */
  --border-strong: #444c56;

  --accent:        #c9a04b;
  --accent-hover:  #d4af61;
  --accent-strong: #d4af61;
  --accent-ink:    #0d1117;

  --brand:   #60a5fa;
  --brand-2: #34d399;
  --brand-2-strong: #6ee7b7;

  --success: #34d399;  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #fbbf24;  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger:  #f87171;  --danger-bg:  rgba(239, 68, 68, 0.12);
  --info:    #60a5fa;  --info-bg:    rgba(96, 165, 250, 0.12);

  --focus: #c9a04b;

  --on-strong:      #eaf1ee;
  --on-strong-muted: #a9c3b8;
  --hairline:       color-mix(in oklab, var(--ink) 16%, transparent);
  --sombra-tinta:   rgba(0, 0, 0, 0.5);

  --campo-verde:    #04543e;
  --campo-marinho:  #101a38;
}

/* ---------- 3. Tipografia ---------- */

:root {
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-ui:      "Lexend", "Segoe UI", system-ui, sans-serif;
  --font-marca:   "Dancing Script", "Segoe Script", cursive;

  --fs-caption: 0.75rem;
  --fs-small:   0.875rem;
  --fs-body:    1rem;
  --fs-lead:    1.25rem;
  --fs-title:   clamp(1.5rem, 1.15rem + 1vw, 2rem);
  --fs-display: clamp(2rem, 1.3rem + 2.8vw, 3.5rem);

  --medida: 66ch;
}

/* ---------- 4. Espaço e layout ---------- */

:root {
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-8: 32px;  --space-12: 48px;
  --space-16: 64px; --space-24: 96px;

  --largura-max: 1360px;
  --largura-conteudo: 1200px;
  --gutter: 16px;

  --bp-sm: 640px; --bp-md: 768px; --bp-lg: 1024px; --bp-xl: 1280px;
}

@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1280px) { :root { --gutter: 32px; } }

/* ---------- 5. Forma, profundidade e movimento ---------- */

:root {
  --radius-card: 8px;
  --radius-modal: 12px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(10, 15, 26, 0.06);
  --shadow-2: 0 4px 12px rgba(10, 15, 26, 0.08);
  --shadow-3: 0 16px 40px rgba(10, 15, 26, 0.14);

  --dur-rapida: 120ms; --dur-padrao: 180ms; --dur-lenta: 260ms;
  --ease-saida: cubic-bezier(0.2, 0, 0, 1);
  --ease-suave: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================================
   Base mínima (reset + tipografia)
   Fica aqui enquanto `base.css` antigo não for migrado para os tokens.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-size: var(--fs-display);
}

h2 { font-size: var(--fs-title); }
h3 { font-size: 1.125rem; letter-spacing: -0.01em; }

p { margin: 0; }

a { color: var(--brand); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

img, svg, video { display: block; max-width: 100%; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: color-mix(in oklab, var(--accent) 55%, transparent);
  color: var(--ink);
}

/* utilidades */
.visualmente-oculto {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pular {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 100;
  transform: translateY(-120%);
  background: var(--ink);
  color: var(--bg);
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  font-size: var(--fs-small);
  font-weight: 600;
  text-decoration: none;
  transition: transform var(--dur-padrao) var(--ease-saida);
}

.pular:focus-visible { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
