/* ==========================================================================
   base.css — reset, document, typography, controls, shared primitives
   ========================================================================== */

/* Metrics-compatible fallback so the display word does not shift when Inter arrives. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html, body { height: auto; }
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; padding: 0; }
address { font-style: normal; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
[hidden] { display: none !important; }

html {
  font-family: var(--font-sans);
  font-size: 100%;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
  overflow-x: clip;
}
html[data-motion="reduced"] { scroll-behavior: auto; }

body {
  position: relative;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-body);
  line-height: 1.55;
  overflow-x: clip;
  overscroll-behavior-x: none;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Page --------------------------------------------------------------------- */
#page { position: relative; z-index: var(--z-page); }
[id] { scroll-margin-top: 24px; }
.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--s5); }
.section { padding-block: var(--section-y); }
.measure { max-width: 36rem; }

/* Typography --------------------------------------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; text-wrap: balance; }
p { text-wrap: pretty; }

.display-xl { font-family: var(--font-display); font-size: var(--fs-display-xl); font-weight: 700; letter-spacing: -0.045em; line-height: 0.92; }
.display-l  { font-family: var(--font-display); font-size: var(--fs-display-l);  font-weight: 700; letter-spacing: -0.035em; line-height: 0.95; }
.display-m  { font-family: var(--font-display); font-size: var(--fs-display-m);  font-weight: 650; letter-spacing: -0.025em; line-height: 1.0; }
.headline   { font-size: var(--fs-headline); font-weight: 600; letter-spacing: -0.015em; line-height: 1.15; }
.title      { font-size: var(--fs-title);    font-weight: 600; letter-spacing: -0.01em;  line-height: 1.25; }
.body-l     { font-size: var(--fs-body-l);   line-height: 1.5; }
.body       { font-size: var(--fs-body);     line-height: 1.55; }
.caption    { font-size: var(--fs-caption);  font-weight: 500; letter-spacing: 0.01em; line-height: 1.4; }
.eyebrow    { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2; color: var(--text-3); }
.readout    { font-family: var(--font-mono); font-size: var(--fs-readout); font-weight: 500; letter-spacing: 0.02em; line-height: 1.5; font-variant-numeric: tabular-nums; color: var(--text-3); white-space: pre-wrap; }
.muted      { color: var(--text-2); }
.faint      { color: var(--text-3); }
.accent     { color: var(--accent); }

/* Controls ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  border-radius: var(--r-round);
  font-weight: 600; font-size: var(--fs-body); letter-spacing: -0.005em; line-height: 1;
  color: var(--text);
  background: var(--mat-thin-bg);
  -webkit-backdrop-filter: var(--mat-thin-blur); backdrop-filter: var(--mat-thin-blur);
  border: 1px solid var(--line);
  transition: transform 160ms var(--ease-out), background-color var(--t-fast) ease-out, border-color var(--t-fast) ease-out;
  white-space: nowrap;
}
.btn--primary { background: var(--brand-fill); color: var(--on-brand); border-color: transparent; box-shadow: var(--glow-primary); -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn--primary.pressed, .btn--primary:active { background: var(--brand-fill-press); }
.btn--bmc { background: var(--bmc); color: var(--on-bmc); border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn--lg { min-height: 64px; padding: 0 var(--s6); font-size: var(--fs-body-l); }
.btn--block { width: 100%; }
@media (hover: hover) {
  .btn:hover { background: var(--mat-thin-hover); border-color: var(--line-strong); }
  .btn--primary:hover { background: var(--brand-fill-press); }
  .btn--bmc:hover { background: #FFE94D; }
}
.chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4);
  border-radius: var(--r-round);
  font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.01em;
  color: var(--text); background: var(--mat-thin-bg); border: 1px solid var(--line);
  -webkit-backdrop-filter: var(--mat-thin-blur); backdrop-filter: var(--mat-thin-blur);
  transition: transform 160ms var(--ease-out), background-color var(--t-fast) ease-out;
}
@media (hover: hover) { .chip:hover { background: var(--mat-thin-hover); } }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r-round);
  color: var(--text-2); background: transparent; border: 1px solid transparent;
  transition: transform 160ms var(--ease-out), background-color var(--t-fast) ease-out, color var(--t-fast) ease-out;
}
.icon-btn svg { width: 20px; height: 20px; }
@media (hover: hover) { .icon-btn:hover { color: var(--text); background: var(--mat-thin-bg); } }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon--fill { fill: currentColor; stroke: none; }

/* Press feedback: on pointer-down, instantly; the return is a one-shot transition. */
.pressed { transform: scale(0.97); transition-duration: 100ms; }
.icon-btn.pressed { transform: scale(0.9); }

/* Focus ------------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible { outline: var(--focus-ring) solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus-visible { outline: none; }
.skip-link {
  position: fixed; top: var(--s3); left: var(--s3); z-index: var(--z-toast);
  padding: var(--s3) var(--s4); border-radius: var(--r-btn);
  background: var(--brand); color: var(--on-brand); font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

/* Reveals ----------------------------------------------------------------- */
html.js .reveal { opacity: 0; transform: translateY(24px); }
html.js .reveal.is-in { opacity: 1; transform: none; transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out); transition-delay: var(--stagger, 0ms); }
html.js[data-motion="reduced"] .reveal { transform: none; }
html.js[data-motion="reduced"] .reveal.is-in { transition: opacity 200ms ease; }
@media print { html.js .reveal { opacity: 1 !important; transform: none !important; } }

/* Grain -------------------------------------------------------------------- */
body::after {
  content: ""; position: fixed; inset: 0; z-index: var(--z-grain);
  background-image: var(--grain, none); background-size: 128px 128px;
  opacity: var(--grain-opacity); pointer-events: none;
}
html[data-power="low"] body::after { display: none; }

/* Atmosphere --------------------------------------------------------------- */
#atmos { position: fixed; inset: 0; z-index: var(--z-atmos); pointer-events: none; overflow: hidden; }
#atmos > div { position: absolute; inset: 0; }
.atmos__spot {
  background: radial-gradient(ellipse 70% 55% at 50% -8%, var(--spot) 0%, transparent 65%);
}
.atmos__disc { inset: auto; width: 60vw; height: 60vw; border-radius: 50%; }
.atmos__disc--a { left: 20vw; top: 70vh; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--disc-a) 0%, transparent 60%); }
.atmos__disc--b { left: 80vw; top: 20vh; width: 40vw; height: 40vw; transform: translate(-50%, -50%); background: radial-gradient(circle, var(--disc-b) 0%, transparent 60%); }

/* Selection ---------------------------------------------------------------- */
::selection { background: rgba(79, 140, 255, 0.35); }

/* Contrast: no text gradients anywhere; defined borders on cards. */
html[data-contrast="more"] .btn, html[data-contrast="more"] .chip, html[data-contrast="more"] .icon-btn { border-color: var(--line); }
