@font-face {
  font-family: Anton;
  src: url("Anton-Regular.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f2efe4;
  --pulp: #e6e1d2;
  --white: #fdfbf4;
  --ink: #171713;
  --muted: #4f4c45;
  --line: #b9b5a8;
  --night: #191d30;
  --night-line: #666d85;
  --night-paper: #f4f1e5;
  --accent: #2641ce;
  --accent-bright: #b4c0ff;
  --accent-soft: #e3e8ff;
  --accent-ink: #fffdf7;
  --gutter: clamp(1.25rem, 4vw, 4.75rem);
  --display: Anton, Impact, "Arial Narrow", sans-serif;
  --reading: Arial, Helvetica, sans-serif;
}

[data-theme="ember"] {
  --accent: #a82d25;
  --accent-bright: #ffb4a6;
  --accent-soft: #f7dece;
}

[data-theme="pine"] {
  --accent: #285946;
  --accent-bright: #aee3ca;
  --accent-soft: #d9e9d9;
}

[data-theme="ink"] {
  --accent: #413e37;
  --accent-bright: #efdfb7;
  --accent-soft: #e7dfce;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-padding-top: 5.5rem; }
html[data-motion="on"] { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--reading);
}

::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3, p, figure, ul, ol { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; text-underline-offset: .22em; }
img { display: block; max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
}
.contact-chapter :focus-visible, .stack-chapter :focus-visible, .next-project :focus-visible {
  outline-color: currentColor;
}

.shell { width: min(87.5rem, calc(100% - 2 * var(--gutter))); margin-inline: auto; }
.skip-link {
  position: fixed;
  z-index: 10;
  inset: .5rem auto auto .5rem;
  padding: .7rem 1rem;
  transform: translateY(-160%);
  background: var(--ink);
  color: var(--white);
}
.skip-link:focus { transform: none; }

.masthead {
  position: sticky;
  z-index: 5;
  top: 0;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.masthead-inner {
  display: flex;
  align-items: center;
  min-height: 4.25rem;
  gap: clamp(.65rem, 2.4vw, 2.5rem);
  padding-block: .5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  flex: 0 0 auto;
  margin-right: auto;
  text-decoration: none;
  font-size: .83rem;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: .02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.35rem;
  aspect-ratio: 1;
  padding-bottom: .02em;
  background: var(--ink);
  color: var(--white);
  font: 1.35rem/1 var(--display);
}

.chapter-nav { display: flex; align-items: center; gap: clamp(.85rem, 2.25vw, 2.25rem); }

.chapter-nav a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding-block: .35rem;
  text-decoration: none;
  font-size: .88rem;
  font-weight: 800;
}

.chapter-nav a span {
  font-size: .81rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.chapter-nav a:hover, .chapter-nav a[aria-current="location"] { color: var(--accent); }
.chapter-nav a[aria-current="location"] { text-decoration: underline; text-decoration-thickness: 2px; }

.reading-tools {
  display: flex;
  align-items: center;
  gap: .7rem;
  border-left: 2px solid var(--line);
  padding-left: clamp(.55rem, 1.5vw, 1.4rem);
}

.theme-picker { display: flex; gap: .12rem; }
.theme-picker button, .motion-toggle, .menu-toggle {
  cursor: pointer;
  border: 0;
  padding: 0;
  background: transparent;
  min-height: 2.75rem;
}

.theme-picker button {
  display: grid;
  place-items: center;
  width: 1.72rem;
  --swatch: #2641ce;
}
.theme-picker button[data-palette="ember"] { --swatch: #a82d25; }
.theme-picker button[data-palette="pine"] { --swatch: #285946; }
.theme-picker button[data-palette="ink"] { --swatch: #413e37; }

.theme-picker button span {
  width: .85rem;
  height: .85rem;
  background: var(--swatch);
  border-radius: 50%;
}
.theme-picker button:hover span,
.theme-picker button[aria-pressed="true"] span { outline: 2px solid var(--swatch); outline-offset: 2px; }

.motion-toggle {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  gap: .4rem;
  font-size: .81rem;
  font-weight: 800;
}
.motion-dot { width: .55rem; height: .55rem; border: 2px solid currentColor; border-radius: 50%; }
.motion-toggle[aria-pressed="true"] .motion-dot { background: currentColor; }

.menu-toggle { display: none; font-size: .87rem; font-weight: 800; }
.menu-toggle span { font-size: 1.2em; }

.reading-progress {
  position: absolute;
  bottom: -2px;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  pointer-events: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .98fr);
  gap: clamp(1.5rem, 3vw, 3rem);
  align-items: center;
  padding-top: clamp(2.25rem, 4.3vw, 4.75rem);
}
.hero-copy { min-width: 0; }
.hero-location {
  display: flex;
  gap: .65rem;
  align-items: center;
  font-size: .88rem;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: .04em;
}
.hero-location span { color: var(--accent); }

.hero-title {
  margin: .85rem 0 1.4rem;
  font: 400 clamp(5.2rem, 11.2vw, 11.6rem)/.91 var(--display);
  text-transform: uppercase;
  letter-spacing: -.015em;
}
.hero-title > span { display: block; }
.hero-title > span + span { color: var(--accent); }
.hero-period { margin-left: .035em; }

.hero-description { max-width: 33ch; font-size: clamp(1.125rem, 1.75vw, 1.55rem); line-height: 1.3; }
.hero-actions, .case-actions, .lab-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem 1.4rem; }
.hero-actions { margin-top: 1.6rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 3.2rem;
  border: 2px solid transparent;
  padding: .65rem 1rem;
  text-decoration: none;
  font-size: .95rem;
  font-weight: 800;
  cursor: pointer;
}
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--ink); color: var(--white); }
.button-outline { background: var(--paper); border-color: var(--ink); }
.button-outline:hover { background: var(--pulp); }

.text-action { display: inline-flex; align-items: center; gap: .4rem; font-weight: 800; text-decoration-thickness: 2px; }
.text-action:hover { color: var(--accent); }

.cover-figure {
  min-width: 0;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  margin: 0;
}

.cover-window {
  aspect-ratio: 1.12;
  overflow: hidden;
  background: var(--accent);
  padding-right: clamp(.6rem, 1.2vw, 1.2rem);
}

.cover-window img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 53% 35%;
}

.cover-figure figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .4rem .8rem;
  min-height: 3.25rem;
  padding: .65rem .9rem;
  font-size: .86rem;
}

.cover-figure figcaption > span span { color: var(--accent-bright); padding-inline: .18rem; }
.cover-figure figcaption a { color: var(--accent-bright); font-weight: 800; white-space: nowrap; }
.cover-figure :focus-visible { outline-color: var(--accent-bright); }

.cover-index {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .4rem 1.2rem;
  padding: 1.05rem 0;
  border-top: 2px solid var(--ink);
  font-size: .92rem;
  font-weight: 800;
}
.cover-index a { text-decoration: none; }
.cover-index span { color: var(--accent); margin-left: .3rem; }
.cover-index a:hover { text-decoration: underline; }

.work-chapter {
  padding-block: clamp(3.5rem, 7.5vw, 7rem);
  background: var(--pulp);
}

.chapter-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 1rem 2.5rem;
  align-items: end;
  margin-bottom: clamp(1.75rem, 3.8vw, 3.6rem);
}
.chapter-intro h2, .stack-heading h2, .contact-layout h2 {
  font: 400 clamp(3.7rem, 7.7vw, 8.3rem)/.95 var(--display);
  text-transform: uppercase;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.chapter-intro p, .stack-heading p, .contact-layout p { max-width: 32ch; font-size: clamp(1.05rem, 1.5vw, 1.26rem); line-height: 1.4; }
.chapter-intro p { padding-bottom: .15em; }

.project-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(.9rem, 1.55vw, 1.5rem);
}
.project-panel { grid-column: span 6; min-width: 0; background: var(--white); }
.project-panel:nth-child(4n+1), .project-panel:nth-child(4n+4) { grid-column: span 7; }
.project-panel:nth-child(4n+2), .project-panel:nth-child(4n+3) { grid-column: span 5; }

.panel-link {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 2px solid var(--ink);
  color: var(--ink);
  text-decoration: none;
}
.panel-link:hover { border-color: var(--accent); }
.panel-link:hover .panel-arrow { color: var(--accent-ink); background: var(--accent); }

.panel-content {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .35rem;
  padding: clamp(1.05rem, 2vw, 1.7rem);
  padding-right: clamp(3.4rem, 6.4vw, 5.5rem);
}

.project-field, .case-label {
  color: var(--accent);
  font-size: .87rem;
  font-weight: 800;
}

.panel-content h3 {
  font: 400 clamp(2.1rem, 4.1vw, 4.15rem)/1.03 var(--display);
  text-transform: uppercase;
  text-wrap: balance;
}

.panel-description { max-width: 47ch; }
.panel-tech { padding-top: .35rem; color: var(--muted); font-size: .86rem; font-weight: 700; }
.panel-arrow {
  position: absolute;
  top: clamp(1.05rem, 2vw, 1.7rem);
  right: clamp(1.05rem, 2vw, 1.7rem);
  display: grid;
  place-items: center;
  width: clamp(2rem, 3.45vw, 3.2rem);
  aspect-ratio: 1;
  border: 2px solid var(--ink);
  font-size: 1.25rem;
  line-height: 1;
}
.panel-link:hover .panel-arrow { border-color: var(--accent); }

.visual {
  position: relative;
  display: grid;
  place-items: center;
  isolation: isolate;
  aspect-ratio: 2.2;
  overflow: hidden;
  border-bottom: 2px solid var(--ink);
}
.visual img, .visual canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visual--mountain {
  background: #1c254a;
  color: #e7ecff;
}
.diagram-note {
  position: absolute;
  bottom: 10%;
  left: 6%;
  font-size: .86rem;
  font-weight: 800;
}

.visual--signal {
  background: #152c29;
  color: #e5fff0;
}
.signal-caption {
  position: absolute;
  inset: auto 7% 10%;
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  font-size: .87rem;
  font-weight: 800;
}

.visual--arena { background: #ded9f0; color: #201d32; }
.arena-graphic {
  width: 86%;
  max-width: 36rem;
  transform: rotate(-3deg);
  background: #2b2443;
  color: #fcf8ff;
  padding: clamp(.9rem, 1.7vw, 1.5rem);
  border: 2px solid #201d32;
}
.arena-head { display: flex; justify-content: space-between; gap: .4rem; font-weight: 800; }
.arena-head span + span, .arena-line { color: #e0d1ff; font-size: .82rem; }
.arena-seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; gap: .25rem; margin-block: .65rem; }
.arena-seats span { display: grid; justify-items: center; gap: .15rem; font-size: .77rem; }
.arena-seats b {
  display: grid;
  place-items: center;
  border-radius: 50%;
  width: clamp(1.7rem, 4.1vw, 3.2rem);
  aspect-ratio: 1;
  background: #d2bdf3;
  color: #201d32;
  font: 400 clamp(1rem, 2vw, 1.6rem)/1 var(--display);
}
.arena-seats span:first-child b { background: #e9fd9d; }

.visual--soap { background: #d8ccad; }
.visual--soap img { object-position: center 49%; }

.visual--terminal { background: #cddbc1; color: #e9f7dc; }
.terminal-graphic {
  background: #142820;
  width: 83%;
  max-width: 38rem;
  padding: .9rem 1.15rem;
  border: 2px solid #142820;
  font-size: .84rem;
  font-weight: 800;
}
.terminal-graphic > span { display: block; }
.terminal-graphic > span:last-child { color: #b4d1a8; }
.terminal-graphic pre {
  margin: .75rem 0;
  padding: .5rem 0;
  white-space: pre-wrap;
  font-size: clamp(.92rem, 1.5vw, 1.15rem);
  border-block: 2px solid #6a836b;
}
.terminal-cursor { color: #d7f4a3; }

.visual--rail { background: #f1d7ad; color: #212c50; }
.rail-graphic { width: 82%; max-width: 37rem; padding: .75rem 0; font-size: .9rem; font-weight: 800; }
.rail-graphic > span { font: 400 clamp(1.5rem, 3vw, 3rem)/1 var(--display); text-transform: uppercase; }
.rail-route {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: .4rem;
  margin-block: .55rem;
}
.rail-route::before {
  content: "";
  position: absolute;
  left: .45rem;
  right: 1.4rem;
  top: .42rem;
  height: .27rem;
  background: #212c50;
}
.rail-route span { position: relative; display: grid; justify-items: start; gap: .18rem; }
.rail-route span::before {
  content: "";
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid #212c50;
  border-radius: 50%;
  background: #f9f0dc;
}
.rail-graphic p { font-size: .84rem; }

.archive { padding-top: clamp(3.9rem, 7.5vw, 7rem); scroll-margin-top: -1rem; }
.archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .85rem 1.25rem;
  padding-bottom: 1.15rem;
}
.archive-heading h3, .milestones h3 {
  font: 400 clamp(2.6rem, 5.2vw, 5.2rem)/1 var(--display);
  text-transform: uppercase;
  text-wrap: balance;
}
.archive-heading h3 { margin-bottom: .5rem; }
.archive-heading p { max-width: 54ch; }

.archive-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem .4rem;
  padding-block: .5rem;
  border-top: 2px solid var(--ink);
}
.archive-controls button {
  min-height: 2.75rem;
  padding: .4rem .75rem;
  cursor: pointer;
  border: 2px solid transparent;
  background: transparent;
  font-size: .9rem;
  font-weight: 800;
}
.archive-controls button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.archive-controls button:hover:not([aria-pressed="true"]) { border-color: var(--accent); }
.archive-count { margin-left: auto; font-size: .9rem; color: var(--muted); }

.archive-list { list-style: none; padding: 0; border-bottom: 2px solid var(--ink); }
.archive-item { border-top: 2px solid var(--ink); }
.archive-item a {
  display: grid;
  grid-template-columns: minmax(5.85rem, .65fr) minmax(0, 1.55fr) minmax(0, 2.2fr) 1.6rem;
  gap: .5rem 1.05rem;
  align-items: center;
  padding: .85rem clamp(.35rem, 1.2vw, 1rem);
  text-decoration: none;
}
.archive-item a:hover { background: var(--paper); }
.archive-type { font-size: .86rem; font-weight: 800; color: var(--accent); }
.archive-name { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.2; font-weight: 800; }
.archive-description { line-height: 1.35; }
.archive-arrow { color: var(--accent); font-size: 1.3rem; text-align: center; }

.stack-chapter {
  padding-block: clamp(3.75rem, 8vw, 8rem);
  background: var(--night);
  color: var(--night-paper);
}
.stack-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.2fr); gap: clamp(2rem, 8vw, 9rem); }
.stack-heading { align-self: start; position: sticky; top: 6.5rem; }
.stack-heading h2 { margin-bottom: .9rem; }
.stack-heading p { color: var(--night-paper); }
.stack-row { padding-block: 1.35rem 1.55rem; border-top: 2px solid var(--night-line); }
.stack-row:last-child { border-bottom: 2px solid var(--night-line); }
.stack-row h3 {
  font: 400 clamp(2rem, 3.7vw, 3.2rem)/1 var(--display);
  text-transform: uppercase;
  margin-bottom: .35rem;
  text-wrap: balance;
}
.stack-row > a { display: inline-flex; gap: .35rem; color: var(--accent-bright); margin-top: .75rem; font-weight: 800; }
.stack-row > a:hover { color: var(--white); }

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; }
.tags li { padding: .25rem .55rem; background: var(--accent-soft); font-size: .86rem; line-height: 1.25; }
.stack-row .tags { margin-top: .8rem; }
.stack-row .tags li { background: #323950; color: var(--night-paper); }

.about-chapter { padding-block: clamp(3.5rem, 8vw, 8rem); }
.about-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(1.2rem, 5vw, 5rem); }
.about-note { display: grid; justify-items: start; gap: .9rem; align-content: start; }
.about-note p { max-width: 48ch; }
.about-note .about-statement { font-size: clamp(1.4rem, 3vw, 2.45rem); line-height: 1.12; font-weight: 800; max-width: 24ch; }
.milestones { align-self: start; background: var(--pulp); border-inline-start: .6rem solid var(--accent); padding: clamp(1.1rem, 2.7vw, 2.3rem); }
.milestones h3 { font-size: clamp(2.3rem, 4.2vw, 4rem); margin-bottom: .8rem; }
.milestones ul { list-style: none; display: grid; gap: .75rem; padding: 0; margin-bottom: .9rem; }
.milestones li { display: grid; grid-template-columns: 4.2rem 1fr; gap: .75rem; }
.milestones li strong { color: var(--accent); }
.milestones a { font-weight: 800; }

.contact-chapter { padding-block: clamp(3.5rem, 8vw, 7rem); background: var(--accent); color: var(--accent-ink); }
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.5rem 3rem; align-items: start; }
.contact-layout h2 { margin-bottom: .95rem; }
.contact-links { min-width: 0; border-top: 2px solid currentColor; }
.contact-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 3.25rem;
  border-bottom: 2px solid currentColor;
  padding: .5rem .15rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.08rem;
}
.contact-link:hover { text-decoration: underline; }
.copy-link {
  min-height: 2.75rem;
  padding: .4rem 0;
  border: 0;
  margin-top: .55rem;
  background: transparent;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}
.copy-status { display: block; font-size: .88rem; overflow-wrap: anywhere; }

.footer { padding-block: 1rem; background: var(--ink); color: var(--white); }
.footer-inner { display: flex; justify-content: space-between; gap: .5rem 1.2rem; flex-wrap: wrap; font-size: .9rem; }
.footer a { font-weight: 800; }
.footer :focus-visible { outline-color: var(--white); }

.case { padding-block: clamp(2.25rem, 4vw, 4rem) clamp(3rem, 7vw, 6rem); }
.back-link { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; }
.back-link:hover, .case-label span { color: var(--accent); }
.case-header {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, .9fr);
  align-items: end;
  column-gap: clamp(1.5rem, 5vw, 5rem);
  margin-block: clamp(1.65rem, 4vw, 3.5rem) clamp(1.9rem, 5vw, 4.25rem);
}
.case-header h1 {
  margin: .25rem 0 .6rem;
  font: 400 clamp(3.2rem, 8.7vw, 8.5rem)/.97 var(--display);
  text-transform: uppercase;
  letter-spacing: -.015em;
  text-wrap: balance;
}
.case-blurb { max-width: 36ch; font-size: clamp(1.1rem, 2vw, 1.5rem); line-height: 1.32; }
.case-meta { border-top: 2px solid var(--ink); padding-top: .8rem; }
.case-meta > p { font-weight: 800; margin-bottom: .6rem; }
.case-actions { margin-top: .8rem; }
.case-actions .button { min-height: 2.8rem; }

.case-figure { border: 2px solid var(--ink); margin-bottom: clamp(1.9rem, 5.5vw, 5rem); }
.case-figure figcaption { padding: .55rem .8rem; font-size: .93rem; }
.visual--detail { aspect-ratio: 2.65; }
.visual--detail.visual--mountain img { object-position: 67% 48%; }
.visual--detail.visual--soap img { object-position: center 49%; }

.case-story { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); gap: clamp(1.4rem, 5vw, 4rem); }
.case-story h2, .case-workflow > h2, .case-evidence h2, .audio-lab h2 {
  font: 400 clamp(2.35rem, 4.4vw, 4rem)/1 var(--display);
  text-transform: uppercase;
  text-wrap: balance;
  margin-bottom: .5rem;
}
.case-story p, .case-evidence p { max-width: 65ch; font-size: 1.075rem; }
.case-workflow, .case-evidence, .audio-lab { margin-top: clamp(2.25rem, 5.5vw, 5rem); padding-top: 1.35rem; border-top: 2px solid var(--ink); }
.case-workflow ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; padding: 0; margin-top: .9rem; list-style-position: inside; }
.case-workflow li { background: var(--pulp); padding: .85rem 1rem; }
.case-workflow li::marker { color: var(--accent); font-weight: 800; }
.case-workflow h3 { display: inline; font-size: 1.12rem; }
.case-workflow p { margin-top: .25rem; }

.audio-lab { display: grid; gap: .85rem; }
.lab-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
.lab-state > div { display: grid; align-content: start; background: var(--pulp); padding: .65rem .85rem; }
.lab-state > div[data-active="true"] { background: var(--accent-soft); }
.lab-state > div[data-failed="true"] { border-bottom: 3px solid #982c24; }
.lab-status { font-weight: 800; }

.next-project { padding-block: 1.45rem; color: var(--night-paper); background: var(--night); }
.next-project a { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.9fr) auto; align-items: center; gap: .45rem 1rem; text-decoration: none; }
.next-project a:hover { color: var(--accent-bright); }
.next-project strong {
  font: 400 clamp(2rem, 5.3vw, 4rem)/1 var(--display);
  text-transform: uppercase;
  text-wrap: balance;
}
.next-project a > span:last-child { font-size: 1.5rem; }

[data-motion="on"] .button, [data-motion="on"] .panel-arrow, [data-motion="on"] .text-action { transition: transform 180ms ease; }
[data-motion="on"] .button:hover, [data-motion="on"] .panel-link:hover .panel-arrow { transform: translateY(-3px); }
[data-motion="on"] .button:active { transform: translateY(1px); }
[data-motion="on"] .is-revealed { animation: reveal 520ms cubic-bezier(.2,.65,.28,1) both; }
[data-motion="on"] .cover-window img { animation: settle 900ms cubic-bezier(.2,.65,.28,1) both; }

@keyframes reveal {
  from { transform: translateY(16px); opacity: .65; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes settle {
  from { transform: scale(1.045); }
  to { transform: scale(1); }
}

@media (max-width: 62rem) {
  .masthead-inner { gap: .9rem; }
  .chapter-nav { gap: .8rem; }
  .reading-tools { gap: .45rem; padding-left: .65rem; }
  .hero-title { font-size: clamp(5rem, 10.8vw, 7rem); }
  .chapter-intro { grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); }
}

@media (max-width: 49rem) {
  html { scroll-padding-top: 5rem; }
  .masthead-inner { flex-wrap: wrap; min-height: 3.8rem; gap: .4rem .75rem; }
  .reading-tools { border-left: 0; padding-left: 0; }
  .theme-picker button { width: 1.65rem; }
  .menu-toggle { display: inline-flex; align-items: center; gap: .3rem; }
  .chapter-nav { order: 3; width: 100%; justify-content: space-between; border-top: 2px solid var(--line); padding-top: .35rem; }
  .chapter-nav a { min-height: 2.5rem; }
  [data-enhanced] .chapter-nav:not([data-open]) { display: none; }

  .hero { grid-template-columns: minmax(0, 1fr); gap: 1.35rem; padding-top: 1.75rem; }
  .hero-title { font-size: clamp(4.55rem, 18.2vw, 9rem); margin-block: .5rem .85rem; }
  .hero-actions { margin-top: 1.05rem; }
  .hero-description { max-width: 37ch; }
  .cover-window { aspect-ratio: 1.28; }
  .cover-figure figcaption { min-height: 2.7rem; }
  .cover-index { gap: .5rem .8rem; }

  .chapter-intro, .about-layout, .contact-layout, .stack-layout { grid-template-columns: minmax(0, 1fr); }
  .stack-layout { gap: 1.6rem; }
  .stack-heading { position: static; }
  .stack-heading h2, .contact-layout h2 { margin-bottom: .6rem; }
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project-panel:nth-child(n) { grid-column: span 1; }
  .panel-content h3 { font-size: clamp(1.85rem, 5.1vw, 3rem); }
  .case-header { grid-template-columns: 1fr; gap: 1.25rem; }
  .case-header h1 { font-size: clamp(3.3rem, 11vw, 6rem); }
  .visual--detail { aspect-ratio: 1.82; }
}

@media (max-width: 35rem) {
  .masthead-inner { gap: .3rem .55rem; }
  .brand { gap: .42rem; font-size: .8rem; }
  .brand-mark { width: 2rem; font-size: 1.15rem; }
  .theme-picker { gap: .02rem; }
  .theme-picker button { width: 1.42rem; }
  .theme-picker button span { width: .72rem; height: .72rem; }
  .motion-toggle { gap: .24rem; }
  .motion-toggle [data-motion-label] { font-size: .78rem; }
  .chapter-nav { justify-content: space-between; gap: .2rem; }
  .chapter-nav a { gap: .2rem; }
  .cover-index { font-size: .87rem; }
  .cover-figure figcaption { font-size: .8rem; }
  .project-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-content h3 { font-size: clamp(2.2rem, 9vw, 3.1rem); }
  .project-panel .visual { aspect-ratio: 1.98; }
  .archive-count { margin-left: .35rem; }
  .archive-controls button { padding-inline: .38rem; }
  .archive-item a { grid-template-columns: minmax(0, 1fr) auto; gap: .22rem .5rem; padding-block: .72rem; }
  .archive-type, .archive-name, .archive-description { grid-column: 1; }
  .archive-arrow { grid-column: 2; grid-row: 1 / 4; }
  .case-workflow ol { grid-template-columns: 1fr; }
  .next-project a { grid-template-columns: minmax(0, 1fr) auto; }
  .next-project a > span:first-child { grid-column: 1 / -1; }
}

@media (max-width: 22rem) {
  :root { --gutter: 1rem; }
  .brand > span + span { display: none; }
  .hero-title { font-size: 4.1rem; }
  .cover-figure figcaption { flex-wrap: wrap; }
}

@media print {
  .masthead, .footer, .archive-controls, .case-actions, .audio-lab, .next-project { display: none !important; }
  body, .stack-chapter, .contact-chapter { color: #000; background: #fff; }
  .stack-heading { position: static; }
  .stack-heading p, .stack-row > a { color: #000; }
}
