/* Base: reset, type, layout primitives, section rhythm, motion states. Loaded after tokens.css. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: calc(var(--header-h) + 16px); }
/* Native smooth anchor scrolling only when Lenis is not running (they fight over in-page links). */
@media (prefers-reduced-motion: no-preference) { html:not(.lenis) { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--page); color: var(--text);
  font-family: var(--font); font-size: var(--fs-16); line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; overflow-x: clip;
}
img, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; color: var(--text); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.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; }
.tnum { font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: 12px; top: -100px; z-index: 100; padding: 10px 16px; border-radius: var(--r-sm); background: var(--text); color: var(--page); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Icon sprite lives inline in every page; the sprite itself takes no space. */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ic .halo { fill: var(--brand-soft); stroke: none; }
.ic-sm { width: 16px; height: 16px; }

/* Barely visible grain over the page. A file, not a data: URL, so img-src stays 'self'. */
body::before { content: ""; position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.035; background-image: url("/assets/img/noise.svg"); }

/* Layout */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
main { position: relative; z-index: var(--z-content); }
.section { padding-block: var(--section-y); position: relative; }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 5vw, 56px); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .lead { margin-inline: auto; }
.band { background: linear-gradient(to bottom, transparent, var(--page-2) 12%, var(--page-2) 88%, transparent); }

/* Type roles */
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-14); font-weight: 600; color: var(--brand-ink); margin-bottom: var(--s-4); letter-spacing: 0.01em; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); flex: none; }
.h2 { font-size: var(--fs-34); line-height: var(--lh-tight); letter-spacing: -0.025em; }
.h3 { font-size: var(--fs-21); line-height: 1.25; letter-spacing: -0.01em; }
.display { font-size: var(--fs-34); line-height: 1.06; letter-spacing: -0.03em; }
.lead { margin-top: var(--s-4); font-size: var(--fs-18); color: var(--text-2); max-width: 60ch; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-14); }
.gold { color: var(--brand-ink); }
@media (min-width: 1024px) {
  .h2 { font-size: var(--fs-44); }
  .lead { font-size: var(--fs-21); }
  .display { font-size: var(--fs-44); }
}
@media (min-width: 1280px) { .display { font-size: var(--fs-60); } }

/* Copy that only makes sense with motion on, or with motion off (design finding 13). */
.when-static { display: none; }
html:not(.motion-ok) .when-motion, .when-static-force .when-motion { display: none; }
html:not(.motion-ok) .when-static, .when-static-force .when-static { display: inline; }
.when-wide { display: none; }
.nobr { white-space: nowrap; } /* keeps "R$" with its number */
.when-narrow { display: block; }
@media (min-width: 1024px) { .when-wide { display: inline; } .when-narrow { display: none; } }

/* Visible placeholder for a fact the owner still has to give. Listed in docs/WAVE1-OPEN-QUESTIONS.md. */
.ph { color: var(--brand-ink); font-weight: 600; background: var(--brand-soft); border-radius: 4px; padding: 0 3px; }

/* Entrances. Hidden only when motion.js will animate them (html.motion-ok set by boot.js);
   boot.js removes motion-ok again if the motion module never reports ready. */
html.motion-ok [data-reveal] { opacity: 0; }

/* Reading progress: pure CSS, off the main thread, only where scroll timelines exist. */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 70; background: linear-gradient(90deg, var(--brand-line), var(--brand)); transform-origin: 0 50%; transform: scaleX(0); pointer-events: none; display: none; }
@keyframes bd-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { display: block; animation: bd-grow linear both; animation-timeline: scroll(root); }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
