/* Compound — site layout.
   Type sizes, line-heights, tracking and families come from the generated
   classes in tokens.css (.display-xl, .body, .label-s, .mono-s …); this file
   adds layout, colour, case and state only. Every length here is a spacing,
   radius or duration token; the exceptions are 1px rules, 100%, and the
   `ch`/`em` measures that hold a line length. */

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

html { background: var(--surface); }

body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--on-ink); }

/* ---- grid ---------------------------------------------------------- */

.wrap { max-width: 1280px; margin: 0 auto; padding-inline: var(--space-24); }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--space-6); }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: 1 / -1; }

.section { padding-block: var(--space-16); border-top: 1px solid var(--hairline); }
.section--open { border-top: 0; }
.measure { max-width: 34em; }

.stack-4 > * + * { margin-top: var(--space-4); }
.stack-6 > * + * { margin-top: var(--space-6); }
.stack-8 > * + * { margin-top: var(--space-8); }
.gap-6 { margin-top: var(--space-6); }
.gap-8 { margin-top: var(--space-8); }
.gap-12 { margin-top: var(--space-12); }

/* ---- type roles ----------------------------------------------------- */

h1, h2, h3, p, ul, ol { margin: 0; }

.eyebrow { text-transform: uppercase; color: var(--ink-muted); }
.note { color: var(--ink-faint); }
.caption { color: var(--ink-muted); }
.readout { color: var(--ink-muted); }
.prose + .prose { margin-top: var(--space-4); }
.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--border-strong);
  transition: text-decoration-color var(--dur-instant) var(--ease-out-quint);
}
.prose a:hover { text-decoration-color: var(--ink); }

/* ---- masthead ------------------------------------------------------- */

.masthead {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface); border-bottom: 1px solid var(--hairline);
}
.masthead__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-8); padding-block: var(--space-4);
}
.markword { text-transform: uppercase; color: var(--ink); text-decoration: none; }
.nav { display: flex; align-items: center; gap: var(--space-6); flex-wrap: wrap; }
.nav a {
  text-transform: uppercase; color: var(--ink-muted); text-decoration: none;
  transition: color var(--dur-instant) var(--ease-out-quint);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

.toggle {
  text-transform: uppercase;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong); border-radius: var(--radius-0);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background var(--dur-instant) var(--ease-out-quint),
              color var(--dur-instant) var(--ease-out-quint);
}
.toggle:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }

/* ---- controls (ActionLink) ------------------------------------------ */

.action {
  display: inline-block; text-transform: uppercase;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--ink); border-radius: var(--radius-0);
  background: var(--ink); color: var(--on-ink); text-decoration: none; cursor: pointer;
  transition: background var(--dur-instant) var(--ease-out-quint),
              color var(--dur-instant) var(--ease-out-quint);
}
.action:hover { background: var(--surface); color: var(--ink); }
.action--ghost { background: transparent; color: var(--ink); border-color: var(--border-strong); }
.action--ghost:hover { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }

/* ---- hero ----------------------------------------------------------- */

.hero { position: relative; padding-block: var(--space-32) var(--space-24); overflow: hidden; }
.hero__field {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  /* The field keeps to the right, clear of the copy — the same split the
     cover uses. Legibility comes from the mask, never from lowering opacity. */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 38%, #000 62%, #000 100%);
  mask-image: linear-gradient(to right, transparent 0%, transparent 38%, #000 62%, #000 100%);
}
.hero__field canvas { display: block; }
.hero__inner { position: relative; z-index: 1; }
.hero h1 { max-width: 14ch; }
.hero .lede { max-width: 32em; margin-top: var(--space-8); }

/* ---- figures -------------------------------------------------------- */

.figure { background: var(--surface-sunken); padding: var(--space-8); margin: 0; }
.figure__head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-4); }
.figure__canvas { position: relative; margin-top: var(--space-4); }
.figure__canvas canvas { display: block; width: 100%; }
.figure figcaption { margin-top: var(--space-4); }

/* ---- numbered build list -------------------------------------------- */

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li {
  counter-increment: step;
  display: grid; grid-template-columns: var(--space-16) 1fr; gap: var(--space-6);
  padding-block: var(--space-6); border-top: 1px solid var(--hairline);
}
.steps > li::before {
  content: "0" counter(step);
  font-family: var(--font-mono); font-size: 13px; line-height: 26px;
  color: var(--ink-faint);
}
.steps p { margin-top: var(--space-3); }

/* ---- phases --------------------------------------------------------- */

.phase { padding-block: var(--space-12); border-top: 1px solid var(--hairline); }
.phase__meta { display: flex; flex-direction: column; gap: var(--space-3); }
.phase__unit { color: var(--ink-faint); }

/* ---- refusals ------------------------------------------------------- */

.refuse { list-style: none; padding: 0; }
.refuse li { padding-block: var(--space-4); border-top: 1px solid var(--hairline); }
/* Stays in the serif family: the brand book forbids mixing grotesk and serif
   inside one sentence, and these lead-ins are part of the sentence. */
.refuse b { font-family: var(--font-serif); font-weight: 600; }

/* ---- products -------------------------------------------------------- */

.products {
  list-style: none; padding: 0;
  margin-top: var(--space-8);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}
.product { border-top: 1px solid var(--border-strong); padding-top: var(--space-4); }
.product p + p { margin-top: var(--space-3); }
.product__link {
  display: block; text-decoration: none; color: inherit;
  transition: opacity var(--dur-instant) var(--ease-out-quint);
}
.product__link:hover { opacity: 0.64; }
.product__link h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--border-strong); }

/* ---- call to action -------------------------------------------------- */

.cta { background: var(--ink); color: var(--on-ink); padding: var(--space-16) var(--space-24); }
.cta h2 { max-width: 16ch; }
.cta .eyebrow, .cta .prose { color: var(--on-ink); }
.cta .action { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
.cta .action:hover { background: transparent; color: var(--on-ink); }

/* ---- footer --------------------------------------------------------- */

.footer { padding-block: var(--space-12); border-top: 1px solid var(--hairline); }
.footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-6); }

/* ---- narrow --------------------------------------------------------- */

@media (max-width: 900px) {
  .wrap { padding-inline: var(--space-6); }
  .col-4, .col-5, .col-7, .col-8 { grid-column: 1 / -1; }
  .hero { padding-block: var(--space-16) var(--space-12); }
  /* The copy spans the full width here, so the right-hand mask no longer
     keeps the field clear of it. Drop the field rather than dim it. */
  .hero__field { display: none; }
  .hero h1 { font-size: 45px; letter-spacing: -0.02em; max-width: none; }
  .cta { padding: var(--space-12) var(--space-6); }
  .cta h2, .phase h2 { font-size: 32px; }
  .steps h3 { font-size: 23px; }
  .steps > li { grid-template-columns: var(--space-12) 1fr; gap: var(--space-4); }
  .masthead__inner { flex-wrap: wrap; gap: var(--space-4); }
  .nav { gap: var(--space-4); }
}

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