/* Carbon Black holding page.
   One poster-scaled screen that never scrolls: the stage is 160 x 90 rem on wide
   screens and 90 x 160 rem on tall ones, and 1rem is sized so it always fits.
   Palette, type and the ink-and-planet look come straight from carbonblack.tech. */

@font-face { font-family: Chango; src: url(../fonts/chango.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Familjen Grotesk"; src: url(../fonts/familjen.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --sky: #16c5bc;
  --sky-deep: #0c9f9b;
  --sky-line: #0fb2ab;
  --ink: #171033;
  --ink-2: #261b4d;
  --ink-3: #3d3170;
  --cream: #fff5d9;
  --amber: #ffb400;
  --coral: #fa4f15;
  --pink: #ea2576;
  --acid: #c6f500;
  --cyan: #4ff0ff;
  --coffee: #6b3b1f;
  --spring: cubic-bezier(.22, 1.5, .42, 1);
  --snap: linear(0, .5 12%, 1.12 28%, 1.03 40%, .98 54%, 1.005 72%, 1);
  --display: Chango, "Arial Black", sans-serif;
  --text: "Familjen Grotesk", "Segoe UI", system-ui, sans-serif;
  --line: .35rem;
  --drop: 0 .5rem 0 var(--ink);
}

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

html {
  height: 100%;
  font-size: min(calc(100vw / 160), calc(100vh / 90));
  font-size: min(calc(100vw / 160), calc(100dvh / 90));
  background: var(--sky);
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  position: fixed; inset: 0;
  margin: 0; overflow: hidden;
  background: var(--sky); color: var(--ink);
  font: 500 1.8rem/1.35 var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: manipulation;
}

p, h1, h2 { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg { display: block; }
::selection { background: var(--pink); color: var(--cream); }
:focus-visible { outline: .4rem solid var(--ink); outline-offset: .3rem; box-shadow: 0 0 0 .3rem var(--cream); border-radius: .6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Halftone weather in the corners, the same pop-print grain as the main site. */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background-image: radial-gradient(circle, var(--sky-deep) 26%, transparent 28%);
  background-size: 14px 14px;
  -webkit-mask-image: radial-gradient(ellipse 60% 70% at 100% 100%, #000 10%, transparent 75%), radial-gradient(ellipse 45% 55% at 0 0, #000, transparent 70%);
  mask-image: radial-gradient(ellipse 60% 70% at 100% 100%, #000 10%, transparent 75%), radial-gradient(ellipse 45% 55% at 0 0, #000, transparent 70%);
}

/* Hand-drawn line boil: three noise frames swapped at about 8fps, like a cel cartoon. */
.boil-soft { animation: boil .42s steps(1) infinite; }
@keyframes boil { 0% { filter: url(#boil-0); } 33% { filter: url(#boil-1); } 66% { filter: url(#boil-2); } }

/* ---------- Sky ---------- */
.sky { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.sky-far, .sky-stars { translate: calc(var(--px, 0) * var(--depth)) calc(var(--py, 0) * var(--depth)); }
.sky-far { --depth: 8px; }
.sky-stars { --depth: 16px; }
.trace { fill: none; stroke: var(--sky-line); stroke-width: 5; stroke-linejoin: round; }
.node circle { fill: var(--sky); stroke: var(--sky-line); stroke-width: 5; }
.star { fill: var(--ink); transform-box: fill-box; transform-origin: center; animation: twinkle 4.2s ease-in-out infinite; }
.star-cream { fill: var(--cream); }
.s2 { animation-delay: -1.1s; animation-duration: 5.3s; }
.s3 { animation-delay: -2.4s; }
.s4 { animation-delay: -.6s; animation-duration: 3.6s; }
.s5 { animation-delay: -3.1s; animation-duration: 6s; }
.s6 { animation-delay: -1.8s; }
.s7 { animation-delay: -2.9s; animation-duration: 3.2s; }
.s8 { animation-delay: -.2s; animation-duration: 4.8s; }
.s9 { animation-delay: -3.7s; }
@keyframes twinkle { 0%, 100% { scale: 1; rotate: 0deg; } 45% { scale: .55; rotate: 20deg; } 55% { scale: 1.15; } }

/* ---------- The stage ---------- */
.stage {
  position: absolute; left: 50%; top: 50%;
  width: 160rem; height: 90rem;
  translate: -50% -50%;
}
.intro .stage { visibility: hidden; }
.stage > * { position: absolute; }

/* Shared outline style for every hand-drawn part. */
.o { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.o:not([fill]) { fill: none; }
.o-thick { stroke-width: 7; }
.o-fine { stroke-width: 3.5; }
.ground { fill: var(--sky-deep); }

/* ---------- Docket ---------- */
.docket {
  left: 4rem; top: 3.4rem;
  display: grid; gap: .1rem;
  padding: 1rem 2rem 1.1rem 4.2rem;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: .8rem;
  box-shadow: var(--drop);
  rotate: -2.5deg;
  line-height: 1.15;
}
.docket-hole { position: absolute; left: 1.3rem; top: 50%; width: 1.7rem; height: 1.7rem; margin-top: -.85rem; border-radius: 50%; background: var(--sky); border: .3rem solid var(--ink); }
.docket-k { font-size: 1.2rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.docket-k b { font-variant-numeric: tabular-nums; color: var(--pink); }
.docket-v { font: 400 1.9rem/1.15 var(--display); max-width: 36rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docket-v.long { font-size: 1.55rem; }
.docket-v.longer { font-size: 1.25rem; }
.docket-s { font-size: 1.3rem; font-weight: 700; }
.docket-s em { font-style: normal; padding: 0 .4rem; background: var(--acid); border-radius: .3rem; }

/* ---------- Sound toggle ---------- */
.sound {
  right: 4rem; top: 3.6rem;
  width: 6.4rem; height: 6.4rem;
  display: grid; place-items: center;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: 50%;
  box-shadow: var(--drop);
  transition: translate .15s, box-shadow .15s, background .15s;
}
.sound:hover { background: var(--amber); }
.sound:active { translate: 0 .3rem; box-shadow: 0 .2rem 0 var(--ink); }
.sound svg { width: 3.6rem; height: 3.6rem; fill: none; stroke: var(--ink); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.sp-box { fill: var(--ink); }
.sp-on { display: none; }
.sound[aria-pressed="true"] .sp-on { display: inline; }
.sound[aria-pressed="true"] .sp-off { display: none; }
.sound[aria-pressed="true"] { background: var(--acid); }

/* ---------- Planet core ---------- */
.core { left: 61rem; top: 5.5rem; width: 38rem; aspect-ratio: 1; }
.orbit { position: absolute; inset: -22%; width: 144%; height: 144%; overflow: visible; pointer-events: none; }
.orbit ellipse { fill: none; stroke: var(--ink); stroke-width: 3; stroke-dasharray: 1 14; stroke-linecap: round; opacity: .45; }
.sat { position: absolute; left: 50%; top: 50%; width: 7.4rem; margin: -1.85rem 0 0 -3.7rem; z-index: 1; will-change: transform; pointer-events: none; }
.sat.front { z-index: 6; }
.sat-led { animation: blink 1.6s steps(1) infinite; }
.planet { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.planet-body { fill: var(--ink); }
.planet-shade { fill: var(--ink-2); }
.planet-craters circle { fill: var(--ink-2); stroke: var(--ink-3); stroke-width: 3; }
.planet-rivets circle { fill: var(--ink-3); }
.planet-shine { fill: none; stroke: var(--ink-3); stroke-width: 12; stroke-linecap: round; }
.planet-ring { fill: none; stroke: var(--ink); stroke-width: 8; }
.logo { position: absolute; inset: 7.5%; z-index: 3; border-radius: 50%; transition: scale .25s var(--spring); }
.logo:hover { scale: 1.03; }
.logo:active { scale: .97; }
.logo-img { display: block; width: 100%; height: auto; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.hat {
  left: 50%; top: -15.5%; width: 47%; z-index: 4;
  position: absolute;
  translate: -38% 0; rotate: 11deg;
  transform-origin: 50% 90%;
  transition: rotate .35s var(--spring);
}
.hat:hover { rotate: 2deg; }
.hat svg { width: 100%; height: auto; overflow: visible; }
.hat-shine { fill: none; stroke: var(--cream); stroke-width: 7; stroke-linecap: round; opacity: .75; }
.shock { position: absolute; aspect-ratio: 1; border-radius: 50%; border: .6rem solid var(--cream); pointer-events: none; z-index: 1; }

/* ---------- Headline ribbon ---------- */
.headline { left: 80rem; top: 41.6rem; z-index: 7; translate: -50% 0; font-weight: 400; pointer-events: none; }
.ribbon { display: block; padding: .3rem; background: var(--ink); rotate: -1.4deg; clip-path: polygon(0 0, 100% 0, calc(100% - 1.3rem) 50%, 100% 100%, 0 100%, 1.3rem 50%); }
.ribbon-text { display: block; padding: .7rem 3.6rem .8rem; background: var(--cream); font: 400 2.6rem/1.05 var(--display); letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; clip-path: polygon(0 0, 100% 0, calc(100% - 1.2rem) 50%, 100% 100%, 0 100%, 1.2rem 50%); }

/* ---------- The hanging domain ---------- */
.bunting { left: 43.5rem; top: 48.6rem; width: 75rem; height: 19rem; z-index: 6; }
.cable { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cable-jacket { fill: none; stroke: var(--ink); stroke-width: 11; stroke-linecap: round; }
.cable-core { fill: none; stroke: var(--coral); stroke-width: 4.5; stroke-linecap: round; stroke-dasharray: 14 10; animation: flow 1.6s linear infinite; }
.pulley { position: absolute; top: -1.9rem; width: 3.8rem; height: 3.8rem; border-radius: 50%; background: var(--cream); border: .4rem solid var(--ink); box-shadow: 0 .35rem 0 var(--ink); }
.pulley::after { content: ""; position: absolute; inset: 30%; border-radius: 50%; background: var(--ink); }
.pulley-l { left: -1.9rem; }
.pulley-r { right: -1.9rem; }
.letters { position: absolute; inset: 0; }
.lt {
  position: absolute; top: 0; left: 0;
  transform-origin: 50% 0;
  cursor: grab; touch-action: none;
  user-select: none; -webkit-user-select: none;
  will-change: transform;
}
.lt.drag { cursor: grabbing; }
.lt::before { /* the string */
  content: ""; position: absolute; left: 50%; top: 0;
  width: .38rem; height: calc(var(--len) + .3em); margin-left: -.19rem;
  background: var(--ink); border-radius: .2rem;
}
.lt::after { /* the hook */
  content: ""; position: absolute; left: 50%; top: -.8rem;
  width: 1.6rem; height: 1.6rem; margin-left: -.8rem;
  border-radius: 50%; border: .38rem solid var(--ink); border-bottom-color: transparent;
  rotate: -30deg;
}
.g {
  position: relative; display: block;
  margin-top: var(--len);
  font: 400 1em/1 var(--display);
  color: var(--amber);
  -webkit-text-stroke: .05em var(--ink); paint-order: stroke fill;
  text-shadow: 0 .03em 0 var(--ink), 0 .06em 0 var(--ink), 0 .09em 0 var(--ink);
  transition: color .3s;
}
.lt.hot .g { color: var(--cream); transition: none; }
.lt.tld .g {
  margin-top: calc(var(--len) + .2em);
  padding: .14em .42em .2em;
  font-size: .3em; letter-spacing: .02em;
  color: var(--ink); -webkit-text-stroke: 0; text-shadow: none;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: .5em;
  box-shadow: 0 .4rem 0 var(--ink);
  white-space: nowrap;
}
.lt.tld.hot .g { background: var(--acid); }
.behaved .lt .g { color: var(--acid); }

/* ---------- Job sheet note ---------- */
.note {
  left: 80rem; top: 68.4rem; width: 64rem; z-index: 5;
  translate: -50% 0; rotate: .7deg;
  padding: 1.5rem 2.6rem 1.6rem;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: .5rem;
  box-shadow: var(--drop);
  font-size: 1.85rem; line-height: 1.38; text-align: center; text-wrap: balance;
}
.note p { position: relative; z-index: 1; }
.note strong { font-weight: 700; background: linear-gradient(transparent 58%, var(--amber) 58%, var(--amber) 92%, transparent 92%); padding: 0 .15em; }
.scrawl {
  font-weight: 700; white-space: nowrap; padding-bottom: .2em;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 10' preserveAspectRatio='none'%3E%3Cpath d='M2 6c12-4 22 3 34-1s20-3 30 0 22 3 32-2 14 1 20 0' fill='none' stroke='%23ea2576' stroke-width='3.4' stroke-linecap='round'/%3E%3C/svg%3E") 0 100% / 100% .45em no-repeat;
}
.tape { position: absolute; top: -1.5rem; width: 9rem; height: 2.8rem; background: rgba(255, 255, 255, .5); border-inline: .25rem dashed rgba(255, 255, 255, .7); box-shadow: 0 .1rem .3rem rgba(23, 16, 51, .12); z-index: 2; }
.tape-l { left: -2.4rem; rotate: -9deg; }
.tape-r { right: -2.2rem; rotate: 7deg; }
.ring-stain { position: absolute; right: 5rem; bottom: -1.2rem; width: 7.6rem; aspect-ratio: 1; border-radius: 50%; border: .55rem solid rgba(107, 59, 31, .13); box-shadow: inset 0 0 0 .25rem rgba(107, 59, 31, .06), .4rem -.3rem 0 -.2rem rgba(107, 59, 31, .05); pointer-events: none; }
.stamp {
  position: absolute; right: -3rem; top: -3.4rem; z-index: 3;
  padding: .3rem 1.4rem .4rem;
  font: 400 3.4rem/1 var(--display); text-transform: uppercase; letter-spacing: .04em;
  color: var(--pink); border: .5rem double var(--pink); border-radius: .8rem;
  background: rgba(255, 245, 217, .7);
  rotate: -14deg; opacity: 0; pointer-events: none;
}

/* ---------- Call to action ---------- */
.cta-row { left: 80rem; top: 79.6rem; translate: -50% 0; z-index: 5; display: flex; align-items: center; gap: 2.4rem; white-space: nowrap; }
.cta {
  display: inline-flex; align-items: center; gap: .8rem;
  padding: 1rem 2.4rem 1.1rem;
  background: var(--amber); color: var(--ink);
  border: var(--line) solid var(--ink); border-radius: 99rem;
  box-shadow: var(--drop);
  font-size: 2rem; font-weight: 700; text-decoration: none;
  transition: translate .15s, box-shadow .15s, background .15s;
}
.cta svg { width: 2.2rem; height: 2.2rem; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; transition: translate .25s var(--spring); }
.cta:hover { background: var(--cream); }
.cta:hover svg { translate: .4rem 0; }
.cta:active { translate: 0 .35rem; box-shadow: 0 .15rem 0 var(--ink); }
.cta.nudge { animation: nudge .9s var(--spring); }
@keyframes nudge { 0%, 100% { rotate: 0deg; } 20% { rotate: -4deg; scale: 1.06; } 45% { rotate: 3deg; } 70% { rotate: -1.5deg; } }
.cta-aside { font-size: 1.6rem; font-weight: 700; }
.cta-aside a { text-decoration: underline; text-decoration-thickness: .25rem; text-underline-offset: .3rem; text-decoration-color: var(--pink); }
.cta-aside a:hover { text-decoration-color: var(--ink); }

/* ---------- Build-O-Matic ---------- */
.machine { left: 2rem; top: 13.5rem; width: 38rem; aspect-ratio: 444 / 640; z-index: 4; }
.mach-svg { width: 100%; height: 100%; overflow: visible; }
.mach-word { font: 400 22px/1 var(--display); fill: var(--ink); }
.mach-name { font-size: 20px; }
.mach-mk { font-size: 15px; fill: var(--cream); }
.mach-warn { font-size: 11px; }
.gauge-word { font: 700 11px/1 var(--text); fill: var(--ink); letter-spacing: .06em; }
.casing-shine { fill: none; stroke: #ffd666; stroke-width: 8; stroke-linecap: round; }
.glare { fill: none; stroke: var(--cream); stroke-width: 7; stroke-linecap: round; opacity: .8; }
.needle { transform-box: view-box; transform-origin: 290px 300px; rotate: -70deg; }
.belt-line { fill: none; stroke: var(--cream); stroke-width: 3; stroke-dasharray: 6 18; stroke-linecap: round; animation: belt-run .7s linear infinite; }
@keyframes belt-run { to { stroke-dashoffset: -24; } }

.a-spin { transform-box: fill-box; transform-origin: center; animation: spin 18s linear infinite; }
.a-spin-slow { animation-duration: 26s; }
.a-spin-fast { animation-duration: 9s; }
.a-spin-rev { animation-duration: 15s; animation-direction: reverse; }
.a-spin-rev2 { animation-duration: 6s; animation-direction: reverse; }
@keyframes spin { to { rotate: 360deg; } }

.puff { fill: var(--cream); stroke: var(--ink); stroke-width: 4; transform-box: fill-box; transform-origin: center; animation: puff 3.9s ease-out infinite; }
.p2 { animation-delay: -1.3s; }
.p3 { animation-delay: -2.6s; }
.puff-ring { fill: none; stroke: var(--amber); stroke-width: 6; transform-box: fill-box; transform-origin: center; animation: puff-ring 9s ease-out infinite; animation-delay: -4s; }
@keyframes puff { 0% { transform: translate(0, 0) scale(.3); opacity: 0; } 10%, 62% { opacity: 1; } 100% { transform: translate(28px, -118px) scale(1.9); opacity: 0; } }
@keyframes puff-ring { 0%, 62% { transform: translate(0, 0) scale(.3); opacity: 0; } 66% { opacity: 1; } 100% { transform: translate(-14px, -140px) scale(2.3); opacity: 0; } }

.bulb { transform-box: fill-box; transform-origin: center; animation: bulb-drop 6.6s cubic-bezier(.5, 0, .9, .6) infinite; opacity: 0; }
.b2 { animation-delay: -2.2s; }
.b3 { animation-delay: -4.4s; }
@keyframes bulb-drop { 0% { transform: translateY(-90px) rotate(-20deg); opacity: 0; } 12% { opacity: 1; } 34% { transform: translateY(40px) rotate(10deg) scale(.7); opacity: 1; } 38%, 100% { transform: translateY(56px) scale(.4); opacity: 0; } }

.card { transform-box: fill-box; transform-origin: center; animation: card 7.5s linear infinite; opacity: 0; }
.c2 { animation-delay: -2.5s; }
.c3 { animation-delay: -5s; }
@keyframes card {
  0% { transform: translate(0, -34px) scale(.55); opacity: 0; }
  6% { transform: translate(0, -12px) scale(.9); opacity: 1; }
  11% { transform: translate(0, 0) scale(1); }
  70% { transform: translate(168px, 0) rotate(0deg); opacity: 1; }
  78% { transform: translate(196px, 12px) rotate(35deg); }
  90% { transform: translate(214px, 70px) rotate(80deg); opacity: 1; }
  100% { transform: translate(222px, 100px) rotate(100deg); opacity: 0; }
}

.led { animation: blink 3.3s steps(1) infinite; }
.led-1 { animation-duration: 2.1s; animation-delay: -.7s; }
.led-2 { animation-duration: 4.3s; animation-delay: -1.3s; }
.led-3 { animation-duration: 1.7s; animation-delay: -.4s; }
.led-4 { animation-duration: 5.9s; animation-delay: -2s; }
@keyframes blink { 0%, 62%, 79%, 100% { opacity: 1; } 63%, 78% { opacity: .22; } }

.valve { transform-box: fill-box; transform-origin: center; }
.valve-steam { opacity: 0; }
.steam { fill: var(--cream); stroke: var(--ink); stroke-width: 3.5; transform-box: fill-box; transform-origin: center; }
.overdrive .valve { animation: spin .5s linear infinite; }
.overdrive .valve-steam { opacity: 1; }
.overdrive .steam { animation: steam .6s ease-out infinite; }
.overdrive .steam-2 { animation-delay: -.2s; }
.overdrive .steam-3 { animation-delay: -.4s; }
@keyframes steam { from { transform: translate(0, 10px) scale(.4); opacity: 1; } to { transform: translate(-18px, -30px) scale(1.4); opacity: 0; } }

.overdrive .mach-svg { animation: rattle .11s linear infinite; }
@keyframes rattle { 0% { translate: 0 0; rotate: 0deg; } 25% { translate: -.3rem .15rem; rotate: -.5deg; } 50% { translate: .25rem -.2rem; rotate: .4deg; } 75% { translate: -.15rem -.1rem; rotate: -.2deg; } }

.big-btn {
  position: absolute; left: 68.47%; top: 61.25%; width: 18.9%;
  aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%;
}
.big-btn svg { width: 100%; height: 100%; overflow: visible; }
.big-btn .dome { transition: transform .12s; }
.big-btn:hover .dome { transform: translateY(-2px); }
.big-btn:active .dome, .big-btn.pressed .dome { transform: translateY(7px); transition-duration: .05s; }
.big-btn.tempt { animation: tempt 1.1s var(--spring); }
@keyframes tempt { 0%, 100% { scale: 1; } 30% { scale: 1.14; } 55% { scale: .96; } 75% { scale: 1.04; } }
.warn-tag {
  position: absolute; left: 86%; top: 72%;
  padding: .5rem .9rem .6rem;
  background: var(--cream); border: .3rem solid var(--ink); border-radius: .5rem;
  font: 400 1.15rem/1.1 var(--display); text-transform: uppercase;
  rotate: 9deg; box-shadow: 0 .3rem 0 var(--ink);
  pointer-events: none;
}
.warn-tag::before { content: ""; position: absolute; left: -3.4rem; top: .7rem; width: 3.6rem; height: .25rem; background: var(--ink); rotate: -24deg; transform-origin: 100% 50%; }

/* ---------- Gus ---------- */
.robot { left: 122.5rem; top: 23rem; width: 31.5rem; z-index: 5; }
.robot-btn { display: block; width: 100%; border-radius: 2rem; }
.robot-btn:focus-visible { outline-offset: -.4rem; }
.robot-svg { width: 100%; height: auto; overflow: visible; }
.crate-word { font: 400 24px/1 var(--display); fill: var(--coral); letter-spacing: .04em; }
.crate-small { font: 700 12px/1 var(--text); fill: var(--ink); letter-spacing: .14em; }
.crate-arrow { fill: none; stroke: var(--coral); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.robot-name { font: 400 13px/1 var(--display); fill: var(--ink); letter-spacing: .1em; }
.head { transform-box: view-box; transform-origin: 170px 236px; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { rotate: -1.5deg; } 50% { rotate: 1.5deg; translate: 0 2px; } }
.antenna { transform-box: view-box; transform-origin: 170px 92px; }
.bulb-top { animation: blink 2.6s steps(1) infinite; }
.arm-l { transform-box: view-box; transform-origin: 102px 262px; animation: tap 2.8s ease-in infinite; }
@keyframes tap { 0%, 52%, 100% { rotate: 0deg; } 60% { rotate: 14deg; } 66% { rotate: -2deg; } 72% { rotate: 12deg; } 78% { rotate: 0deg; } }
.arm-r { transform-box: view-box; transform-origin: 242px 262px; animation: idle-arm 4.4s ease-in-out infinite; }
@keyframes idle-arm { 0%, 100% { rotate: 0deg; } 50% { rotate: -6deg; } }
.robot-btn:hover .arm-r, .arm-r.wave { animation: wave .5s ease-in-out 3 alternate; }
@keyframes wave { from { rotate: 8deg; } to { rotate: -26deg; } }
.eyes { transform-box: fill-box; transform-origin: center; transition: scale .07s; }
.eyes.blink { scale: 1 .08; }
.brow { transition: translate .2s var(--spring); }
.robot.surprised .brow { translate: 0 -8px; }
.robot.hop .robot-btn { animation: hop .55s var(--spring); }
@keyframes hop { 0%, 100% { translate: 0 0; } 35% { translate: 0 -2.2rem; } 60% { translate: 0 .3rem; } }
.antenna.boing { animation: boing .7s var(--spring); }
@keyframes boing { 0% { scale: 1 1; } 25% { scale: 1 1.5; } 50% { scale: 1 .7; } 75% { scale: 1 1.15; } 100% { scale: 1 1; } }

.bubble {
  position: absolute; right: 2%; bottom: 92%;
  width: max-content; max-width: 34rem;
  padding: 1.1rem 1.8rem 1.3rem;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: 2.2rem;
  box-shadow: var(--drop);
  font-size: 1.8rem; font-weight: 700; line-height: 1.25;
  transform-origin: 70% 120%;
  opacity: 0; scale: .5; translate: 0 1rem;
  transition: opacity .15s, scale .35s var(--spring), translate .35s var(--spring);
  pointer-events: none;
  z-index: 2;
}
.bubble::after {
  content: ""; position: absolute; right: 34%; bottom: -1.7rem;
  width: 2.8rem; height: 2.8rem;
  background: var(--cream);
  border-right: var(--line) solid var(--ink); border-bottom: var(--line) solid var(--ink);
  rotate: 45deg;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.bubble.show { opacity: 1; scale: 1; translate: 0 0; }

/* ---------- Readout ---------- */
.readout {
  left: 118.5rem; top: 72.6rem; width: 37.5rem; z-index: 5;
  background: var(--cream);
  border: var(--line) solid var(--ink); border-radius: 1.4rem;
  box-shadow: var(--drop);
  overflow: hidden; rotate: -.6deg;
}
.readout-title { padding: .45rem 1.2rem .5rem; background: var(--ink); color: var(--cream); font: 400 1.15rem/1.1 var(--display); letter-spacing: .1em; text-transform: uppercase; }
.cells { display: grid; grid-template-columns: repeat(3, 1fr); }
.cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .1rem; padding: .7rem .4rem .8rem; min-width: 0; }
.cell + .cell { border-left: .3rem solid var(--ink); }
.cell-v { font: 400 1.7rem/1 var(--display); font-variant-numeric: tabular-nums; }
.cell-k { font-size: 1.1rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; text-align: center; }
.dial { width: 8.4rem; height: auto; }
.dial-needle { transform-box: view-box; transform-origin: 60px 62px; rotate: -90deg; }
.cell-mug { transition: background .15s; }
.cell-mug:hover { background: #ffe9ad; }
.mug { width: 6rem; height: auto; overflow: visible; }
.coffee { transform-box: view-box; transform-origin: 0 62px; }
.mug-steam path { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; opacity: .55; animation: mug-steam 2.4s ease-in-out infinite; }
.mug-steam path + path { animation-delay: -1.2s; }
@keyframes mug-steam { 0%, 100% { translate: 0 2px; opacity: 0; } 50% { translate: 0 -3px; opacity: .6; } }
.cell-mug.low .mug { animation: shiver .3s linear infinite; }
@keyframes shiver { 50% { translate: .15rem 0; } }
.flip { display: inline-flex; gap: .3rem; margin-bottom: .3rem; perspective: 20rem; }
.flip span {
  position: relative; display: grid; place-items: center;
  width: 2.5rem; height: 3.4rem;
  background: var(--ink); color: var(--cream);
  border-radius: .5rem;
  font: 400 2.1rem/1 var(--display);
}
.flip span::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: .12rem; background: rgba(0, 0, 0, .45); }
.flip span.tick { animation: flip .4s var(--spring); }
@keyframes flip { 0% { transform: rotateX(-90deg); } 100% { transform: rotateX(0); } }

/* ---------- Workshop log ---------- */
.log {
  left: 80rem; top: 85.4rem; width: 70rem; height: 3.6rem; z-index: 5;
  translate: -50% 0;
  display: flex; align-items: center;
  background: var(--ink); color: var(--cream);
  border-radius: 99rem;
  font-size: 1.45rem; font-weight: 500;
  overflow: hidden;
}
.log-k { flex: none; align-self: stretch; display: flex; align-items: center; padding: 0 1.4rem 0 1.6rem; margin-right: 1.2rem; background: var(--amber); color: var(--ink); font: 400 1.05rem/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.log-line { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding-right: 1.6rem; }
.log-t { color: var(--acid); font-weight: 700; font-variant-numeric: tabular-nums; }
.caret { display: inline-block; width: .55em; height: 1em; margin-left: .15em; vertical-align: -.12em; background: var(--cream); animation: blink-hard 1s steps(1) infinite; }
@keyframes blink-hard { 50% { opacity: 0; } }

.foot { left: 4rem; top: 86.1rem; font-size: 1.3rem; font-weight: 700; }

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

/* ---------- Bugs ---------- */
.bugs { inset: 0; pointer-events: none; z-index: 20; }
.bug { position: absolute; left: 0; top: 0; width: 5.4rem; margin: -2.7rem 0 0 -2.7rem; pointer-events: auto; cursor: crosshair; touch-action: none; }
.bug::before { content: ""; position: absolute; inset: -1.6rem; } /* a fair target on touch screens */
.bug svg { width: 100%; height: auto; overflow: visible; }
.leg { fill: none; stroke: var(--ink); stroke-width: 3.4; stroke-linecap: round; transform-box: fill-box; }
.leg-a { animation: scuttle .16s linear infinite alternate; transform-origin: 100% 50%; }
.leg-b { animation: scuttle .16s linear infinite alternate-reverse; transform-origin: 0 50%; }
@keyframes scuttle { from { rotate: -16deg; } to { rotate: 16deg; } }
.bug-px { animation: glitch .5s steps(1) infinite; }
.bug-px-2 { animation-delay: -.25s; }
@keyframes glitch { 50% { opacity: .2; translate: 1px 0; } }
.splat { position: absolute; left: 0; top: 0; width: 7.4rem; margin: -3.7rem 0 0 -3.7rem; pointer-events: none; }
.splat svg { width: 100%; height: auto; }
.plus { position: absolute; left: 0; top: 0; translate: -50% -50%; font: 400 2.6rem/1 var(--display); color: var(--acid); -webkit-text-stroke: .1em var(--ink); paint-order: stroke fill; pointer-events: none; white-space: nowrap; }

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }

.noscript { position: fixed; inset: auto 0 0; margin: 0; padding: 1rem 1.6rem; background: var(--ink); color: var(--cream); font-size: 15px; z-index: 60; }

/* ---------- Tall screens: the same poster, re-hung for portrait ---------- */
@media (max-aspect-ratio: 1/1) {
  html { font-size: min(calc(100vw / 90), calc(100vh / 172)); font-size: min(calc(100vw / 90), calc(100dvh / 172)); }
  .stage { width: 90rem; height: 172rem; }

  .docket { left: 3rem; top: 2.6rem; padding: 1.1rem 2rem 1.2rem 4.4rem; }
  .docket-k, .docket-s { font-size: 1.6rem; }
  .docket-v { font-size: 2.4rem; max-width: 40rem; }
  .sound { right: 3rem; top: 3.4rem; width: 8rem; height: 8rem; }
  .sound svg { width: 4.4rem; height: 4.4rem; }

  .core { left: 28.5rem; top: 14rem; width: 33rem; }
  .headline { left: 45rem; top: 44.8rem; }
  .ribbon-text { font-size: 3rem; padding-inline: 3.4rem; }
  .bunting { left: 5rem; top: 51.6rem; width: 80rem; height: 17rem; }

  .note { left: 45rem; top: 71rem; width: 82rem; font-size: 2.75rem; padding: 1.8rem 3rem 2rem; }
  .stamp { font-size: 4.4rem; right: -1rem; }
  .cta-row { left: 45rem; top: 92rem; flex-direction: column; gap: 1.4rem; }
  .cta { font-size: 3rem; padding: 1.4rem 3.6rem 1.5rem; }
  .cta svg { width: 3.2rem; height: 3.2rem; }
  .cta-aside { font-size: 2.3rem; }

  .machine { left: 1.5rem; top: 107rem; width: 32rem; }
  .warn-tag { font-size: 1.5rem; left: 82%; top: 76%; }
  .robot { left: 60rem; top: 113rem; width: 27rem; }
  .bubble { right: 92%; bottom: 50%; max-width: 31rem; font-size: 2.4rem; transform-origin: 105% 80%; }
  .bubble::after { right: -1.6rem; bottom: 2.2rem; rotate: -45deg; }

  .readout { left: 3rem; top: 157rem; width: 84rem; rotate: 0deg; }
  .readout-title { display: none; }
  .cell { flex-direction: row; justify-content: center; align-items: center; gap: 1rem; padding: .6rem; }
  .cell-dial, .cell-mug { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 1rem; }
  .cell-dial svg, .cell-mug svg { grid-row: span 2; }
  .cell-dial .cell-v, .cell-mug .cell-v { align-self: end; }
  .cell-dial .cell-k, .cell-mug .cell-k { align-self: start; }
  .dial { width: 8rem; }
  .mug { width: 5rem; }
  .cell-v { font-size: 2.2rem; }
  .cell-k { font-size: 1.3rem; }
  .cell-bugs { flex-direction: column; gap: .3rem; }

  .log { left: 45rem; top: 167.4rem; width: 84rem; height: 3.8rem; font-size: 1.8rem; }
  .log-k { font-size: 1.25rem; }
  .foot { display: none; }

  .bug { width: 7.4rem; margin: -3.7rem 0 0 -3.7rem; }
  .splat { width: 9.4rem; margin: -4.7rem 0 0 -4.7rem; }
}

/* ---------- Less motion, please ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .boil-soft { animation: none; filter: none; }
  .card, .bulb, .puff, .puff-ring { opacity: 0; }
}
