/* ==========================================================================
   base.css — reset, fontes, tipografia, layout base, utilitarios.
   ========================================================================== */

/* --- Fontes self-hosted · site.md §10 · nada do Google Fonts em producao --- */
@font-face {
  font-family: "Quicksand";
  src: url("../fonts/quicksand-latin.woff2") format("woff2");
  font-weight: 300 600;             /* fonte variavel: um arquivo, quatro pesos */
  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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Quicksand";
  src: url("../fonts/quicksand-latin-ext.woff2") format("woff2");
  font-weight: 300 600;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Style Script";
  src: url("../fonts/style-script-latin.woff2") format("woff2");
  font-weight: 400;
  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+2074, U+20AC, U+2122, U+2191,
    U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Style Script";
  src: url("../fonts/style-script-latin-ext.woff2") format("woff2");
  font-weight: 400;
  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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--space-4));
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink-600);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;            /* site.md §11: nunca scroll horizontal */
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

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

a { color: var(--rosewood-800); text-decoration-thickness: 1px; text-underline-offset: 4px; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* --- Tipografia · design.md §3.3 ------------------------------------------ */
h1, h2, h3, h4 {
  color: var(--ink-900);
  text-wrap: balance;
  font-style: normal;            /* Quicksand nao tem italico · §3.2 */
}
p { text-wrap: pretty; }

h1 { font-size: var(--fs-h1); font-weight: 300; line-height: var(--lh-h1); letter-spacing: var(--ls-h1); max-width: 18ch; }
h2 { font-size: var(--fs-h2); font-weight: 400; line-height: var(--lh-h2); letter-spacing: var(--ls-h2); max-width: 24ch; }
h3 { font-size: var(--fs-h3); font-weight: 500; line-height: var(--lh-h3); letter-spacing: var(--ls-h3); }
h4 { font-size: var(--fs-h4); font-weight: 600; line-height: var(--lh-h4); }

.lead {
  font-size: var(--fs-lead);
  line-height: var(--lh-lead);
  color: var(--ink-600);
  max-width: 48ch;
}

.eyebrow {
  display: block;
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--rosewood-800);
}

.small { font-size: var(--fs-small); font-weight: 500; line-height: var(--lh-small); color: var(--ink-500); }

/* Style Script · §3.1 · nunca uppercase, nunca abaixo de 28px */
.script {
  font-family: var(--font-script);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

/* --- Layout --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Ritmo vertical enxugado: o padrao de design.md §4 (128px no desktop) somado
   ao respiro interno do cabecalho estava consumindo quase uma dobra so de
   espaco vazio antes do conteudo. Ver memoria.md D28. */
.section { padding-block: calc(var(--section-y) * 0.62); }
.section--alt { background: var(--surface-alt); }
.section--dark { background: var(--surface-dark); color: var(--blush-100); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--white); }
.section--dark .eyebrow { color: var(--rose-300); }

.section-head { margin-bottom: var(--space-6); }
.section-head .eyebrow + h2 { margin-top: var(--space-2); }
.section-head h2 + .lead { margin-top: var(--space-4); }
/* Titulos de secao cabem numa linha; 24ch quebrava quase todos em duas */
.section-head h2 { max-width: 30ch; }
.section-head--center { text-align: center; }
.section-head--center h2,
.section-head--center .lead { margin-inline: auto; }

/* Ornamento champagne · design.md §5 · 1px a 40%, no maximo 64px */
.rule-champagne {
  width: 64px; height: 1px; border: 0; margin: var(--space-4) 0 0;
  background: var(--champagne); opacity: 0.4;
}
.section-head--center .rule-champagne { margin-inline: auto; }

.grid { display: grid; gap: var(--grid-gap); }
.prose { max-width: var(--measure); }

/* --- Acessibilidade ------------------------------------------------------- */
.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;
}

/* site.md §12: foco visivel sempre. outline:none sem substituto e proibido. */
:focus-visible {
  outline: 2px solid var(--rosewood-800);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute; top: 0; left: var(--gutter); z-index: 200;
  transform: translateY(-120%);
  padding: var(--space-3) var(--space-5);
  background: var(--rosewood-800); color: var(--white);
  font-size: var(--fs-small); font-weight: 600;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  text-decoration: none;
  transition: transform var(--dur-micro) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* --- Revelar ao rolar · design.md §10 ------------------------------------- */
/* A classe so e adicionada por JS: sem JS o conteudo nasce visivel. */
.js-reveal .reveal { opacity: 0; transform: translateY(24px); }
.js-reveal .reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--dur-reveal) var(--ease),
              transform var(--dur-reveal) var(--ease);
  transition-delay: calc(var(--i, 0) * 80ms);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal .reveal { opacity: 1; transform: none; }
}
