/* ==========================================================================
   Portfolio site: main.css
   Three colours. One typeface. Mobile first.

   COLOUR RHYTHM (the one rule that holds the page together)
   Sections alternate grounds, so a change of colour always means a new
   chapter. Never put two sections of the same ground next to each other.

     index.html           hero BONE → 01 RED → 02 BONE → 03 RED → 04 BONE → 05 RED
     case-study pages     article BONE → gallery RED → next BONE → contact RED

   Add a case study? Insert it as a pair (or flip everything after it) so the
   alternation holds.

   STRUCTURE
   Every section opens with the same index bar:  (0x) Section  ·····  meta
   Colour gives the rhythm; the bar tells you where you are.
   ========================================================================== */

@font-face {
  font-family: "Inter Tight";
  src: url("../assets/fonts/inter-tight-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Brand — do not add colours */
  --bone: #EEEBE3;
  --red: #CA0013;   /* SHEZI RED — primary */
  --rule: #C72A09;  /* RULE RED — accent */

  /* Roles on a bone ground (flipped in .section--red) */
  --ground: var(--bone);
  --ink: var(--red);
  --accent: var(--rule);
  --line: var(--rule);

  --font: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Type scale — phone → desktop */
  --fs-display: clamp(2.6rem, 8.3vw, 6.75rem);  /* hero + closing line  42 → 108px */
  --fs-title:   clamp(2.5rem, 8vw, 6rem);       /* section titles       40 → 96px  */
  --fs-stat:    clamp(1.6rem, 2.9vw, 2.125rem); /* stat values          26 → 34px  */
  --fs-lead:    clamp(1.25rem, 2.3vw, 1.5rem);  /* leads                20 → 24px  */
  --fs-body:    clamp(1rem, 1.25vw, 1.0625rem); /* body                 16 → 17px  */
  --fs-label:   0.75rem;                        /* labels               12px       */
  --fs-micro:   0.6875rem;                      /* captions             11px       */

  --gutter: clamp(16px, 5.5vw, 64px);
  --max: 1200px;
  --gap: clamp(16px, 2vw, 24px);                /* grid column gap */
  --section-pad: clamp(56px, 10vw, 136px);

  color-scheme: light;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, p, figure, dl, dd, ul, ol { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

body {
  background: var(--bone);
  color: var(--red);
  font-family: var(--font);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--ink); color: var(--ground); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -100px;
  background: var(--red); color: var(--bone);
  padding: 8px 12px; font-weight: 600; text-decoration: none; z-index: 10;
}
.skip:focus { top: 12px; }

[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.br-wide { display: none; }  /* hero line breaks, tablet and up only */

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  background: var(--ground);
  color: var(--ink);
  padding-block: var(--section-pad);
}

.section--red {
  --ground: var(--red);
  --ink: var(--bone);
  --accent: var(--bone);
  --line: var(--bone);
}

/* ---------- Type roles ---------- */
.display,
.title {
  font-weight: 800;
  line-height: 0.96;
  letter-spacing: -0.025em;
  text-transform: uppercase;
}
.display { font-size: var(--fs-display); }
.title   { font-size: var(--fs-title); text-wrap: balance; }

/* Labels: semibold, caps, tracked (small caps without a faux small-caps font) */
.label {
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.lead {
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.body { max-width: 62ch; text-wrap: pretty; }
.body + .body { margin-top: 1em; }

.micro {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* ---------- Index bar: opens every section ---------- */
.bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: clamp(28px, 5vw, 64px);
}
.bar__index { color: var(--ink); font-weight: 700; }
.bar__index b { font-weight: 800; margin-right: 0.6em; }

/* ---------- Site header (home) ---------- */
.site-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-block: 20px;
}
.site-head a { text-decoration: none; }
.wordmark { font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; font-size: 0.875rem; }
.site-nav { display: flex; gap: clamp(14px, 3vw, 32px); }
.site-nav a:hover, .topbar a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-nav .hide-sm { display: none; }

/* ---------- Top bar (case-study pages) ---------- */
.topbar { padding-block: 20px; }
.topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.topbar a { text-decoration: none; }

/* ---------- Hero ---------- */
.hero { padding-top: 0; }
.hero .display { margin-top: clamp(20px, 3vw, 36px); text-wrap: wrap; }

.hero__intro {
  display: grid;
  gap: 16px;
  margin-top: clamp(20px, 3vw, 32px);
}
/* The editor keeps an empty lead so it can be clicked; it must not take a grid column, or the body shifts right only in the editor. */
.hero__intro > .lead:empty { display: none; }

/* Each number links to the project that proves it */
.stats {
  display: grid;
  margin-top: clamp(40px, 6vw, 80px);
  border-top: 1px solid var(--line);
}
.stat {
  display: grid;
  gap: 6px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.stat__value {
  font-size: var(--fs-stat);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.stat__ref { color: var(--accent); }

/* Brand names as plain ruled text, never logos */
.brands { margin-top: clamp(28px, 4vw, 48px); }
.brands__list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.brands__list li { display: grid; gap: 6px; align-content: end; }
.brands__name { font-weight: 800; text-transform: uppercase; letter-spacing: 0.01em; }
/* Logos are drawn as a silhouette in the section's ink, so every brand sits in the site palette */
.brands__logo {
  display: block;
  width: 132px;
  height: 40px;
  background: currentColor;
  -webkit-mask: left center / contain no-repeat;
  mask: left center / contain no-repeat;
}
.brands__list li { flex: 0 0 auto; }
.nda-note { margin-top: 20px; max-width: 46ch; }

/* Sound toggle on loops where the audio is part of the work */
.media__frame { position: relative; }
.sound {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  border: 1px solid currentColor;
  background: var(--bone);
  color: var(--red);
  cursor: pointer;
}
.sound[aria-pressed="true"] { background: var(--red); color: var(--bone); }
.stat:hover .stat__ref { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Case study ---------- */
.case-meta { margin-top: 14px; }

.case-body {
  display: grid;
  gap: 40px;
  margin-top: clamp(32px, 5vw, 64px);
}

/* Key–value rows: label column + text column, ruled like an exam paper */
.kv { border-top: 1px solid var(--line); }
.kv__row {
  display: grid;
  gap: 4px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.kv dt { color: var(--accent); }
.kv dd { max-width: 58ch; text-wrap: pretty; }

.takeaway {
  margin-top: 28px;
  font-size: var(--fs-lead);
  font-weight: 700;
  line-height: 1.3;
  max-width: 34ch;
  text-wrap: pretty;
}

.story { display: grid; align-content: start; }
.story > .lead + .body { margin-top: 20px; }

.more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid currentColor;
  padding-bottom: 4px;
  justify-self: start;
}
.more__arrow { transition: transform 0.2s ease; }
.more:hover .more__arrow { transform: translateX(4px); }

.disclaimer { margin-top: 32px; }

/* ---------- Media (click-to-play video) ----------
   Every slot works the same way:
     poster  → assets/img/posters/<slot>.webp
     video   → assets/video/<slot>.mp4
   No poster → the slot shows "Video to follow" (the file name on localhost). */
.media { display: grid; gap: 10px; align-content: start; }

.media__frame {
  position: relative;
  aspect-ratio: var(--ar, 16 / 9);
  background: var(--rule);
  overflow: hidden;
}
.section--red .media__frame { background: transparent; box-shadow: inset 0 0 0 1px var(--bone); }

.media__frame::before {
  content: "Video to follow";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 16px 16px 14px;
  text-align: center;
  color: var(--bone);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.is-local .media__frame::before { content: "VIDEO SLOT · " attr(data-slot); }

.media__frame > a,
.media__frame > video,
.media__frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.media__frame img { object-fit: cover; }
.media__frame video { object-fit: contain; background: var(--rule); }

.media__frame img.is-missing { visibility: hidden; }
.media__frame.is-empty .media__icon { display: none; }
.media__frame.is-empty .media__play { cursor: default; }

.media__play { display: block; cursor: pointer; }
.media__icon {
  position: absolute;
  left: 50%; top: 50%;
  width: clamp(56px, 9vw, 76px);
  aspect-ratio: 1;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--bone);
  transition: transform 0.2s ease;
}
.media__icon::after {
  content: "";
  position: absolute;
  left: 54%; top: 50%;
  translate: -50% -50%;
  border-style: solid;
  border-width: 11px 0 11px 18px;
  border-color: transparent transparent transparent var(--red);
}
.media__play:hover .media__icon,
.media__play:focus-visible .media__icon { transform: scale(1.08); }

.media__meta { color: var(--accent); }

/* ---------- Gallery (case-study pages) ---------- */
.gallery { display: grid; gap: clamp(28px, 4vw, 48px); }

/* ---------- Next project (case-study pages) ---------- */
.next {
  display: block;
  text-decoration: none;
}
.next .title { display: block; margin-top: 8px; }
.next:hover .more__arrow { transform: translateX(8px); }

/* ---------- How I work: numbered, ruled rows ---------- */
.principles { border-top: 1px solid var(--line); }
.principle {
  display: grid;
  grid-template-columns: 2.5em 1fr;
  column-gap: var(--gap);
  row-gap: 8px;
  padding-block: 22px;
  border-bottom: 1px solid var(--line);
}
.principle__num { grid-row: span 2; padding-top: 0.3em; }
.principle h3 {
  font-size: var(--fs-lead);
  font-weight: 800;
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: -0.005em;
  text-wrap: balance;
}
.principle p { max-width: 52ch; }

/* ---------- Contact ---------- */
.contact-list {
  display: grid;
  margin-top: clamp(40px, 6vw, 72px);
  border-top: 1px solid var(--line);
}
.contact-list > div {
  display: grid;
  gap: 4px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.contact-list dd {
  font-size: var(--fs-lead);
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.contact-list a { text-decoration: none; border-bottom: 2px solid currentColor; }
.contact-list a:hover { border-bottom-width: 4px; }

.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(48px, 7vw, 96px);
}
.colophon a { text-underline-offset: 3px; }

/* ---------- 404 ---------- */
.notfound { min-height: 100svh; display: grid; align-content: center; }
.notfound .display { margin-block: 24px 32px; }

/* ==========================================================================
   Phablet and up: key–value rows go side by side
   ========================================================================== */
@media (min-width: 560px) {
  .kv__row, .contact-list > div {
    grid-template-columns: 9.5em 1fr;
    column-gap: var(--gap);
    align-items: baseline;
  }
  .site-nav .hide-sm { display: inline; }
}

/* ==========================================================================
   Tablet and up
   ========================================================================== */
@media (min-width: 720px) {
  .br-wide { display: inline; }  /* 3-line hero, same breaks as the Canva site */

  .hero__intro { grid-template-columns: 5fr 6fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
  .hero__intro .body { max-width: 46ch; }

  .stats { grid-template-columns: repeat(3, 1fr); column-gap: var(--gap); border-bottom: 1px solid var(--line); }
  .stat { border-bottom: 0; padding-block: 20px 22px; }

  /* 12-column grid: number | heading | text */
  .principle { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: baseline; padding-block: 28px; }
  .principle__num { grid-column: 1 / span 1; grid-row: auto; padding-top: 0; }
  .principle h3   { grid-column: 2 / span 5; }
  .principle p    { grid-column: 7 / span 6; }
}

/* ==========================================================================
   Desktop
   ========================================================================== */
@media (min-width: 960px) {
  .case-body {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap);
    align-items: start;
  }
  .case-body > .story { grid-column: 1 / span 6; padding-right: clamp(16px, 3vw, 48px); }
  .case-body > .media { grid-column: 7 / span 6; position: sticky; top: 32px; }

  .case-body--wide-media > .story { grid-column: 1 / span 5; }
  .case-body--wide-media > .media { grid-column: 6 / span 7; }

  .gallery--split { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .gallery--split > .media:first-child { grid-column: 1 / -1; }

  .contact-list { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
  .contact-list > div { grid-template-columns: 7em 1fr; }
}

/* ==========================================================================
   Draft 2026-10-06: moving work first
   ========================================================================== */
/* Muted loops: poster shows until the clip is in view (main.js). */
.media__frame > video.loop { object-fit: cover; background: var(--rule); }
.loopfig .media__frame::before { content: none; }
.hero__media { margin-top: clamp(20px, 3vw, 36px); margin-inline: calc(var(--gutter) * -1); }
.hero__media .media__frame { --ar: 16 / 9 !important; }
.hero__media .media__meta { padding-inline: var(--gutter); }
@media (min-width: 720px) { .hero__media { margin-inline: 0; } .hero__media .media__meta { padding-inline: 0; } }
@media (min-width: 960px) {
  .hero__top--media { display: grid; grid-template-columns: 5fr 7fr; column-gap: var(--gap); align-items: end; }
  .hero__top--media .display { font-size: clamp(2.6rem, 4.6vw, 4.5rem); }
  .hero__top--media .br-wide { display: none; }
}

/* Doors (1 Nov): one still per project under the headline, so no single job is the first impression.
   Tags say what kind of job it is. On a mouse, hover plays the loop from the start and eases the frame in.
   Phone: two by two (an odd first door runs full width). Desktop: one row. */
.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px var(--gap); margin-top: clamp(28px, 4vw, 48px); }
.doors > li:first-child:nth-last-child(odd) { grid-column: 1 / -1; }
.door { display: grid; gap: 3px; align-content: start; text-decoration: none; }
.door__frame { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--rule); margin-bottom: 8px; }
.doors > li:first-child:nth-last-child(odd) .door__frame { aspect-ratio: 16 / 9; }
.door__frame img, .door__video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.door__video { opacity: 0; transition: opacity 0.25s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.2, 1); }
.door__video.is-playing { opacity: 1; }
.door:hover .door__frame img, .door:hover .door__video,
.door:focus-visible .door__frame img, .door:focus-visible .door__video { transform: scale(1.045); }

/* Kind-of-job tags: bone plates, top left, always visible */
.door__tags { position: absolute; left: 8px; top: 8px; right: 8px; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; }
.door__tags > span {
  background: var(--bone); color: var(--red); padding: 4px 6px 3px;
  font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2;
}
@media (max-width: 559px) {
  .door__tags { left: 6px; top: 6px; gap: 3px; }
  .door__tags > span { padding: 3px 5px 2px; letter-spacing: 0.04em; }
}

.door__title { font-weight: 800; line-height: 1.1; letter-spacing: -0.005em; text-transform: uppercase; text-wrap: balance; }
.door__go { display: inline-block; font-weight: 600; opacity: 0; transform: translateX(-6px); transition: opacity 0.2s ease, transform 0.25s ease; }
.door:hover .door__go, .door:focus-visible .door__go { opacity: 1; transform: none; }
@media (hover: none) { .door__go { opacity: 1; transform: none; } }

/* Tablet: an even row count, or two over three */
@media (min-width: 560px) and (max-width: 959px) {
  .doors { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .doors > li, .doors > li:first-child:nth-last-child(odd) { grid-column: span 3; }
  .doors--5 > li:nth-child(n+3) { grid-column: span 2; }
  .door__frame, .doors > li:first-child:nth-last-child(odd) .door__frame { aspect-ratio: 4 / 3; }
}
@media (min-width: 720px) and (max-width: 959px) {
  .hero:has(.doors) .display { font-size: 6.4vw; }
}
@media (min-width: 960px) {
  .hero:has(.doors) .display { font-size: clamp(2.6rem, 5vw, 4.5rem); }
  .doors { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-columns: none; margin-top: 40px; }
  .doors > li:first-child:nth-last-child(odd) { grid-column: auto; }
  /* 4:5, the shape the door clips are framed for (_src/doors/make_doors.py). On a short laptop screen the
     height gives way so the names stay on the first screen; the frame gets wider, never narrower. */
  .door__frame, .doors > li:first-child:nth-last-child(odd) .door__frame { width: 100%; aspect-ratio: 4 / 5; max-height: clamp(170px, calc(100svh - 540px), 320px); }
}

/* Label tag sitting on a clip: bone plate, red type (works on both grounds) */
.tag {
  position: absolute; left: 0; bottom: 0; z-index: 2;
  display: grid; gap: 2px; padding: 8px 10px 7px;
  background: var(--bone); color: var(--red);
  font-size: var(--fs-micro); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.2;
  max-width: 85%;
}
.tag b { font-weight: 800; font-size: 0.75rem; }
.tag span { font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.75rem; }

.case-gut { margin-top: clamp(24px, 4vw, 48px); }
.case-body--solo { grid-template-columns: 1fr !important; }
.case-body--solo > .story { grid-column: 1 / -1 !important; }

.loopgrid { display: grid; gap: var(--gap); margin-top: clamp(28px, 4vw, 48px); grid-template-columns: 1fr 1fr; }
.loopgrid--1 { grid-template-columns: 1fr; }
.loopfig--wide { grid-column: 1 / -1; }
.loopgrid .media__meta { display: none; }
@media (max-width: 559px) {
  .loopgrid .tag { position: static; background: none; color: var(--ink); padding: 6px 0 0; max-width: none; }
  .loopgrid .tag span { display: none; }
  .loopgrid--1 .tag span { display: block; }
}

/* Big number */
.bignum { display: grid; gap: 6px; margin-top: clamp(24px, 4vw, 48px); padding-block: 18px; border-block: 1px solid var(--line); }
.bignum__value { font-size: var(--fs-title); font-weight: 800; line-height: 0.95; letter-spacing: -0.02em; text-transform: uppercase; }
.bignum__note { color: var(--accent); }

/* Compare slider */
.compare-fig { display: grid; gap: 10px; margin-top: clamp(28px, 4vw, 48px); }
.compare { position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--rule); touch-action: pan-y; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare__before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare__line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--bone); z-index: 2; pointer-events: none; }
.compare__line::after { content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: var(--bone); box-shadow: inset 0 0 0 2px var(--red); }
.compare__l { left: 0; right: auto; }
.compare__r { left: auto; right: 0; }
.compare__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3; }
.compare__pick, .pick { display: flex; flex-wrap: wrap; gap: 8px; }
.compare__pick button, .pick button {
  font: inherit; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink); background: transparent; border: 1px solid var(--line); padding: 8px 12px; min-height: 36px; cursor: pointer;
}
.compare__pick button[aria-pressed="true"], .pick button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }

/* Sun scrubber and version switch (3 Nov): an engine frame, a range under it, date or version buttons */
.scrub-fig, .switch-fig { display: grid; gap: 10px; margin-top: clamp(40px, 6vw, 80px); }
.scrub, .switch { position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--rule); }
.scrub img, .switch img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.switch img { transition: opacity 0.25s ease; }
.switch img.is-off { opacity: 0; }
.scrub__time { font-variant-numeric: tabular-nums; }
.scrub__range { width: 100%; margin: 4px 0; accent-color: var(--ink); min-height: 32px; cursor: ew-resize; }

/* Contact within thumb reach on phones */
.fab {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 20;
  padding: 14px 18px; background: var(--red); color: var(--bone); text-decoration: none;
  box-shadow: 0 0 0 2px var(--bone); opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.fab.is-on { opacity: 1; transform: none; pointer-events: auto; }
@media (min-width: 960px) { .fab { display: none; } }

body:has(.draft-note) { padding-top: 30px; }
.draft-note {
  position: fixed; left: 0; right: 0; top: 0; z-index: 30; margin: 0; padding: 6px var(--gutter);
  background: var(--bone); color: var(--red); border-bottom: 1px solid var(--rule); text-align: center;
}

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

/* Editor-only notes (preview builds only; the public build strips them and refuses to ship them) */
.editor-note { margin-top: 12px; padding: 10px 12px; border: 1px dashed currentColor; max-width: 60ch; }

/* ==========================================================================
   Stills, steps and drawings (31 Oct): still images next to the video slots
   ========================================================================== */
.block-label { padding-top: 12px; border-top: 1px solid var(--line); margin-bottom: 14px; }

/* Collage: numbered photos, captions and credits listed underneath */
.stills-fig { display: grid; gap: 10px; margin-top: clamp(40px, 6vw, 80px); }
.stills { display: grid; gap: var(--gap); grid-template-columns: 1fr 1fr; }
.still { position: relative; overflow: hidden; background: var(--rule); aspect-ratio: 4 / 5; }
.still:first-child { grid-column: 1 / -1; aspect-ratio: 1; }
.still:last-child:nth-child(even) { grid-column: 1 / -1; aspect-ratio: 16 / 10; }
.still img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.still .tag { padding: 5px 8px 4px; }
.stills__caps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: cap; }
.stills__caps li { counter-increment: cap; max-width: 70ch; }
.stills__caps li::before { content: counter(cap) "  "; font-weight: 800; white-space: pre; }
.stills__caps .credit { color: var(--accent); }
@media (min-width: 960px) {
  .stills { grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); grid-template-rows: 1fr 1fr; aspect-ratio: var(--ar); }
  .still, .still:first-child, .still:last-child:nth-child(even) { aspect-ratio: auto; grid-column: span var(--w); grid-row: span var(--h); }
  .stills__caps ol { grid-template-columns: 1fr 1fr; column-gap: var(--gap); }
}

/* Steps: phone = image beside the line, desktop = one row of columns */
.steps-block { margin-top: clamp(40px, 6vw, 80px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.step {
  display: grid; column-gap: 14px; row-gap: 6px; align-content: start;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  grid-template-areas: "phase phase" "img num" "img text";
}
.step__phase { grid-area: phase; display: none; }
.step--phase .step__phase { display: block; padding-top: 10px; border-top: 2px solid var(--line); margin-top: 6px; }
.step__img { grid-area: img; position: relative; aspect-ratio: var(--ar); overflow: hidden; background: var(--rule); align-self: start; }
.step__img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.step__num { grid-area: num; color: var(--accent); }
.step__text { grid-area: text; margin: 0; font-size: var(--fs-micro); line-height: 1.45; max-width: 46ch; text-wrap: pretty; }
@media (min-width: 560px) { .step__text { font-size: 0.8125rem; } }
@media (min-width: 960px) {
  .steps { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: var(--gap); }
  .step { grid-template-columns: minmax(0, 1fr); grid-template-areas: "phase" "img" "num" "text"; grid-template-rows: auto auto auto 1fr; }
  .step__phase { display: block; min-height: 2.6em; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 0; }
  .step--phase .step__phase { border-top-width: 2px; margin-top: 0; }
  .step__num { margin-top: 4px; }
}

/* Drawing: inline SVG, strokes and text in the section's ink */
.drawing { display: grid; gap: 10px; align-content: start; color: var(--ink); }
.drawing__svg { display: block; width: 100%; height: auto; overflow: visible; }
@media (min-width: 960px) {
  .case-body > .drawing { grid-column: 7 / span 6; position: sticky; top: 32px; }
  .case-body--wide-media > .drawing { grid-column: 6 / span 7; }
}
.stills__caps .credit { margin: 6px 0 0; }
@media (min-width: 960px) {
  /* The phase name runs across its group of steps on one line instead of wrapping in one column */
  .step__phase { min-height: 0; height: 2.4em; white-space: nowrap; overflow: visible; }
}
