*, *::before, *::after { box-sizing: border-box; }

/* No overflow rule on <html>: even `clip` there breaks position: sticky
   for every sticky stage on the page. Horizontal overhang is clipped where
   it is made instead (the chapter cards, the hero stage, the bleed). */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.68;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
/* Syne ships no italic — asking for one makes the browser slant the
   roman, which is not the typeface. Emphasis is weight, not slant. */
em { font-style: normal; font-weight: 700; }

/* Running copy: Syne Regular with a little extra air — Syne is a display
   face doing text duty. */
p, li, dd, label, input, select, textarea, .body { font-family: var(--font-body); }
p { font-weight: 400; }

:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--white);
  color: var(--black);
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--t-fast) var(--ease);
}
.skip:focus { transform: translateY(0); }

/* ---------- construction armature ----------
   Hairline column rules over the whole page. They are the thing that
   makes every section feel drawn on the same sheet; faint enough to run
   across imagery without reading as a defect. */
.armature {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 0 var(--gutter);
  pointer-events: none;
  opacity: 0.55;
}
.armature span { border-left: 1px solid rgba(255, 255, 255, 0.08); }
.armature span:last-child { border-right: 1px solid rgba(255, 255, 255, 0.08); }
@media (max-width: 720px) {
  .armature { grid-template-columns: repeat(3, 1fr); }
  .armature span:nth-child(n + 4) { display: none; }
}

/* ---------- scroll progress ---------- */
.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  z-index: 70;
  pointer-events: none;
}
.progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform-origin: 0 50%;
  transform: scaleX(0);
}

/* ---------- corner HUD ----------
   Four corners, one tiny typographic voice. Nothing here is a button
   that looks like a button: the wordmark, {MENU}, the scroll readout and
   BACK TO TOP are all set in the same 10px tracked caps. */
.frame {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1;
}
.frame::before,
.frame::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 110px;
  pointer-events: none;
}
.frame::before { top: 0;    background: linear-gradient(180deg, rgba(0,0,0,.5), transparent); }
.frame::after  { bottom: 0; background: linear-gradient(0deg,   rgba(0,0,0,.5), transparent); }

.frame > * { position: absolute; z-index: 1; pointer-events: auto; }

.frame__logo {
  top: 18px; left: var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
}
/* The tight-cropped logotype, not the square file: in the 720px square
   the letters only filled a third of the height, so a 28px logo had
   letters about ten pixels tall. */
.frame__logo img { width: auto; height: 40px; }
.frame__logo b { font-size: 13px; font-weight: 600; letter-spacing: 0.2em; }

.frame__menu {
  top: 22px; right: var(--gutter);
  padding: 10px 0 10px 18px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  color: var(--text);
  transition: color var(--t-fast) var(--ease);
}
a.frame__menu { text-decoration: none; }
.frame__menu::before { content: '['; color: var(--text-4); }
.frame__menu::after  { content: ']'; color: var(--text-4); }
.frame__menu:hover { color: var(--green); }

.frame__counter {
  bottom: 24px; left: var(--gutter);
  display: flex;
  align-items: baseline;
  gap: 14px;
  pointer-events: none;
}
.frame__scroll { color: var(--text); font-variant-numeric: tabular-nums; }
.frame__scroll b { font-weight: 600; display: inline-block; min-width: 3.2ch; text-align: right; }
.frame__num {
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}
.frame__num::before { content: '['; color: var(--text-4); }
.frame__num::after  { content: ']'; color: var(--text-4); }
.frame__name { color: var(--text-3); transition: color var(--t-med) var(--ease); }
.frame__counter.is-changing .frame__name { color: var(--green); }

.frame__totop {
  bottom: 24px; right: var(--gutter);
  padding: 8px 0;
  text-decoration: none;
  color: var(--text-3);
  transition: color var(--t-fast) var(--ease);
}
.frame__totop:hover { color: var(--text); }

/* ---------- menu ----------
   A frosted panel that slides in from the right and takes half the
   screen; the page stays visible, dimmed, behind it. */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  visibility: hidden;
  transition: visibility 0s linear 800ms;
}
.menu[aria-hidden="false"] { visibility: visible; transition-delay: 0s; }

.menu__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 600ms var(--ease);
}
.menu[aria-hidden="false"] .menu__scrim { opacity: 1; }

.menu__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(100%, 50vw);
  min-width: min(100%, 540px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 92px clamp(28px, 4vw, 72px) 44px;
  background: rgba(6, 6, 9, 0.66);
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  backdrop-filter: blur(28px) saturate(1.2);
  transform: translateX(100%);
  transition: transform 800ms cubic-bezier(0.76, 0, 0.24, 1);
  overflow-y: auto;
}
.menu[aria-hidden="false"] .menu__panel { transform: none; }

.menu__eyebrow {
  margin: 0 0 24px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}

.menu__body {
  align-self: center;
  display: grid;
  gap: clamp(14px, 2.4vh, 26px);
  min-width: 0;
}
.menu__nav {
  display: flex;
  flex-direction: column;
}
.menu__nav a {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 1.6vw, 24px);
  padding: clamp(8px, 1.3vh, 14px) 0;
  text-decoration: none;
  font-weight: 400;
  font-size: clamp(26px, 2.9vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--text);
  transform: translateX(28px);
  opacity: 0;
  transition: color var(--t-fast) var(--ease), transform 700ms var(--ease), opacity 500ms var(--ease);
}
.menu__nav a span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-4);
  min-width: 2.4em;
}
.menu__nav a:hover { color: var(--green); }
.menu__nav a:hover span { color: var(--green); }
.menu__nav a.is-here { font-weight: 700; }
.menu[aria-hidden="false"] .menu__nav a { transform: none; opacity: 1; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(1) { transition-delay: 160ms; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(2) { transition-delay: 200ms; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(3) { transition-delay: 240ms; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(4) { transition-delay: 280ms; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(5) { transition-delay: 320ms; }
.menu[aria-hidden="false"] .menu__nav a:nth-child(6) { transition-delay: 360ms; }

/* The site's pages: a quieter row under the departments. */
.menu__pages {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px clamp(18px, 1.8vw, 30px);
  padding-top: clamp(14px, 2.2vh, 24px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 500ms var(--ease) 420ms, transform 700ms var(--ease) 420ms;
}
.menu[aria-hidden="false"] .menu__pages { opacity: 1; transform: none; }
.menu__pages .menu__label { flex-basis: 100%; margin: 0 0 2px; }
.menu__pages a {
  font-family: var(--font);
  font-weight: 400;
  font-size: clamp(16px, 1.3vw, 21px);
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--text-2);
  transition: color var(--t-fast) var(--ease);
}
.menu__pages a:hover, .menu__pages a.is-here { color: var(--green); }
.menu__pages a i { font-style: normal; color: var(--text-4); margin-left: 6px; }

.menu__foot {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: space-between;
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 500ms var(--ease) 420ms, transform 700ms var(--ease) 420ms;
}
.menu[aria-hidden="false"] .menu__foot { opacity: 1; transform: none; }
.menu__col { display: grid; gap: 8px; align-content: start; }
.menu__label {
  margin: 0 0 4px;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-4);
}
.menu__col a {
  font-family: var(--font);
  text-decoration: none;
  color: var(--text-2);
  transition: color var(--t-fast) var(--ease);
}
.menu__col a:hover { color: var(--green); }
.menu__col a i { font-style: normal; display: inline-block; margin-left: 4px; transition: transform var(--t-fast) var(--ease); }
.menu__col a:hover i { transform: translate(2px, -2px); }
.menu__col p { margin: 0; font-family: var(--font); color: var(--text-3); line-height: 1.4; }
.menu__col p em { color: var(--text); }

/* ---------- cursor-follow preview (fine pointers only) ---------- */
.preview {
  position: fixed;
  top: 0; left: 0;
  z-index: 65;
  width: 280px;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(-600px, -600px, 0);
  transition: opacity var(--t-fast) var(--ease), transform 520ms var(--ease);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}
.preview img { width: 100%; height: 100%; object-fit: cover; }
.preview.is-on { opacity: 1; }
@media (hover: none), (pointer: coarse) { .preview { display: none; } }

/* ---------- pills ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border: 1px solid var(--line-3);
  border-radius: 999px;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  /* a pill is sometimes a <button>, which inherits neither by default */
  font-family: var(--font);
  color: inherit;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.pill:hover { border-color: var(--green); color: var(--green); }
.pill span { transition: transform var(--t-fast) var(--ease); }
.pill:hover span { transform: translateX(4px); }

.pill--solid { background: var(--white); color: var(--black); border-color: var(--white); }
.pill--solid:hover { background: var(--green); border-color: var(--green); color: var(--black); }

.pill--grad { background: var(--grad); border-color: transparent; color: var(--white); }
.pill--grad:hover { color: var(--white); border-color: transparent; filter: brightness(1.12); }

/* AR has nothing to enter on a desktop, so the button states that plainly
   instead of sending you somewhere else. */
.pill.is-inert {
  background: transparent;
  border-color: var(--line-3);
  color: var(--text-3);
  cursor: default;
  filter: none;
}
.pill.is-inert:hover { border-color: var(--line-3); color: var(--text-3); filter: none; }

/* ---------- braced labels ----------
   [LIKE THIS] — the section tags and the corner HUD share one voice. */
.tag {
  display: inline-block;
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
}
.tag::before { content: '['; color: var(--text-4); }
.tag::after  { content: ']'; color: var(--text-4); }

/* ---------- reveal ---------- */
/* GSAP drives these; CSS only sets the pre-animation state. */
[data-reveal] { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- footer ----------
   Shared chrome: the project pages and the archive both use it. The home
   page restyles it in scenes.css, which loads after this. */
/* Bottom padding clears the HUD's corner readouts (24px off the edge). */
.footer { padding: clamp(50px, 8vh, 100px) var(--gutter) 74px; }
.footer__logo {
  display: block;
  width: min(56vw, 760px);
  height: auto;
  margin: 0 auto 32px;
}
.footer__row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
}
.footer__row a { text-decoration: none; }
.footer__row a:hover { color: var(--green); }

@media (max-width: 860px) {
  .footer__logo { width: 78vw; }
}
