/* ==========================================================================
   FAcode — base.css
   Self-hosted faces, reset, the type system, and layout primitives.
   Consumes tokens.css only.
   ========================================================================== */

/* ---------- 1. Faces (self-hosted, latin subset) ---------- */

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../../fonts/space-grotesk-var-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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: "IBM Plex Sans";
  font-style: normal;
  font-weight: 100 700;
  font-display: swap;
  src: url("../../fonts/ibm-plex-sans-var.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../fonts/ibm-plex-mono-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, 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: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../../fonts/ibm-plex-mono-500-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ---------- 2. Reset ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h-lg) + var(--sp-4));
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-body);
  color: var(--text-body);
  background-color: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img,
svg,
video { display: block; max-width: 100%; }

img { height: auto; }

button,
input,
select,
textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

ul, ol { margin: 0; padding: 0; }

figure, blockquote { margin: 0; }

address { font-style: normal; }

hr {
  height: 0;
  margin: 0;
  border: 0;
  border-top: var(--bw-hair) solid var(--line);
}


/* ---------- 3. Type system ---------- */

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3);
  overflow-wrap: break-word;
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  color: var(--text-strong);
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-4xl);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
}

h2 {
  font-size: var(--fs-3xl);
  line-height: 1.08;
  letter-spacing: var(--ls-display);
}

h3 {
  font-size: var(--fs-lg);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

h4 {
  font-size: var(--fs-md);
  line-height: var(--lh-snug);
  letter-spacing: var(--ls-snug);
}

h5, h6 {
  font-size: var(--fs-sm);
  letter-spacing: var(--ls-snug);
}

p {
  margin: 0 0 var(--sp-2);
  max-width: var(--measure);
  overflow-wrap: break-word;
}

p:last-child { margin-bottom: 0; }

b, strong { font-weight: var(--fw-semibold); color: var(--text-strong); }

small { font-size: var(--fs-sm); }

a {
  color: var(--text-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

a:hover { color: var(--teal-600); text-decoration-color: currentColor; }

.on-navy a:not(.btn):not(.brand) { color: var(--text-on-navy-accent); }
.on-navy a:not(.btn):not(.brand):hover { color: var(--teal-400); }

::selection { background: var(--wash-teal-strong); color: var(--navy-900); }


/* ---------- 4. Focus ---------- */

:focus { outline: none; }

:focus-visible {
  outline: var(--focus-width) solid var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  top: var(--sp-1);
  left: var(--sp-1);
  z-index: var(--z-float);
  padding: var(--sp-1) var(--sp-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--text-on-navy);
  background: var(--navy-800);
  border-radius: var(--r-sm);
  transform: translateY(-200%);
  transition: transform var(--t-base);
}

.skip-link:focus-visible { transform: translateY(0); color: var(--text-on-navy); }


/* ---------- 5. Layout primitives ---------- */

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--tight {
  max-width: calc(var(--container-tight) + var(--gutter) * 2);
}

.section {
  padding-block: var(--section-y);
}

.section--lg { padding-block: var(--section-y-lg); }
.section--sm { padding-block: var(--section-y-sm); }

/* Alternating grounds carry the page rhythm */
.section--paper  { background-color: var(--white); }
.section--sunken { background-color: var(--surface-sunken); }

.section--deep,
.section--navy {
  background-color: var(--surface);   /* remapped by .on-navy */
}

/* A hairline instead of a hard edge between two light sections */
.section--ruled { border-top: var(--bw-hair) solid var(--line); }

/* Editorial splits — asymmetric by default, never 50/50 */
.split {
  display: grid;
  gap: var(--grid-gap);
}

@media (min-width: 900px) {
  .split--7-5 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
  .split--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--8-4 { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
  .split--4-8 { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); }
  .split--6-5 { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(40px, 6vw, 112px); }
  .split--align-end   { align-items: end; }
  .split--align-start { align-items: start; }
}

.stack > * + * { margin-top: var(--sp-3); }
.stack--sm > * + * { margin-top: var(--sp-2); }
.stack--lg > * + * { margin-top: var(--sp-5); }


/* ---------- 6. Utilities (few, deliberate) ---------- */

.measure       { max-width: var(--measure); }
.measure-tight { max-width: var(--measure-tight); }
.measure-wide  { max-width: var(--measure-wide); }

.visually-hidden {
  position: absolute;
  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;
}

/* Reveal — a single quiet fade-up, only for elements below the fold.
   Content is fully visible when JS is off or motion is reduced. */
.reveal-init {
  opacity: 0;
  transform: translateY(14px);
}

.reveal-init.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity var(--dur-4) var(--ease-out), transform var(--dur-4) var(--ease-out);
}

.reveal-d1.is-visible { transition-delay: 70ms; }
.reveal-d2.is-visible { transition-delay: 140ms; }
.reveal-d3.is-visible { transition-delay: 210ms; }
