/* Otter Tutor: design v3. Spec-sheet tiles joined by 4 px seams. */

:root {
  --seam: #E2E3E5;
  --tile: #F6F5F1;
  --ink: #15171C;
  --panel: #0F1216;
  --laser: #FF4A1C;
  --highlight: #FFD54A;
  --marker: #1E44B8;

  --muted: #575B63;          /* secondary text on tiles, 6.5:1 */
  --on-panel: #E9EAEC;
  --muted-dark: #A2A7B0;     /* secondary text on panels, 7:1 */
  --otter-bg: #34355E;       /* otter.cpp BG: color565(52, 53, 94) */
  --bezel: #23243F;          /* screen frame, a shade darker than the navy screen */
  --bezel-ring: #45477A;     /* otter.cpp BG2 stripes: color565(69, 71, 120) */
  --video-bg: #F7F7F5;       /* background of the 360 render */

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --hand: "Kalam", "Comic Sans MS", cursive;

  --gap: 4px;
  --pad: clamp(20px, 3vw, 40px);
  --max: 1440px;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--seam);
  color: var(--ink);
  font-family: var(--font);
  font-size: clamp(1rem, .95rem + .2vw, 1.0625rem);
  line-height: 1.55;
  overflow-x: clip;
}
h1, h2, h3, p, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; }
[role="list"] { list-style: none; }
img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
em { font-style: italic; }
:focus-visible { outline: 3px solid var(--laser); outline-offset: 3px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 12px; top: -64px; z-index: 50;
  background: var(--ink); color: var(--tile); padding: 10px 16px; text-decoration: none; font-weight: 700;
}
.skip-link:focus { top: 12px; }
.is-hidden { visibility: hidden; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-size: .8125rem; font-weight: 500; letter-spacing: 0; line-height: 1.4; }
.muted { color: var(--muted); }
.muted-dark { color: var(--muted-dark); }

/* wide, heavy display type */
.nameplate, .headline, h2, h3, .kicker, .ask, .wordmark, .story-num, .big-num, .wordmark-sm {
  font-family: var(--font);
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.01em;
}

/* ---------- page + grid ---------- */
.page { max-width: var(--max); margin: 0 auto; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
main { display: flex; flex-direction: column; gap: var(--gap); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gap); }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

.tile {
  position: relative;
  background: var(--tile);
  padding: var(--pad);
  border-radius: 2px;
  overflow: hidden;
  isolation: isolate;
}
.panel { background: var(--panel); color: var(--on-panel); }

/* graph paper: 1 px lines every 24 px */
.grid-paper {
  background-image:
    linear-gradient(rgba(21, 23, 28, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 28, .07) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: -1px -1px;
}

/* axis tick marks along a seam: minor every 24 px, major every 120 px */
.ticks-bottom::after, .section-head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 12px; pointer-events: none; opacity: .4;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 120px) left bottom / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ink) 0 1px, transparent 1px 24px) left bottom / 100% 6px no-repeat;
}

/* handwritten derivations behind a few tiles, ~7% */
.bg-math { position: absolute; inset: 0; z-index: -1; pointer-events: none; color: var(--marker); opacity: .07; font-family: var(--hand); font-weight: 700; }
.bm { position: absolute; white-space: nowrap; line-height: 1; font-size: clamp(2.5rem, 1.5rem + 5vw, 6.5rem); }
.bm-hero-1 { top: 4%; right: -3%; }
.bm-hero-2 { bottom: 4%; right: 2%; font-size: clamp(1.8rem, 1rem + 3.5vw, 4.5rem); }
.bm-prob-1 { top: -6%; right: 2%; }
.bm-prob-2 { bottom: -4%; right: 30%; font-size: clamp(1.8rem, 1rem + 3vw, 4rem); }
.bm-sine { top: 10%; right: 0; width: min(60%, 600px); height: 80%; opacity: 1; }

/* ---------- header + nav ---------- */
.site-header {
  position: sticky; top: var(--gap); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 24px;
  padding-top: 14px; padding-bottom: 14px;
}
.wordmark-sm { font-size: 1.1rem; text-decoration: none; }
.nav-list { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 22px; }
.nav-list a { position: relative; text-decoration: none; font-weight: 600; font-size: .95rem; padding: 4px 0; }
.nav-list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--laser);
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav-list a:hover::after, .nav-list a:focus-visible::after { transform: scaleX(1); }

/* ---------- buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  font-family: var(--font); font-weight: 700; font-size: 1rem; font-variation-settings: "wdth" 110;
  text-decoration: none; border-radius: 2px; transition: background-color .15s ease, color .15s ease;
}
.btn-laser { background: var(--laser); color: var(--ink); }
.btn-laser:hover { background: #FF6A42; }
.btn-ghost { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--tile); }

/* ---------- hero ---------- */
.spec-line { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding-top: 14px; padding-bottom: 20px; }
.nameplate-tile { padding-top: clamp(20px, 3vw, 36px); padding-bottom: clamp(16px, 2.5vw, 30px); }
.nameplate {
  font-size: min(10.2vw, 10.5rem); line-height: .86; text-transform: uppercase; white-space: nowrap;
  font-variation-settings: "wdth" 118; letter-spacing: -0.02em;
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 22px; }
.headline { font-size: clamp(1.9rem, 1.1rem + 3vw, 3.5rem); line-height: 1.02; max-width: 16ch; }
.sub { font-size: clamp(1.05rem, 1rem + .3vw, 1.25rem); max-width: 44ch; }

.hero-otter, .demo-otter { display: flex; flex-direction: column; gap: 14px; container-type: inline-size; }
.otter-stage { display: flex; flex-direction: column; align-items: center; gap: 14px; flex: 1; justify-content: center; }
.otter-stage .bubble { align-self: stretch; }
.panel-label { color: var(--muted-dark); }

/* the otter's portrait screen (240x320) in a dark bezel */
.otter-frame {
  width: min(100%, 250px); background: var(--bezel); padding: 12px; border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--bezel-ring);
}
.otter-canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 3 / 4;
  background: var(--otter-bg); border-radius: 3px;
}
/* wide enough: screen on the left, speech bubble pointing at it from the right */
@container (min-width: 440px) {
  .otter-stage { flex-direction: row; align-items: center; }
  .otter-frame { flex: none; width: min(50%, 290px); }
  .otter-stage .bubble { align-self: center; flex: 1; margin-top: 0; }
  .otter-stage .bubble::before { top: 50%; left: -9px; margin-top: -9px; }
}

.bubble {
  position: relative; align-self: flex-start; max-width: 100%;
  background: var(--tile); color: var(--ink); padding: 12px 16px; border-radius: 2px;
  font-weight: 600; min-height: 3.2em; margin-top: 8px;
}
.bubble::before {
  content: ""; position: absolute; top: -9px; left: 28px; width: 18px; height: 18px;
  background: inherit; transform: rotate(45deg);
}

/* ---------- whiteboard ---------- */
.board { color: var(--marker); }
.board-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px;
  min-height: clamp(84px, 9vw, 120px); padding: 8px 0;
}
.board-line + .board-line { border-top: 1px dashed rgba(21, 23, 28, .25); }
.line-no { color: var(--muted); width: 1.5em; flex: none; }
.hand { font-family: var(--hand); font-weight: 700; font-size: clamp(1.35rem, 1rem + 1.8vw, 2.4rem); line-height: 1.2; }
.hl { background: linear-gradient(176deg, transparent 52%, var(--highlight) 52% 88%, transparent 88%); padding: 0 .15em; }
.frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .85em; line-height: 1.15; }
.frac > span:first-child { border-bottom: 3px solid currentColor; padding: 0 .2em .05em; }
.frac > span:last-child { padding: .05em .2em 0; }

/* the red-pen circle: the page's one emphasis device */
.circled { position: relative; display: inline-block; }
.pen-circle {
  position: absolute; left: -20px; top: -16px; width: calc(100% + 40px); height: calc(100% + 32px);
  color: var(--laser); pointer-events: none; overflow: visible; z-index: 1;
}
.pen-circle use { stroke-width: 3; }

.laser-dot {
  position: absolute; right: -34px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; z-index: 2;
  background: var(--laser);
  box-shadow: 0 0 0 4px rgba(255, 74, 28, .28), 0 0 18px 6px rgba(255, 74, 28, .5);
}
.laser-dot.lands { animation: laser-land .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes laser-land {
  0% { transform: translate(40px, -60px) scale(.4); opacity: 0; }
  60% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
.pen-circle { stroke-dasharray: 1.02; stroke-dashoffset: 0; }
.pen-circle.draws { animation: pen-draw .7s ease-in-out both; }
@keyframes pen-draw { from { stroke-dashoffset: 1.02; } to { stroke-dashoffset: 0; } }
.flag { margin-left: auto; color: var(--ink); border-left: 3px solid var(--laser); padding: 2px 0 2px 10px; }
.hero-board .board-line:last-child .hand { margin-right: 40px; }

/* ---------- section heads ---------- */
.section-head { display: flex; flex-direction: column; gap: 14px; padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(28px, 4vw, 52px); }
h2 { font-size: clamp(1.75rem, 1.1rem + 2.8vw, 3.4rem); line-height: 1.04; max-width: 22ch; }
h2 .pen-circle { left: -12px; top: -6px; width: calc(100% + 24px); height: calc(100% + 12px); }
h3 { font-size: 1.3rem; line-height: 1.15; }
.section-sub { font-size: 1.15rem; max-width: 50ch; }
.tile-label { font-family: var(--mono); font-size: .8125rem; font-weight: 500; font-variation-settings: normal; margin-bottom: 18px; }
.panel .tile-label { color: var(--muted-dark); }

/* ---------- robot ---------- */
.video-tile { grid-row: span 2; display: flex; flex-direction: column; gap: 18px; }
.viewport { position: relative; background: var(--video-bg); width: 100%; max-width: 580px; margin: 12px auto 0; }
.robot-video { width: 100%; aspect-ratio: 1; object-fit: cover; }
.corner { position: absolute; width: 18px; height: 18px; border-color: var(--on-panel); border-style: solid; border-width: 0; }
.c-tl { top: -10px; left: -10px; border-top-width: 2px; border-left-width: 2px; }
.c-tr { top: -10px; right: -10px; border-top-width: 2px; border-right-width: 2px; }
.c-bl { bottom: -10px; left: -10px; border-bottom-width: 2px; border-left-width: 2px; }
.c-br { bottom: -10px; right: -10px; border-bottom-width: 2px; border-right-width: 2px; }
.video-tile figcaption { display: flex; flex-direction: column; gap: 6px; font-size: 1.05rem; max-width: 52ch; margin-top: auto; }

.spec-table, .status-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { padding: 14px 0; border-top: 1px solid var(--ink); text-align: left; vertical-align: baseline; }
.spec-table tr:last-child > * { border-bottom: 1px solid var(--ink); }
.spec-table th { font-family: var(--mono); font-size: .8125rem; font-weight: 500; color: var(--muted); width: 32%; padding-right: 12px; }
.spec-table td { font-weight: 600; }

.hatch-tile {
  display: grid; place-items: center; min-height: 220px;
  background-color: var(--tile);
  background-image: repeating-linear-gradient(45deg, rgba(21, 23, 28, .5) 0 1px, transparent 1px 9px);
}
.hatch-label { display: flex; align-items: center; gap: 16px; background: var(--tile); box-shadow: 0 0 0 1px var(--ink); padding: 16px 22px; max-width: 320px; font-weight: 600; }
.big-num { font-size: 3.6rem; line-height: 1; }

/* ---------- problem ---------- */
.prose p { font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); line-height: 1.45; max-width: 40ch; }
.kicker-tile { display: flex; align-items: flex-end; }
.kicker { font-size: clamp(1.5rem, 1rem + 1.8vw, 2.3rem); line-height: 1.08; }
.cat-tile { display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.cat-tile p { font-size: 1.1rem; }

/* ---------- demo ---------- */
.demo-board { display: flex; flex-direction: column; justify-content: center; }
.ghost-line {
  flex: 1 1 220px; max-width: 520px; align-self: flex-end; margin-bottom: 18px;
  color: var(--muted); border-bottom: 2px dashed rgba(30, 68, 184, .45); padding-bottom: 6px;
}
#demo-written .ch { display: inline-block; white-space: pre; }
.writing .ch { opacity: 0; transform: translateY(2px); animation: ink-in .07s ease-out forwards; }
@keyframes ink-in { to { opacity: 1; transform: none; } }
.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.choice {
  appearance: none; border: 0; font: inherit; color: var(--marker); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 150px;
  transition: background-color .15s ease;
}
.choice .hand { font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); white-space: nowrap; }
.choice-key { color: var(--muted); }
.choice-caption { color: var(--ink); visibility: hidden; }
.choices.is-revealed .choice-caption { visibility: visible; }
.choices.is-revealed .choice-caption::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; background: var(--laser); vertical-align: middle; }
.choices.is-revealed .choice[data-choice="3"] .choice-caption::before { background: #1F8A4C; }
.choice:hover { background: #FFFFFF; }
.choice:focus-visible { outline-offset: -6px; }
.choice[aria-pressed="true"] { box-shadow: inset 0 -4px 0 var(--laser); background: #FFFFFF; }
.fine-print { padding-top: 16px; padding-bottom: 16px; }

/* "What the otter did": spec-sheet verdict panel */
.verdict-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-bottom: 18px; }
.verdict-head h3 { margin-right: auto; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: .9rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-ghost:disabled:hover { background: transparent; color: var(--ink); }
.verdict-table { width: 100%; border-collapse: collapse; }
.verdict-table th, .verdict-table td { padding: 14px 0; border-top: 1px solid var(--ink); text-align: left; vertical-align: baseline; }
.verdict-table tr:last-child > * { border-bottom: 1px solid var(--ink); }
.verdict-table th { font-family: var(--mono); font-size: .8125rem; font-weight: 500; color: var(--muted); width: 26%; padding-right: 16px; }
.verdict-table td { font-weight: 600; font-size: 1.05rem; }
.kind { font-family: var(--mono); font-weight: 700; padding: 2px 8px; box-shadow: inset 0 0 0 1.5px var(--ink); margin-right: 10px; }
.kind-bad { background: var(--laser); box-shadow: none; }
.kind-ok { background: #BFE8CF; box-shadow: none; }
.hidden-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.redacted { flex: 1 1 280px; transition: filter .3s ease, background-color .3s ease; }
.redacted:not(.is-revealed) { filter: blur(6px); background: rgba(21, 23, 28, .12); color: var(--ink); user-select: none; }
.verdict-note { display: block; margin-top: 6px; }

/* ---------- how it decides ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.step { display: flex; flex-direction: column; gap: 14px; min-height: 200px; }
.step p { font-size: 1.05rem; }
.step strong { display: block; font-weight: 800; font-variation-settings: "wdth" 118; font-size: 1.3rem; line-height: 1.15; margin-bottom: 6px; }
.step-num { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.step-num::before { content: ""; width: 8px; height: 8px; background: var(--laser); }

.status-table th, .status-table td { padding: 14px 0; border-top: 1px solid rgba(233, 234, 236, .22); text-align: left; }
.status-table th { font-weight: 500; color: var(--on-panel); }
.status-table td { font-family: var(--mono); font-weight: 700; font-size: clamp(1.4rem, 1rem + 1.2vw, 2rem); text-align: right; }
.status-table .pen-circle { left: -16px; top: -8px; width: calc(100% + 32px); height: calc(100% + 16px); }

.rules li { font-weight: 700; font-size: 1.15rem; padding: 14px 0 14px 22px; border-top: 1px solid var(--ink); position: relative; }
.rules li:last-child { border-bottom: 1px solid var(--ink); }
.rules li::before { content: ""; position: absolute; left: 0; top: 1.35em; width: 8px; height: 8px; background: var(--laser); }

/* ---------- build ---------- */
.story { display: flex; flex-direction: column; gap: 12px; }
.story-num { font-size: clamp(3rem, 2rem + 4vw, 5rem); line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.unit { font-family: var(--mono); font-size: .875rem; font-weight: 500; color: var(--muted); font-variation-settings: normal; letter-spacing: 0; }
.stack { display: flex; flex-wrap: wrap; gap: 8px; }
.stack li { font-family: var(--mono); font-size: .9rem; padding: 6px 12px; box-shadow: inset 0 0 0 1px var(--ink); }
.team { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.member { display: flex; flex-direction: column; gap: 8px; }
.avatar {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; margin-bottom: 8px;
  font-family: var(--font); font-weight: 800; font-variation-settings: "wdth" 118; font-size: 2.4rem; color: var(--ink);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.has-img { background: var(--seam); }
.av-blue { background: #8DB6F2; }
.av-pink { background: #F4B3C8; }
.av-green { background: #9FD8A8; }
.av-yellow { background: var(--highlight); }

/* ---------- footer ---------- */
.ask-tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 28px; min-height: 260px; }
.ask { font-size: clamp(1.9rem, 1.1rem + 3vw, 3.6rem); line-height: 1.02; max-width: 18ch; }
.footer-info { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { font-weight: 700; }
.wordmark-tile { padding-top: 10px; padding-bottom: 0; }
.wordmark { display: block; font-size: min(11.4vw, 11.5rem); line-height: .78; white-space: nowrap; letter-spacing: -0.03em; font-variation-settings: "wdth" 125; transform: translateY(8%); }

/* ---------- responsive ---------- */
@media (max-width: 1024px) {
  .steps, .choices, .team { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
  .video-tile { grid-row: auto; }
  .flag { margin-left: 0; }
}
@media (max-width: 560px) {
  .steps, .choices { grid-template-columns: 1fr; }
  .choice { gap: 10px; padding-top: 16px; padding-bottom: 16px; }
  .site-header { position: relative; top: 0; }
  html { scroll-padding-top: 8px; }
  .nav-list { gap: 2px 14px; }
  .nav-list a { font-size: .875rem; }
  .step, .choice { min-height: 0; }
  .laser-dot { right: -26px; }
}

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

.flag.flag-ok { border-left-color: #1F8A4C; }

/* hint ladder */
.ladder { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.ladder-step { display: flex; flex-direction: column; gap: 12px; }
.ladder-step strong { font-weight: 800; font-variation-settings: "wdth" 118; }
.ladder-quote { font-family: var(--hand); font-weight: 700; color: var(--marker); font-size: 1.15rem; line-height: 1.3; margin-top: auto; }
.ladder-never .step-num { color: var(--muted-dark); }
.hint-text { flex: 1 1 280px; }
@media (max-width: 1024px) { .ladder { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .ladder { grid-template-columns: 1fr; } }

/* =========================================================
   Round 3: real photos, circuit, smoother motion
   ========================================================= */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }

/* reveal on scroll: hidden only after JS tags an element .rv */
.js-reveal .rv { opacity: 0; }
.js-reveal .rv.is-in { opacity: 1; animation: rv-rise .9s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 95ms); }
@keyframes rv-rise { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: none; } }
.rv.is-in img.ph { animation: ph-settle 1.4s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 95ms + 60ms); }
@keyframes ph-settle { from { transform: scale(1.03); } to { transform: none; } }

/* gentle lift on hover */
.lift { transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
@media (hover: hover) {
  .lift:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(21, 23, 28, .14); z-index: 2; }
}

/* smoother state changes */
.bubble { transition: opacity .22s ease, transform .3s var(--ease); }
.bubble.is-swapping { opacity: 0; transform: translateY(4px); }
.laser-dot.lands { animation: laser-glide .75s var(--ease) both, laser-glow 2.4s ease-in-out .75s infinite; }
@keyframes laser-glide {
  0% { transform: translate(46px, -64px) scale(.35); opacity: 0; }
  55% { opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@keyframes laser-glow {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255, 74, 28, .28), 0 0 18px 6px rgba(255, 74, 28, .5); }
  50% { box-shadow: 0 0 0 7px rgba(255, 74, 28, .2), 0 0 32px 11px rgba(255, 74, 28, .62); }
}
.pen-circle.draws { animation: pen-draw .95s cubic-bezier(.6, .1, .3, 1) both; }
#verdict td.cell-in { animation: cell-in .55s var(--ease) backwards; animation-delay: calc(var(--row, 0) * 90ms); }
@keyframes cell-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* ---------- photos ---------- */
.video-tile.pair { grid-row: auto; }
.photo-tile { display: flex; flex-direction: column; gap: 18px; }
.photo-viewport { flex: 1; max-width: none; margin-top: 12px; display: flex; }
.photo-viewport img { width: 100%; height: 100%; min-height: 340px; max-height: 620px; aspect-ratio: 4 / 5; object-fit: cover; }
.photo-tile figcaption { display: flex; flex-direction: column; gap: 6px; font-size: 1.05rem; max-width: 52ch; }
[data-lightbox] { cursor: zoom-in; }
[data-lightbox]:focus-visible { outline: 3px solid var(--laser); outline-offset: 3px; }

/* ---------- circuit ---------- */
.circuit-tile { display: flex; flex-direction: column; }
.circuit-map { position: relative; background: #FFFFFF; box-shadow: inset 0 0 0 1px rgba(21, 23, 28, .15); }
.circuit-map img { width: 100%; height: auto; }
.hotspot {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 34px; height: 34px; border: 0; border-radius: 50%; padding: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--ink); color: var(--tile);
  font: 700 .85rem/1 var(--mono); box-shadow: 0 0 0 3px #FFFFFF;
  transition: background-color .2s ease, color .2s ease, transform .3s var(--ease), box-shadow .3s var(--ease);
}
.hotspot::before {
  content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--laser);
  opacity: 0; animation: hs-ping 2.8s ease-out infinite; animation-delay: calc(var(--n, 0) * .4s);
}
@keyframes hs-ping { 0% { transform: scale(.7); opacity: .75; } 75%, 100% { transform: scale(1.55); opacity: 0; } }
.hotspot:hover, .hotspot:focus-visible, .hotspot.is-active {
  background: var(--laser); color: var(--ink); transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 0 0 3px #FFFFFF, 0 0 0 9px rgba(255, 74, 28, .25);
}
.hotspot:focus-visible { outline-offset: 6px; }
.pins-tile { display: flex; flex-direction: column; }
.pin-wrap { overflow-x: auto; }
.pin-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.pin-table th, .pin-table td { padding: 13px 14px 13px 10px; border-top: 1px solid var(--ink); text-align: left; vertical-align: baseline; }
.pin-table thead th { font-family: var(--mono); font-size: .8125rem; font-weight: 500; color: var(--muted); border-top: 0; }
.pin-table tbody tr:last-child > * { border-bottom: 1px solid var(--ink); }
.pin-table td:nth-child(1) { font-family: var(--mono); font-weight: 700; width: 3.2em; }
.pin-table td:nth-child(2) { font-weight: 700; }
.pin-table td:nth-child(3) { font-family: var(--mono); font-weight: 700; font-size: .9rem; }
.pin-table tbody tr { transition: background-color .3s ease, box-shadow .3s ease; }
.pin-table tbody tr.is-active { background: rgba(255, 74, 28, .13); box-shadow: inset 4px 0 0 var(--laser); }
.pin-note { margin-top: 16px; max-width: 80ch; }

/* ---------- final setup strip ---------- */
.strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.strip-item { display: flex; flex-direction: column; gap: 14px; }
.ph-frame { overflow: hidden; background: var(--panel); }
.strip-item img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.strip-item p { font-weight: 600; font-size: 1.05rem; }

/* ---------- lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0;
  border: 0; background: transparent; color: var(--on-panel); overflow: hidden;
}
.lightbox[open] { display: grid; place-items: center; animation: lb-in .4s var(--ease); }
.lightbox::backdrop { background: rgba(15, 18, 22, .9); }
.lb-figure { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: min(92vw, 1280px); padding: 64px 16px; }
.lb-figure img { max-width: 100%; max-height: 80vh; width: auto; height: auto; object-fit: contain; background: #FFFFFF; }
.lb-figure figcaption { text-align: center; color: var(--on-panel); max-width: 70ch; }
.lb-btn {
  position: fixed; width: 48px; height: 48px; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--tile); color: var(--ink); font: 700 1.3rem/1 var(--font);
  transition: background-color .15s ease, transform .25s var(--ease);
}
.lb-btn:hover { background: var(--laser); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; margin-top: -24px; }
.lb-next { right: 16px; top: 50%; margin-top: -24px; }
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .strip { grid-template-columns: 1fr; }
  .photo-viewport img { max-height: 520px; }
}
@media (max-width: 560px) {
  .hotspot { width: 26px; height: 26px; font-size: .75rem; }
  .lb-prev, .lb-next { top: auto; bottom: 16px; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .js-reveal .rv { opacity: 1; }
  .lift:hover { transform: none; }
}
