/* ==========================================================================
   BASE — reset, design tokens, tipografia e utilitários

   PALETA OFICIAL CREATIVE YC — retirada do manual de identidade visual
   criado pela Yasmin. Nenhuma cor fora desta lista é usada; as variações
   vêm de color-mix() entre duas cores da própria paleta (ou com branco/preto)
   quando o contraste exige.

     #FAF8F5  areia     fundo claro
     #E8DED1  linho     superfície secundária
     #B5C29A  sálvia    acento claro
     #8A9A6B  oliva     acento médio
     #1F3B2E  floresta  tinta / fundo escuro
     #F8ED88  sol       destaque pontual (grifos)
     #393838  grafite   neutro escuro
     #111111  tinta     preto da marca

   TIPOGRAFIA OFICIAL — Bevenida (títulos), Visby (corpo de texto) e
   Handsome (palavras-chave manuscritas). As três são licenciadas; enquanto
   os arquivos não estiverem em assets/fonts/, o site usa substitutas do
   Google Fonts (Bodoni Moda, Jost e Caveat). Ver css/fontes.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Paleta bruta */
  --areia: #faf8f5;
  --linho: #e8ded1;
  --salvia: #b5c29a;
  --oliva: #8a9a6b;
  --floresta: #1f3b2e;
  --sol: #f8ed88;
  --grafite: #393838;
  --tinta: #111111;

  /* Oliva escurecida com floresta — usada onde o acento precisa passar
     em contraste de texto (eyebrows, links, rótulos pequenos). */
  --oliva-tinta: color-mix(in srgb, var(--oliva) 42%, var(--floresta));

  /* Papéis semânticos — tema claro (padrão) */
  --bg: var(--areia);
  --bg-alt: #fff;
  --surface: #fff;
  --surface-2: var(--linho);
  --surface-sunken: color-mix(in srgb, var(--linho) 52%, var(--areia));
  --ink: var(--floresta);
  /* Percentuais calibrados para WCAG AA sobre a areia:
     ink-2 ≈ 7.1:1 · ink-3 ≈ 4.7:1 (rótulos pequenos ainda passam). */
  --ink-2: color-mix(in srgb, var(--floresta) 84%, transparent);
  --ink-3: color-mix(in srgb, var(--floresta) 70%, transparent);
  --line: color-mix(in srgb, var(--floresta) 12%, transparent);
  --line-strong: color-mix(in srgb, var(--floresta) 22%, transparent);
  --accent: var(--oliva-tinta);
  --accent-soft: color-mix(in srgb, var(--salvia) 30%, transparent);
  --accent-flat: var(--oliva);       /* superfícies e traços, não texto */
  --chip: color-mix(in srgb, var(--salvia) 42%, #fff);
  --mark: var(--sol);                /* grifo sob palavras-chave */

  /* Botão primário */
  --btn-bg: var(--floresta);
  --btn-ink: var(--areia);

  /* Sombras — sempre derivadas do verde da marca, nunca cinza puro */
  --sh-sm: 0 1px 2px color-mix(in srgb, var(--floresta) 6%, transparent),
           0 4px 12px color-mix(in srgb, var(--floresta) 5%, transparent);
  --sh-md: 0 2px 4px color-mix(in srgb, var(--floresta) 5%, transparent),
           0 12px 32px color-mix(in srgb, var(--floresta) 9%, transparent);
  --sh-lg: 0 4px 8px color-mix(in srgb, var(--floresta) 5%, transparent),
           0 32px 64px -12px color-mix(in srgb, var(--floresta) 22%, transparent);
  --sh-xl: 0 60px 120px -30px color-mix(in srgb, var(--floresta) 34%, transparent);

  /* Tipografia */
  --f-display: "Bevenida", "Bodoni Moda", "Didot", "Playfair Display", Georgia, serif;
  --f-sans: "Visby", "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Futura", "Avenir Next", Helvetica, Arial, sans-serif;
  /* Manuscrita das palavras-chave — ver css/fontes.css */
  --f-hand: "Handsome", "Caveat", "Segoe Script", "Bradley Hand", cursive;
  --f-mono: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;

  /* Escala fluida */
  --t-hero: clamp(2.75rem, 6.3vw, 6.1rem);
  --t-h2: clamp(2.1rem, 4.6vw, 4rem);
  --t-h3: clamp(1.35rem, 2vw, 1.85rem);
  --t-h4: clamp(1.05rem, 1.3vw, 1.2rem);
  --t-lead: clamp(1.02rem, 1.35vw, 1.28rem);
  --t-body: 1rem;
  --t-sm: 0.875rem;
  --t-xs: 0.76rem;

  /* Ritmo e medidas */
  --wrap: 1280px;
  --wrap-narrow: 860px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(5rem, 11vh, 9.5rem);
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;
  --r-full: 999px;

  /* Movimento */
  --e-out: cubic-bezier(0.22, 1, 0.36, 1);
  --e-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --d-fast: 0.22s;
  --d-mid: 0.5s;
  --d-slow: 0.9s;

  color-scheme: light;
}

/* Tema escuro — a floresta vira fundo, a areia vira tinta e a sálvia
   assume o papel de acento (sobre verde escuro ela tem contraste de sobra). */
[data-theme="dark"] {
  --bg: color-mix(in srgb, var(--floresta) 86%, var(--tinta));
  --bg-alt: var(--floresta);
  --surface: color-mix(in srgb, var(--floresta) 92%, var(--areia));
  --surface-2: color-mix(in srgb, var(--floresta) 82%, var(--tinta));
  --surface-sunken: color-mix(in srgb, var(--floresta) 74%, var(--tinta));
  --ink: var(--areia);
  /* No escuro, 50% de areia caía para 4.3:1 — 58% recoloca em 5:1. */
  --ink-2: color-mix(in srgb, var(--areia) 76%, transparent);
  --ink-3: color-mix(in srgb, var(--areia) 58%, transparent);
  --line: color-mix(in srgb, var(--areia) 14%, transparent);
  --line-strong: color-mix(in srgb, var(--areia) 26%, transparent);
  --accent: var(--salvia);
  --accent-soft: color-mix(in srgb, var(--salvia) 22%, transparent);
  --accent-flat: var(--salvia);
  --chip: color-mix(in srgb, var(--salvia) 20%, transparent);
  --mark: color-mix(in srgb, var(--sol) 76%, var(--oliva));
  --btn-bg: var(--areia);
  --btn-ink: var(--floresta);
  --sh-lg: 0 4px 8px rgb(0 0 0 / 0.25), 0 32px 64px -12px rgb(0 0 0 / 0.55);
  --sh-xl: 0 60px 120px -30px rgb(0 0 0 / 0.7);
  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Reset enxuto
   -------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

* { margin: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: var(--t-body);
  line-height: 1.6;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--d-mid) var(--e-out),
              color var(--d-mid) var(--e-out);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: 0; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

:where(h1, h2, h3, h4, h5) {
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p { text-wrap: pretty; }

/* --------------------------------------------------------------------------
   3. Foco visível e acessibilidade
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.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: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -140%);
  z-index: 999;
  padding: 0.85rem 1.5rem;
  background: var(--floresta);
  color: var(--areia);
  border-radius: 0 0 var(--r-md) var(--r-md);
  font-size: var(--t-sm);
  transition: transform var(--d-fast) var(--e-out);
}
.skip-link:focus-visible { transform: translate(-50%, 0); }

/* --------------------------------------------------------------------------
   4. Tipografia expressiva
   -------------------------------------------------------------------------- */
.display {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  /* A Bevenida/Bodoni tem ascendentes e descendentes longas: entrelinha 1
     colaria as linhas e cortaria o "q" e o "ç". */
  line-height: 1.06;
}

/* Palavra-chave manuscrita — o gesto que a Yasmin usa em todas as peças da
   marca ("história", "marca", "identificação"). A manuscrita tem altura-x
   menor que a serifada de display, então compensamos com um leve aumento
   de corpo para as duas ficarem opticamente do mesmo tamanho. */
.italic-accent {
  font-family: var(--f-hand);
  font-style: normal;
  font-weight: 400;
  /* A manuscrita é mais larga que a serifada: aumentar o corpo faria a
     palavra estourar a linha do título. Fica em 1em e ganha um respiro
     lateral, que é o que a caligrafia pede. */
  font-size: 1em;
  line-height: inherit;
  padding-inline: 0.04em;
  color: var(--accent);
}
/* No texto corrido a manuscrita fica pequena demais e pede um empurrão */
p .italic-accent,
.lead .italic-accent,
.about__statement .italic-accent { font-size: 1.08em; }

/* Grifo: o traço fino sob a palavra que a marca usa para enfatizar.
   Desenha-se da esquerda para a direita quando a linha é revelada. */
/* inline-block para que a caixa acompanhe a palavra, e não a linha inteira.
   Com entrelinha ~1 nos títulos, o traço cai logo abaixo da linha de base. */
.grifo {
  position: relative;
  display: inline-block;
  white-space: nowrap;
}
.grifo::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.05em;
  min-height: 2px;
  background: var(--accent-flat);
  border-radius: 2px;
  transform-origin: left;
  transition: transform 0.9s var(--e-out) 0.35s;
}
/* Sem JavaScript o traço já nasce desenhado; com JS ele espera a revelação. */
.js .grifo::after { transform: scaleX(0); }
.js [data-reveal].is-in .grifo::after,
.js [data-text-reveal].is-in .grifo::after { transform: scaleX(1); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--t-xs);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: 0.6;
}

.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 56ch;
}

/* --------------------------------------------------------------------------
   5. Layout base
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
  /* impede que um filho de conteúdo largo (botão com texto longo, por
     exemplo) estufe o contêiner quando ele é item de flex ou de grid */
  min-width: 0;
}

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(3.5rem, 7vh, 6rem); }
.section--sunken { background: var(--surface-sunken); }

.section-head {
  display: grid;
  gap: 1.25rem;
  max-width: 720px;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
.section-head h2 { font-size: var(--t-h2); }

.section-head--split {
  max-width: none;
  grid-template-columns: minmax(0, 1fr);
  align-items: end;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .section-head--split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.85fr); }
  .section-head--split .section-head__aside { justify-self: end; text-align: left; }
}

.rule {
  height: 1px;
  background: var(--line);
  border: 0;
}

/* --------------------------------------------------------------------------
   5.1 Textura de papel — o grão que aparece em todas as peças da marca.
   Ruído gerado em SVG, sem imagem externa e sem custo de rede.
   -------------------------------------------------------------------------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::after { opacity: 0.09; mix-blend-mode: overlay; }

/* --------------------------------------------------------------------------
   5.2 Marca d'água — o logotipo em escala gigante atrás do conteúdo,
   como nas peças impressas do manual.
   -------------------------------------------------------------------------- */
.watermark {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  user-select: none;
  font-family: var(--f-display);
  font-style: italic;
  font-size: clamp(9rem, 26vw, 24rem);
  line-height: 0.72;
  letter-spacing: -0.04em;
  color: var(--accent-flat);
  opacity: 0.07;
  white-space: nowrap;
}
[data-theme="dark"] .watermark { opacity: 0.09; }
.watermark--right { right: -0.12em; bottom: -0.14em; }
.watermark--left { left: -0.08em; top: -0.1em; }

/* Garante que o conteúdo fique acima da marca d'água */
.section > .wrap { position: relative; z-index: 1; }

/* --------------------------------------------------------------------------
   6. Preferências de movimento
   -------------------------------------------------------------------------- */
@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;
    scroll-behavior: auto !important;
  }
}
