/* ==========================================================================
   Project Inside Out — design system
   --------------------------------------------------------------------------
   1.  Tokens
   2.  Reset + base
   3.  Typography
   4.  Layout primitives
   5.  Plates + scrims (the background imagery layer)
   6.  Glass
   7.  Header + navigation
   8.  Hero
   9.  Components
   10. Footer
   11. Motion
   12. Responsive
   ========================================================================== */

/* 1. Tokens ---------------------------------------------------------------- */
/*
   Three-layer token architecture:
     primitive (raw values) → semantic (purpose) → component (per-part).
   Components must reference semantic tokens, never raw hex.
*/

:root {
  /* ---- Layer 1: primitive ---------------------------------------------- */

  /* Ink ramp */
  --ink-1000: #020408;
  --ink-900: #05070c;
  --ink-850: #070a11;
  --ink-800: #0a0e16;
  --ink-700: #10151f;
  --ink-600: #182030;

  /* Gold ramp — the authorship colour */
  --gold-200: #f7e7c2;
  --gold-300: #f0d79a;
  --gold-400: #e0bd6f;
  --gold-500: #c9a227;
  --gold-600: #a37f1c;

  /* Blue ramp — the blueprint colour */
  --blue-300: #b9d4f2;
  --blue-400: #7fb0e8;
  --blue-500: #4a7fb8;

  /* Neutral ramp */
  --white: #ffffff;
  --paper-100: #f5f2ea;
  --paper-200: #cfd5de;
  --paper-300: #99a3b2;
  --paper-400: #6d7688;
  --green-400: #7fd6a8;

  /* Alpha primitives (surfaces + separators read in dark and light plates) */
  --a-white-02: rgb(255 255 255 / 2%);
  --a-white-03: rgb(255 255 255 / 3%);
  --a-white-06: rgb(255 255 255 / 6%);
  --a-white-09: rgb(255 255 255 / 9%);
  --a-white-12: rgb(255 255 255 / 12%);
  --a-white-20: rgb(255 255 255 / 20%);
  --a-gold-08: rgb(201 162 39 / 8%);
  --a-gold-30: rgb(201 162 39 / 30%);
  --a-gold-55: rgb(201 162 39 / 55%);

  /* Type families */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype",
    Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, "Liberation Mono", monospace;

  /* Fluid type scale */
  --step--2: clamp(0.7rem, 0.68rem + 0.1vw, 0.76rem);
  --step--1: clamp(0.82rem, 0.79rem + 0.15vw, 0.9rem);
  --step-0: clamp(1rem, 0.96rem + 0.2vw, 1.09rem);
  --step-1: clamp(1.2rem, 1.12rem + 0.4vw, 1.45rem);
  --step-2: clamp(1.45rem, 1.3rem + 0.75vw, 1.95rem);
  --step-3: clamp(1.8rem, 1.5rem + 1.4vw, 2.7rem);
  --step-4: clamp(2.2rem, 1.7rem + 2.4vw, 3.8rem);
  --step-5: clamp(2.5rem, 1.8rem + 3.2vw, 4.7rem);
  --step-6: clamp(2.9rem, 1.9rem + 4.4vw, 6rem);

  /* Spacing — 4/8 rhythm */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  /* Icon sizes */
  --icon-sm: 16px;
  --icon-md: 24px;
  --icon-lg: 32px;
  --icon-stroke: 1.5;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-mid: 300ms;
  --dur-slow: 900ms;

  /* ---- Layer 2: semantic ----------------------------------------------- */

  --surface-base: var(--ink-900);
  --surface-raised: var(--ink-850);
  --surface-sunken: var(--ink-1000);
  --surface-glass: linear-gradient(
    155deg,
    rgb(255 255 255 / 8.5%) 0%,
    rgb(255 255 255 / 3%) 42%,
    rgb(255 255 255 / 5.5%) 100%
  );
  --surface-glass-strong: linear-gradient(
    155deg,
    rgb(255 255 255 / 13%) 0%,
    rgb(255 255 255 / 5%) 45%,
    rgb(240 215 154 / 7%) 100%
  );
  --surface-light: linear-gradient(160deg, #fbf9f5, #ebe6dc);

  --text-primary: var(--paper-100);   /* >= 4.5:1 on --surface-base */
  --text-secondary: var(--paper-200); /* >= 4.5:1 on --surface-base */
  --text-tertiary: var(--paper-300);  /* >= 3:1  on --surface-base */
  --text-quiet: var(--paper-400);
  --text-on-accent: var(--ink-1000);
  --text-on-light: var(--ink-900);
  --text-secondary-on-light: #5a6270;

  --accent: var(--gold-500);
  --accent-bright: var(--gold-300);
  --accent-deep: var(--gold-600);
  --accent-grad: linear-gradient(120deg, var(--gold-300), var(--gold-500));
  --accent-cool: var(--blue-400);

  --border-subtle: var(--a-white-09);
  --border-default: var(--a-white-12);
  --border-strong: var(--a-white-20);
  --border-accent: var(--a-gold-30);

  --focus-ring: var(--gold-300);

  --scrim-modal: rgb(4 6 11 / 96%); /* > 60% black: preserves legibility */

  --shadow-lift: 0 32px 80px -28px rgb(0 0 0 / 78%);
  --shadow-lift-lg: 0 42px 90px -32px rgb(0 0 0 / 88%);

  --measure: 62ch;
  --max: 1440px;
  --max-narrow: 1120px;
  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --section-y: clamp(5rem, 11vw, 11rem);
  --radius: 4px;
  --radius-lg: 10px;
  --tap-min: 44px; /* minimum interactive target */

  /* ---- Layer 3: component ---------------------------------------------- */

  --glass-bg: var(--surface-glass);
  --glass-bg-strong: var(--surface-glass-strong);
  --glass-hairline: linear-gradient(
    120deg,
    rgb(247 231 194 / 55%),
    rgb(255 255 255 / 12%) 38%,
    rgb(255 255 255 / 6%) 62%,
    rgb(224 189 111 / 42%)
  );
  --glass-shadow: var(--shadow-lift), 0 2px 0 0 var(--a-white-06) inset;
  --glass-blur: 22px;

  --btn-primary-bg: var(--accent-grad);
  --btn-primary-fg: var(--text-on-accent);
  --btn-ghost-border: var(--border-strong);
  --btn-ghost-fg: var(--text-primary);

  --nav-fg: var(--text-secondary);
  --nav-fg-active: var(--text-primary);
  --nav-underline: var(--gold-400);

  --card-body-fg: var(--text-tertiary);
  --rule-grad: linear-gradient(
    90deg,
    transparent,
    var(--a-white-12) 18%,
    rgb(224 189 111 / 34%) 50%,
    var(--a-white-12) 82%,
    transparent
  );

  color-scheme: dark;
}

/* 2. Reset + base ---------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.68;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Global grain + a vignette that keeps the page feeling like one frame. */
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
}

body::before {
  background-image: url("../img/tile-grain.svg");
  background-size: 200px 200px;
  opacity: 0.34;
  mix-blend-mode: overlay;
}

body::after {
  background: radial-gradient(
    120% 90% at 50% 45%,
    transparent 42%,
    rgb(2 4 8 / 42%) 100%
  );
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

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

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.75rem 1.25rem;
  font-weight: 600;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

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

/* 3. Typography ------------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5 {
  margin: 0;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

p {
  margin: 0 0 1.15em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

.display {
  font-family: var(--font-display);
  font-size: var(--step-6);
  line-height: 0.94;
  letter-spacing: -0.022em;
}

.h1 {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 0.98;
}

.h2 {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1.02;
}

.h3 {
  font-size: var(--step-2);
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: -0.012em;
  line-height: 1.22;
}

.h4 {
  font-size: var(--step-1);
  font-weight: 600;
  font-family: var(--font-sans);
  letter-spacing: -0.008em;
  line-height: 1.3;
}

.serif {
  font-family: var(--font-display);
  font-weight: 400;
}

.gold {
  color: var(--accent-bright);
}

.gold-grad {
  background: linear-gradient(
    100deg,
    var(--gold-200) 0%,
    var(--gold-400) 38%,
    var(--gold-200) 62%,
    var(--accent) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.56;
  color: var(--text-secondary);
  max-width: var(--measure);
}

.muted {
  color: var(--text-tertiary);
}

.small {
  font-size: var(--step--1);
  line-height: 1.6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-400);
  margin: 0 0 1.4rem;
}

.eyebrow::before {
  content: "";
  width: clamp(1.5rem, 4vw, 3rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.eyebrow--plain::before {
  display: none;
}

.eyebrow--num::before {
  content: attr(data-num);
  width: auto;
  height: auto;
  background: none;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* An authored line: the canonical statements from the source material. */
.canon {
  font-family: var(--font-display);
  font-size: var(--step-3);
  line-height: 1.24;
  letter-spacing: -0.012em;
  color: var(--text-primary);
  border-left: 1px solid var(--accent-deep);
  padding-left: clamp(1.25rem, 3vw, 2.5rem);
  max-width: 30ch;
}

.canon--wide {
  max-width: 46ch;
}

blockquote {
  margin: 0;
}

/* 4. Layout primitives ----------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--narrow {
  max-width: var(--max-narrow);
}

.section {
  position: relative;
  padding-block: var(--section-y);
  isolation: isolate;
}

.section--tight {
  padding-block: clamp(3.5rem, 7vw, 6.5rem);
}

.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.75rem);
}

.cols-2 {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
}

.cols-4 {
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
}

/* Locks a set to exactly three across once there is room, so a six-item
   set reads as 3 + 3 rather than 4 + 2. */
@media (width >= 1040px) {
  .grid--3up {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.split--even {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split--sticky > :first-child {
  position: sticky;
  top: clamp(6rem, 14vh, 9rem);
}

.stack > * + * {
  margin-top: var(--stack-gap, 1.5rem);
}

.rule {
  height: 1px;
  border: 0;
  margin: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(255 255 255 / 14%) 18%,
    rgb(224 189 111 / 34%) 50%,
    rgb(255 255 255 / 14%) 82%,
    transparent
  );
}

/* 5. Plates + scrims ------------------------------------------------------- */

/*
   Every background image lives on a .plate. Swap the --plate custom property
   for a photograph and the whole system adapts — see assets/img/ART-DIRECTION.md.
*/
.plate {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background-color: var(--ink-900);
}

.plate::before {
  content: "";
  position: absolute;
  inset: -12% 0 -12%;
  background-image: var(--plate);
  background-size: cover;
  background-position: var(--plate-pos, center);
  transform: translate3d(0, var(--plate-shift, 0), 0);
  will-change: transform;
}

/* Scrim: the contrast contract that keeps every headline readable. */
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      var(--scrim-angle, 96deg),
      rgb(5 7 12 / var(--scrim-a, 92%)) 0%,
      rgb(5 7 12 / var(--scrim-b, 68%)) 46%,
      rgb(5 7 12 / var(--scrim-c, 30%)) 100%
    ),
    linear-gradient(
      180deg,
      rgb(5 7 12 / 62%) 0%,
      transparent 22%,
      transparent 70%,
      rgb(5 7 12 / 88%) 100%
    );
}

.plate--center::after {
  background:
    radial-gradient(
      100% 90% at 50% 50%,
      rgb(5 7 12 / 34%) 0%,
      rgb(5 7 12 / 82%) 78%
    ),
    linear-gradient(
      180deg,
      rgb(5 7 12 / 72%) 0%,
      transparent 26%,
      transparent 66%,
      rgb(5 7 12 / 92%) 100%
    );
}

.plate--quiet::after {
  background:
    linear-gradient(96deg, rgb(5 7 12 / 96%) 0%, rgb(5 7 12 / 86%) 60%, rgb(5 7 12 / 74%) 100%),
    linear-gradient(180deg, rgb(5 7 12 / 80%) 0%, transparent 30%, rgb(5 7 12 / 92%) 100%);
}

/*
   Plate library. The url() must live here rather than in an inline style:
   a url() inside a custom property resolves against the stylesheet that
   substitutes it, not against the document.
   Swapping in photography means changing only these eight declarations.
*/
.plate-civic    { --plate: url("../img/plate-civic-dusk.svg"); }
.plate-campus   { --plate: url("../img/plate-campus-dawn.svg"); }
.plate-stai     { --plate: url("../img/plate-transition.svg"); }
.plate-pressure { --plate: url("../img/plate-pressure.svg"); }
.plate-campfire { --plate: url("../img/plate-campfire.svg"); }
.plate-brick    { --plate: url("../img/plate-brick.svg"); }
.plate-network  { --plate: url("../img/plate-network.svg"); }
.plate-philly   { --plate: url("../img/plate-philadelphia.svg"); }

/*
   Photographic plates. Student-life photography, graded down so it belongs
   inside the dark cinematic system rather than fighting it: desaturated,
   slightly cooled, and always under a heavier scrim than the generated art.
*/
.plate-photo-students  { --plate: url("../img/photo/students-walking-back.webp"); }
.plate-photo-colonnade { --plate: url("../img/photo/campus-colonnade.webp"); }
.plate-photo-together  { --plate: url("../img/photo/walking-together.webp"); }
.plate-photo-autumn    { --plate: url("../img/photo/autumn-path.webp"); }
.plate-photo-entrance  { --plate: url("../img/photo/campus-entrance.webp"); }
.plate-photo-crossing  { --plate: url("../img/photo/crossing-campus.webp"); }

.plate--photo::before {
  filter: saturate(0.5) contrast(1.1) brightness(0.6);
}

.plate--photo::after {
  background:
    linear-gradient(
      var(--scrim-angle, 96deg),
      rgb(5 7 12 / var(--scrim-a, 94%)) 0%,
      rgb(5 7 12 / var(--scrim-b, 76%)) 46%,
      rgb(5 7 12 / var(--scrim-c, 46%)) 100%
    ),
    linear-gradient(
      180deg,
      rgb(5 7 12 / 72%) 0%,
      rgb(5 7 12 / 22%) 26%,
      rgb(5 7 12 / 40%) 68%,
      rgb(5 7 12 / 94%) 100%
    );
}

/* Photographic thumbnails inside discovery cards. */
.pillar--photo .pillar__plate {
  filter: saturate(0.42) contrast(1.1) brightness(0.48);
}

/* A photograph behind a card needs a heavier scrim than generated art does. */
.pillar--photo .pillar__scrim {
  background: linear-gradient(
    185deg,
    rgb(5 7 12 / 52%) 0%,
    rgb(5 7 12 / 78%) 48%,
    rgb(5 7 12 / 96%) 100%
  );
}

/* An inline photograph used as evidence or atmosphere inside a section. */
.photo {
  position: relative;
  margin: 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lift);
}

.photo img {
  width: 100%;
  aspect-ratio: var(--photo-ratio, 16 / 10);
  object-fit: cover;
  object-position: var(--photo-pos, center);
  filter: saturate(0.5) contrast(1.12) brightness(0.58);
}

.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgb(5 7 12 / 34%) 0%,
    rgb(5 7 12 / 14%) 38%,
    rgb(5 7 12 / 86%) 100%
  );
}

.photo figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  padding: 2.25rem 1.25rem 1.1rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.photo--tall img {
  --photo-ratio: 4 / 5;
}

/*
   Exhibit: an authored slide from the founder's brief, shown as an artifact.
   Slides are pre-graded and carry baked-in text, so no filter and no scrim —
   only the frame, a hairline, and the caption.
*/
.photo--exhibit img {
  --photo-ratio: 1376 / 728;
  filter: none;
}

.photo--exhibit::after {
  background: none;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
  border-radius: inherit;
}

.photo--exhibit figcaption {
  position: static;
  padding: 0.75rem 0.25rem 0;
  background: none;
  color: var(--text-quiet);
}

.photo--wide img {
  --photo-ratio: 21 / 9;
}

/* Optional blueprint hairline overlay drawn over a plate. */
.plate--blueprint {
  background-image: url("../img/tile-blueprint.svg");
  background-size: 140px 140px;
}

.section--edge::before,
.section--edge::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgb(224 189 111 / 26%),
    transparent
  );
  z-index: 1;
}

.section--edge::before {
  top: 0;
}

.section--edge::after {
  bottom: 0;
}

/* 6. Glass ----------------------------------------------------------------- */

.glass {
  position: relative;
  background: var(--glass-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  padding: clamp(1.5rem, 3vw, 2.5rem);
  overflow: hidden;
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .glass {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(135%);
    backdrop-filter: blur(var(--glass-blur)) saturate(135%);
  }
}

/* The luminous hairline that makes the panel read as glass, not as a box. */
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--glass-hairline);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* Specular sheen across the top third. */
.glass::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 45%;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    var(--border-subtle),
    transparent
  );
  pointer-events: none;
}

.glass--strong {
  background: var(--glass-bg-strong);
}

.glass--flat::after {
  display: none;
}

/* The solid white statement panel from the key art. */
.pane-light {
  background: linear-gradient(160deg, #fbf9f5, #ebe6dc);
  color: var(--ink-900);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3.4vw, 3rem);
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / 80%);
}

.pane-light .eyebrow {
  color: var(--accent-deep);
}

.pane-light .muted {
  color: #5a6270;
}

/* 7. Header + navigation --------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  transition: background 0.4s var(--ease), border-color 0.4s var(--ease),
    transform 0.45s var(--ease);
  border-bottom: 1px solid transparent;
}

.site-header.is-stuck {
  background: rgb(5 7 12 / 72%);
  border-bottom-color: var(--border-subtle);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.site-header.is-hidden {
  transform: translateY(-102%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: clamp(4.25rem, 7vw, 5.5rem);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand__mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name b {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.brand__name span {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(0.7rem, 1.15vw, 1.35rem);
}

/* :not(.btn) keeps the CTA on its own colour, padding and target size. */
.nav a:not(.btn) {
  position: relative;
  font-size: clamp(0.78rem, 0.7rem + 0.22vw, 0.88rem);
  letter-spacing: 0.005em;
  color: var(--text-secondary);
  padding-block: 0.4rem;
  transition: color 0.25s var(--ease);
  white-space: nowrap;
}

.nav a:not(.btn)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--gold-400);
  transition: right 0.4s var(--ease);
}

.nav a:not(.btn):hover,
.nav a[aria-current="page"] {
  color: var(--text-primary);
}

.nav a:not(.btn):hover::after,
.nav a[aria-current="page"]::after {
  right: 0;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  margin-right: -0.5rem;
}

.nav-toggle span:not(.visually-hidden) {
  display: block;
  position: relative;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: background 0.2s var(--ease);
}

.nav-toggle span:not(.visually-hidden)::before,
.nav-toggle span:not(.visually-hidden)::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 1.5px;
  background: var(--text-primary);
  transition: transform 0.35s var(--ease);
}

.nav-toggle span:not(.visually-hidden)::before {
  top: -7px;
}

.nav-toggle span:not(.visually-hidden)::after {
  top: 7px;
}

.nav-toggle[aria-expanded="true"] span:not(.visually-hidden) {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span:not(.visually-hidden)::before {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:not(.visually-hidden)::after {
  transform: translateY(-7px) rotate(-45deg);
}

/* Scroll progress hairline */
.progress {
  position: fixed;
  inset: 0 auto auto 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent-bright));
  z-index: 101;
}

/* 8. Hero ------------------------------------------------------------------ */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: clamp(620px, 100svh, 1100px);
  padding-block: clamp(9rem, 18vh, 13rem) clamp(3.5rem, 8vh, 6rem);
  isolation: isolate;
  overflow: hidden;
}

.hero--tall {
  min-height: clamp(640px, 108svh, 1180px);
}

.hero__inner {
  width: 100%;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: end;
}

.hero__title {
  margin-bottom: 1.6rem;
}

.hero__title em {
  font-style: normal;
  display: block;
}

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 2.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.hero__meta span::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--accent);
  transform: rotate(45deg);
}

.scroll-cue {
  position: absolute;
  left: var(--gutter);
  bottom: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-quiet);
  z-index: 3;
}

.scroll-cue i {
  display: block;
  width: 44px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), transparent);
  animation: cue 2.6s var(--ease) infinite;
}

@keyframes cue {
  0%, 100% { transform: scaleX(0.4); transform-origin: 0 50%; opacity: 0.5; }
  50% { transform: scaleX(1); transform-origin: 0 50%; opacity: 1; }
}

/* Page hero used on the six pillar pages */
.pagehead {
  position: relative;
  padding-block: clamp(9rem, 20vh, 15rem) clamp(4rem, 9vw, 8rem);
  isolation: isolate;
  overflow: hidden;
}

.pagehead__index {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.24em;
  color: var(--accent);
  text-transform: uppercase;
}

/* 9. Components ------------------------------------------------------------ */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1.7rem;
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: 0.03em;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: transform 0.3s var(--ease), background 0.3s var(--ease),
    color 0.3s var(--ease), border-color 0.3s var(--ease);
}

.btn svg {
  transition: transform 0.35s var(--ease);
}

.btn:hover svg {
  transform: translateX(4px);
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent-bright), var(--accent));
  color: var(--ink-1000);
  font-weight: 600;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -14px rgb(201 162 39 / 70%);
}

.btn--ghost {
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.btn--ghost:hover {
  border-color: var(--gold-400);
  color: var(--gold-200);
  background: var(--a-gold-08);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.25rem;
}

/* Link with an arrow, used inside cards */
.link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-400);
  transition: gap 0.3s var(--ease), color 0.3s var(--ease);
}

.link:hover {
  gap: 0.95rem;
  color: var(--gold-200);
}

/* Cards */
.card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  height: 100%;
  transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
}

a.card:hover,
.card--hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lift-lg),
    0 2px 0 0 var(--border-subtle) inset;
}

.card__num {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.2em;
  color: var(--accent);
}

.card__title {
  font-size: var(--step-2);
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.12;
}

.card__body {
  color: var(--text-tertiary);
  font-size: var(--step--1);
  flex: 1;
}

.card__foot {
  margin-top: auto;
  padding-top: 0.5rem;
}

/* A pillar card carries its own plate thumbnail. */
.pillar {
  position: relative;
  min-height: clamp(310px, 34vw, 420px);
  justify-content: flex-end;
  isolation: isolate;
  border-radius: var(--radius-lg);
  overflow: hidden;
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
}

.pillar__plate {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: var(--plate);
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: transform 0.9s var(--ease-out);
}

.pillar:hover .pillar__plate {
  transform: scale(1.08);
}

.pillar__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    185deg,
    rgb(5 7 12 / 18%) 0%,
    rgb(5 7 12 / 62%) 48%,
    rgb(5 7 12 / 93%) 100%
  );
}

/*
   Homepage hierarchy.
   ------------------------------------------------------------------
   The discovery surface deliberately runs at four weights so a first-time
   visitor reads an order rather than a menu:

     .feature      the governing discipline — the largest moment after the hero
     .pillar--lg   the primary routes into using the work
     .pillar--wide the initiatives, two across
     .mini         the deeper systems, quiet and dense

   Every area still has its own homepage section. Only the weight varies.
*/

.feature {
  text-align: center;
}

.feature__statement {
  font-family: var(--font-display);
  font-size: var(--step-5);
  line-height: 1.06;
  letter-spacing: -0.018em;
  max-width: 20ch;
  margin-inline: auto;
  text-wrap: balance;
}

.feature__lede {
  max-width: 56ch;
  margin: clamp(1.75rem, 3vw, 2.5rem) auto 0;
  color: var(--text-secondary);
  font-size: var(--step-1);
  line-height: 1.55;
}

.feature .flow {
  justify-content: center;
}

.feature .btn-row {
  justify-content: center;
}

.feature__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  margin-top: clamp(3rem, 6vw, 4.5rem);
  text-align: left;
}

/* Primary route — a taller pillar with more room for the promise. */
.pillar--lg {
  min-height: clamp(400px, 46vw, 560px);
}

.pillar--lg .card__title {
  font-size: var(--step-3);
}

.pillar--lg .card__body {
  font-size: var(--step-0);
  color: var(--text-secondary);
  flex: 0;
}

/* Initiative — wide, two across. */
.pillar--wide {
  min-height: clamp(320px, 34vw, 420px);
}

/* Deeper systems — quiet, dense, clearly secondary. */
.mini {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1.25rem, 2.2vw, 1.75rem);
  height: 100%;
  transition: transform 0.5s var(--ease-out), border-color 0.4s var(--ease);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--a-white-02);
}

.mini:hover {
  transform: translateY(-3px);
  border-color: var(--border-accent);
}

.mini__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.mini__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 400;
  line-height: 1.18;
}

.mini__body {
  font-size: var(--step--1);
  color: var(--text-tertiary);
  flex: 1;
}

.mini__more {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
  padding-top: 0.5rem;
}

.mini:hover .mini__more {
  color: var(--accent-bright);
}

/* Section label used to separate the tiers. */
.tier {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.tier h2 {
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 400;
  line-height: 1.08;
  max-width: 22ch;
}

.tier p {
  color: var(--text-tertiary);
  font-size: var(--step--1);
  max-width: 46ch;
  margin: 0;
}

/* The founder band — editorial, not a card. */
.editorial {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

@media (width <= 900px) {
  .editorial {
    grid-template-columns: minmax(0, 1fr);
  }

  .feature__statement {
    max-width: none;
  }
}

/* Numbered index list */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: idx;
}

.index-list > li {
  counter-increment: idx;
  position: relative;
  display: grid;
  grid-template-columns: clamp(3rem, 7vw, 5.5rem) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: baseline;
  padding-block: clamp(1.5rem, 3vw, 2.4rem);
  border-top: 1px solid var(--border-subtle);
}

.index-list > li:last-child {
  border-bottom: 1px solid var(--border-subtle);
}

.index-list > li::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: var(--step--1);
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* Definition rows */
.def {
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 3rem);
  padding-block: clamp(1.4rem, 2.6vw, 2.1rem);
  border-top: 1px solid var(--border-subtle);
  align-items: start;
}

.def:last-of-type {
  border-bottom: 1px solid var(--border-subtle);
}

.def__term {
  font-size: var(--step-1);
  font-family: var(--font-display);
  color: var(--text-primary);
  line-height: 1.2;
}

.def__term small {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 0.5rem;
}

.def__desc {
  color: var(--text-tertiary);
  font-size: var(--step--1);
}

/* Stats */
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--step-4);
  line-height: 1;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

/* Timeline */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 clamp(1.75rem, 4vw, 3rem);
}

.timeline::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--a-gold-55) 12%,
    var(--a-gold-55) 88%,
    transparent
  );
}

.timeline > li {
  position: relative;
  padding-bottom: clamp(2rem, 4vw, 3.25rem);
}

.timeline > li:last-child {
  padding-bottom: 0;
}

.timeline > li::before {
  content: "";
  position: absolute;
  left: calc(clamp(1.75rem, 4vw, 3rem) * -1);
  top: 0.62rem;
  width: 9px;
  height: 9px;
  transform: translateX(-4px) rotate(45deg);
  background: var(--gold-400);
  box-shadow: 0 0 0 4px var(--ink-900);
}

.timeline__when {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 0.45rem;
}

.timeline__title {
  font-size: var(--step-1);
  font-family: var(--font-display);
  margin-bottom: 0.5rem;
  line-height: 1.2;
}

.timeline__body {
  color: var(--text-tertiary);
  font-size: var(--step--1);
  max-width: 58ch;
}

/* Process / flow chain */
.flow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.flow li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  background: var(--a-white-03);
}

.flow li::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--accent);
  transform: rotate(45deg);
  flex-shrink: 0;
}

/* Tag pills */
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-bright);
  border: 1px solid var(--border-accent);
  border-radius: 100px;
  background: rgb(201 162 39 / 7%);
}

.pill--muted {
  color: var(--text-tertiary);
  border-color: var(--border-default);
  background: var(--a-white-03);
}

/* Checklist */
.checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.85rem;
}

.checks li {
  position: relative;
  padding-left: 1.75rem;
  color: var(--text-secondary);
  font-size: var(--step--1);
}

.checks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.checks--tight li {
  font-size: var(--step--1);
}

/* Accordion */
.acc {
  border-top: 1px solid var(--border-subtle);
}

.acc:last-of-type {
  border-bottom: 1px solid var(--border-subtle);
}

.acc summary {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding-block: clamp(1.1rem, 2.2vw, 1.6rem);
  cursor: pointer;
  list-style: none;
  font-size: var(--step-1);
  font-family: var(--font-display);
  transition: color 0.3s var(--ease);
}

.acc summary::-webkit-details-marker {
  display: none;
}

.acc summary::after {
  content: "";
  margin-left: auto;
  flex-shrink: 0;
  width: 11px;
  height: 11px;
  border-right: 1px solid var(--gold-400);
  border-bottom: 1px solid var(--gold-400);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.35s var(--ease);
}

.acc[open] summary::after {
  transform: rotate(-135deg) translate(-3px, -3px);
}

.acc summary:hover {
  color: var(--gold-200);
}

.acc__body {
  padding-bottom: clamp(1.2rem, 2.4vw, 1.9rem);
  color: var(--text-tertiary);
  font-size: var(--step--1);
  max-width: 68ch;
}

.acc__key {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.18em;
  color: var(--accent);
  flex-shrink: 0;
}

/* Tabs */
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.tabs__btn {
  padding: 0.7rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

.tabs__btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.tabs__btn[aria-selected="true"] {
  color: var(--ink-1000);
  background: linear-gradient(120deg, var(--accent-bright), var(--accent));
  border-color: transparent;
  font-weight: 600;
}

.tabs__panel[hidden] {
  display: none;
}

/* Marquee */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border-subtle);
  padding-block: clamp(1rem, 2vw, 1.6rem);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee__track {
  display: flex;
  gap: clamp(2rem, 5vw, 4.5rem);
  width: max-content;
  animation: slide 46s linear infinite;
}

.marquee:hover .marquee__track {
  animation-play-state: paused;
}

.marquee span {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--text-quiet);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}

.marquee span::after {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--accent-deep);
  transform: rotate(45deg);
}

@keyframes slide {
  to {
    transform: translateX(-50%);
  }
}

/* Callout */
.callout {
  display: grid;
  gap: 1rem;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-left: 2px solid var(--accent);
  background: linear-gradient(
    100deg,
    rgb(201 162 39 / 9%),
    rgb(201 162 39 / 0%) 70%
  );
  border-radius: 0 var(--radius) var(--radius) 0;
}

.callout__label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-400);
}

/* Governance note — the maturity/claims discipline made visible.
   Uses --text-tertiary (7.0:1), not --text-quiet (3.7:1): these blocks carry the
   non-authorisation and no-partner disclaimers, so they are load-bearing copy and
   must clear AA at this size. */
.note {
  font-size: var(--step--2);
  line-height: 1.7;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: clamp(1rem, 2vw, 1.5rem);
  background: var(--a-white-02);
}

.note b {
  color: var(--text-tertiary);
  font-weight: 600;
}

/* Status chip for maturity language */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.28rem 0.6rem;
  border-radius: 2px;
  border: 1px solid currentcolor;
}

.status--foundational { color: var(--gold-400); }
.status--demonstrated { color: #7fd6a8; }
.status--implemented { color: var(--blue-400); }
.status--proposed { color: var(--text-tertiary); }

/* Big number backdrop */
.ghost-num {
  position: absolute;
  right: var(--gutter);
  top: -0.12em;
  font-family: var(--font-display);
  font-size: clamp(7rem, 22vw, 20rem);
  line-height: 0.8;
  color: var(--a-white-03);
  pointer-events: none;
  z-index: -1;
  user-select: none;
}

/* Figure with caption for the art plates used inline */
.figure {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 40px 90px -34px rgb(0 0 0 / 85%);
}

.figure img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.figure figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.5rem 1.5rem 1.25rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: linear-gradient(transparent, rgb(3 5 10 / 92%));
}

/* Icons — single family, single stroke weight, sized from tokens. */
.icon {
  width: var(--icon-sm);
  height: var(--icon-sm);
  flex-shrink: 0;
  stroke: currentcolor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon--md {
  width: var(--icon-md);
  height: var(--icon-md);
}

/* Every interactive control clears the 44px minimum target. */
.btn,
.tabs__btn,
.nav-toggle,
.acc summary {
  min-height: var(--tap-min);
}

.nav a:not(.btn),
.link,
.site-footer li a {
  position: relative;
}

.nav a:not(.btn)::before,
.link::before,
.site-footer li a::before {
  content: "";
  position: absolute;
  inset: 50% 0 auto;
  height: var(--tap-min);
  transform: translateY(-50%);
  pointer-events: auto;
}

/* 10. Footer --------------------------------------------------------------- */

.site-footer {
  position: relative;
  padding-block: clamp(4rem, 8vw, 7rem) 2.5rem;
  border-top: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, var(--ink-850), var(--ink-1000));
  isolation: isolate;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  margin-bottom: clamp(3rem, 6vw, 4.5rem);
}

.site-footer h4 {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
  font-weight: 400;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.site-footer li a {
  font-size: var(--step--1);
  color: var(--text-tertiary);
  transition: color 0.25s var(--ease);
}

.site-footer li a:hover {
  color: var(--gold-200);
}

.site-footer__base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  font-size: var(--step--2);
  color: var(--text-quiet);
}

/* 11. Motion --------------------------------------------------------------- */

/*
   Only hide revealable content when JS is present to reveal it again.
   Without JS the page renders fully at its final state.
*/
.js [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

.js [data-reveal="fade"] {
  transform: none;
}

.js [data-reveal="right"] {
  transform: translateX(-28px);
}

.js [data-reveal="scale"] {
  transform: scale(0.97);
}

/* Line-by-line headline reveal */
.lines span {
  display: block;
  overflow: hidden;
}

.js .lines span > i {
  display: block;
  font-style: inherit;
  transform: translateY(102%);
  transition: transform 1.05s var(--ease-out);
  transition-delay: var(--line-delay, 0ms);
}

.is-in .lines span > i,
.lines.is-in span > i {
  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;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .js .lines span > i {
    transform: none;
  }

  .plate::before {
    transform: none !important;
  }
}

/* 12. Responsive ----------------------------------------------------------- */

/* Phone widths crop the plate hard, so the scrim goes flatter and heavier. */
@media (width <= 860px) {
  .plate::after {
    background:
      linear-gradient(
        180deg,
        rgb(5 7 12 / 88%) 0%,
        rgb(5 7 12 / 74%) 34%,
        rgb(5 7 12 / 80%) 66%,
        rgb(5 7 12 / 95%) 100%
      );
  }
}

@media (width <= 1080px) {
  .split,
  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .split--sticky > :first-child {
    position: static;
  }
}

@media (width <= 1180px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.5rem;
    padding: 6rem var(--gutter) 3rem;
    background: var(--scrim-modal);
    -webkit-backdrop-filter: blur(24px);
    backdrop-filter: blur(24px);
    transform: translateY(-100%);
    /* visibility flips instantly on open (so focus can land inside) and is
       delayed on close (so the panel stays visible while it slides away). */
    transition: transform 0.6s var(--ease-out), visibility 0s 0.6s;
    visibility: hidden;
    overflow-y: auto;
  }

  .nav.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.6s var(--ease-out), visibility 0s 0s;
  }

  .nav a:not(.btn) {
    font-family: var(--font-display);
    font-size: var(--step-3);
    padding-block: 0.5rem;
    color: var(--text-primary);
  }

  .nav .btn {
    margin-top: 1.5rem;
    align-self: flex-start;
  }

  /* The brand and the close control stay above the open overlay. */
  .brand,
  .nav-toggle {
    position: relative;
    z-index: 2;
  }

  .def {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }

  .index-list > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }

  .index-list > li::before {
    display: block;
  }

  .hero {
    min-height: clamp(560px, 92svh, 900px);
  }

  .scroll-cue {
    display: none;
  }

  .ghost-num {
    display: none;
  }
}

@media (width <= 520px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .canon {
    max-width: none;
  }
}

/* ==========================================================================
   The discovery wall — bricks.html #categories
   Invitation surface. Tactile, high-contrast, mobile-first. Essential copy is
   never grey-on-black: --text-tertiary appears only on the counter label and
   the standing disclaimer, which are metadata, not the copy a visitor acts on.
   ========================================================================== */

.wall__head {
  display: flex;
  justify-content: flex-start;
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.wall__counter {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.7rem 1.3rem;
  border: 1px solid var(--border-default);
  border-radius: var(--radius);
  background: var(--a-white-03);
}

.wall__counter-label {
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.wall__counter-value {
  font-family: var(--font-mono);
  font-size: var(--step-1);
  font-weight: 600;
  color: var(--accent-bright);
  font-variant-numeric: tabular-nums;
}

/* ---- the wall itself ---- */

.wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.wall__slot {
  display: grid;
}

.wall__slot:last-child {
  grid-column: 1 / -1;
}

/* ---- the brick ---- */

.brick {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 3px;
  text-align: left;
  text-decoration: none;
  background:
    linear-gradient(180deg, var(--ink-700) 0%, var(--ink-800) 55%, var(--ink-900) 100%);
  box-shadow:
    inset 0 1px 0 rgb(240 215 154 / 22%),
    inset 0 -1px 0 rgb(0 0 0 / 70%),
    inset 1px 0 0 rgb(255 255 255 / 4%),
    0 10px 22px -12px rgb(0 0 0 / 90%);
  transition:
    transform 0.28s var(--ease-out),
    box-shadow 0.28s var(--ease-out),
    background 0.28s var(--ease-out);
}

.brick__face {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
  min-height: 112px;
  padding: 1.15rem 1.15rem 1.05rem;
}

.brick__name {
  font-family: var(--font-display);
  font-size: var(--step-1);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--text-primary);
}

.brick__hint {
  font-size: var(--step--1);
  line-height: 1.4;
  color: var(--text-secondary);
}

.brick:hover {
  transform: translateY(-2px);
  background:
    linear-gradient(180deg, var(--ink-600) 0%, var(--ink-700) 55%, var(--ink-800) 100%);
  box-shadow:
    inset 0 1px 0 rgb(240 215 154 / 42%),
    inset 0 -1px 0 rgb(0 0 0 / 70%),
    inset 1px 0 0 rgb(255 255 255 / 6%),
    0 18px 34px -14px rgb(0 0 0 / 95%);
}

.brick:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 3px;
  transform: translateY(-2px);
}

.brick[aria-expanded="true"] {
  transform: translateY(1px);
  background:
    linear-gradient(180deg, var(--ink-800) 0%, var(--ink-850) 100%);
  box-shadow:
    inset 0 1px 0 rgb(240 215 154 / 60%),
    inset 0 2px 8px rgb(0 0 0 / 70%);
}

/* Structural courses — the wall's mass. Texture only: aria-hidden in markup,
   never focusable, and carrying no information. */
.wall__courses {
  margin-top: 10px;
  height: 132px;
  border-radius: 3px;
  background:
    repeating-linear-gradient(90deg,
      transparent 0 96px, rgb(245 242 234 / 6%) 96px 97px),
    repeating-linear-gradient(180deg,
      transparent 0 32px, rgb(245 242 234 / 6%) 32px 33px);
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}

.wall__footnote {
  margin-top: 1.5rem;
  font-size: var(--step-0);
  color: var(--text-secondary);
}

/* ---- the band: a readable block with no JS, a sheet or panel with it ---- */

.band__inner {
  padding: 1.5rem 0 0;
}

.band__title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  line-height: 1.05;
  color: var(--text-primary);
}

.band__invitation {
  margin-top: 0.85rem;
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--text-primary);
}

.band__scope {
  margin-top: 0.6rem;
  font-size: var(--step--1);
  line-height: 1.55;
  color: var(--text-secondary);
}

.band__label {
  margin-top: 1.6rem;
  font-family: var(--font-mono);
  font-size: var(--step--2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.band__list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.band__list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--text-primary);
}

.band__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 7px;
  height: 7px;
  border: 1px solid var(--accent);
  transform: rotate(45deg);
}

.band__list--ways li::before {
  background: var(--accent);
}

.band .pills {
  margin-top: 0.75rem;
}

.band__action {
  margin-top: 1.75rem;
  width: 100%;
  justify-content: center;
  min-height: 52px;
}

.band__note {
  margin-top: 1rem;
  font-size: var(--step--1);
  line-height: 1.45;
  color: var(--text-tertiary);
}

.band__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-primary);
  background: var(--a-white-05);
  border: 1px solid var(--border-default);
  border-radius: 50%;
}

.band__close:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* Without JS every band is simply an open, readable block, separated by a rule.
   The brick above it is an ordinary in-page link to it. */
.band {
  border-top: 1px solid var(--border-subtle);
  margin-top: 1.5rem;
}

/* ---- with JS: bands collapse, bricks become dialog triggers ---- */

.js .band {
  border-top: 0;
  margin-top: 0;
}

.js .band[hidden] {
  display: none;
}

.js .band__close {
  display: grid;
}

.js .band--sheet {
  position: fixed;
  z-index: 201;
  inset: auto 0 0 0;
  max-height: 88svh;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 14px 14px 0 0;
  background: var(--ink-850);
  box-shadow: 0 -24px 60px -20px rgb(0 0 0 / 90%);
  border-top: 1px solid var(--border-strong);
  transform: translateY(100%);
  transition: transform 0.32s var(--ease-out);
}

.js .band--sheet.is-open {
  transform: translateY(0);
}

.js .band__inner {
  padding: 2.25rem 1.35rem 2.5rem;
}

/* the grab handle */
.js .band--sheet::before {
  content: "";
  position: sticky;
  top: 0.6rem;
  display: block;
  width: 44px;
  height: 4px;
  margin: 0 auto -4px;
  border-radius: 100px;
  background: var(--border-strong);
}

.wall__scrim {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgb(2 4 8 / 72%);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s var(--ease-out), visibility 0s 0.32s;
}

.wall__scrim.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s var(--ease-out), visibility 0s 0s;
}

@media (width >= 620px) {
  .wall {
    gap: 12px;
  }

  .brick__face {
    min-height: 132px;
  }
}

/* ---- desktop: one course of five, detail as a side panel ---- */

@media (width >= 1024px) {
  .wall {
    grid-template-columns: repeat(5, 1fr);
  }

  .wall__slot:last-child {
    grid-column: auto;
  }

  .brick__face {
    min-height: 168px;
  }

  .wall__courses {
    height: 168px;
  }

  .js .band--sheet {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(460px, 42vw);
    max-height: none;
    border-radius: 0;
    border-top: 0;
    border-left: 1px solid var(--border-strong);
    transform: translateX(100%);
    transition: transform 0.36s var(--ease-out);
    box-shadow: -24px 0 70px -24px rgb(0 0 0 / 92%);
  }

  .js .band--sheet.is-open {
    transform: translateX(0);
  }

  .js .band__inner {
    padding: 3rem 2.25rem;
  }

  /* the wall stays usable beside the panel, so no scrim on desktop */
  .js .band--sheet::before {
    display: none;
  }

  .wall__scrim {
    display: none;
  }

  .band__action {
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .brick,
  .js .band--sheet,
  .wall__scrim {
    transition: none;
  }

  .brick:hover,
  .brick:focus-visible,
  .brick[aria-expanded="true"] {
    transform: none;
  }
}

@media print {
  body::before,
  body::after,
  .plate,
  .site-header,
  .progress,
  .scroll-cue {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }
}
