/* ---------------------------------------------------------------
   taly.dev: the split stage.
   One half of the first screen holds still (a photograph, or the
   drawn shape of a system); the other half is read. Plain CSS, no
   build step. Every page uses this file; styles.css is no longer
   linked from any page.
   --------------------------------------------------------------- */

@font-face {
  font-family: "Rokkitt";
  src: url("fonts/rokkitt-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-roman.woff2") format("woff2");
  font-weight: 400 600;
  font-style: normal;
  font-display: optional;
}

@font-face {
  font-family: "Literata";
  src: url("fonts/literata-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: optional;
}

:root {
  --bg: #161c1a;
  --surface: #1f2725;
  --surface-2: #2a3431;
  --surface-3: #3a4643;
  --edge: #7d8a85;
  --ink: #e3e2da;
  --muted: #9ba19a;
  --accent: #9fc7b8;
  --accent-ink: #161c1a;

  --font-display: "Rokkitt", "Roboto Slab", "Rockwell", "Arial Narrow", sans-serif;
  --font-text: "Literata", "Georgia", "Times New Roman", serif;

  /* Five sizes do all the visible work. */
  --step-small: clamp(0.8125rem, 0.79rem + 0.1vw, 0.875rem);
  --step-body: clamp(1.0625rem, 1.02rem + 0.25vw, 1.25rem);
  --step-lead: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --step-head: clamp(2.25rem, 1.4rem + 3.2vw, 4.25rem);
  --step-display: clamp(4.25rem, 1.8rem + 10.4vw, 10.5rem);

  --gutter: 12px;
  --pad: clamp(20px, 4vw, 64px);
  --section: clamp(96px, 12vw, 200px);
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.6;
  font-optical-sizing: auto;
}

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

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

p { margin: 0 0 1em; }

h1, h2, h3 { margin: 0; font-weight: 600; }

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

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

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

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 12px 18px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.skip-link:focus { top: var(--gutter); }

/* ---------- shared pieces ---------- */

.display {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.85;
}

.head {
  font-size: var(--step-lead);
  line-height: 1.2;
  font-weight: 600;
}

.lead {
  font-size: var(--step-lead);
  line-height: 1.4;
  max-width: 34ch;
}

.soft { color: var(--muted); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.button:hover { background: var(--ink); }
.button:active { transform: scale(0.97); }

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1;
}

.nav {
  display: flex;
  gap: clamp(14px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
  transition: color 160ms var(--ease);
}
.nav a:hover,
.nav a[aria-current="page"] { color: var(--accent); }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }

.frame {
  padding-left: var(--pad);
  padding-right: var(--pad);
}

/* ---------- the stage: sheet on the left, photograph on the right ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--gutter);
  padding: var(--gutter);
  align-items: start;
}

.sheet {
  background: var(--surface);
  padding: 0 var(--pad) var(--pad);
}

.sheet-first {
  display: flex;
  flex-direction: column;
  min-height: calc(100svh - 2 * var(--gutter));
}

.sheet-title {
  margin-top: auto;
  margin-bottom: auto;
  padding: 40px 0;
}

.sheet-title { container-type: inline-size; }

.sheet-title h1 {
  font-size: min(var(--step-display), 19.5cqi);
  margin: 0 0 40px;
}

.sheet-title .lead { margin-bottom: 36px; }

.sheet-more {
  padding-top: var(--section);
  padding-bottom: 32px;
}

.sheet-more h2 {
  font-size: var(--step-head);
  margin-bottom: 40px;
}

.doing {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 40px;
}
.doing h3 {
  font-size: var(--step-lead);
  line-height: 1.25;
  margin-bottom: 10px;
}
.doing p { max-width: 46ch; margin: 0; }

.photo {
  position: sticky;
  top: var(--gutter);
  height: calc(100svh - 2 * var(--gutter));
  min-height: 420px;
  overflow: hidden;
  background: var(--surface-2);
}

.photo-set {
  position: absolute;
  inset: 0 0 56px 0;
  margin: 0;
}

.photo-set img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.6s ease;
}
.photo-set img.is-current { opacity: 1; }

/* The pictures that only the crossfade will show stay out of layout, and
   so are never fetched, until script.js has the page loaded and lets them in. */
.photo-set img[loading="lazy"]:not(.is-ready) { display: none; }

.photo-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  background: var(--surface);
  font-size: var(--step-small);
}
.photo-bar p { margin: 0; }

.photo-toggle {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.photo-toggle:hover { border-color: var(--accent); color: var(--accent); }
.photo-toggle[hidden] { display: none; }

/* ---------- work: big names beside a fixed preview ---------- */

.work {
  padding-top: var(--section);
  padding-bottom: var(--section);
}

.work-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 48px;
}
.work-head h2 { font-size: var(--step-lead); }

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.names {
  margin: 0;
  padding: 0;
  list-style: none;
}

.names a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 13rem;
  align-items: baseline;
  column-gap: 20px;
  padding: 10px 0;
  text-decoration: none;
  color: var(--muted);
  transition: color 200ms var(--ease);
}

.names .name {
  font-size: var(--step-head);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
}

.names .what {
  text-align: right;
  font-size: var(--step-small);
  color: var(--muted);
}

.names .is-active a,
.names a:hover,
.names a:focus-visible { color: var(--ink); }
.names .is-active .what { color: var(--ink); }

.names figure { display: none; }

.preview {
  position: sticky;
  top: 15vh;
  margin: 0;
}

.preview-frame {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
}

.preview-frame svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 200ms ease;
}
.preview-frame svg.is-current { opacity: 1; }

.preview figcaption {
  margin-top: 16px;
  font-size: var(--step-small);
  color: var(--muted);
  min-height: 3.2em;
}

/* Diagram drawing language: filled blocks in the palette, labels in the text face. */
.dg-ground { fill: var(--surface); }
.dg-a { fill: var(--surface-2); }
.dg-b { fill: var(--surface-3); }
.dg-c { fill: var(--accent); }
.dg-ink { fill: var(--ink); }
.dg text {
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 600;
  fill: var(--ink);
}
.dg .on-c { fill: var(--accent-ink); }
.dg .big {
  font-family: var(--font-display);
  font-size: 64px;
  font-weight: 800;
  fill: var(--accent);
}

/* ---------- letter ---------- */

.letter {
  padding: var(--section) var(--pad);
}
.letter-body {
  max-width: 34rem;
  margin: 0 auto;
}
.letter h2 {
  font-size: var(--step-head);
  margin-bottom: 40px;
}
.letter p { margin-bottom: 1.4em; }
.letter mark {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0 0.15em;
}
.sign {
  font-style: italic;
  font-size: var(--step-lead);
  margin: 48px 0 4px;
}
.sign + p { color: var(--muted); font-size: var(--step-small); }

/* ---------- toolkit: plain names in columns ---------- */

.toolkit {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 9fr);
  gap: clamp(24px, 4vw, 64px);
  padding-top: var(--section);
  padding-bottom: var(--section);
  background: var(--surface);
}
.toolkit h2 { font-size: var(--step-head); line-height: 1; }
.toolkit h2 + p { margin-top: 24px; max-width: 24ch; color: var(--muted); }

.columns {
  columns: 4 11rem;
  column-gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.columns > li {
  break-inside: avoid;
  margin-bottom: 1.5em;
}
.columns ul { margin: 0; padding: 0; list-style: none; }
.columns li li,
.columns .kind {
  font-size: var(--step-lead);
  line-height: 1.5;
}
.columns .kind { color: var(--muted); margin: 0; font-weight: 400; }

/* ---------- contact ---------- */

.contact {
  padding-top: var(--section);
  padding-bottom: var(--section);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: end;
}
.contact h2 {
  font-size: var(--step-head);
  line-height: 1;
  margin-bottom: 32px;
}
.contact .prompt { font-size: var(--step-lead); line-height: 1.35; max-width: 30ch; }
.contact .button { margin-top: 16px; }

.ways {
  margin: 0;
  display: grid;
  gap: 24px;
}
.ways div { display: grid; gap: 2px; }
.ways dt { color: var(--muted); }
.ways dd { margin: 0; font-size: var(--step-lead); overflow-wrap: anywhere; }

/* ---------- footer: the name across the last photograph ---------- */

.footer {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background: #0d1110;
  color: var(--ink);
}
.footer > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.5);
}
.footer-top,
.footer-bottom {
  position: relative;
  padding: 32px var(--pad);
}
.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
}
.footer-top ul { margin: 0; padding: 0; list-style: none; }
.footer-top li { margin-bottom: 4px; }
.footer-top a { display: inline-block; padding: 6px 0; }
.footer .wordmark-big {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  /* "Taly.dev" sets about 4.6em wide: fit it between the page margins. */
  font-size: calc((100vw - 2 * var(--pad) - 16px) / 4.8);
  line-height: 0.8;
  letter-spacing: -0.01em;
  margin: 0 0 24px;
}
.footer .legal { font-size: var(--step-small); margin: 0; max-width: 60ch; }

.band {
  margin: var(--section) 0 0;
}
.band img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- inner-page title ---------- */

.page-title {
  padding-top: clamp(64px, 10vw, 160px);
  padding-bottom: clamp(48px, 6vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: end;
}
.page-title h1 { font-size: var(--step-display); }
.page-title .lead { margin: 0; }

/* ---------- work page: one system per stage ---------- */

.systems { margin: 0; padding: 0 0 var(--section); list-style: none; }

.system {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 5vw, 80px);
  align-items: start;
  padding-top: clamp(64px, 8vw, 128px);
}

.system-figure {
  position: sticky;
  top: 24px;
  margin: 0;
  aspect-ratio: 4 / 5;
  background: var(--surface);
}
.system-figure svg { width: 100%; height: 100%; }

.system h2 {
  font-size: var(--step-head);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.system .status { color: var(--accent); margin-bottom: 28px; }
.system-body p { max-width: 46ch; }

.facts {
  margin: 32px 0 0;
  display: grid;
  gap: 20px;
}
.facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 16px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts a { display: inline-block; }

/* ---------- about page ---------- */

.timeline { margin: 0; padding: 0; list-style: none; }
.timeline > li {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(16px, 4vw, 64px);
  padding: 40px 0;
}
.timeline > li:nth-child(even) {
  background: var(--surface);
  padding-left: var(--pad);
  padding-right: var(--pad);
  margin: 0 calc(-1 * var(--pad));
}
.timeline h3 { font-size: var(--step-lead); line-height: 1.25; }
.timeline .when { color: var(--muted); margin: 6px 0 0; }
.timeline ul { margin: 0; padding-left: 1.1em; }
.timeline ul li { margin: 0 0 0.6em; }

.section-head {
  font-size: var(--step-head);
  line-height: 1;
  margin-bottom: 48px;
}

.block {
  padding-top: var(--section);
}

/* ---------- case studies and the design-system page ----------
   Same header, footer, type and colours as the other pages. A study is a
   title, then one band per section: the heading on the left, the reading
   on the right. */

.button-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--edge);
}
.button-ghost:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--accent); }
.button[disabled] { opacity: 0.45; pointer-events: none; }
.button[aria-busy="true"] { position: relative; color: transparent; pointer-events: none; }
.button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid var(--accent-ink);
  border-top-color: transparent;
  animation: button-spin 0.7s linear infinite;
}
@keyframes button-spin { to { transform: rotate(360deg); } }

.case-hero {
  padding-top: clamp(64px, 10vw, 160px);
  padding-bottom: clamp(48px, 6vw, 96px);
}
.eyebrow {
  margin: 0 0 24px;
  color: var(--accent);
  font-size: var(--step-small);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.case-hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  line-height: 0.92;
  font-size: var(--step-head);
  max-width: 18ch;
  margin: 0 0 32px;
}
.case-hero .lead { max-width: 46ch; margin: 0 0 36px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.case-section {
  padding-top: clamp(40px, 5vw, 80px);
  padding-bottom: clamp(40px, 5vw, 80px);
  border-top: 1px solid var(--surface-2);
}
.case-inner {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  column-gap: clamp(24px, 4vw, 64px);
}
.case-inner > * { grid-column: 2; min-width: 0; }
.case-inner > h2 {
  grid-column: 1;
  grid-row: 1;
  font-size: var(--step-lead);
  line-height: 1.2;
  margin-bottom: 24px;
}

.case-block {
  max-width: 62ch;
  margin: 0 0 1.25em;
  color: var(--ink);
}
.case-block:last-child { margin-bottom: 0; }
.case-note { font-size: var(--step-small); color: var(--muted); }

code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.86em;
  padding: 0.1em 0.35em;
  background: var(--surface-2);
  overflow-wrap: anywhere;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--gutter);
  margin: 0 0 1.75rem;
}
.stat-box {
  padding: 20px;
  background: var(--surface);
}
.stat-box .figure {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--step-lead);
  line-height: 1.1;
  text-transform: uppercase;
  color: var(--accent);
  overflow-wrap: anywhere;
}
.stat-box .label {
  display: block;
  margin-top: 6px;
  font-size: var(--step-small);
  color: var(--muted);
}

.callout {
  max-width: 62ch;
  margin: 0 0 1.75rem;
  padding: 20px 24px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
}
.callout p { margin: 0 0 0.6em; }
.callout p:last-child { margin-bottom: 0; }
.callout-label {
  display: block;
  margin-bottom: 8px;
  color: var(--accent);
  font-size: var(--step-small);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-cta {
  padding-top: clamp(64px, 8vw, 128px);
  padding-bottom: var(--section);
  border-top: 1px solid var(--surface-2);
}
.case-cta h2 { font-size: var(--step-head); line-height: 1; margin-bottom: 24px; max-width: 20ch; }
.case-cta p { max-width: 46ch; color: var(--muted); }

/* The design-system page documents the older token names; they are kept
   here, mapped onto this palette, so its samples still resolve. */
.ds-page {
  --bg-raised: var(--surface);
  --bg-inset: var(--surface-2);
  --text: var(--ink);
  --text-muted: var(--muted);
  --border: var(--surface-2);
  --border-interactive: var(--surface-3);
  --error: #e5897c;
  --status-live-bg: #1f3a33;
  --status-live-text: var(--accent);
  --status-active-bg: #263049;
  --status-active-text: #aebcf2;
  --status-shipped-bg: #3a3220;
  --status-shipped-text: #e0c27a;
  --font-mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --text-display: var(--step-head);
  --text-h1: clamp(2rem, 4.5vw, 3rem);
  --text-h2: clamp(1.5rem, 3vw, 2rem);
  --text-h3: 1.1rem;
  --text-h4: 0.95rem;
  --text-body-lg: 1.15rem;
  --text-body: 1rem;
  --text-body-sm: 0.9rem;
  --text-caption: 0.8rem;
  --text-mono-label: 0.85rem;
}
.ds-page .case-inner { display: block; }
.ds-idea { padding: 20px 24px; background: var(--surface); border-left: 4px solid var(--accent); max-width: 62ch; }
.ds-block { margin: 0 0 3rem; }
.ds-block:last-child { margin-bottom: 0; }
.ds-block h2,
.ds-block h3 { font-size: var(--step-lead); line-height: 1.2; margin: 0 0 0.5rem; }
.ds-block-note { color: var(--muted); max-width: 62ch; margin: 0 0 1.5rem; font-size: var(--step-small); }
.ds-type-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--surface-2);
}
.ds-type-row:last-child { border-bottom: 0; }
.ds-type-sample { flex: 1 1 20rem; margin: 0; }
.ds-type-meta { font-family: var(--font-mono); font-size: var(--step-small); color: var(--muted); overflow-wrap: anywhere; }
.ds-swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--gutter); margin-top: 24px; }
.ds-swatch { background: var(--surface); }
.ds-swatch-color { height: 3.5rem; }
.ds-swatch-body { padding: 12px 16px; font-size: var(--step-small); }
.ds-swatch-role { display: block; font-weight: 600; }
.ds-swatch-meta { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); color: var(--muted); margin-top: 6px; }
.ds-pass { color: var(--accent); font-weight: 600; }
.ds-space-row { display: flex; align-items: center; gap: 16px; padding: 8px 0; }
.ds-space-bar { display: block; height: 0.75rem; background: var(--accent); }
.ds-space-label { flex: 0 0 11rem; font-family: var(--font-mono); font-size: var(--step-small); color: var(--muted); }
.ds-table-wrap { overflow-x: auto; }
.ds-table { width: 100%; border-collapse: collapse; font-size: var(--step-small); }
.ds-table th,
.ds-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
.ds-table th { color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.ds-table td:not(:first-child) { font-family: var(--font-mono); }
.ds-state-grid { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.ds-motion-demo { padding: 24px; border: 1px dashed var(--edge); color: var(--muted); font-size: var(--step-small); }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-weight: 600; font-size: var(--step-small); }
.form-field input,
.form-field textarea { font: inherit; width: 100%; padding: 12px; background: var(--surface); color: var(--ink); border: 1px solid var(--edge); border-radius: 0; }
.form-field textarea { display: block; min-height: 10rem; resize: vertical; }
.contact-form { display: grid; gap: 24px; }
.contact-form .button { justify-self: start; white-space: nowrap; border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.form-note { margin: 0; color: var(--muted); font-size: var(--step-small); }
.form-status { margin: 0; }
.form-status:empty { display: none; }
/* Honeypot: off-screen rather than display:none, so bots still fill it in. */
.form-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skeleton { display: block; background: var(--surface-2); color: transparent; }
.project-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); gap: var(--gutter); }
.project-card { display: flex; flex-direction: column; gap: 12px; padding: 24px; background: var(--surface); }
.project-card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.project-card h3 { margin: 0; font-size: var(--step-lead); }
.project-card p { margin: 0; color: var(--muted); font-size: var(--step-small); }
.project-status { padding: 3px 10px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.status-active { background: var(--status-active-bg); color: var(--status-active-text); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag-list li { padding: 2px 10px; font-size: 0.75rem; background: var(--surface-2); color: var(--muted); }
.project-link { margin-top: auto; font-weight: 600; font-size: var(--step-small); }

/* ---------- entrances (armed only by script.js; see [data-enter]) ---------- */

.js-enter [data-enter] > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
}
.js-enter [data-enter] > *:nth-child(2) { transition-delay: 80ms; }
.js-enter [data-enter] > *:nth-child(3) { transition-delay: 160ms; }
.js-enter [data-enter] > *:nth-child(4) { transition-delay: 240ms; }
.js-enter [data-enter] > *:nth-child(n+5) { transition-delay: 300ms; }
.js-enter [data-enter].is-in > * { opacity: 1; transform: none; }

/* ---------- narrower screens ---------- */

@media (max-width: 60rem) {
  .work-grid { grid-template-columns: 1fr; }
  .preview { display: none; }
  .names li + li { margin-top: 40px; }
  .names figure {
    display: block;
    margin: 0 0 16px;
    background: var(--surface);
  }
  .names figure svg { width: 100%; height: auto; max-height: 360px; }
  .names a { color: var(--ink); grid-template-columns: 1fr; row-gap: 6px; }
  .names .what { text-align: left; }
  .names .what { color: var(--muted); }

  .toolkit,
  .page-title,
  .system { grid-template-columns: 1fr; }
  .system-figure { position: static; max-width: 30rem; }
  .columns { columns: 2; column-gap: 20px; }
  .columns li li,
  .columns .kind { font-size: var(--step-body); }
}

@media (max-width: 48rem) {
  .stage { grid-template-columns: 1fr; }
  /* Name and menu first, then the photograph, then the rest of the sheet. */
  .sheet-col { display: contents; }
  .sheet-first { order: 0; }
  .photo {
    order: 1;
    height: 56svh;
    min-height: 300px;
  }
  .sheet-more { order: 2; }
  /* Two sheets in a row: close the grid gap so the sticky photo does not show through. */
  .sheet-more + .sheet-more { margin-top: calc(-1 * var(--gutter)); }
  .sheet { position: relative; z-index: 1; }
  .sheet-first { min-height: 0; }
  .case-inner { display: block; }
  .case-inner > h2 { margin-bottom: 20px; }
  .sheet-title { padding: 32px 0 8px; }
  .sheet-title h1 { margin-bottom: 28px; }
  .bar { flex-wrap: wrap; }
  .timeline > li { grid-template-columns: 1fr; }
  .facts div { grid-template-columns: 1fr; gap: 2px; }
  .footer { min-height: 88svh; }
}

@media (max-width: 40rem) {
  .contact { grid-template-columns: 1fr; }
}

@media (max-width: 24rem) {
  .nav { gap: 14px; }
  .wordmark { font-size: 1.25rem; }
  .button { padding: 0 20px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
  .js-enter [data-enter] > * { opacity: 1; transform: none; }
}

/* ---------- print: show every block, whatever was scrolled into view ---------- */
@media print {
  .js-enter [data-enter] > * { opacity: 1 !important; transform: none !important; transition: none !important; }
}
