/* Design A — built from the Sketch artboard "A" (1440 px wide).
   Fluid values interpolate between a 375 px phone and the 1440 px artboard,
   so at 1440 px every size matches the Sketch file exactly. */

:root {
  --bg: #f4f7fa;
  --ink: #222222;
  --muted: #666666;
  --accent: #c6421f;
  --tile: #eaeff5;
  --tile-hover: #edf3fb;
  --stage: #25272d;                                /* media panels: the opposite of the page */
  --stage-alt: #30333a;                            /* for white artwork that needs a dark panel */
  --line: rgba(34, 34, 34, .14);
  --link-line: rgba(34, 34, 34, .35);
  --on-stage: #f4f7fa;                             /* text and lines drawn on a media panel */
  --on-stage-muted: #a3a8b2;
  --on-stage-line: rgba(244, 247, 250, .24);
  --on-stage-accent: #f27d58;
  --on-stage-accent-ink: #222222;

  --radius: 10px;
  --gap: 10px;
  --maxw: 1280px;
  --gutter: clamp(16px, 5.556vw, 80px);          /* 80 px at 1440 */

  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Dark theme: <body class="theme-dark">. Same components, inverted palette.
   Page = the light theme's dark panel colour; media panels flip to light.
   Accent is lifted so it keeps AA contrast on the dark background. */
.theme-dark {
  --bg: #25272d;
  --ink: #f4f7fa;
  --muted: #a3a8b2;
  --accent: #f27d58;
  --tile: #30333a;
  --tile-hover: #383b43;
  --stage: #eaeff5;
  --stage-alt: #30333a;
  --line: rgba(244, 247, 250, .16);
  --link-line: rgba(244, 247, 250, .4);
  --on-stage: #222222;
  --on-stage-muted: #5f626b;
  --on-stage-line: rgba(34, 34, 34, .2);
  --on-stage-accent: #c6421f;
  --on-stage-accent-ink: #ffffff;
  color-scheme: dark;
}

/* Dark theme for pages whose media is itself dark (car UI): panels stay dark,
   one step below the page, instead of flipping to light. <body class="theme-dark stage-dark"> */
.theme-dark.stage-dark {
  --stage: #1b1d21;
  --stage-alt: #30333a;
  --on-stage: #f4f7fa;
  --on-stage-muted: #a3a8b2;
  --on-stage-line: rgba(244, 247, 250, .2);
  --on-stage-accent: #f27d58;
  --on-stage-accent-ink: #25272d;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

.wrap {
  width: min(100% - 2 * var(--gutter), var(--maxw));
  margin-inline: auto;
}

/* ---------- Top navigation ---------- */

.site-header { padding-top: clamp(20px, 13px + 1.88vw, 40px); }

.domain-nav {
  display: flex;
  flex-wrap: wrap;                                 /* five domains: wraps to a second line when tight */
  gap: 16px clamp(20px, 13px + 1.88vw, 40px);
  font-size: clamp(16px, 14.6px + 0.376vw, 20px);
  line-height: 1.2;
}

.domain-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: color .2s ease;
}

.domain-nav .label { font-weight: 500; }

.domain-nav a[aria-current],
.domain-nav a:hover { color: var(--accent); }

/* ---------- Hero ---------- */

.hero {
  padding-top: clamp(88px, 32.4px + 14.84vw, 246px);
  padding-bottom: clamp(64px, 20px + 11.74vw, 189px);
}

.hero__title {
  font-size: clamp(48px, 21.24px + 7.136vw, 124px);  /* 48 → 124 */
  line-height: 0.897;
  font-weight: 600;
  letter-spacing: 0;
  margin-left: -0.026em;                           /* optical alignment, as in Sketch */
}

.hero__lead {
  margin-top: clamp(16px, 12.8px + 0.85vw, 25px);
  font-size: clamp(18px, 14.5px + 0.94vw, 28px);
  line-height: 1.286;                              /* 36 / 28 */
  max-width: 34em;
}

/* ---------- Project cards ---------- */

.work {
  display: grid;
  gap: var(--gap);
}

.card {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg, #25272d);
  color: var(--card-ink, #fff);
  isolation: isolate;                              /* keeps corners clipped during zoom */
}

.card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s cubic-bezier(.2, .7, .2, 1);
}

.card:hover .card__media img { transform: scale(1.025); }

.card__body {
  padding: clamp(16px, 7.55px + 2.254vw, 40px) clamp(20px, 13px + 1.88vw, 40px);
  font-size: clamp(17px, 13.1px + 1.033vw, 28px);
  line-height: 1.18;                               /* 33 / 28 */
}

.card__title { font-size: inherit; font-weight: 700; }
.card__text { margin-top: 4px; }

/* ---------- Explore other domains ---------- */

.explore { margin-top: clamp(48px, 36.7px + 3vw, 80px); }

.explore__title {
  font-size: clamp(22px, 18.5px + 0.94vw, 32px);
  line-height: 1.16;                               /* 37 / 32 */
  font-weight: 600;
  margin-bottom: var(--gap);
}

.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);           /* four domains in a row on wide screens */
  gap: var(--gap);
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  min-height: clamp(128px, 105.8px + 5.92vw, 191px);
  padding: clamp(20px, 13px + 1.88vw, 40px);
  border-radius: var(--radius);
  background: var(--tile);
  font-size: clamp(17px, 14.5px + 0.657vw, 24px);
  line-height: 1.17;                               /* 28 / 24 */
  transition: background-color .2s ease, color .2s ease;
}

.tile:hover { background: var(--tile-hover); }
.tile[aria-current] { color: var(--accent); }

/* ---------- Inner-page hero ---------- */
/* Type scale: 16 · 20 · 24 · 28 · 32 · 64 · 116.
   Home keeps the 124 px display; inner pages use 70 px. */

.hero--inner {
  padding-top: clamp(102.4px, 48.3px + 14.42vw, 256px);     /* ×1.6: 102 → 256 */
  padding-bottom: clamp(32px, 15.1px + 4.507vw, 80px);      /* ÷1.5: 32 → 80 */
}

.hero--inner .hero__title {
  font-size: clamp(40px, 29.44px + 2.817vw, 70px);         /* 40 → 70 */
  line-height: 1.05;
}

.hero--inner .hero__lead { margin-top: clamp(9.3px, 7.47px + 0.5vw, 14.7px); }   /* ÷1.5: 9 → 15 */

/* Home: the domain heading under the main hero sits 150 px higher at 1440
   (256 → 106); scaled the same way down to the 375 px phone (102 → 42). */
.hero--home {
  padding-top: clamp(42.4px, 20px + 5.972vw, 106px);
}

/* ---------- About: portrait ---------- */

.photo {
  margin-block: 0;
  aspect-ratio: var(--ar, 16 / 9);
  border-radius: var(--radius);
  overflow: hidden;
  background: #1c2a36;                             /* close to the photo's backdrop while loading */
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;                        /* subject sits slightly right of centre */
}
.photo video,
.photo iframe { display: block; width: 100%; height: 100%; border: 0; object-fit: cover; }

/* ---------- About: statement ---------- */
/* Large type on the right half of the 4-column grid (the same axis as the footer links). */

.statement {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  padding-top: clamp(56px, 33.5px + 6vw, 120px);
  padding-bottom: clamp(48px, 36.7px + 3vw, 80px);
}

.statement__text {
  grid-column: 3 / 5;
  display: grid;
  gap: 1em;
  font-size: clamp(18px, 14.5px + 0.94vw, 28px);
  line-height: 1.286;
}

/* ---------- About: information panels ---------- */
/* Panels use the tile colour; label on the left half, content on the right half.
   The half split lands on the page grid's 3rd column whatever the padding. */

.panels {
  display: grid;
  gap: var(--gap);
}

.panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  align-items: start;
  --pp: clamp(20px, 13px + 1.88vw, 40px);
  padding: var(--pp);
  border-radius: var(--radius);
  background: var(--tile);
  font-size: clamp(17px, 14.5px + 0.657vw, 24px);
  line-height: 1.33;
}

.panel__label {
  grid-column: 1 / 3;
  font-size: inherit;
  line-height: inherit;
  font-weight: 400;
}

.panel__content { grid-column: 3 / 5; }

.list li {
  padding-block: .5em;
  border-top: 1px solid var(--line);
}
.list li:first-child { padding-top: 0; border-top: 0; }
.list li:last-child { padding-bottom: 0; }

/* Panel text keeps the panel's size; the case-study .prose below would otherwise set 20 px */
.panel__content.prose { display: grid; gap: .8em; font-size: inherit; line-height: inherit; }

.entries { display: grid; gap: clamp(18px, 15.5px + 0.66vw, 25px); }

.entry__label {
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
}

.link {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
  text-decoration-color: var(--link-line);
  overflow-wrap: anywhere;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.link:hover { color: var(--accent); text-decoration-color: currentColor; }

.panel--dark { background: #25272d; color: #ffffff; }
.panel--dark .entry__label { color: rgba(255, 255, 255, .62); }
.panel--dark .link { text-decoration-color: rgba(255, 255, 255, .4); }
.panel--dark .link:hover { color: #ffffff; text-decoration-color: #ffffff; }

/* ---------- Case study ---------- */
/* Reading text 20 px, sub-heads 24 px bold, chapter titles 32 px, outcome 28 px — all from the existing scale. */

/* Project facts: tiles under the cover, same size, padding and type as the domain tiles */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin-top: var(--gap);
  margin-bottom: 0;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: clamp(128px, 105.8px + 5.92vw, 191px);
  padding: clamp(20px, 13px + 1.88vw, 40px);
  border-radius: var(--radius);
  background: var(--tile);
  font-size: clamp(17px, 15.94px + 0.282vw, 20px);   /* body text step: 17 → 20 */
  line-height: 1.25;
}
.fact dt { color: var(--muted); }
.fact dd { margin: 0; }

/* Cards in the style of .facts inside a chapter: an icon on top, a line of text at the bottom */
.gestures { grid-column: 1 / -1; margin: 0; padding: 0; list-style: none; }
.gesture { justify-content: space-between; gap: clamp(20px, 13px + 1.88vw, 40px); }
.gesture__icon { display: block; width: 155px; max-width: 100%; height: auto; aspect-ratio: 1; }   /* 310 px artwork, sharp on 2× screens */

.chapter {
  --row-gap: clamp(28px, 19.5px + 2.25vw, 52px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  row-gap: var(--row-gap);
  align-items: start;
  padding-top: clamp(56px, 33.5px + 6vw, 120px);
}

.chapter__head {
  grid-column: 1 / 3;
  grid-row: 1;
  font-size: clamp(22px, 18.5px + 0.94vw, 32px);
  line-height: 1.16;
  font-weight: 600;
}
.chapter__num { display: block; margin-bottom: 4px; font-weight: 400; }   /* number regular, title 600 */

.chapter__body { grid-column: 3 / 5; }            /* the right-half reading axis, as on About */
.chapter__head + .chapter__body { grid-row: 1; }

.prose {
  display: grid;
  gap: .9em;
  font-size: clamp(17px, 15.94px + 0.282vw, 20px);
  line-height: 1.5;
}
.prose h3 {
  margin-top: .9em;
  font-size: clamp(19px, 17.24px + 0.47vw, 24px);
  line-height: 1.25;
  font-weight: 700;
}
.prose--lead {
  font-size: clamp(18px, 14.5px + 0.94vw, 28px);
  line-height: 1.286;
}

.caption {
  grid-column: 3 / 5;
  margin-top: calc(14px - var(--row-gap));
  font-size: 16px;
  line-height: 1.45;
  color: var(--muted);
}

/* Two info cards side by side (tile colour) */
.duo {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap);
}
.duo__card {
  display: grid;
  align-content: start;
  gap: .9em;
  padding: clamp(20px, 13px + 1.88vw, 40px);
  border-radius: var(--radius);
  background: var(--tile);
  font-size: clamp(17px, 15.94px + 0.282vw, 20px);
  line-height: 1.5;
}
.duo__card h3 {
  font-size: clamp(19px, 17.24px + 0.47vw, 24px);
  line-height: 1.25;
  font-weight: 700;
}

/* Media stage: dark panel (colour of the first project card) for UI images and video */
.stage {
  grid-column: 1 / -1;
  display: grid;
  justify-items: center;
  gap: clamp(12px, 8.5px + 0.94vw, 22px);
  margin: 0;
  padding: clamp(16px, 7.55px + 2.254vw, 40px);
  border-radius: var(--radius);
  background: var(--stage);
}
.stage--alt { background: var(--stage-alt); }
.stage--blend { background: transparent; }        /* artwork already drawn on the page colour: keep the panel's spacing, drop its fill */
.stage.wrap { margin-inline: auto; }               /* a stage used as a page-width cover */
.stage > * { width: 100%; max-width: var(--mw, none); }
.stage img,
.stage video { display: block; width: 100%; height: auto; }
.stage video { aspect-ratio: 1712 / 1086; border-radius: 6px; background: #111; }
/* Media edge to edge: no inner padding, corners clipped by the stage radius */
.stage--flush { padding: 0; overflow: hidden; }
.stage--flush video { aspect-ratio: var(--ar, 16 / 10); border-radius: 0; }

.stage--collapsed {
  position: relative;
  max-height: clamp(420px, 300px + 32vw, 760px);
  overflow: hidden;
  align-content: start;
}
.stage--collapsed::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 50%;
  background: linear-gradient(to bottom, transparent, var(--stage) 80%);
  pointer-events: none;
}
.stage__more {
  position: absolute;
  left: 50%;
  bottom: clamp(20px, 13px + 1.88vw, 40px);
  z-index: 1;
  width: auto;
  transform: translateX(-50%);
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .2s ease;
}
.stage__more:hover { background: rgba(255, 255, 255, .2); }

.photo--in-chapter { grid-column: 1 / -1; width: 100%; margin: 0; }
.photo--narrow { justify-self: center; max-width: var(--mw); }
.photo--light { background: transparent; }          /* light artwork: no dark fringe at the rounded corners */
/* Full page width: breaks out of the column (body clips the overflow), square corners */
.photo--bleed { width: 100vw; max-width: none; margin-inline: calc(50% - 50vw); border-radius: 0; }

/* Image shown as is, without a panel: at most half its pixel width (sharp on 2× screens),
   never wider than the column; narrower screens scale it down proportionally. */
.plain { grid-column: 1 / -1; justify-self: center; width: 100%; max-width: var(--max, none); margin: 0; }
.plain.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }   /* page cover: column width, natural proportions */
/* Wider than the column: up to --max, never closer to the window edge than the gutter, centred on the column */
.plain--wide {
  --w: min(var(--max), 100vw - 2 * var(--gutter));
  justify-self: start;
  width: var(--w);
  max-width: none;
  margin-inline: calc((100% - var(--w)) / 2);
}
.plain img,
.plain video { display: block; width: 100%; height: auto; }
.plain video { background: transparent; }          /* video drawn on the page colour blends into the page */
.plain--rounded img { border-radius: var(--radius); }
.plain--stack { display: grid; gap: 10px; }          /* several images in one block, close together */
.plain--grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }   /* images two per row */
@media (max-width: 719px) { .plain--grid { grid-template-columns: 1fr; } }

/* Small sign-off emblem at the end of a case */
.mark { grid-column: 1 / -1; justify-self: center; margin: 0; }
.mark img { display: block; height: auto; }

.appstore { justify-self: start; display: block; margin-top: .4em; transition: opacity .2s ease; }
.appstore img { display: block; width: 160px; height: auto; }
.appstore:hover { opacity: .8; }

/* Other projects: caption bars joined into one rounded block */
.others { padding-top: clamp(56px, 33.5px + 6vw, 120px); }
.strips {
  display: grid;
  border-radius: var(--radius);
  overflow: hidden;
}
.strip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(16px, 7.55px + 2.254vw, 40px) clamp(20px, 13px + 1.88vw, 40px);   /* = card caption */
  background: var(--card-bg);
  color: var(--card-ink);
  font-size: clamp(17px, 13.1px + 1.033vw, 28px);
  line-height: 1.18;
  transition: filter .2s ease;
}
.strip:hover { filter: brightness(1.07); }
.strip:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }
.strip__title { font-weight: 700; }

/* ---------- Placeholders and key numbers ---------- */

.stage--placeholder {
  aspect-ratio: 16 / 9;
  place-items: center;
  outline: 1px dashed var(--on-stage-line);
  outline-offset: calc(-1 * clamp(12px, 8px + 1vw, 20px));
}
.stage--placeholder p {
  max-width: 36em;
  padding: 0 clamp(16px, 7.5px + 2.25vw, 40px);
  text-align: center;
  font-size: clamp(15px, 13.6px + 0.376vw, 19px);
  line-height: 1.45;
  color: var(--on-stage-muted);
}
.stage--placeholder p span {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--on-stage-accent);
}

.numbers {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.fact__num {
  display: block;
  margin-bottom: clamp(8px, 5.2px + 0.75vw, 16px);
  font-size: clamp(36px, 26.1px + 2.63vw, 64px);
  line-height: 1;
  font-weight: 700;
}

/* ---------- Diagrams: real HTML on a media panel, reflow on small screens ---------- */

.diagram {
  --d-gap: clamp(28px, 22px + 1.6vw, 44px);
  width: 100%;
  padding: clamp(0px, -4px + 1.1vw, 12px) 0;
  font-size: clamp(14px, 13.3px + 0.188vw, 16px);
  line-height: 1.35;
  color: var(--on-stage);
}
.diagram__title {
  margin-bottom: clamp(18px, 13px + 1.3vw, 32px);
  font-size: clamp(16px, 14.6px + 0.376vw, 20px);
  font-weight: 500;
}
.diagram strong { display: block; font-weight: 700; color: var(--on-stage); }

.chip {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--on-stage-line);
  border-radius: 999px;
  font-size: .85em;
  font-weight: 500;
  color: var(--on-stage);
}
.chip--primary { border-color: var(--on-stage-accent); background: var(--on-stage-accent); color: var(--on-stage-accent-ink); }
.chip--quiet { border-style: dashed; color: var(--on-stage-muted); }

/* Run-and-compare loop */
.loop {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--d-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}
.loop__step {
  position: relative;
  padding: clamp(14px, 11px + 0.85vw, 22px);
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius);
}
.loop__step strong { margin-bottom: 6px; }
.loop__step span { display: block; color: var(--on-stage-muted); }
.loop__step--accent { border-color: var(--on-stage-accent); background: color-mix(in srgb, var(--on-stage-accent) 14%, transparent); }
.loop__step--accent span { color: var(--on-stage); }
.loop__step:not(:last-child)::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: calc(var(--d-gap) / -2);
  transform: translate(50%, -50%);
  font-size: 20px;
  color: var(--on-stage-muted);
}
.loop__back {                                      /* U-shaped return line under the row */
  position: relative;
  height: 34px;
  margin: 14px 12.5% 0;
  border: 1px solid var(--on-stage-line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: .9em;
  color: transparent;
}
.loop__back::before {
  content: "▲";
  position: absolute;
  top: -12px;
  left: -6px;
  font-size: 10px;
  color: var(--on-stage-muted);
}
.loop__back::after {
  content: "↺  Run again with the new rule";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 50%);
  padding: 0 14px;
  background: var(--stage);
  white-space: nowrap;
  color: var(--on-stage-muted);
}

/* Knowledge map */
.kmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--d-gap) var(--gap);
}
.kmap__src {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: clamp(14px, 11px + 0.85vw, 22px);
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius);
}
.kmap__note { display: block; font-size: .9em; color: var(--on-stage-muted); }
.kmap__src--top::after,
.kmap__src--bottom::before {
  content: "";
  position: absolute;
  left: 50%;
  height: var(--d-gap);
  border-left: 1px dashed var(--on-stage-line);
}
.kmap__src--top::after { top: 100%; }
.kmap__src--bottom::before { bottom: 100%; }
.kmap__agent {
  grid-column: 1 / -1;
  padding: clamp(14px, 11px + 0.85vw, 22px);
  border: 1px solid var(--on-stage-accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--on-stage-accent) 14%, transparent);
  text-align: center;
}
.kmap__agent span { display: block; margin-top: 4px; color: var(--on-stage); }

/* Context layers */
.layers {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  grid-template-areas: "stack sources" "deliv deliv";
  gap: var(--d-gap);
}
.layers__stack { grid-area: stack; display: grid; gap: var(--gap); margin: 0; padding: 0; list-style: none; }
.layer {
  padding: clamp(14px, 11px + 0.85vw, 20px);
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius);
}
.layer strong { margin-bottom: 4px; }
.layer span { display: block; color: var(--on-stage-muted); }
.layer--main { border-color: var(--on-stage-accent); background: color-mix(in srgb, var(--on-stage-accent) 14%, transparent); }
.layer--main span { color: var(--on-stage); }
.layers__sources {
  grid-area: sources;
  align-self: end;
  position: relative;
  display: grid;
  gap: var(--gap);
  padding: clamp(14px, 11px + 0.85vw, 20px);
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius);
}
.layers__sources::before {                         /* arrow to the feature spec */
  content: "←";
  position: absolute;
  bottom: 44px;
  left: calc(var(--d-gap) * -1);
  width: var(--d-gap);
  text-align: center;
  font-size: 20px;
  color: var(--on-stage-muted);
}
.layers__label { font-weight: 700; }
.layers__source { padding: 10px 14px; border: 1px solid var(--on-stage-line); border-radius: 8px; }
.layers__source span,
.layers__deliverable span { display: block; color: var(--on-stage-muted); }
.layers__note { font-size: .9em; color: var(--on-stage-muted); }
.layers__deliverable {
  grid-area: deliv;
  position: relative;
  padding: clamp(14px, 11px + 0.85vw, 20px);
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius);
}
.layers__deliverable::before {
  content: "↓";
  position: absolute;
  bottom: 100%;
  left: 31%;
  height: var(--d-gap);
  line-height: var(--d-gap);
  font-size: 20px;
  color: var(--on-stage-muted);
}

/* ---------- Footer ---------- */

.site-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: var(--gap);
  margin-top: clamp(48px, 36.7px + 3vw, 80px);
  padding-bottom: clamp(24px, 18.4px + 1.5vw, 40px);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
}

.copyright { grid-column: 1 / 3; }

.social {
  grid-column: 3 / 5;                              /* starts on the 3rd column, as in Sketch */
  display: flex;
  flex-wrap: wrap;
  gap: 8px 30px;
}

.social a { transition: color .2s ease; }
.social a:hover { color: var(--ink); }

/* ---------- Tablet ---------- */

@media (max-width: 1279px) {
  .tiles { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 959px) {
  .facts,
  .numbers { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1023px) {
  .statement__text { grid-column: 2 / 5; }
  /* label column ends exactly where the page grid's 2nd column starts */
  .panel { grid-template-columns: calc((100% + 2 * var(--pp) - 3 * var(--gap)) / 4 - var(--pp)) 1fr; }
  .panel__label { grid-column: 1 / 2; }
  .panel__content { grid-column: 2 / 3; }

  .chapter__head { grid-column: 1 / -1; }
  .chapter__head + .chapter__body { grid-row: auto; }
  .chapter__body,
  .caption { grid-column: 2 / 5; }

  .site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px 24px;
  }
  .social { gap: 8px 24px; }
}

/* ---------- Phone ---------- */

@media (max-width: 719px) {
  .domain-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 20px;
  }

  .br-wide { display: none; }

  .tiles { grid-template-columns: 1fr 1fr; }
  .tiles li:last-child:nth-child(odd) { grid-column: 1 / -1; }

  .photo:not(.photo--in-chapter) { aspect-ratio: 4 / 3; }   /* covers and portrait: taller crop on phones */

  .statement__text,
  .panel__label,
  .panel__content { grid-column: 1 / -1; }
  .panel__label { margin-bottom: 14px; font-weight: 500; }

  .chapter__body,
  .caption { grid-column: 1 / -1; }
  .duo { grid-template-columns: 1fr; }

  .stage--placeholder { aspect-ratio: 4 / 3; }

  .loop { grid-template-columns: 1fr; }
  .loop__step:not(:last-child)::after { content: "↓"; top: auto; right: 50%; bottom: calc(var(--d-gap) / -2); transform: translate(50%, 50%); }
  .loop__back { height: auto; margin: 14px 0 0; border: 0; text-align: center; color: var(--on-stage-muted); }
  .loop__back::before { content: "↺  "; position: static; font-size: inherit; }
  .loop__back::after { content: none; }
  .loop__back { font-size: .9em; }

  .kmap { grid-template-columns: 1fr; row-gap: var(--gap); }
  .kmap__agent { order: -1; margin-bottom: 8px; }
  .kmap__src--top::after, .kmap__src--bottom::before { content: none; }

  .layers { grid-template-columns: 1fr; grid-template-areas: "stack" "sources" "deliv"; }
  .layers__sources::before { content: "↑"; bottom: 100%; left: 31%; width: auto; height: var(--d-gap); line-height: var(--d-gap); }

  .site-footer {
    flex-direction: column;
    justify-content: flex-start;
  }
  .social { order: -1; gap: 10px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
