/* junson.dev/pdes, the Project DES page.
   Five parts, one after the other. Each opens with a centred headline; under it, large rounded panels hold the
   pictures, with the words beside them. The page scrolls the ordinary way.
   ../style.css gives the reset, the two themes and the theme toggle. This file sets the page's own type
   (Newsreader for headlines, IBM Plex Sans for the rest), the brand colours and the layout.
   The film panel is dark in both themes. */

:root {
  --film-bg: #0B0D10;        /* the brand's ink. The film is rendered on exactly this colour. */
  --pd-green: #35D07F;
  --pd-green-deep: #1FA35F;  /* the under-edge of the green button */
  --pd-red: #E5484D;
  --pd-orange: #DD6B10;
  --pd-dim: #2A3038;         /* borders on the dark film panel */
  --pd-green-text: #128A4E;  /* the green, dark enough to read on a light page */
  --pd-ink: #0B0D10;
  --bg: #ffffff;
  --pd-alt: #F6F5F1;         /* every other part of the page sits on this */
  --pd-line: #E5E3DD;
  --pd-card: #ffffff;
  --pd-soft: #F1F0EC;
  --pd-sand: #F3ECE0;        /* the three panel tints */
  --pd-sky: #E4EEF2;
  --pd-mint: #E2F3E9;
  --pd-shadow: 0 1px 2px rgba(11, 13, 16, 0.05), 0 14px 40px rgba(11, 13, 16, 0.08);
  --pd-empty: #E6E8E4;       /* a square of the year before it is checked */
  --text: #1B1E22;
  --text-strong: #0B0D10;
  --text-muted: #4A5159;
  --text-faint: #666D75;
  --display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1012;
    --pd-alt: #14171A;
    --pd-green-text: #35D07F;
    --pd-ink: #ffffff;
    --pd-line: #262B30;
    --pd-card: #181C20;
    --pd-soft: #1C2025;
    --pd-sand: #211F1B;
    --pd-sky: #172027;
    --pd-mint: #14231B;
    --pd-shadow: 0 0 0 1px #262B30, 0 20px 50px rgba(0, 0, 0, 0.45);
    --pd-empty: #2A3036;
    --text: #E6E8EA;
    --text-strong: #ffffff;
    --text-muted: #C6CBD1;
    --text-faint: #A7AEB6;
  }
}

:root[data-theme="dark"] {
  --bg: #0E1012;
  --pd-alt: #14171A;
  --pd-green-text: #35D07F;
  --pd-ink: #ffffff;
  --pd-line: #262B30;
  --pd-card: #181C20;
  --pd-soft: #1C2025;
  --pd-sand: #211F1B;
  --pd-sky: #172027;
  --pd-mint: #14231B;
  --pd-shadow: 0 0 0 1px #262B30, 0 20px 50px rgba(0, 0, 0, 0.45);
  --pd-empty: #2A3036;
  --text: #E6E8EA;
  --text-strong: #ffffff;
  --text-muted: #C6CBD1;
  --text-faint: #A7AEB6;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body.pdes {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

/* The page's content grows with the window, so on a very wide screen nothing looks small. */
.pd-wrap {
  width: min(1480px, 90vw);
  margin: 0 auto;
}

/* --- Header: a rounded bar that floats at the top --- */

.pd-nav {
  position: fixed;
  top: 14px;
  left: 0;
  right: 0;
  z-index: 20;
  pointer-events: none;
}

.pd-nav-in {
  pointer-events: auto;
  width: min(1480px, 90vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 60px;
  padding: 0 12px 0 24px;
  border-radius: 999px;
  border: 1px solid var(--pd-line);
  background: var(--pd-card);
  box-shadow: 0 6px 24px rgba(11, 13, 16, 0.06);
}

.pd-logo {
  display: block;
  line-height: 0;
}

.pd-logo svg {
  height: 18px;
  width: auto;
  display: block;
}

.logo-ink-fill { fill: var(--pd-ink); }
.logo-ink-stroke { stroke: var(--pd-ink); }
.logo-green-fill { fill: var(--pd-green); }
.logo-green-stroke { stroke: var(--pd-green); }

.pd-links {
  display: flex;
  gap: 28px;
  font-size: 15px;
}

.pd-links a,
.pd-back {
  text-decoration: none;
  color: var(--text-muted);
}

.pd-links a:hover,
.pd-back:hover {
  color: var(--text-strong);
}

.pd-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 15px;
}

.pd-nav .theme-toggle {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-color: var(--pd-line);
}

/* --- A part of the page --- */

.pd-page {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vw, 72px);
  padding: clamp(80px, 9vw, 150px) 0;
}

.pg-hero {
  padding-top: clamp(130px, 12vw, 190px);
  padding-bottom: clamp(48px, 5vw, 80px);
}

.band-alt {
  background: var(--pd-alt);
}

.pg-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 1.6vw, 26px);
  text-align: center;
}

/* --- Words --- */

.pdes h2.pd-eyebrow {
  margin: 0;
  padding: 0;
  border: 0;
  font-family: var(--sans);
  font-size: clamp(13px, 0.95vw, 16px);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--pd-green-text);
}

.pd-title {
  margin: 0;
  max-width: 20ch;
  font-family: var(--display);
  font-size: clamp(36px, 4.3vw, 76px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--text-strong);
}

h1.pd-title {
  max-width: 21ch;
  font-size: clamp(38px, 4.9vw, 88px);
}

.pd-title-big {
  font-size: clamp(40px, 5.4vw, 96px);
}

.pd-title em {
  font-style: italic;
}

.pd-lead {
  font-size: clamp(18px, 1.45vw, 25px);
  line-height: 1.45;
  color: var(--text-muted);
  max-width: 32em;
}

.pd-lead-strong {
  font-family: var(--display);
  font-size: clamp(24px, 2.4vw, 42px);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  max-width: 24em;
}

.pd-small {
  font-size: clamp(14px, 0.95vw, 16px);
  line-height: 1.5;
  color: var(--text-faint);
}

.pd-names {
  font-size: clamp(15px, 1vw, 17px);
  color: var(--text-muted);
}

.pd-kicker {
  font-size: clamp(15px, 1.05vw, 18px);
  color: var(--text-faint);
}

.one-city {
  color: var(--pd-green-text);
}

.missing {
  color: var(--pd-orange);
}

/* With the script on: the first headline's words rise in one after the other, and things rise in as they
   come on screen. */
.js .pd-giant .w {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.35em);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .is-active .pd-giant .w {
  opacity: 1;
  transform: none;
}

.js .rv {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.js .rv.is-in {
  opacity: 1;
  transform: none;
}

/* --- Buttons --- */

.pd-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.pd-btn {
  font-size: clamp(16px, 1.1vw, 19px);
  font-weight: 500;
  text-decoration: none;
  color: var(--text-strong);
  padding: 0.85em 1.9em;
  border: 1px solid var(--pd-line);
  border-radius: 999px;
  background: var(--pd-card);
  box-shadow: 0 3px 0 var(--pd-line);
  transition: transform 0.12s, box-shadow 0.12s;
}

.pd-btn:hover {
  color: var(--text-strong);
  transform: translateY(1px);
  box-shadow: 0 2px 0 var(--pd-line);
}

.pd-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--pd-line);
}

.pd-btn-main {
  background: var(--pd-green);
  border-color: var(--pd-green);
  color: #0B0D10;
  box-shadow: 0 4px 0 var(--pd-green-deep);
}

.pd-btn-main:hover {
  color: #0B0D10;
  box-shadow: 0 3px 0 var(--pd-green-deep);
}

.pd-btn-main:active {
  box-shadow: 0 0 0 var(--pd-green-deep);
  transform: translateY(4px);
}

.pd-btn-dark,
.pd-btn-dark:hover {
  background: var(--pd-ink);
  border-color: var(--pd-ink);
  color: var(--bg);
  box-shadow: none;
  transform: none;
}

.pd-btn-small {
  font-size: 14.5px;
  padding: 9px 18px;
}

/* --- Panels: the large rounded grounds the pictures sit on --- */

.panel {
  margin: 0;
  border-radius: clamp(22px, 2.2vw, 40px);
  padding: clamp(22px, 3vw, 56px);
  background: var(--pd-sand);
}

.panel-sand { background: var(--pd-sand); }
.panel-sky { background: var(--pd-sky); }
.panel-mint { background: var(--pd-mint); }

.pd-rows {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3.4vw, 64px);
}

/* A row: a big picture panel and the words beside it. Every other row is the other way round. */
.pd-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 96px);
  align-items: center;
}

.pd-row-flip {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
}

.pd-row-flip > :first-child {
  order: 2;
}

/* A picture panel in a row is tall, with its picture in the middle. */
.pd-row > .panel {
  min-height: clamp(280px, 31vw, 560px);
  justify-content: center;
}

.pd-row-film {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}

.pd-row-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(14px, 1.4vw, 24px);
}

.pd-row-title {
  font-family: var(--display);
  font-size: clamp(28px, 2.9vw, 52px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text-strong);
}

.pd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pd-tag {
  font-size: clamp(16px, 1.25vw, 22px);
  color: var(--text-muted);
  padding: 0.5em 1.3em;
  border: 1.5px dashed var(--text-faint);
  border-radius: 999px;
}

.panel-number {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(240px, 26vw, 460px);
}

.pd-huge {
  font-family: var(--display);
  font-size: clamp(64px, 9.5vw, 180px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  color: var(--pd-green-text);
}

.panel-number .pd-huge {
  font-size: clamp(56px, 7.6vw, 150px);
}

.pd-pair {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(20px, 2.4vw, 40px);
}

.panel-fact {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: clamp(10px, 1vw, 18px);
  min-height: clamp(220px, 20vw, 360px);
}

.panel-fact .pd-huge {
  font-size: clamp(60px, 7.5vw, 140px);
}

.pd-fact-text {
  font-size: clamp(18px, 1.5vw, 26px);
  line-height: 1.35;
  color: var(--text);
  max-width: 24em;
}

.missing-label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--pd-orange);
  font-weight: 500;
}

.gap-ring {
  width: 1.3em;
  height: 1.3em;
  border-radius: 50%;
  border: 1.5px dashed var(--pd-orange);
}

/* --- The line drawings --- */

.wire {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 20px);
}

.wire svg {
  display: block;
  width: 100%;
  height: auto;
}

.wire .draw,
.wire-dash {
  fill: none;
  stroke: var(--text);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wire .wire-main {
  stroke: var(--pd-green-text);
  stroke-width: 3.2;
}

.wire-node {
  fill: var(--pd-sky);
  stroke: var(--pd-green-text);
  stroke-width: 2.4;
}

.wire-dash {
  stroke: var(--pd-orange);
  stroke-width: 2.6;
  stroke-dasharray: 6 6;
  animation: dash 1.2s linear infinite;
}

.wire .wire-depot {
  stroke: var(--text-strong);
  stroke-width: 2.4;
}

.wire-truck {
  fill: var(--pd-green);
}

.wire-q {
  fill: var(--pd-card);
  stroke: var(--pd-orange);
  stroke-width: 2.4;
}

.wire-q-text {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  text-anchor: middle;
  fill: var(--pd-orange);
}

.wire-label {
  font-family: var(--sans);
  font-size: 17px;
  fill: var(--text-muted);
}

.wire-label-end {
  text-anchor: end;
}

@keyframes dash {
  to { stroke-dashoffset: -12; }
}

/* The long drawing on the first page. */
.grid-art figcaption {
  text-align: right;
}

.ga-ground {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1.2;
}

.grid-art .draw {
  stroke: var(--text);
  stroke-width: 1.7;
}

.grid-art .ga-thin .draw,
.grid-art .draw.ga-thin {
  stroke: var(--text-faint);
  stroke-width: 1.2;
}

.grid-art .ga-wire {
  stroke: var(--pd-green-text);
  stroke-width: 2.2;
}

/* Small dots run along the wire, away from the substation. */
.ga-flow {
  fill: none;
  stroke: var(--pd-green);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 0.1 46;
  animation: flow 2.2s linear infinite;
}

@keyframes flow {
  to { stroke-dashoffset: -46.1; }
}

.ga-limit {
  fill: none;
  stroke: var(--pd-red);
  stroke-width: 3.4;
  stroke-linecap: round;
}

.ga-ask {
  fill: none;
  stroke: var(--pd-orange);
  stroke-width: 2.2;
  stroke-dasharray: 6 6;
  animation: dash 1.2s linear infinite;
}

.grid-art .ga-depot {
  stroke: var(--text-strong);
  stroke-width: 2;
}

.ga-truck {
  fill: var(--pd-green);
}

.grid-art .ga-fix {
  stroke: var(--pd-green);
  stroke-width: 2.2;
}

.ga-fix-ring {
  fill: none;
  stroke: var(--pd-green);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.ga-tag path {
  fill: none;
  stroke: var(--text-faint);
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.ga-tag rect {
  fill: var(--pd-card);
  stroke: var(--pd-line);
  stroke-width: 1;
}

.ga-tag text {
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 500;
  text-anchor: middle;
  fill: var(--text-strong);
}

.ga-tag-limit rect { stroke: var(--pd-red); }
.ga-tag-limit text { fill: var(--pd-red); }
.ga-tag-fix rect { stroke: var(--pd-green); }
.ga-tag-fix text { fill: var(--pd-green-text); }
.ga-tag-new rect { stroke: var(--pd-orange); }
.ga-tag-new text { fill: var(--pd-orange); }

/* With the script on, the coloured parts wait until the drawing has drawn itself. */
.js .ga-tag,
.js .ga-limit,
.js .ga-ask,
.js .ga-flow,
.js .ga-truck,
.js .ga-fix-ring {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.js .grid-art.is-drawn .ga-tag,
.js .grid-art.is-drawn .ga-limit,
.js .grid-art.is-drawn .ga-ask,
.js .grid-art.is-drawn .ga-flow,
.js .grid-art.is-drawn .ga-truck,
.js .grid-art.is-drawn .ga-fix-ring {
  opacity: 1;
}

.js .grid-art.is-drawn .ga-tag-fix { transition-delay: 0.9s; }
.js .grid-art.is-drawn .ga-tag-limit { transition-delay: 0.5s; }
.js .grid-art.is-drawn .ga-tag-new { transition-delay: 0.1s; }

/* --- The answer card --- */

.panel-card {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 20px);
}

.answer {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.2vw, 20px);
  padding: clamp(20px, 2.2vw, 40px);
  background: var(--pd-card);
  border-radius: clamp(16px, 1.6vw, 28px);
  box-shadow: var(--pd-shadow);
}

.answer-q {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: clamp(15px, 1.05vw, 18px);
  color: var(--text-muted);
}

.answer-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pd-green);
  box-shadow: 0 0 0 4px rgba(53, 208, 127, 0.18);
}

.answer-big {
  font-family: var(--display);
  font-size: clamp(24px, 2.1vw, 38px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.answer-year {
  position: relative;
}

.answer-year svg {
  display: block;
  width: 100%;
  height: auto;
}

.yr-ok { fill: var(--pd-green); }
.yr-short rect { fill: var(--pd-red); }

.yr-cell {
  fill: var(--pd-empty);
  transition: fill 0.35s;
}

.yr-cell.is-ok { fill: var(--pd-green); }
.yr-cell.is-short { fill: var(--pd-red); }
.yr-cell:hover { opacity: 0.6; }

.yr-months text,
.yr-hours text {
  font-family: var(--sans);
  font-size: 10px;
  text-anchor: middle;
  fill: var(--text-faint);
}

.yr-hours text {
  text-anchor: end;
}

.yr-call path {
  fill: none;
  stroke: var(--pd-red);
  stroke-width: 1;
}

.yr-call text {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  text-anchor: middle;
  fill: var(--pd-red);
}

/* With the script on, the label waits for the red squares. */
.js .yr-call {
  opacity: 0;
  transition: opacity 0.5s;
}

.js .yr-call.is-in {
  opacity: 1;
}

.answer-tip {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -130%);
  padding: 5px 10px;
  border-radius: 6px;
  background: #0B0D10;
  color: #ffffff;
  font-size: 13.5px;
  white-space: nowrap;
  pointer-events: none;
}

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

.answer-rows li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8em 0;
  border-top: 1px solid var(--pd-line);
  font-size: clamp(16px, 1.2vw, 21px);
  font-weight: 500;
  color: var(--text-strong);
}

.answer-rows li:last-child {
  padding-bottom: 0;
}

.answer-rows li::before {
  content: "";
  flex: 0 0 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pd-green);
}

/* --- Three questions, answered two ways --- */

.qa {
  gap: clamp(14px, 1.3vw, 22px);
}

.seg {
  display: none;            /* the two buttons need the script */
  position: relative;
  grid-template-columns: 1fr 1fr;
  padding: 5px;
  border-radius: 999px;
  background: var(--pd-soft);
}

.js .seg {
  display: inline-grid;
}

/* The pill that marks the chosen side. It slides across when the other side is chosen. */
.seg::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 5px;
  width: calc(50% - 5px);
  border-radius: 999px;
  background: var(--pd-ink);
  transition: transform 0.35s cubic-bezier(0.3, 0.8, 0.2, 1);
}

.qa[data-show="us"] .seg::before {
  transform: translateX(100%);
}

.seg-b {
  position: relative;
  font: inherit;
  font-size: clamp(15px, 1.1vw, 19px);
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.6em 1.8em;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.25s, transform 0.12s;
}

/* The side that is not chosen answers the pointer. */
.seg-b:hover {
  color: var(--text-strong);
  background: var(--pd-line);
}

.seg-b:active {
  transform: scale(0.96);
}

.seg-b:focus-visible {
  outline: 2px solid var(--pd-green);
  outline-offset: 2px;
}

.qa[data-show="today"] .seg-b[data-show="today"],
.qa[data-show="us"] .seg-b[data-show="us"] {
  color: var(--bg);
  background: transparent;
  cursor: default;
}

.qa-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.qa-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: clamp(14px, 1.3vw, 22px) 0;
  border-top: 1px solid var(--pd-line);
}

.qa-q {
  font-size: clamp(15px, 1.05vw, 18px);
  color: var(--text-faint);
}

.qa-a {
  font-family: var(--display);
  font-size: clamp(24px, 2.2vw, 40px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.qa-today {
  color: var(--text-faint);
}

.qa-tag {
  display: block;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.qa-us .qa-tag {
  color: var(--pd-green-text);
}

/* With the script on, only the chosen answers show, and the small labels are not needed. */
.js .qa-tag,
.js .qa[data-show="us"] .qa-today,
.js .qa[data-show="today"] .qa-us {
  display: none;
}

.js .qa-a {
  animation: swap 0.4s ease;
}

@keyframes swap {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* --- The film --- */

.film-wrap {
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1.2vw, 20px);
}

.film {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--film-bg);
  border: 1px solid var(--pd-dim);
  border-radius: clamp(22px, 2.2vw, 40px);
  overflow: hidden;
}

.film-still,
.film-clip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.film-clip.is-off {
  visibility: hidden;
}

.film-replay {
  position: absolute;
  right: 16px;
  bottom: 16px;
  font-family: var(--sans);
  font-size: 14px;
  color: #D5DAE0;
  background: rgba(11, 13, 16, 0.7);
  border: 1px solid #3A424C;
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
}

.film-replay:hover {
  color: #ffffff;
  border-color: #B6BDC6;
}

/* The words on the last picture (the year seen from above): which months, which hours. They sit over the film
   at fixed places, so they only show when that picture is the one on screen. */
.film-marks {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s;
  pointer-events: none;
  font-size: clamp(12px, 1vw, 17px);
  color: #D5DAE0;
}

.film.is-done .film-marks {
  opacity: 1;
}

.film-marks span {
  position: absolute;
  white-space: nowrap;
}

.mark-call {
  left: 63.5%;
  top: 11.5%;
  transform: translateX(-50%);
  padding: 0.35em 0.8em;
  border-radius: 0.5em;
  background: var(--pd-red);
  color: #ffffff;
  font-weight: 600;
}

.mark-line {
  left: 63.5%;
  top: 16%;
  width: 1.5px;
  height: 28%;
  background: var(--pd-red);
}

.mark { transform: translateX(-50%); }
.mark-h0 { left: 18.7%; top: 79.5%; }
.mark-h12 { left: 50%; top: 79.5%; }
.mark-h24 { left: 81.3%; top: 79.5%; }
.mark-jan { left: 5.5%; top: 66%; }
.mark-dec { left: 5.5%; top: 31%; }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(10px, 1vw, 16px);
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: clamp(14px, 1.3vw, 22px);
  align-items: start;
  width: 100%;
  padding: clamp(16px, 1.6vw, 28px);
  border: 1px solid var(--pd-line);
  border-radius: clamp(16px, 1.6vw, 26px);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.step:hover {
  border-color: var(--text-faint);
  background: var(--pd-card);
}

.step.is-on {
  background: var(--pd-card);
  box-shadow: var(--pd-shadow);
}

.step-n {
  width: 2.1em;
  height: 2.1em;
  line-height: 2.1em;
  border-radius: 50%;
  text-align: center;
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 500;
  background: var(--pd-soft);
  color: var(--text-muted);
  transition: background 0.3s, color 0.3s;
}

.step.is-on .step-n,
.step.is-done .step-n {
  background: var(--pd-green);
  color: #0B0D10;
}

.step-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-h {
  font-family: var(--display);
  font-size: clamp(23px, 2vw, 36px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--text-strong);
}

.step-p {
  font-size: clamp(16px, 1.25vw, 22px);
  line-height: 1.4;
  color: var(--text-muted);
}

/* A thin line along the bottom of a step fills while its clip plays. */
.step-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
}

.step-bar span {
  display: block;
  height: 100%;
  background: var(--pd-green);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform 0.25s linear;
}

.step:not(.is-on) .step-bar {
  visibility: hidden;
}

/* --- Footer: one quiet centred line --- */

.pd-footer {
  border-top: 1px solid var(--pd-line);
}

.pd-footer-in {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 28px;
  padding-top: 26px;
  padding-bottom: 30px;
  font-size: 14px;
  color: var(--text-muted);
}

.pd-footer-in a {
  text-decoration: none;
  color: var(--text-muted);
}

.pd-footer-in a:hover {
  color: var(--text-strong);
}

/* --- Narrow screens and phones: one column --- */

@media (max-width: 900px) {
  .pd-wrap,
  .pd-nav-in {
    width: calc(100% - 32px);
  }
  .pd-links,
  .pd-back,
  .pd-btn-small {
    display: none;
  }
  .pd-nav-in {
    height: 54px;
    padding: 0 8px 0 18px;
  }
  .pd-row,
  .pd-row-flip,
  .pd-row-film,
  .pd-pair {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel-number .pd-huge {
    font-size: clamp(56px, 17vw, 110px);
  }
  .pd-row-flip > :first-child {
    order: 0;
  }
  .grid-art {
    overflow-x: auto;
  }
  .grid-art svg {
    width: 860px;
    max-width: none;
  }
  .grid-art figcaption {
    text-align: left;
  }
  .film-marks {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .wire-dash,
  .ga-ask,
  .ga-flow,
  .js .qa-a {
    animation: none;
  }
  .js .rv,
  .js .pd-giant .w,
  .yr-cell,
  .seg::before {
    transition: none;
  }
}
