/* ==========================================================================
   base.css — reset, fonts, base typography, utilities
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------
   Self-hosted, no CDN. Variable WOFF2 files live in assets/fonts/.
   ------------------------------------------------------------------------ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('../assets/fonts/space-grotesk-variable.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Inter';
  src: url('../assets/fonts/inter-variable.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrains Mono';
  src: url('../assets/fonts/jetbrains-mono-variable.woff2') format('woff2');
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

/* --- Reset --------------------------------------------------------------- */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + var(--sp-6));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background-color: var(--bg-page);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

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

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

/* --- Focus ---------------------------------------------------------------
   Never remove the outline without a replacement. Not transitioned. --- */

:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --- Base typography ----------------------------------------------------- */

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text-title);
  text-wrap: balance;
}

p { text-wrap: pretty; }

.display-xl,
.display-lg {
  font-size: var(--fs-display-lg);
  font-weight: 700;
  line-height: var(--lh-display);
  letter-spacing: var(--ls-display);
  text-transform: uppercase;
}

.display-xl { font-size: var(--fs-display-xl); }

.display-md {
  font-size: var(--fs-display-md);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}

.heading {
  font-size: var(--fs-heading);
  font-weight: 700;
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
}

/* The one word per display title that carries the brand gradient.
   Both ends of --gradient-text pass AA, so the text stays legible
   across the whole sweep. */
.grad {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* --- Kicker: the mono accent. The studio's signature gesture (D11). ------ */

.kicker {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
  color: var(--action);
}

.kicker::before {
  content: '';
  width: 24px;
  height: 1px;
  background-color: currentColor;
  flex: none;
}

.lede {
  font-size: var(--fs-body-lg);
  color: var(--text-muted);
  max-width: 46ch;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  font-weight: 500;
  letter-spacing: var(--ls-mono);
  text-transform: uppercase;
}

/* --- Utilities ----------------------------------------------------------- */

.measure { max-width: var(--measure); }

.visually-hidden {
  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: var(--sp-2);
  left: var(--sp-2);
  z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background-color: var(--action);
  color: var(--on-action);
  border-radius: var(--radius-md);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus { transform: translateY(0); }

/* --- Scroll reveal -------------------------------------------------------
   Fires once at 20% visibility. Never reverses on scroll back.

   IMPORTANT: .reveal on its own does NOTHING. The hidden state only applies
   once js/reveal.js has added [data-armed]. Content must never depend on a
   script running to become visible — if the JS is blocked, fails to parse,
   or is switched off, the page still reads normally.
   ------------------------------------------------------------------------ */

.reveal[data-armed] {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: calc(var(--index, 0) * 60ms);
}

.reveal[data-armed].is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal[data-armed] {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
