/* wiliam.ai — layout, type, colour, sections, buttons, paper section, footer.
   State styles for the motion hooks (reveals, lit words, active steps, solid nav,
   open menu, rail state, cursor, spotlight) live in js/motion.css. */

/* ------------------------------------------------------------------ tokens */
:root {
  --bg: #050912;
  --bg-alt: #08101D;
  --bg-footer: #03060D;
  --card: #0B1526;
  --inset: #070E1A;

  --paper: #EEF1F8;
  --paper-ink: #050912;
  --paper-muted: #3D4A66;
  --paper-line: rgba(5, 9, 18, .14);

  --text: #EAF1F8;
  --text-2: #C3CFDE;
  --muted: #8FA1B8;
  --faint: #6F829C;
  --ghost: #1A2436;

  --accent: #4FE3DE;
  --accent-hover: #8AF0EC;
  --accent-on: #041320;
  --accent-2: #8BEFE2;
  --accent-rgb: 79, 227, 222;

  --line: rgba(214, 228, 250, .08);
  --line-2: rgba(214, 228, 250, .2);

  --font: 'Hanken Grotesk', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --serif: 'Instrument Serif', Georgia, serif;

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-flow: cubic-bezier(.65, 0, .35, 1);

  --nav-h: 64px;
  --wrap: min(1240px, calc(100% - 2 * clamp(20px, 4vw, 32px)));
  --section-pad: clamp(96px, 12vw, 168px);

  /* added by U1: the horizontal inset that lines a full-bleed block up with --wrap */
  --gutter: calc((100% - var(--wrap)) / 2);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  overflow-x: clip;
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 18px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
h1, h2, h3 { font-weight: 600; }
ol, ul { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: italic; }

::selection { background: var(--accent); color: var(--accent-on); }

:focus { outline: none; }
:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  border-radius: 4px;
}
.btn:focus-visible,
.nav-burger:focus-visible { border-radius: 999px; }

/* ---------------------------------------------------------------- layering */
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
main,
.footer { position: relative; z-index: 1; }
/* .nav and .rail are fixed, not relative: they sit above main (z 1) so page
   content scrolls underneath them, and above the open menu panel. */
.nav { z-index: 30; }
.nav-menu { z-index: 25; }
.rail { z-index: 20; }
#cursor { position: fixed; top: 0; left: 0; z-index: 50; pointer-events: none; }

/* -------------------------------------------------------------- skip link */
.skip {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 60;
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-on);
  font: 600 15px/1 var(--font);
  transform: translateY(-200%);
  transition: transform 150ms var(--ease);
}
.skip:focus,
.skip:focus-visible { transform: none; }

/* ------------------------------------------------------------- typography */
.display em,
.h2 em,
.statement em,
.step h2 em {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.04em;
  letter-spacing: -.01em;
  color: var(--accent-2);
}

.eyebrow {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow .dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: calc((1.4em - 6px) / 2); /* centred on the first line when the label wraps */
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s var(--ease) infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), .55); }
  70% { box-shadow: 0 0 0 9px rgba(var(--accent-rgb), 0); }
  100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

.chapter {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}
.chapter .num {
  font: 600 52px/1 var(--font);
  letter-spacing: -.07em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(var(--accent-rgb), .6);
}
.chapter .lbl {
  font: 400 10px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.h2 {
  max-width: 18ch;
  margin: 0 0 56px;
  font: 600 clamp(38px, 5.2vw, 76px)/1.04 var(--font);
  letter-spacing: -.035em;
  text-wrap: balance;
}

.lead {
  max-width: 46ch;
  font-size: clamp(18px, 1.45vw, 21px);
  line-height: 1.55;
  color: var(--text-2);
  text-wrap: pretty;
}

.arr { font-family: var(--mono); font-weight: 400; }

/* ---------------------------------------------------------------- buttons */
.btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 56px;
  padding: 0 28px;
  border-radius: 999px;
  font: 500 16px/1 var(--font);
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, color 150ms, transform 150ms, box-shadow 150ms;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
  box-shadow: 0 0 40px rgba(var(--accent-rgb), .25);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn-secondary {
  border: 1px solid var(--line-2);
  color: var(--text);
}
.btn-secondary:hover {
  background: rgba(214, 228, 250, .06);
  border-color: rgba(var(--accent-rgb), .5);
  transform: translateY(-1px);
}
.btn-sm {
  height: 40px;
  padding: 0 20px;
  font-size: 15px;
  gap: 8px;
}

/* -------------------------------------------------------------------- nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-inline: max(clamp(20px, 4vw, 32px), (100% - 1240px) / 2);
  border-bottom: 1px solid transparent;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.nav-logo img {
  height: 28px;
  width: auto;
}
.nav-logo span {
  font: 800 13px/1 var(--font);
  letter-spacing: .24em;
  white-space: nowrap;
}

.nav-links {
  display: none;
  align-items: center;
  gap: clamp(24px, 2.6vw, 36px);
}
.nav-links a {
  font: 400 12px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 150ms;
}
.nav-links a:hover { color: var(--text); }

.nav-cta {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-cta .btn-sm { display: none; }

.nav-burger {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(214, 228, 250, .16);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: border-color 150ms;
}
.nav-burger:hover { border-color: rgba(var(--accent-rgb), .5); }
.nav-burger span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: var(--text);
  transition: transform 250ms var(--ease);
}
.nav-burger[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.nav-burger[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

/* full-screen menu panel (shown by motion.js removing [hidden]) */
.nav-menu {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  padding: calc(var(--nav-h) + 32px) clamp(20px, 4vw, 32px) clamp(40px, 8vh, 72px);
  background: rgba(5, 9, 18, .96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  overflow-y: auto;
}
.nav-menu[hidden] { display: none; }
.nav-menu nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}
.nav-menu a {
  font: 600 clamp(3rem, 9vw, 8.5rem)/1.02 var(--font);
  letter-spacing: -.04em;
  color: var(--text);
  transition: color 150ms;
}
.nav-menu a:hover { color: var(--accent); }
.nav-menu a:last-child {
  margin-top: 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -.01em;
  color: var(--accent-2);
}

/* ------------------------------------------------------------------- rail */
.rail {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.rail a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.rail a i {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.rail a::after {
  content: attr(data-label);
  position: absolute;
  right: 28px;
  top: 50%;
  transform: translate(6px, -50%);
  font: 400 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.rail a:hover::after,
.rail a:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: end;
  row-gap: 28px;
  padding: calc(var(--nav-h) + 8vh) var(--gutter) clamp(56px, 9vh, 104px);
  overflow: clip;
  isolation: isolate;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -260px;
  left: 50%;
  width: 1400px;
  height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--accent-rgb), .13), transparent 72%);
  pointer-events: none;
}
.hero .eyebrow { margin-bottom: 4px; }
.display {
  font: 600 clamp(52px, 7.6vw, 124px)/.95 var(--font);
  letter-spacing: -.045em;
  text-wrap: balance;
}
.display .ln { display: block; }
.display .ln > span { display: block; }
.hero .lead { margin-top: 12px; }
.hero .btns { margin-top: 4px; }

/* ---------------------------------------------------------------- marquee */
.marquee {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  height: 56px;
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font: 400 12px/1 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}
.marquee-track {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 40px;
  padding-right: 40px; /* keeps the seam equal to the gap when the track wraps */
  width: max-content;
  white-space: nowrap;
}
.marquee-track i {
  font-style: normal;
  color: var(--accent);
}
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* without JS (or with reduced motion) the strip still drifts, at a constant pace */
@media (scripting: none) {
  .marquee-track { animation: marquee 40s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; }
}

/* ------------------------------------------------- scroll-lit statements */
.statement-section {
  position: relative;
  height: 220vh;
}
.statement-short { height: 160vh; }
.statement-section > .chapter {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  z-index: 1;
  margin: 0;
  padding: 24px var(--gutter) 0;
}
.statement-pin {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 clamp(20px, 6vw, 80px);
}
/* the chapter sits above the pinned block, sharing its first screen */
.statement-section > .chapter + .statement-pin { margin-top: -100px; }
.statement {
  width: 100%;
  max-width: min(1100px, 100%);
  font: 600 clamp(30px, 3.7vw, 58px)/1.08 var(--font);
  letter-spacing: -.02em;
  text-wrap: pretty;
}
.belief {
  font-size: clamp(36px, 5vw, 84px);
  line-height: 1;
  letter-spacing: -.035em;
  text-align: center;
  text-wrap: balance;
}
.belief em { display: block; margin-top: .12em; }

/* ------------------------------------------------- the loop (pinned stage) */
.loop {
  position: relative;
  height: 300vh;
  height: 300svh;
}
.pin-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 640px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "chapter ."
    "steps ."
    "progress .";
  padding: calc(var(--nav-h) + 24px) var(--gutter) clamp(32px, 6vh, 64px);
}
.pin-stage > .chapter {
  grid-area: chapter;
  position: relative;
  z-index: 1;
  margin: 0;
}
.pin-progress {
  grid-area: progress;
  position: relative;
  z-index: 1;
  display: flex;
  gap: 8px;
}
.pin-progress .seg {
  position: relative;
  display: block;
  width: 64px;
  height: 2px;
  overflow: hidden;
  background: var(--line-2);
}
.steps {
  grid-area: steps;
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  max-width: 640px;
}
.step {
  grid-area: 1 / 1;
  align-self: center;
}
.step-tag {
  display: block;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
}
.step h2 {
  margin: 20px 0 22px;
  font: 600 clamp(34px, 4.6vw, 64px)/1.04 var(--font);
  letter-spacing: -.035em;
  text-wrap: balance;
}
.step p {
  max-width: 52ch;
  font-size: 20px;
  line-height: 1.5;
  color: var(--text-2);
  text-wrap: pretty;
}
.ghost {
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 50%;
  display: flex;
  align-items: center;
  font: 800 clamp(96px, 22vw, 320px)/1 var(--font);
  letter-spacing: -.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(214, 228, 250, .14);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* with scripting disabled the stage never pins: list the three steps instead */
@media (scripting: none) {
  .loop { height: auto; }
  .pin-stage { position: relative; height: auto; padding-block: var(--section-pad); row-gap: 48px; }
  .pin-progress { display: none; }
  .steps { display: flex; flex-direction: column; gap: 56px; }
}

/* ------------------------------------------------- sections with rhythm */
#built,
#building,
#why,
#contact {
  padding: var(--section-pad) var(--gutter);
}

/* ------------------------------------------------------ paper (Built) */
.paper {
  position: relative;
  background: var(--paper);
  color: var(--paper-ink);
  color-scheme: light;
}
.paper ::selection { background: var(--paper-ink); color: var(--paper); }
.paper .chapter .num { -webkit-text-stroke: 1px rgba(5, 9, 18, .5); }
.paper .chapter .lbl { color: var(--paper-muted); }
.paper em { color: var(--paper-ink); }
.paper :focus-visible { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--paper-ink); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2px;
  padding: 2px;
  background: var(--paper-line);
}
.card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  grid-template-areas:
    "k k"
    "h h"
    "p p"
    ". a";
  min-height: 300px;
  padding: 36px;
  background: var(--paper);
  color: var(--paper-ink);
  transition: translate .4s var(--ease);
}
.card:hover { translate: 0 -2px; }
.card .card-k {
  grid-area: k;
  font: 400 12px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper-muted);
}
.card h3 {
  grid-area: h;
  margin-top: clamp(40px, 5vw, 64px);
  font: 600 26px/1.15 var(--font);
  letter-spacing: -.02em;
  text-wrap: balance;
}
.card p {
  grid-area: p;
  margin-top: 12px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--paper-muted);
  text-wrap: pretty;
}
.card .arr {
  grid-area: a;
  align-self: end;
  justify-self: end;
  margin-top: 28px;
  font-size: 22px;
  line-height: 1;
  transition: transform .4s var(--ease);
}
.card:hover .arr { transform: rotate(-45deg); }
.footnote {
  margin-top: 40px;
  font: 400 12px/1.5 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

/* -------------------------------------------------------- Building rows */
#building .rows { margin: 0; padding: 0; list-style: none; }
#building .rows li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 36px 0;
  border-top: 1px solid var(--line);
}
#building .rows li:last-child { border-bottom: 1px solid var(--line); }
#building .row-n {
  font: 400 13px/1.4 var(--mono);
  letter-spacing: .12em;
  color: var(--accent);
}
#building .rows h3 {
  margin-bottom: 10px;
  font: 600 28px/1.15 var(--font);
  letter-spacing: -.02em;
}
#building .rows p {
  max-width: 52ch;
  color: var(--muted);
  text-wrap: pretty;
}

/* -------------------------------------------------------- Why pillars */
#why .pillars {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 2px;
  background: var(--line);
}
#why .pillar {
  position: relative;
  overflow: hidden;
  padding: 36px;
  background: var(--bg);
}
#why .pillar h3 {
  margin-bottom: 14px;
  font: 600 24px/1.2 var(--font);
  letter-spacing: -.02em;
}
#why .pillar p {
  max-width: 44ch;
  color: var(--muted);
  text-wrap: pretty;
}

/* -------------------------------------------------------------- Close */
.close {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.close .h2 {
  max-width: 14ch;
  margin: 0 auto 28px;
  font-size: clamp(44px, 6.4vw, 96px);
}
.close .lead {
  margin: 0 auto 40px;
  color: var(--muted);
  text-wrap: balance;
}
.close .btns { justify-content: center; }

/* ------------------------------------------------------------- Footer */
.footer {
  background: var(--bg-footer);
  border-top: 1px solid var(--line);
  padding: clamp(64px, 8vw, 112px) 0 32px;
}
.footer-cols {
  width: var(--wrap);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}
.footer-mail {
  font-size: 15px;
  color: var(--muted);
  transition: color 150ms;
}
.footer-mail:hover { color: var(--accent); }
.footer-h {
  margin-bottom: 18px;
  font: 400 11px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--faint);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-col a {
  font-size: 15px;
  color: var(--muted);
  transition: color 150ms;
}
.footer-col a:hover { color: var(--text); }

.footer-giant {
  display: flex;
  justify-content: center;
  margin-top: clamp(56px, 8vw, 120px);
  overflow: hidden;
  user-select: none;
}
.halftone {
  display: block;
  flex: none;
  margin-right: -.08em; /* cancel the trailing letter-space so the word centres */
  font: 800 clamp(96px, 19vw, 300px)/.8 var(--font);
  letter-spacing: .08em;
  white-space: nowrap;
  color: transparent;
  background: linear-gradient(90deg, #fff 0, #fff 45%, var(--accent) 50%, #fff 55%, #fff 100%);
  background-size: 220% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-mask-image: radial-gradient(circle, #000 1.4px, transparent 1.6px);
  -webkit-mask-size: 6px 6px;
  mask-image: radial-gradient(circle, #000 1.4px, transparent 1.6px);
  mask-size: 6px 6px;
  animation: glimmer 5.5s linear infinite;
  padding-block: .06em;
}
@keyframes glimmer {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
.footer-legal {
  width: var(--wrap);
  margin: 28px auto 0;
  font: 400 11px/1.5 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}

/* --------------------------------------------------------- breakpoints */
@media (min-width: 640px) {
  .nav-cta .btn-sm { display: inline-flex; }

  #building .rows li {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0;
  }
  #building .row-n { padding-top: 9px; }

  .footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (min-width: 860px) {
  .nav-links { display: flex; }
  .nav-burger { display: none; }
  .nav-menu { display: none; }

  .rail { display: flex; }

  #why .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #why .pillar { padding: 44px; min-height: 240px; }

  .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}

@media (min-width: 1100px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    column-gap: 64px;
    row-gap: 0;
  }
  .hero .eyebrow { grid-column: 1 / -1; margin-bottom: 32px; }
  .hero .display { grid-column: 1 / -1; }
  .hero .lead { grid-column: 2; margin-top: 44px; }
  .hero .btns { grid-column: 2; margin-top: 32px; }
}

/* below the desktop rail breakpoint, and on touch screens: no rail, no cursor */
@media (max-width: 859.98px) {
  .rail,
  #cursor { display: none !important; }
}
@media (hover: none) {
  .rail,
  #cursor { display: none !important; }
}

@media (max-width: 639.98px) {
  .nav-logo span { font-size: 12px; letter-spacing: .2em; }
  .pin-stage { grid-template-columns: minmax(0, 1fr); grid-template-areas: "chapter" "steps" "progress"; }
  .step p { font-size: 18px; }
  .card { padding: 28px; min-height: 260px; }
  #why .pillar { padding: 28px; }
}

/* ----------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .eyebrow .dot { animation: none; }
  .halftone { animation: none; background-position: 50% 0; }
  .btn,
  .card,
  .card .arr,
  .rail a::after,
  .nav-burger span { transition: none; }
  .btn-primary:hover,
  .btn-secondary:hover { transform: none; }
  .card:hover { translate: none; }
  .card:hover .arr { transform: none; }
}

/* ------------------------------------------------ integration (architect) */
/* The mission statement keeps a left column on wide screens so the sphere has the right. */
@media (min-width: 1100px) {
  #mission .statement-pin { justify-content: flex-start; padding-left: var(--gutter); }
  #mission .statement { max-width: min(820px, 58%); }
}
@media (max-width: 640px) {
  .halftone { font-size: 22vw; } /* the 96px floor is wider than a phone */
  .ghost { -webkit-text-stroke-color: rgba(214, 228, 250, .07); }
}
/* [data-reveal] in motion.css owns `transition`; restate it here with the hover lift included
   so the lift eases instead of snapping (same delay semantics as the reveal). */
.cards .card,
#why .pillar {
  transition: opacity 1s var(--ease), transform 1s var(--ease), translate .4s var(--ease), border-color .3s var(--ease);
  transition-delay: var(--d, 0s), var(--d, 0s), 0s, 0s;
}
/* Rail over the paper section: dark dots while Built is the active section. */
.rail:has(a[href="#built"].is-active) a i { background: rgba(5, 9, 18, .45); }
.rail:has(a[href="#built"].is-active) a.is-active i { background: var(--paper-ink); }
.rail:has(a[href="#built"].is-active) a::after { color: var(--paper-ink); }
