/* ==========================================================
   Sciencekakura holding page: one screen, no scrolling.
   Brand tokens match assets/css/styles.css (red #CC0000, navy #000066,
   the logo's red-to-navy gradient, Source Serif 4 + IBM Plex Sans, self-hosted).
   Sizes scale with the smaller of the screen's width and height, so the
   whole page fits one screen. At very high zoom it scrolls instead of
   cutting text off.
   The construction site, under a dusk sky in the logo's gradient: a tower
   crane brings the logo in and keeps working on a 12-second loop (lift, move
   along the arm, back, set down). Equipment stands along the edge of the
   site; below it run the sidewalk, the curb and the road, which
   carries the footer. Landscape screens put the crane beside the headline,
   portrait screens underneath it.
   Motion tokens follow transitions.dev (texts reveal, badge pop).
   ========================================================== */

@font-face { font-family: "Source Serif 4"; src: url("../fonts/source-serif-4-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("../fonts/ibm-plex-sans-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root {
  /* Colour roles */
  --red: #CC0000;
  --navy: #000066;
  --plum: #61005C;            /* from the logo gradient */
  --lavender: #CFCFF5;        /* secondary text on navy (11:1) */
  --paper: #FFFFFF;
  --deep: #00003A;            /* tyres, tracks, pipes */
  --slab: #2E2E8C;            /* sidewalk */
  --curb: #DCDCF5;
  --asphalt: #07072F;         /* road */
  --blueprint: #2F55DD;       /* the engineers' plan */

  /* Type: four sizes */
  --font-display: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --step-hero: clamp(30px, min(10.4vw, 13.5svh), 156px);
  --step-lede: clamp(20px, min(2.4vw, 3.6svh), 34px);
  --step-body: 17px;
  --step-small: 14px;

  /* Frame */
  --margin: clamp(16px, 3.2vw, 48px);
  --crane-col: clamp(150px, 27vw, 500px);
  --col-gap: clamp(24px, 3vw, 48px);
  --sink: 44px;                                     /* the bottom strip of the site, where the crane and the equipment stand */
  --kit: clamp(40px, min(11vw, 9svh), 110px);       /* height of the excavator; the other equipment is to scale */

  /* The crane's working loop: starts once the logo has arrived and settled */
  --loop: 12s;
  --loop-start: 4100ms;
  --crew-loop: 24s;           /* the engineers' work, two crane loops */

  /* Motion tokens (transitions.dev) */
  --duration-quick: 150ms;
  --ease-out: ease-out;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.36, 0.64, 1);
  --stagger-dur: 600ms;
  --stagger-distance: 20px;
  --stagger-stagger: 70ms;
  --stagger-blur: 3px;
  --stagger-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  background: var(--navy);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--navy);
  color: var(--paper);
  font: 400 var(--step-body)/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--paper); color: var(--navy); }

p, h1 { margin: 0; }

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: text-underline-offset var(--duration-quick) var(--ease-out);
}
a:hover { text-underline-offset: 0.32em; }

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

/* ---------- The one screen ---------- */
.page {
  min-height: 100vh; /* taste-skill-ignore: fallback for browsers without svh */
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto auto auto;   /* stage, site edge, sidewalk, road */
  /* The crane and the headline drawing must not add scrolling. */
  position: relative;
  overflow: hidden;
  overflow: clip;
  /* Dusk over the site: navy overhead, turning to the logo's plum and red at the horizon. */
  background: linear-gradient(180deg, #00004A 0%, var(--navy) 32%, #22006A 58%, var(--plum) 82%, #870050 100%); /* taste-skill-ignore: the logo's own navy-to-red gradient as the sky */

  /* The headline drawing (transitions.dev text variant), in light dots on navy */
  --tig-line: rgba(207, 207, 245, 0.55);
  --tig-strong: #FFFFFF;
  --tig-ink: rgba(255, 255, 255, 0.5);
  --tig-surface: var(--navy);
  --tig-text: #FFFFFF;
  --tig-muted: var(--lavender);
  --tig-font: var(--font-body);
}

/* Portrait screens: the headline at the top, the crane filling the space below it. */
.stage {
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  row-gap: clamp(12px, 3svh, 32px);
  padding: clamp(24px, 6svh, 72px) var(--margin) 0;
}
.copy { min-width: 0; }

.title {
  font: 600 var(--step-hero)/0.98 var(--font-display);
  letter-spacing: -0.03em;
  font-optical-sizing: none;   /* the drawing traces the same letter shapes the page shows */
}
.draw-wait .title { opacity: 0; }
.line { display: block; }

.lede {
  margin-top: clamp(14px, 3svh, 32px);
  font: 500 var(--step-lede)/1.3 var(--font-body);
  color: var(--lavender);
}

/* ---------- The crane ---------- */
.crane {
  display: block;
  width: 100%;
  height: 100%;
  contain: size;          /* the crane fills the space left; it never makes the page taller */
  overflow: visible;
  translate: 0 var(--sink);   /* its foot stands on the sidewalk edge, like the equipment */
}

.crane-steel { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.crane-lace { stroke: var(--lavender); stroke-width: 1.75; }
.crane-tie { stroke: var(--lavender); stroke-width: 1.5; }
.crane-red { fill: var(--red); stroke: var(--paper); stroke-width: 2; }
.crane-glass { fill: var(--lavender); stroke: none; }
.crane-trolley, .crane-bar { fill: var(--paper); }
.crane-cable path { fill: none; stroke: var(--paper); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.crane-load { cursor: grab; }

/* The cable, the swing and the nudge all pivot on the trolley. */
.crane-cable, .crane-swing, .crane-nudge {
  transform-box: view-box;
  transform-origin: 165px 148px;
}

/* Arrival: 1. the trolley runs out along the jib, 2. the cable lowers the logo, 3. it sways and settles. */
.crane-run   { animation: crane-run 1000ms var(--ease-smooth-out) 300ms both; }
.crane-cable { animation: crane-cable 1300ms var(--ease-smooth-out) 1200ms both; }
.crane-load  { animation: crane-load 1300ms var(--ease-smooth-out) 1200ms both; }
.crane-swing { animation: crane-sway 3000ms ease-in-out 1100ms both; }

/* Then, with JavaScript (so the footer button can stop it), the crane keeps working.
   Each loop starts and ends with the logo at rest, so it repeats without a jump. */
.js .crane-run {
  animation:
    crane-run 1000ms var(--ease-smooth-out) 300ms both,
    crane-run-loop var(--loop) ease-in-out var(--loop-start) infinite;
}
.js .crane-cable {
  animation:
    crane-cable 1300ms var(--ease-smooth-out) 1200ms both,
    crane-cable-loop var(--loop) ease-in-out var(--loop-start) infinite;
}
.js .crane-load {
  animation:
    crane-load 1300ms var(--ease-smooth-out) 1200ms both,
    crane-load-loop var(--loop) ease-in-out var(--loop-start) infinite;
}
.js .crane-swing {
  animation:
    crane-sway 3000ms ease-in-out 1100ms both,
    crane-sway-loop var(--loop) ease-in-out var(--loop-start) infinite;
}

/* Stopped on an earlier visit: the logo waits at rest. Starting again skips the
   arrival and goes straight into the loop at the lift. */
.crane-still :is(.crane-run, .crane-cable, .crane-load, .crane-swing) { animation: none; }
.crane-restart .crane-run   { animation: crane-run-loop var(--loop) ease-in-out calc(var(--loop) * -0.28) infinite; }
.crane-restart .crane-cable { animation: crane-cable-loop var(--loop) ease-in-out calc(var(--loop) * -0.28) infinite; }
.crane-restart .crane-load  { animation: crane-load-loop var(--loop) ease-in-out calc(var(--loop) * -0.28) infinite; }
.crane-restart .crane-swing { animation: crane-sway-loop var(--loop) ease-in-out calc(var(--loop) * -0.28) infinite; }

/* Stopped during this visit: everything holds where it is.
   (The classes are named after the crane, but they also stop the engineers, further down.) */
.crane-paused :is(.crane-run, .crane-cable, .crane-load, .crane-swing) { animation-play-state: paused; }

/* The cable runs 272 units from the trolley (148) to the hook block (420);
   the cable's scale and the load's lift always use the same numbers, so the hook stays on the cable. */
@keyframes crane-run   { from { transform: translateX(150px); } to { transform: none; } }
@keyframes crane-cable { from { transform: scaleY(0.2); } to { transform: none; } }
@keyframes crane-load  { from { transform: translateY(-217.6px); } to { transform: none; } }
@keyframes crane-sway {
  0%   { transform: rotate(0deg); }
  14%  { transform: rotate(2.2deg); }
  34%  { transform: rotate(-1.45deg); }
  54%  { transform: rotate(0.85deg); }
  72%  { transform: rotate(-0.4deg); }
  88%  { transform: rotate(0.12deg); }
  100% { transform: rotate(0deg); }
}

/* The loop, 12 seconds:
   0–28% rest · 28–38% lift · 38–48% out along the jib · 48–60% hold ·
   60–70% back · 70–80% set down · 80–100% settle. */
@keyframes crane-run-loop {
  0%, 38%   { transform: none; }
  48%, 60%  { transform: translateX(-40px); }
  70%, 100% { transform: none; }
}
@keyframes crane-cable-loop {
  0%, 28%   { transform: none; }
  38%, 70%  { transform: scaleY(0.6); }
  80%, 100% { transform: none; }
}
@keyframes crane-load-loop {
  0%, 28%   { transform: none; }
  38%, 70%  { transform: translateY(-108.8px); }
  80%, 100% { transform: none; }
}
/* Positive turns swing the logo left. It lags behind the trolley as it sets off,
   and swings on when the trolley stops. */
@keyframes crane-sway-loop {
  0%, 38%   { transform: rotate(0deg); }
  41%       { transform: rotate(-1.9deg); }
  46%       { transform: rotate(-0.5deg); }
  51%       { transform: rotate(2deg); }
  54%       { transform: rotate(-1.1deg); }
  57%       { transform: rotate(0.5deg); }
  60%       { transform: rotate(0deg); }
  63%       { transform: rotate(1.9deg); }
  68%       { transform: rotate(0.5deg); }
  73%       { transform: rotate(-2deg); }
  76%       { transform: rotate(1deg); }
  79%       { transform: rotate(-0.5deg); }
  83%       { transform: rotate(0.25deg); }
  87%       { transform: rotate(-0.1deg); }
  91%, 100% { transform: rotate(0deg); }
}

/* ---------- Cones ---------- */
.cone-red { fill: var(--red); }
.cone-white { fill: var(--paper); }
.cone {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: cone-pop 520ms var(--ease-bounce) both;
}
.cone--1 { animation-delay: 2300ms; }
.cone--2 { animation-delay: 2440ms; }
@keyframes cone-pop { from { opacity: 0; transform: scale(0.3); } to { opacity: 1; transform: none; } }

/* ---------- Two engineers at work, at the foot of the crane ----------
   A 24-second cycle that starts with the crane's loop and covers two of them. The times
   below are in seconds of that cycle; the keyframe percentages were worked out from them. */
.eng-leg  { fill: var(--deep); stroke: var(--paper); stroke-width: 2; }
.eng-vest { fill: var(--red); stroke: var(--paper); stroke-width: 2; stroke-linejoin: round; }
.eng-stripe { fill: none; stroke: var(--paper); stroke-width: 2.5; }
.eng-head { fill: var(--deep); stroke: var(--paper); stroke-width: 2; }
.eng-hat  { fill: var(--paper); stroke: var(--paper); stroke-width: 2; stroke-linejoin: round; }
.eng-brim { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; }
.eng-arm  { fill: none; stroke: var(--paper); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.eng-hand { fill: var(--paper); }
.bp-sheet { fill: var(--blueprint); stroke: var(--paper); stroke-width: 1.5; }
.bp-grid  { fill: none; stroke: rgba(255, 255, 255, 0.3); stroke-width: 0.6; }
.bp-line  { fill: none; stroke: var(--paper); stroke-width: 1; }

/* Walking: --walk is 1 while an engineer walks and 0 while they stand; --step swings
   from -1 to 1 with every step. Legs, arms and a small bob are worked out from both,
   so the legs only move while walking. */
@property --walk { syntax: "<number>"; inherits: true; initial-value: 0; }
@property --step { syntax: "<number>"; inherits: true; initial-value: 0; }
@keyframes eng-step { from { --step: -1; } to { --step: 1; } }

/* Every part turns on its joint, in the figure's own drawing (feet at 0,0, facing right). */
.crew :is(.walker, .face, .bob, .leg, .arm, .swing, .head, .bp) { transform-box: view-box; }
.face { transform-origin: 0 0; }
.leg-1 { transform-origin: -5.5px -42px; transform: rotate(calc(var(--walk) * var(--step) * 22deg)); }
.leg-2 { transform-origin: 5.5px -42px;  transform: rotate(calc(var(--walk) * var(--step) * -22deg)); }
.arm-f, .swing-f { transform-origin: 10px -83px; }
.arm-b, .swing-b { transform-origin: -10px -83px; }
.swing-f { transform: rotate(calc(var(--walk) * var(--step) * -16deg)); }
.swing-b { transform: rotate(calc(var(--walk) * var(--step) * 16deg)); }
.bob { transform: translateY(calc(var(--walk) * var(--step) * var(--step) * 1.5px)); }
.head { transform-origin: 0 -86px; }
.bp { transform-origin: 0 -54px; }

/* At their posts (also without JavaScript, with reduced motion, and when paused before
   loading): the left one looks into the instrument, the right one faces the crane. */
.face-b { transform: scaleX(-1); }
.a-arm-f { transform: rotate(-72deg); }
.a-head { transform: rotate(10deg); }
.bp { transform: scaleX(0); }

.js .bob { animation: eng-step 0.4s ease-in-out infinite alternate; }
.js .walker-a { animation: walk-a var(--crew-loop) linear var(--loop-start) infinite; }
.js .walker-b { animation: walk-b var(--crew-loop) linear var(--loop-start) infinite; }
.js .face-a   { animation: face-a var(--crew-loop) linear var(--loop-start) infinite; }
.js .face-b   { animation: face-b var(--crew-loop) linear var(--loop-start) infinite; }
.js .a-arm-f  { animation: a-arm-f var(--crew-loop) ease-in-out var(--loop-start) infinite; }
.js .a-arm-b  { animation: a-arm-b var(--crew-loop) ease-in-out var(--loop-start) infinite; }
.js .a-head   { animation: a-head var(--crew-loop) ease-in-out var(--loop-start) infinite; }
.js .b-arm-f  { animation: b-arm-f var(--crew-loop) ease-in-out var(--loop-start) infinite; }
.js .b-head   { animation: b-head var(--crew-loop) ease-in-out var(--loop-start) infinite; }
.js .bp       { animation: bp-open var(--crew-loop) ease-in-out var(--loop-start) infinite; }
/* The footer button stops them with the crane; starting again keeps them in step with it.
   These rules must come after the ones above. */
.crane-still :is(.crew-anim, .bob) { animation: none; }
.crane-restart .crew-anim { animation-delay: calc(var(--loop) * -0.28); }
.crane-paused :is(.crew-anim, .bob) { animation-play-state: paused; }

/* Engineer A works at x=60 and meets at x=134; B works at x=392 and meets at x=206;
   the blueprint opens at x=170. Both stay below the hanging logo the whole time.
   0–9.6 s   A surveys (glancing up at the crane at 5 s); B waves to A, then signals the crane
   9.8 s     B sets off; A follows at 11.85 s; both arrive at 13.2 s
   13.2–19.4 s  the blueprint opens; at 15.6 s A points up at the logo as the crane lifts it, B nods
   19.4 s    back to work: A arrives at 20.75 s, B at 22.8 s */
/* A walks to the blueprint and back */
@keyframes walk-a {
        0% { transform: none; --walk: 0; }
   48.958% { --walk: 0; }
   49.375% { transform: none; }
   49.583% { --walk: 1; }
   54.583% { --walk: 1; }
       55% { transform: translateX(74px); }
   55.208% { --walk: 0; }
   80.417% { --walk: 0; }
   80.833% { transform: translateX(74px); }
   81.042% { --walk: 1; }
   86.042% { --walk: 1; }
   86.458% { transform: none; }
   86.667% { --walk: 0; }
      100% { transform: none; --walk: 0; }
}
/* A faces right, and left on the way back */
@keyframes face-a {
        0% { transform: none; }
   80.792% { transform: none; }
   80.833% { transform: scaleX(-1); }
   86.458% { transform: scaleX(-1); }
     86.5% { transform: none; }
      100% { transform: none; }
}
/* A: adjusts the survey instrument, then holds the blueprint */
@keyframes a-arm-f {
        0% { transform: rotate(-72deg); }
      2.5% { transform: rotate(-80deg); }
    5.833% { transform: rotate(-66deg); }
    9.167% { transform: rotate(-80deg); }
     12.5% { transform: rotate(-66deg); }
   15.833% { transform: rotate(-80deg); }
   19.167% { transform: rotate(-66deg); }
     22.5% { transform: rotate(-80deg); }
   25.833% { transform: rotate(-66deg); }
   29.167% { transform: rotate(-80deg); }
     32.5% { transform: rotate(-66deg); }
   35.833% { transform: rotate(-80deg); }
   39.167% { transform: rotate(-66deg); }
     42.5% { transform: rotate(-80deg); }
   45.833% { transform: rotate(-66deg); }
   48.333% { transform: rotate(-72deg); }
   49.792% { transform: rotate(0deg); }
       55% { transform: rotate(0deg); }
   56.667% { transform: rotate(-52deg); }
    78.75% { transform: rotate(-52deg); }
   80.417% { transform: rotate(0deg); }
   86.458% { transform: rotate(0deg); }
   87.917% { transform: rotate(-72deg); }
       90% { transform: rotate(-80deg); }
   93.333% { transform: rotate(-66deg); }
   96.667% { transform: rotate(-80deg); }
      100% { transform: rotate(-72deg); }
}
/* A: points up at the logo as the crane lifts it */
@keyframes a-arm-b {
        0% { transform: rotate(0deg); }
   64.583% { transform: rotate(0deg); }
    66.25% { transform: rotate(170deg); }
   67.917% { transform: rotate(162deg); }
   69.583% { transform: rotate(172deg); }
    71.25% { transform: rotate(164deg); }
     72.5% { transform: rotate(170deg); }
    73.75% { transform: rotate(0deg); }
      100% { transform: rotate(0deg); }
}
/* A: looks into the instrument, glances up at the crane, reads the plan, looks up at the logo */
@keyframes a-head {
        0% { transform: rotate(10deg); }
   20.417% { transform: rotate(10deg); }
   21.667% { transform: rotate(-12deg); }
   26.667% { transform: rotate(-12deg); }
   27.917% { transform: rotate(10deg); }
   48.333% { transform: rotate(10deg); }
   49.375% { transform: rotate(0deg); }
       55% { transform: rotate(0deg); }
   56.667% { transform: rotate(8deg); }
   64.167% { transform: rotate(8deg); }
   65.417% { transform: rotate(-15deg); }
     72.5% { transform: rotate(-15deg); }
    73.75% { transform: rotate(8deg); }
    78.75% { transform: rotate(8deg); }
   80.417% { transform: rotate(0deg); }
   86.458% { transform: rotate(0deg); }
   87.917% { transform: rotate(10deg); }
      100% { transform: rotate(10deg); }
}
/* B walks to the blueprint and back */
@keyframes walk-b {
        0% { transform: none; --walk: 0; }
   40.417% { --walk: 0; }
   40.833% { transform: none; }
   41.042% { --walk: 1; }
   54.583% { --walk: 1; }
       55% { transform: translateX(-186px); }
   55.208% { --walk: 0; }
   80.417% { --walk: 0; }
   80.833% { transform: translateX(-186px); }
   81.042% { --walk: 1; }
   94.583% { --walk: 1; }
       95% { transform: none; }
   95.208% { --walk: 0; }
      100% { transform: none; --walk: 0; }
}
/* B faces left (towards the load), and right on the way back */
@keyframes face-b {
        0% { transform: scaleX(-1); }
   80.792% { transform: scaleX(-1); }
   80.833% { transform: none; }
       95% { transform: none; }
   95.042% { transform: scaleX(-1); }
      100% { transform: scaleX(-1); }
}
/* B: waves to A, then signals the crane's lift, move, hold, return and lowering, then holds the blueprint */
@keyframes b-arm-f {
        0% { transform: rotate(0deg); }
    1.667% { transform: rotate(0deg); }
    3.333% { transform: rotate(-150deg); }
    4.375% { transform: rotate(-130deg); }
    5.417% { transform: rotate(-165deg); }
    6.458% { transform: rotate(-130deg); }
      7.5% { transform: rotate(-160deg); }
     8.75% { transform: rotate(-150deg); }
       10% { transform: rotate(0deg); }
     12.5% { transform: rotate(0deg); }
    13.75% { transform: rotate(-170deg); }
       15% { transform: rotate(-158deg); }
    16.25% { transform: rotate(-178deg); }
     17.5% { transform: rotate(-158deg); }
    18.75% { transform: rotate(-172deg); }
   19.792% { transform: rotate(-95deg); }
   21.042% { transform: rotate(-88deg); }
   22.292% { transform: rotate(-100deg); }
   23.333% { transform: rotate(-92deg); }
   24.583% { transform: rotate(-120deg); }
   29.583% { transform: rotate(-120deg); }
   30.625% { transform: rotate(-100deg); }
   31.875% { transform: rotate(-140deg); }
   33.125% { transform: rotate(-100deg); }
   34.375% { transform: rotate(-140deg); }
   35.417% { transform: rotate(-45deg); }
   36.667% { transform: rotate(-70deg); }
   37.917% { transform: rotate(-40deg); }
   39.167% { transform: rotate(-68deg); }
   40.208% { transform: rotate(0deg); }
       55% { transform: rotate(0deg); }
   56.667% { transform: rotate(-52deg); }
    78.75% { transform: rotate(-52deg); }
   80.417% { transform: rotate(0deg); }
      100% { transform: rotate(0deg); }
}
/* B: watches the load, reads the plan, looks up, nods */
@keyframes b-head {
        0% { transform: rotate(0deg); }
   10.833% { transform: rotate(0deg); }
     12.5% { transform: rotate(-14deg); }
   39.583% { transform: rotate(-14deg); }
   40.833% { transform: rotate(0deg); }
       55% { transform: rotate(0deg); }
   56.667% { transform: rotate(8deg); }
   64.167% { transform: rotate(8deg); }
   65.417% { transform: rotate(-12deg); }
     72.5% { transform: rotate(-12deg); }
   73.333% { transform: rotate(8deg); }
   74.375% { transform: rotate(0deg); }
   75.417% { transform: rotate(8deg); }
   76.458% { transform: rotate(0deg); }
     77.5% { transform: rotate(8deg); }
    78.75% { transform: rotate(8deg); }
   80.417% { transform: rotate(0deg); }
      100% { transform: rotate(0deg); }
}
/* the blueprint unrolls between them and rolls up again */
@keyframes bp-open {
        0% { transform: scaleX(0); }
   55.833% { transform: scaleX(0); }
   57.917% { transform: none; }
   78.333% { transform: none; }
       80% { transform: scaleX(0); }
      100% { transform: scaleX(0); }
}

/* ---------- The site edge: equipment along the sidewalk ---------- */
.ground {
  grid-row: 2;
  position: relative;
  z-index: 3;
  height: var(--sink);
}

/* The equipment stands on the sidewalk's edge, between the left margin and the hanging
   logo (coming-soon.js measures where the logo hangs and sets --site-right).
   Every drawing is 120 units tall with its ground at the bottom, so they share one scale
   and one height. Items that don't fit wrap onto a second row above, which is cut off
   completely, so only whole items show and the first in the list are kept. */
.site {
  position: absolute;
  z-index: 1;
  left: var(--margin);
  right: var(--site-right, 62%);
  bottom: 0;
  height: var(--kit);
  display: flex;
  flex-wrap: wrap-reverse;
  align-content: flex-start;   /* with wrap-reverse: the first row sits at the bottom */
  align-items: flex-start;     /* and its items stand on the bottom edge */
  justify-content: space-between;
  column-gap: clamp(16px, 2.5vw, 48px);
  overflow: hidden;
}
.kit { display: block; flex: none; width: auto; height: var(--kit); overflow: visible; }

.kit-line { fill: none; stroke: var(--paper); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.kit-red { fill: var(--red); stroke: var(--paper); stroke-width: 2; stroke-linejoin: round; }
.kit-dark { fill: var(--deep); stroke: var(--paper); stroke-width: 2.5; }
.kit-soft { fill: none; stroke: var(--lavender); stroke-width: 2; stroke-linecap: round; }
.kit-glass { fill: var(--lavender); }
.kit-pale { fill: var(--paper); }
.kit-dot { fill: var(--lavender); }
.kit-stripe { fill: var(--red); }
.kit-outline { fill: none; stroke: var(--paper); stroke-width: 2; }
.kit-arm, .kit-arm-core { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kit-arm { stroke: var(--paper); stroke-width: 10; }
.kit-arm-core { stroke: var(--red); stroke-width: 5; }
.kit-sand { fill: rgba(207, 207, 245, 0.32); stroke: var(--paper); stroke-width: 2.5; stroke-linejoin: round; }

/* ---------- Sidewalk and curb ---------- */
.sidewalk {
  grid-row: 3;
  position: relative;
  z-index: 3;
  height: clamp(16px, 2.6svh, 26px);
  border-top: 2px solid var(--lavender);    /* the paving's edge */
  border-bottom: 5px solid var(--curb);     /* the curb */
  background: repeating-linear-gradient(90deg, var(--slab) 0 62px, var(--deep) 62px 64px); /* taste-skill-ignore: paving slabs and their joints, two flat colours */
}

/* ---------- The road, which carries the footer ---------- */
.foot {
  grid-row: 4;
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 24px;
  padding: 34px var(--margin) clamp(12px, 2.4svh, 22px);
  background: var(--asphalt);
  font-size: var(--step-small);
  color: var(--lavender);
}
/* the lane markings */
.foot::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 14px;
  height: 4px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0 36px, transparent 36px 72px); /* taste-skill-ignore: dashed lane line */
}
.foot-legal { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* Stop / start the crane. Only with JavaScript, and never with reduced motion. */
.crane-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin: -6px -12px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--lavender);
  font: 500 var(--step-small)/1.2 var(--font-body);
  cursor: pointer;
  transition:
    background-color var(--duration-quick) var(--ease-out),
    color var(--duration-quick) var(--ease-out);
}
.js .crane-toggle { display: inline-flex; }
.crane-toggle:hover { background: rgba(255, 255, 255, 0.12); color: var(--paper); }
.crane-toggle-icon { display: block; width: 14px; height: 14px; fill: currentColor; }
.icon-play { display: none; }
:is(.crane-paused, .crane-still) .icon-pause { display: none; }
:is(.crane-paused, .crane-still) .icon-play { display: inline; }

/* ---------- Landscape screens: the crane beside the headline ---------- */
@media (min-aspect-ratio: 5/4) {
  :root {
    --step-hero: clamp(30px, min(8.2vw, 13.5svh), 156px);
    --kit: clamp(40px, min(13svh, 7vw), 140px);
  }
  .stage {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 1fr) var(--crane-col);
    align-items: center;
    column-gap: var(--col-gap);
    padding: clamp(16px, 4svh, 48px) var(--margin) 0;
  }
  /* keep the headline clear of the equipment below it */
  .copy { padding-bottom: calc(var(--kit) + clamp(12px, 3svh, 32px)); }
  .crane { align-self: stretch; }
  .site { right: var(--site-right, calc(var(--margin) + var(--crane-col) + var(--col-gap))); }
}

/* Short screens (phones held sideways): a shallower street. */
@media (max-height: 520px) {
  :root { --sink: 30px; }
  .stage { padding-top: 10px; }
  .sidewalk { height: 12px; border-bottom-width: 4px; }
  .foot { padding-top: 22px; padding-bottom: 8px; row-gap: 2px; }
  .foot::before { top: 8px; height: 3px; }
}

/* ---------- Entrance (only with JavaScript, never with reduced motion) ---------- */
.js .rv {
  opacity: 0;
  translate: 0 var(--stagger-distance);
  filter: blur(var(--stagger-blur));
}
.js.is-in .rv {
  opacity: 1;
  translate: none;
  filter: none;
  transition:
    opacity var(--stagger-dur) var(--stagger-ease),
    translate var(--stagger-dur) var(--stagger-ease),
    filter var(--stagger-dur) var(--stagger-ease);
  transition-delay: calc(var(--i, 0) * var(--stagger-stagger));
}

/* Reduced motion: the logo hangs still, nothing loops, and there is nothing to stop. */
@media (prefers-reduced-motion: reduce) {
  .js .rv { opacity: 1; translate: none; filter: none; }
  .crane-run, .crane-cable, .crane-load, .crane-swing, .cone,
  .crew-anim, .bob { animation: none !important; }
  .crane-toggle { display: none !important; }
  *, *::before, *::after { transition: none !important; }
}
