/* ============================================================
   Freddie Beasley — one person, four worlds.
   Light editorial design system.

   Shared shell (identity, nav, footer, brass rule, page codes)
   stays constant. Each page scope changes typography, palette
   and pacing:

     body.voice    01 / VOICE    — editorial stage      (home)
     body.contact  02 / CONTACT  — matchday programme   (rugby)
     body.build    03 / BUILD    — workbench            (programming)
     body.study    04 / STUDY    — annotated archive    (academics)
   ============================================================ */

/* ---------- 1. RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img, video, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }
ul { list-style: none; }


/* ---------- 2. TOKENS ---------- */
:root {
  /* shared identity */
  --paper:      #FBF9F5;
  --paper-2:    #F3EFE8;
  --paper-3:    #EAE4D9;
  --ink:        #17161A;
  --ink-2:      #3D3A38;
  --ink-soft:   #6B6660;
  --rule:       rgba(23,22,26,0.13);
  --rule-soft:  rgba(23,22,26,0.07);
  --brass:      #A0762F;   /* the shared signature rule */
  --brass-soft: rgba(160,118,47,0.16);

  /* per-scope accent — overridden below */
  --accent:      #1F4D3A;
  --accent-soft: rgba(31,77,58,0.10);
  --surface:     var(--paper);
  --surface-alt: var(--paper-2);

  /* type */
  --sans:    'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif:   'Fraunces', Georgia, 'Times New Roman', serif;
  --mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --display: var(--serif);

  /* metrics */
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 62ch;
  --nav-h: 66px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* 01 / VOICE — warm ivory, Millfield green, brass */
body.voice {
  --accent: #1F4D3A;
  --accent-soft: rgba(31,77,58,0.10);
  --surface: #FBF9F5;
  --surface-alt: #F2EFE7;
  --display: var(--serif);
}

/* 02 / CONTACT — newsprint white, Bath blue, acid highlight */
body.contact {
  --accent: #17348C;
  --accent-soft: rgba(23,52,140,0.09);
  --volt: #D8F237;
  --paper: #F7F7F5;
  --surface: #F7F7F5;
  --surface-alt: #ECECE8;
  --ink: #101015;
  --display: 'Anton', 'Archivo', Impact, sans-serif;
}

/* 03 / BUILD — plotting paper, ink green, monospace */
body.build {
  --accent: #1D6A56;
  --accent-soft: rgba(29,106,86,0.09);
  --paper: #F7F8F4;
  --surface: #F7F8F4;
  --surface-alt: #EEF0E9;
  --ink: #14181A;
  --grid: rgba(29,106,86,0.09);
  --display: var(--mono);
}

/* 04 / STUDY — warm archival paper, oxblood ink */
body.study {
  --accent: #7A2B2B;
  --accent-soft: rgba(122,43,43,0.08);
  --paper: #FAF6EC;
  --surface: #FAF6EC;
  --surface-alt: #F2EBDB;
  --ink: #221E1A;
  --display: 'Newsreader', Georgia, serif;
}


/* ---------- 3. BASE ---------- */
body {
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-2);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.08; font-weight: 700; }
h1 { font-family: var(--display); }
h2 { font-family: var(--display); }
h3 { font-family: var(--sans); font-weight: 700; line-height: 1.25; }
p  { max-width: var(--measure); }
p + p { margin-top: 1rem; }
strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

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

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

.container {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container.narrow { max-width: 820px; }

section { padding: clamp(3.5rem, 8vw, 6.5rem) 0; }
section.tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.band-alt { background: var(--surface-alt); }
.band-top { border-top: 1px solid var(--rule); }
.band-bottom { border-bottom: 1px solid var(--rule); }

.text-center { text-align: center; }


/* ---------- 4. SHARED IDENTITY MARKS ---------- */

/* the thin brass rule */
.brass-rule {
  height: 2px;
  width: 56px;
  background: var(--brass);
  border: 0;
  margin: 0 0 1.5rem;
}

/* numbered page code — 01 / VOICE */
.page-code {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}

/* small caps eyebrow above a section */
.eyebrow, .section-label {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.9rem;
}

/* section heading block */
.sec-head { margin-bottom: clamp(2rem, 4vw, 3rem); max-width: 62ch; }
.sec-head h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  letter-spacing: -0.02em;
}
.sec-head p { margin-top: 0.9rem; color: var(--ink-soft); }

/* caption — date, event and why it matters */
.caption {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  margin-top: 0.6rem;
  max-width: 46ch;
}
.caption b { color: var(--ink); font-weight: 600; }


/* ---------- 5. NAV ---------- */
#nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 97%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
#nav.scrolled { border-bottom-color: var(--rule); }

.nav-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding: 0 var(--gutter);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.nav-logo::after {
  content: '';
  width: 22px;
  height: 1.5px;
  background: var(--brass);
}

.nav-links { display: flex; align-items: center; gap: 0.35rem; }
.nav-links a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.83rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
  text-decoration: none;
  border-radius: 2px;
  position: relative;
  transition: color 0.2s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 0.75rem; right: 0.75rem; bottom: 0.15rem;
  height: 1.5px;
  background: var(--brass);
}

/* Programming carries a submenu. It opens on hover and on keyboard focus, and
   the parent link still navigates — the menu is a shortcut, not a gate. */
.nav-links .has-sub { position: relative; }
.nav-links .has-sub > a { display: flex; align-items: center; gap: 0.35rem; }
.sub-caret {
  width: 5px; height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-1.5px) rotate(45deg);
  opacity: 0.55;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.nav-sub {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 190px;
  padding: 0.35rem 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 2px solid var(--brass);
  box-shadow: 0 12px 28px rgba(23,22,26,0.10);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s var(--ease), transform 0.18s var(--ease), visibility 0.18s;
}
/* a small bridge so the pointer can cross the gap without the menu closing */
.nav-links .has-sub::after {
  content: '';
  position: absolute;
  top: 100%; left: 0; right: 0;
  height: 10px;
}
.nav-links .has-sub:hover .nav-sub,
.nav-links .has-sub:focus-within .nav-sub {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.nav-links .has-sub:hover .sub-caret,
.nav-links .has-sub:focus-within .sub-caret { transform: translateY(0) rotate(225deg); opacity: 1; }
.nav-sub a {
  display: block;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-sub a:hover { background: var(--accent-soft); color: var(--ink); }

.hamburger { display: none; width: 34px; height: 34px; position: relative; }
.hamburger span {
  position: absolute;
  left: 6px; right: 6px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s;
}
.hamburger span:nth-child(1) { top: 11px; }
.hamburger span:nth-child(2) { top: 16.5px; }
.hamburger span:nth-child(3) { top: 22px; }
.hamburger.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

.nav-mobile {
  position: fixed;
  inset: var(--nav-h) 0 auto 0;
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  padding: 0.5rem var(--gutter) 1.5rem;
  display: none;
  flex-direction: column;
}
.nav-mobile.open { display: flex; }
.nav-mobile a {
  padding: 0.85rem 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
}
.nav-mobile a.active { color: var(--accent); }
/* submenu entries are indented and quieter than their parent */
.nav-mobile a.nav-mobile-sub {
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.6rem 0 0.6rem 1.25rem;
  color: var(--ink-soft);
}
.nav-mobile a.nav-mobile-sub::before { content: '— '; color: var(--brass); }


/* ---------- 6. BUTTONS + LINKS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid var(--ink);
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }

/* editorial inline link with drawn underline */
.link-arrow {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid var(--brass);
  transition: gap 0.2s var(--ease), color 0.2s var(--ease);
}
.link-arrow:hover { gap: 0.75rem; color: var(--accent); }


/* ---------- 7. TAGS + STATS (restyled, kept) ---------- */
.tag-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
/* Every .tag-list sits inside .duo-text, whose `> * + *` rule is more
   specific and would otherwise win with 1rem. This was what the inline
   style on each tag list was really doing. */
.duo-text > .tag-list { margin-top: 0.5rem; }
.tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  background: transparent;
  padding: 0.3rem 0.6rem;
  border-radius: 2px;
}
.tag.on { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }

/* record row: label + value, ruled — replaces the counter strip */
.record { border-top: 1px solid var(--ink); }
.record-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--rule);
}
.record-key { font-size: 0.95rem; color: var(--ink); font-weight: 600; }
.record-key small {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 0.2rem;
}
.record-val {
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* horizontal figure strip */
.figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule);
}
/* the divider sits on the left of each cell, with padding either side so the
   numbers and labels never touch a rule */
.figure { padding: 1.4rem 1.5rem; border-left: 1px solid var(--rule); }
.figure:first-child { border-left: 0; padding-left: 0; }
.figure-val {
  font-family: var(--display);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.figure-key {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}


/* ---------- 8. MEDIA + DUO LAYOUT ---------- */
/* duo: media and text side by side. Media side is set per instance. */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.duo.wide-left  { grid-template-columns: 1.25fr 1fr; }
.duo.wide-right { grid-template-columns: 1fr 1.25fr; }
.duo.middle { align-items: center; }

/* two media side by side across the full column width */
.media-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(0.75rem, 2vw, 1.25rem); }
.media-row-2 figure { margin: 0; }
.duo-text { max-width: 56ch; }
.duo-text > * + * { margin-top: 1rem; }

figure { margin: 0; }
.frame {
  position: relative;
  background: var(--paper-3);
  overflow: hidden;
}
.frame img, .frame video { width: 100%; height: 100%; object-fit: cover; }
.frame.tall { aspect-ratio: 3 / 4; }
.frame.wide { aspect-ratio: 4 / 3; }
.frame.cinema { aspect-ratio: 16 / 9; }
.frame.portrait { aspect-ratio: 9 / 16; }
.frame.square { aspect-ratio: 1 / 1; }
/* .fit — show the whole frame, never crop. For screenshots, diagrams and
   anything where the edges carry information. */
.frame.fit { background: var(--paper-2); }
.frame.fit img, .frame.fit video { object-fit: contain; }

/* keep media from becoming absurdly tall on wide screens — a full-width
   portrait frame is taller than the viewport */
.media-narrow   { max-width: 880px; margin-inline: auto; }
.media-portrait { max-width: 480px; margin-inline: auto; }

/* deliberate irregularity — a slight tilt on select images */
.tilt-l { transform: rotate(-1.1deg); }
.tilt-r { transform: rotate(0.9deg); }

img[data-src] { opacity: 0; transition: opacity 0.5s var(--ease); }
img[data-src].loaded, img.loaded { opacity: 1; }

video { background: #0d0d0f; }


/* ---------- 9. CAROUSEL (manual only — never auto) ---------- */
.carousel-wrap { position: relative; overflow: hidden; background: var(--paper-3); }
.carousel-track { display: flex; transition: transform 0.5s var(--ease); height: 100%; }
.carousel-slide { min-width: 100%; position: relative; height: 100%; }
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }

/* Match photography arrives in mixed orientations. `carousel-contain` shows every
   frame whole and letterboxes against paper — a crop would cut people out of the
   picture. Only use plain `.carousel-wrap` when every slide shares an orientation. */
.carousel-wrap.carousel-contain {
  aspect-ratio: 4 / 3;
  max-height: 70vh;
  background: var(--paper-2);
}
.carousel-wrap.carousel-contain .carousel-slide img { object-fit: contain; }

/* portrait galleries (squad portraits) — same rule, taller box */
.carousel-wrap.carousel-portrait {
  aspect-ratio: 3 / 4;
  max-height: 78vh;
  background: var(--paper-2);
}
.carousel-wrap.carousel-portrait .carousel-slide img { object-fit: contain; }

/* carousel-fill — for a set where every slide shares the same portrait ratio,
   so the frame can match the photographs and they fill it edge to edge */
.carousel-wrap.carousel-portrait.carousel-fill { aspect-ratio: 2 / 3; }
.carousel-wrap.carousel-portrait.carousel-fill .carousel-slide img { object-fit: cover; }

.carousel-caption {
  position: absolute;
  inset: auto 0 0 0;
  /* bottom padding clears the dots, which sit in the same corner */
  padding: 2.5rem 1rem 1.9rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  font-size: 1rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  z-index: 2;
}
.carousel-btn:hover { background: var(--ink); color: var(--paper); }
.carousel-btn.prev { left: 0.75rem; }
.carousel-btn.next { right: 0.75rem; }

.carousel-dots {
  position: absolute;
  left: 0; right: 0; bottom: 0.75rem;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  z-index: 2;
}
/* dots sit over photographs on some slides and over paper letterboxing on
   others — the hairline keeps them legible on both */
.carousel-dot {
  width: 20px; height: 3px;
  background: rgba(255,255,255,0.55);
  box-shadow: 0 0 0 1px rgba(23,22,26,0.32);
  transition: background 0.2s var(--ease);
}
.carousel-dot.active { background: #fff; box-shadow: 0 0 0 1px rgba(23,22,26,0.55); }

/* controls placed below the frame (portrait carousels) */
.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
}
.carousel-controls .carousel-btn { position: static; transform: none; }
.carousel-controls .carousel-dots { position: static; }
.carousel-controls .carousel-dot { background: var(--rule); }
.carousel-controls .carousel-dot.active { background: var(--ink); }


/* ---------- 10. THUMB STRIP + LIGHTBOX ---------- */
.thumb-strip { display: grid; gap: 0.6rem; }
.thumb-strip.cols-2 { grid-template-columns: repeat(2, 1fr); }
.thumb-strip.cols-3 { grid-template-columns: repeat(3, 1fr); }
.thumb-strip.cols-4 { grid-template-columns: repeat(4, 1fr); }
.thumb-item {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--paper-3);
  cursor: zoom-in;
  border: 1px solid transparent;
  transition: border-color 0.2s var(--ease), opacity 0.2s var(--ease);
}
.thumb-item img { width: 100%; height: 100%; object-fit: cover; }
.thumb-item:hover { border-color: var(--brass); }
.thumb-item.active { border-color: var(--ink); }
/* a thumbnail that does not open — no zoom cursor, no hover affordance */
.thumb-item.is-static { cursor: default; }
.thumb-item.is-static:hover { border-color: transparent; }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16,15,14,0.94);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: min(1100px, 92vw); max-height: 82vh; object-fit: contain; }
.lightbox-caption {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.75);
  text-align: center;
}
.lightbox-close {
  position: absolute;
  top: 1.25rem; right: 1.5rem;
  width: 40px; height: 40px;
  color: #fff;
  font-size: 1.1rem;
  border: 1px solid rgba(255,255,255,0.25);
}


/* ---------- 11. PLACEHOLDER (photos not yet available) ---------- */
.pending {
  border: 1px dashed var(--rule);
  background: repeating-linear-gradient(
    45deg, transparent, transparent 9px,
    var(--rule-soft) 9px, var(--rule-soft) 10px);
  padding: clamp(2rem, 5vw, 3rem);
  text-align: center;
}
.pending h3 { font-size: 1rem; margin-bottom: 0.35rem; }
.pending p { color: var(--ink-soft); font-size: 0.85rem; margin-inline: auto; }


/* ---------- 12. FEEDS (YouTube / GitHub) ---------- */
.yt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.5rem; }
.yt-card { text-decoration: none; }
.yt-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--paper-3);
  border: 1px solid var(--rule);
}
.yt-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.92);
  color: #c00;
  border-radius: 50%;
  pointer-events: none;
}
.yt-play svg { width: 22px; height: 22px; margin-left: 2px; }
.yt-info h3 { font-size: 0.95rem; margin-top: 0.85rem; }
.yt-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.35rem;
}

.spinner {
  width: 22px; height: 22px;
  margin: 2rem auto;
  border: 2px solid var(--rule);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ---------- 13. FOOTER ---------- */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.62);
  padding: clamp(3rem, 6vw, 4.5rem) 0 2.5rem;
}
.footer-inner {
  max-width: 1180px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.footer-rule { height: 2px; width: 56px; background: var(--brass); margin-bottom: 2rem; }
.footer-name {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.footer-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin-top: 0.75rem;
}
.footer-socials { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 2rem; }
.social-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 2px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.social-pill:hover { background: #fff; color: var(--ink); border-color: #fff; }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
}


/* ============================================================
   14. PAGE 01 / VOICE — editorial stage
   ============================================================ */

.stage {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2rem, 6vw, 4rem));
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
}
.stage-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.stage h1 {
  font-size: clamp(2.9rem, 8.5vw, 6.4rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}
.stage h1 em {
  font-style: italic;
  color: var(--accent);
}
.stage-kicker {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}
.stage-kicker b { color: var(--brass); font-weight: 500; }
.stage-line {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  margin-top: 1.75rem;
  max-width: 40ch;
}
.stage-cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.stage-figure { position: relative; }
.stage-figure .frame { aspect-ratio: 4 / 5; }

/* signature: hand-drawn brass underline that draws itself */
.underlined { position: relative; display: inline-block; }
.underlined svg {
  position: absolute;
  left: -2%;
  bottom: -0.02em;
  width: 104%;
  height: 0.2em;
  overflow: visible;
  pointer-events: none;
}
.underlined svg path {
  fill: none;
  stroke: var(--brass);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 600);
  stroke-dashoffset: var(--len, 600);
  transition: stroke-dashoffset 0.9s var(--ease);
}
.underlined.drawn svg path { stroke-dashoffset: 0; }

/* manifesto — one belief, stated large */
.manifesto {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3.1vw, 2.1rem);
  line-height: 1.38;
  letter-spacing: -0.015em;
  color: var(--ink);
  max-width: 24ch;
  font-weight: 400;
}
.manifesto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}
.manifesto-aside { max-width: 46ch; color: var(--ink-soft); }
.manifesto-aside p + p { margin-top: 1rem; }

/* leadership record — a timeline, not badges */
.timeline { border-top: 1px solid var(--ink); }
.timeline-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 1.5rem;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.timeline-when {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass);
}
.timeline-what { font-size: 1.1rem; font-weight: 600; color: var(--ink); }
.timeline-why { color: var(--ink-soft); font-size: 0.92rem; }

/* contact sheet — the speech sequence */
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}
.sheet-cell { position: relative; }
/* Square cells, like a real proof sheet. The source frames are a mix of
   portrait and landscape, so a square crops both moderately instead of
   destroying one of them — object-position is tuned per image. */
.sheet-cell .frame { aspect-ratio: 1 / 1; }
/* a held slot for speaking I have photography of but have not added yet */
.sheet-pending {
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px dashed var(--rule);
  background-image: repeating-linear-gradient(
    45deg, transparent, transparent 9px,
    var(--rule-soft) 9px, var(--rule-soft) 10px);
}
.sheet-pending span {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--surface-alt);
  padding: 0.3rem 0.6rem;
}
.sheet-cell figcaption {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin-top: 0.55rem;
}
.sheet-cell .idx { color: var(--brass); }

/* four doors — each styled as its destination */
.doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.door {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  padding: 1.5rem;
  text-decoration: none;
  border: 1px solid var(--rule);
  background: var(--paper);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.3s var(--ease);
}
.door:hover { transform: translateY(-4px); border-color: var(--ink); }
.door-img {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.door-img img { width: 100%; height: 100%; object-fit: cover; }
.door::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(12,11,10,0.92) 22%, rgba(12,11,10,0.45) 60%, rgba(12,11,10,0.2));
}
.door > *:not(.door-img) { position: relative; z-index: 2; }
.door-code {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}
.door-title {
  margin-top: auto;
  color: #fff;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.door-desc { color: rgba(255,255,255,0.75); font-size: 0.85rem; margin-top: 0.6rem; max-width: 30ch; }
.door-go {
  margin-top: 1rem;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  display: inline-flex;
  gap: 0.5rem;
  transition: gap 0.25s var(--ease);
}
.door:hover .door-go { gap: 0.9rem; }

/* each door speaks its destination's language */
.door-contact .door-title { font-family: 'Anton', Impact, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: 0.01em; }
.door-build   .door-title { font-family: var(--mono); font-size: clamp(1.2rem, 2.4vw, 1.6rem); font-weight: 600; }
.door-study   .door-title { font-family: 'Newsreader', Georgia, serif; font-style: italic; font-weight: 500; }

/* The programming door carries no photograph — the research is explicit that a
   picture of a person proves nothing about code. It gets a drawn search trace. */
.door-build { background-color: #12171A; border-color: rgba(29,106,86,0.4); }
.door-build::after {
  background: linear-gradient(to top, rgba(10,16,18,0.94) 26%, rgba(10,16,18,0.45) 62%, rgba(10,16,18,0.12));
}
.door-art { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; }
.door-art .d-soft  { fill: none; stroke: #7FD9BF; stroke-opacity: 0.18; stroke-width: 1; }
.door-art .d-block { fill: #7FD9BF; fill-opacity: 0.13; }
.door-art .d-path  { fill: none; stroke: #7FD9BF; stroke-opacity: 0.85; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.door-art .d-node  { fill: #7FD9BF; }
.door-build .door-code { color: rgba(255,255,255,0.55); }
.door-build .door-title { color: #7FD9BF; }
.door-build .door-title::after { content: '_'; animation: blink 1.1s steps(2) infinite; }
.door-build:hover { border-color: #7FD9BF; }


/* ============================================================
   15. PAGE 02 / CONTACT — matchday programme
   ============================================================ */

body.contact h1, body.contact h2 {
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 0.005em;
}
body.contact .sec-head h2 { font-size: clamp(2rem, 5vw, 3.4rem); }

/* newsprint grain, used lightly */
body.contact::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.28'/%3E%3C/svg%3E");
}
body.contact #nav, body.contact main, body.contact footer { position: relative; z-index: 2; }

.kickoff {
  position: relative;
  padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 3.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.kickoff-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
}
.shirt-no {
  font-family: var(--display);
  font-size: clamp(4.5rem, 12vw, 9rem);
  line-height: 0.88;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.shirt-no span { color: var(--accent); }
.kickoff h1 {
  font-size: clamp(2.6rem, 8vw, 5.2rem);
  line-height: 0.9;
  margin-top: 0.5rem;
}
.kickoff-sub {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1.25rem;
  line-height: 2;
}
.kickoff-sub b { color: var(--ink); font-weight: 600; }
.kickoff-flourish {
  font-family: var(--serif);
  font-style: italic;
  text-transform: none;
  font-size: 1.15rem;
  color: var(--accent);
  letter-spacing: 0;
  display: block;
  margin-top: 1rem;
}

/* match log — fixtures as rows */
.matchlog { border-top: 2px solid var(--ink); }
.match-row {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr) auto;
  gap: 1.25rem;
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
  transition: background 0.25s var(--ease), padding-left 0.25s var(--ease);
}
summary.match-row { cursor: pointer; list-style: none; }
summary.match-row::-webkit-details-marker { display: none; }
.match-row.has-photos:hover { background: var(--accent-soft); padding-left: 0.6rem; }
details.match[open] > summary.match-row { background: var(--accent-soft); padding-left: 0.6rem; }
details.match[open] .match-state.live::after { content: ' — open'; }
.match-rd {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.match-op {
  font-family: var(--display);
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  text-transform: uppercase;
  color: var(--ink);
  line-height: 1.1;
}
.match-op small {
  display: block;
  font-family: var(--sans);
  font-size: 0.75rem;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  font-weight: 400;
  margin-top: 0.2rem;
}
.match-state {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  white-space: nowrap;
}
.match-state.live { color: var(--ink); background: var(--volt, #D8F237); padding: 0.25rem 0.5rem; }
.match-panel { padding: 0 0 2rem; border-bottom: 1px solid var(--rule); }

/* training diary */
.diary-block { padding: clamp(2rem, 4vw, 3rem) 0; border-bottom: 1px solid var(--rule); }
.diary-block:last-child { border-bottom: 0; }
.diary-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.5rem;
}
.diary-head h3 {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 2rem);
  text-transform: uppercase;
  font-weight: 400;
  color: var(--ink);
}


/* ============================================================
   16. PAGE 03 / BUILD — workbench on plotting paper
   ============================================================ */

body.build {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
body.build .band-alt {
  background-color: var(--surface-alt);
}
body.build h1, body.build h2 { letter-spacing: -0.02em; font-weight: 700; }

.bench {
  padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 3.5rem));
  padding-bottom: clamp(2.5rem, 5vw, 4rem);
}
.prompt {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--accent);
  letter-spacing: 0.02em;
  margin-bottom: 1.25rem;
}
.prompt .caret {
  display: inline-block;
  width: 8px;
  height: 1.05em;
  background: var(--accent);
  vertical-align: -0.15em;
  margin-left: 2px;
  animation: blink 1.1s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.bench h1 { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.02; }

/* algorithm trail — background signature */
.trail { width: 100%; height: 74px; overflow: visible; margin: 2.5rem 0; }
.trail .path-explored { fill: none; stroke: var(--accent); stroke-opacity: 0.28; stroke-width: 1.5; stroke-dasharray: 3 5; }
.trail .path-found {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: var(--len, 1200);
  stroke-dashoffset: var(--len, 1200);
  transition: stroke-dashoffset 1.6s var(--ease);
}
.trail.drawn .path-found { stroke-dashoffset: 0; }
.trail .node { fill: var(--paper); stroke: var(--accent); stroke-width: 1.5; }
.trail .node.goal { fill: var(--accent); }

/* Project case studies.
   Each project sets its own --case-accent and carries a drawn glyph, so six
   write-ups don't read as six identical rows. */
.case {
  --case-accent: var(--accent);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) 200px;
  gap: clamp(1rem, 3vw, 2.5rem);
}
.case:last-child { border-bottom: 0; }
.case-no {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--case-accent);
  letter-spacing: 0.08em;
  border-top: 2px solid var(--case-accent);
  padding-top: 0.65rem;
}
.case-glyph {
  align-self: start;
  color: var(--case-accent);
  padding-top: 0.4rem;
}
.case-glyph svg { width: 100%; height: auto; overflow: visible; }
.case-glyph .ln { fill: none; stroke: currentColor; stroke-width: 1.5; }
.case-glyph .ln-soft { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.35; }
.case-glyph .ln.ln-thick { stroke-width: 2.5; }
.case-glyph .fill { fill: currentColor; }
.case-glyph .fill-soft { fill: currentColor; opacity: 0.16; }
.case-glyph figcaption {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.6rem;
}
.case h3 { color: var(--ink); }
.case-stack { color: var(--case-accent); opacity: 0.85; }
.case h3 { font-size: clamp(1.25rem, 2.6vw, 1.7rem); letter-spacing: -0.015em; }
.case-stack {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.case-qa { display: grid; gap: 0.85rem; margin-top: 1.1rem; max-width: 68ch; }
.case-qa > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}
.case-qa dt, .case-qa .k {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--case-accent);
}
.case-qa .v { color: var(--ink-2); font-size: 0.94rem; }
.case-links { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-top: 1.25rem; }
.case-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--case-accent);
  padding-bottom: 2px;
  transition: color 0.2s var(--ease);
}
.case-link:hover { color: var(--case-accent); }

/* a live demo is worth more than a link — box it so it reads as a button */
.case-link.live {
  border: 1px solid var(--case-accent);
  border-radius: 2px;
  background: var(--surface-alt);
  color: var(--case-accent);
  padding: 0.45rem 0.75rem;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.case-link.live::before {
  content: '';
  width: 6px; height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.case-link.live:hover { background: var(--case-accent); color: var(--paper); }

/* live demos — larger than a case study, one panel each */
.demos { display: grid; gap: clamp(2rem, 4vw, 3rem); }
.demo {
  --case-accent: var(--accent);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
  border: 1px solid var(--rule);
  border-top: 2px solid var(--case-accent);
  background: var(--paper);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}
.demo:nth-child(even) .demo-panel { order: 2; }
.demo-panel {
  color: var(--case-accent);
  background: var(--surface-alt);
  padding: clamp(1rem, 3vw, 2rem);
}
.demo-panel svg { width: 100%; height: auto; overflow: visible; }
.demo-panel .ln { fill: none; stroke: currentColor; stroke-width: 1.5; }
.demo-panel .ln-soft { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.35; }
.demo-panel .fill { fill: currentColor; }
.demo-panel .fill-soft { fill: currentColor; opacity: 0.14; }
.glyph-t {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  fill: var(--ink-soft);
}
.demo-body h3 { font-size: clamp(1.3rem, 2.8vw, 1.8rem); letter-spacing: -0.015em; }
.demo-lead { margin-top: 0.85rem; color: var(--ink-2); }
.demo-status {
  display: inline-block;
  margin-top: 1.25rem;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--case-accent);
  border: 1px solid var(--case-accent);
  padding: 0.25rem 0.6rem;
}

/* toolbox — replaces percentage bars */
.toolbox { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 2rem; }
.tool-group h4 {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.tool-group li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  color: var(--ink);
}
.tool-group li span {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--ink-soft);
  text-align: right;
}


/* ============================================================
   17. PAGE 04 / STUDY — annotated archive
   ============================================================ */

body.study {
  background-color: var(--paper);
  background-image: radial-gradient(rgba(122,43,43,0.035) 1px, transparent 1px);
  background-size: 4px 4px;
}
body.study h1, body.study h2 { font-weight: 500; letter-spacing: -0.015em; }
body.study h2 em, body.study h1 em { font-style: italic; color: var(--accent); }

.archive-head {
  padding-top: calc(var(--nav-h) + clamp(2rem, 5vw, 3.5rem));
  padding-bottom: clamp(2rem, 4vw, 3rem);
}
.archive-head h1 {
  font-family: var(--display);
  font-size: clamp(2.4rem, 6.5vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
}
.archive-meta {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 1rem;
}

/* index with dotted leaders */
.index-list { max-width: 640px; border-top: 1px solid var(--rule); }
.index-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--rule-soft);
  text-decoration: none;
  color: var(--ink);
}
.index-row:hover .index-title { color: var(--accent); }
.index-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--brass);
  width: 2.5rem;
  flex: none;
  letter-spacing: 0.06em;
}
.index-title { font-family: var(--display); font-size: 1.05rem; transition: color 0.2s var(--ease); }
.index-dots {
  flex: 1;
  border-bottom: 1px dotted var(--rule);
  transform: translateY(-0.25em);
}
.index-pg { font-family: var(--mono); font-size: 0.72rem; color: var(--ink-soft); }

/* transcript */
.transcript { border-top: 1.5px solid var(--ink); }
.transcript-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8rem 4.5rem;
  gap: 1rem;
  align-items: center;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
}
.transcript-sub { font-family: var(--display); font-size: clamp(1.1rem, 2.4vw, 1.5rem); color: var(--ink); }
.transcript-sub small {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--ink-soft);
  margin-left: 0.4rem;
}
.transcript-board {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
/* longer institution names need the columns to breathe */
.transcript.open-cols .transcript-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 1.25rem;
}

/* a result that does not exist yet — stated, not stamped */
.transcript-pending {
  justify-self: end;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px dashed var(--rule);
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
}

/* signature: a single restrained ink stamp */
.stamp {
  justify-self: end;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: 3px;
  padding: 0.15rem 0.55rem;
  line-height: 1.1;
  transform: rotate(-6deg);
  opacity: 0.92;
  transition: transform 0.42s var(--ease), opacity 0.28s ease-out;
}
/* JS arms the stamp before observing it, so no-JS shows the grade outright */
.js .stamp.armed { transform: rotate(-6deg) scale(1.5); opacity: 0; }
.js .stamp.armed.pressed { transform: rotate(-6deg) scale(1); opacity: 0.92; }

/* a foldaway block — same behaviour as the match log, in the archive's voice */
.fold { border-top: 1.5px solid var(--ink); }
.fold-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s var(--ease);
}
.fold-head::-webkit-details-marker { display: none; }
.fold-title {
  font-family: var(--display);
  font-size: clamp(1.3rem, 2.6vw, 1.7rem);
  font-weight: 500;
  color: var(--ink);
}
.fold-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
/* the caret turns when the block opens */
.fold-meta::after {
  content: '';
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s var(--ease);
}
.fold[open] .fold-meta::after { transform: translateY(1px) rotate(-135deg); }
.fold-head:hover .fold-title { color: var(--accent); }
.fold > .transcript { padding-bottom: 1.5rem; }

/* margin notes — teacher feedback as marginalia */
.notes { display: grid; gap: 0; border-top: 1px solid var(--rule); }
.note {
  display: grid;
  grid-template-columns: 12rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.note-by { font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
.note-sub {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.3rem;
}
.note-text {
  font-family: var(--display);
  font-size: 1.02rem;
  line-height: 1.62;
  color: var(--ink-2);
  max-width: 68ch;
  border-left: 2px solid var(--brass-soft);
  padding-left: clamp(1rem, 2vw, 1.5rem);
}
.note-text::first-letter { color: var(--accent); }

/* ============================================================
   18. MOTION
   ============================================================ */
/* Reveals are hidden only when scripting is available to un-hide them.
   Without JS the page renders complete rather than blank. */
.reveal { transition: opacity 0.42s var(--ease), transform 0.42s var(--ease); }
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.visible { opacity: 1; transform: none; }
.reveal-delay-1 { transition-delay: 0.09s; }
.reveal-delay-2 { transition-delay: 0.18s; }
.reveal-delay-3 { transition-delay: 0.27s; }

.enter { opacity: 0; transform: translateY(22px); animation: enter 0.56s var(--ease) forwards; }
.enter-1 { animation-delay: 0.06s; }
.enter-2 { animation-delay: 0.14s; }
.enter-3 { animation-delay: 0.22s; }
@keyframes enter { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal, .js .reveal { opacity: 1; transform: none; }
  .enter { opacity: 1; transform: none; }
  .underlined svg path { stroke-dashoffset: 0; }
  .trail .path-found { stroke-dashoffset: 0; }
  .stamp, .js .stamp.armed { opacity: 0.92; transform: rotate(-6deg) scale(1); }
  .prompt .caret { animation: none; }
}


/* ============================================================
   19. RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .hamburger { display: block; }

  .duo, .duo.wide-left, .duo.wide-right,
  .stage-grid, .kickoff-grid, .manifesto-grid { grid-template-columns: 1fr; }
  .stage-grid { gap: 2rem; }
  .doors { grid-template-columns: 1fr; }
  .contact-sheet { grid-template-columns: repeat(2, 1fr); }
  .timeline-row { grid-template-columns: 1fr; gap: 0.35rem; }
  .note { grid-template-columns: 1fr; gap: 0.75rem; }
  .note-text { padding-left: 1rem; }
  .case { grid-template-columns: 1fr; gap: 0.75rem; }
  .case-qa > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .transcript-row { grid-template-columns: minmax(0, 1fr) auto; }
  .transcript-board { display: none; }
  /* the college is the point of this row, so it stays and takes its own line */
  .transcript.open-cols .transcript-row { grid-template-columns: minmax(0, 1fr) auto; }
  .transcript.open-cols .transcript-board { display: block; grid-column: 1; }
  .match-row { grid-template-columns: 4.5rem minmax(0, 1fr); }
  .match-state { grid-column: 2; }
  .figures { grid-template-columns: repeat(2, 1fr); }
  .figure { border-left: 0; padding-left: 0; padding-right: 1rem; }
  .case { grid-template-columns: 1fr !important; }
  .case-glyph { max-width: 180px; }
  .demo { grid-template-columns: 1fr; }
  .demo:nth-child(even) .demo-panel { order: 0; }
  .media-row-2 { grid-template-columns: 1fr; }
  .manifesto { max-width: none; }
}

@media (max-width: 560px) {
  .thumb-strip.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .carousel-btn { width: 34px; height: 34px; }
  .footer-meta { flex-direction: column; gap: 0.4rem; }
  .tilt-l, .tilt-r { transform: none; }
}

@media print {
  #nav, .nav-mobile, .carousel-btn, .carousel-dots, .lightbox { display: none !important; }
  body { background: #fff; }
  .reveal { opacity: 1; transform: none; }
}


/* ==========================================================================
   19. AI CHATBOT DEMO  (pages/projects/ai-chatbot.php)
   Built from the tokens above; body.build supplies --accent, --paper,
   --surface-alt and --grid. Only this page uses these classes.
   ========================================================================== */

/* Scoped to the chat page only. This was `html, body { height: 100% }`
   inside the demo page; moving it into the shared stylesheet would have
   applied it to every page on the site. .chat-shell uses 100dvh, so the
   body rule alone is enough. */
body.chat-page { height: 100%; overflow: hidden; }

.chat-shell {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.chat-inner {
  width: 100%;
  max-width: 820px;
  margin-inline: auto;
  padding-inline: var(--gutter, 1.25rem);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- top bar ---------- */
.chat-top {
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
}
.chat-top .chat-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 56px;
  padding-block: 0.6rem;
}
.chat-top .prompt {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-back {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 1.5px solid var(--brass);
  padding-bottom: 2px;
  flex: 0 0 auto;
  transition: color 0.2s var(--ease, ease);
}
.chat-back:hover { color: var(--accent); }

.ghost-btn {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.42rem 0.7rem;
  cursor: pointer;
  flex: 0 0 auto;
  transition: color 0.2s var(--ease, ease), border-color 0.2s var(--ease, ease), background 0.2s var(--ease, ease);
}
.ghost-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.ghost-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- scrolling transcript ---------- */
.chat-main {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}
.chat-main::-webkit-scrollbar { width: 10px; }
.chat-main::-webkit-scrollbar-thumb {
  background: var(--rule);
  border: 3px solid var(--paper);
  border-radius: 10px;
}

.chat-intro { padding-block: clamp(2rem, 6vh, 3.5rem) 0.5rem; }
.chat-intro h1 {
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.chat-intro .lead {
  margin-top: 1rem;
  max-width: 56ch;
  color: var(--ink-2);
  font-size: 1rem;
}

.chat-meta {
  display: grid;
  gap: 0.55rem;
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule-soft);
  max-width: 60ch;
}
.chat-meta > div {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 1rem;
  align-items: baseline;
}
.chat-meta .k {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--accent);
}
.chat-meta .v { color: var(--ink-soft); font-size: 0.88rem; }

/* starter questions */
.starters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.6rem;
}
.starter {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s var(--ease, ease), border-color 0.2s var(--ease, ease), background 0.2s var(--ease, ease);
}
.starter:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.starters.gone { display: none; }

/* ---------- messages ---------- */
.chat-log { padding-block: 1.5rem 2.5rem; }
.chat-log:empty { display: none; }

.msg {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding-block: 1.25rem;
  border-top: 1px solid var(--rule-soft);
  animation: msg-in 0.32s var(--ease, ease) both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.msg .label {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-top: 0.28em;
}
.msg.user  .label { color: var(--brass); }
.msg.bot   .label { color: var(--accent); }
.msg.error .label { color: #9B2C2C; }

.msg .body {
  min-width: 0;
  color: var(--ink-2);
  font-size: 0.98rem;
  line-height: 1.65;
}
.msg .body > * + * { margin-top: 0.85em; }
.msg .body p { margin: 0; }
/* style.css resets ul to list-style:none — restore markers in replies */
.msg .body ul, .msg .body ol { margin: 0; padding-left: 1.3rem; }
.msg .body ul { list-style: disc; }
.msg .body ol { list-style: decimal; }
.msg .body li { padding-left: 0.2rem; }
.msg .body li::marker { color: var(--accent); }
.msg .body li + li { margin-top: 0.35em; }
.msg .body a { color: var(--accent); text-underline-offset: 3px; }
.msg .body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  padding: 0.12em 0.36em;
  border-radius: 2px;
}
.msg .body pre {
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.55;
  background: var(--surface-alt);
  border: 1px solid var(--rule-soft);
  border-left: 2px solid var(--accent);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  white-space: pre;
}
.msg .body pre code { background: none; padding: 0; font-size: inherit; }

/* the user's turn reads as a quoted card */
.msg.user .body {
  border-left: 2px solid var(--brass);
  background: var(--brass-soft);
  padding: 0.7rem 0.95rem;
  color: var(--ink);
  border-radius: 0 2px 2px 0;
}
.msg.error .body {
  border-left: 2px solid #9B2C2C;
  background: rgba(155, 44, 44, 0.06);
  padding: 0.7rem 0.95rem;
  border-radius: 0 2px 2px 0;
}
.msg.error .retry {
  display: inline-block;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--brass);
  padding: 0 0 2px;
  cursor: pointer;
}
.msg.error .retry:hover { color: var(--accent); }

/* thinking indicator — three plotting-grid squares + a stage label */
.thinking-wrap { display: flex; align-items: center; gap: 0.8rem; min-height: 1.6em; }
.thinking { display: inline-flex; gap: 5px; }
.thinking-stage {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  animation: stage-in 0.34s var(--ease, ease) both;
}
@keyframes stage-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}
.thinking i {
  width: 6px;
  height: 6px;
  background: var(--accent);
  opacity: 0.25;
  animation: think 1.05s var(--ease, ease) infinite;
}
.thinking i:nth-child(2) { animation-delay: 0.16s; }
.thinking i:nth-child(3) { animation-delay: 0.32s; }
@keyframes think {
  0%, 60%, 100% { opacity: 0.22; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

/* ---------- composer ---------- */
.chat-dock {
  border-top: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.1) blur(8px);
  padding-block: 0.9rem 0.7rem;
  padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 0.6rem;
  border: 1px solid var(--rule);
  background: var(--paper);
  border-radius: 3px;
  padding: 0.5rem 0.5rem 0.5rem 0.85rem;
  transition: border-color 0.2s var(--ease, ease), box-shadow 0.2s var(--ease, ease);
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer textarea {
  font: inherit;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  padding: 0.45rem 0;
  max-height: 9.5rem;
  overflow-y: auto;
}
.composer textarea::placeholder { color: var(--ink-soft); opacity: 0.75; }

.send-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--paper);
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  padding: 0.62rem 0.85rem;
  cursor: pointer;
  transition: opacity 0.2s var(--ease, ease), transform 0.2s var(--ease, ease);
}
.send-btn:hover:not(:disabled) { transform: translateY(-1px); }
.send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
.send-btn svg { width: 13px; height: 13px; }

.dock-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 0.55rem;
}
.dock-note {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  margin: 0;
}
.dock-note .sep { opacity: 0.4; margin-inline: 0.45rem; }
.counter { font-family: var(--mono); font-size: 0.62rem; color: var(--ink-soft); opacity: 0; transition: opacity 0.2s; }
.counter.show { opacity: 1; }
.counter.over { color: #9B2C2C; opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  .msg { grid-template-columns: 1fr; gap: 0.45rem; }
  .msg .label { padding-top: 0; }
  .chat-top .prompt { display: none; }
  .chat-top .chat-inner { justify-content: space-between; }
  .starters { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  .msg { animation: none; }
  .thinking i { animation: none; opacity: 0.45; }
  .thinking-stage { animation: none; }
}
