/* ============================================================
   $TJ: a science fair board, not a crypto landing page.
   Materials: foam board, construction paper, printer paper,
   tape, a Sharpie, and a very patient hot glue gun.
   ============================================================ */

:root {
  --wall: #ECE8DF;
  --board: #FBFAF6;
  --paper: #FFFFFF;
  --ink: #1A1A1A;
  --ink-2: #4B4A46;
  --ink-3: #7A776F;
  --rule: #E4E0D6;

  --blue: #2548D8;
  --blue-d: #1B37A8;
  --red: #E0412B;
  --yellow: #F4B928;
  --green: #2E8B57;

  --grid: rgba(37, 72, 216, .09);
  --tape: rgba(243, 234, 196, .82);

  --f-body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", system-ui, sans-serif;
  --f-head: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-mono: "Atkinson Hyperlegible Mono", ui-monospace, monospace;
  --f-hand: "Gochi Hand", "Comic Sans MS", cursive;

  --shadow-sm: 0 1px 1px rgba(40, 30, 10, .06), 0 4px 10px -6px rgba(40, 30, 10, .28);
  --shadow-md: 0 1px 2px rgba(40, 30, 10, .06), 0 14px 28px -16px rgba(40, 30, 10, .38);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--board);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: var(--blue); text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--blue-d); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 2px; }
mark { background: linear-gradient(transparent 55%, rgba(244, 185, 40, .55) 55%); color: inherit; padding: 0 .1em; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 12px; }

/* ---------- handwriting ---------- */
.hand { font-family: var(--f-hand); font-size: 1.3rem; line-height: 1.2; color: var(--ink-2); margin: 0; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: #fff;
  display: inline-flex; align-items: center; gap: .55em;
  font-family: var(--f-head); font-weight: 700; font-stretch: 90%;
  font-size: 1rem; letter-spacing: .01em;
  padding: .8em 1.2em; border-radius: 4px;
  background: var(--bg); color: var(--fg);
  border: 2px solid var(--ink);
  text-decoration: none; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { color: var(--fg); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn--blue { --bg: var(--blue); }
.btn--yellow { --bg: var(--yellow); --fg: var(--ink); }
.btn--ghost { --bg: var(--paper); --fg: var(--ink); }
.btn--ink { --bg: var(--ink); }
.btn--paper { --bg: var(--paper); --fg: var(--ink); }
.btn--line { --bg: transparent; --fg: #fff; border-color: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,.35); }
.btn--line:hover { box-shadow: 4px 4px 0 rgba(0,0,0,.35); }
.btn--sm { font-size: .88rem; padding: .55em .9em; box-shadow: 2px 2px 0 var(--ink); }
.btn--sm:hover { box-shadow: 3px 3px 0 var(--ink); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  padding: 10px var(--gutter);
  background: color-mix(in srgb, var(--board) 90%, transparent);
  backdrop-filter: saturate(1.2) blur(6px);
  -webkit-backdrop-filter: saturate(1.2) blur(6px);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand__logo { width: 38px; height: 38px; }
.brand__tag {
  font-family: var(--f-head); font-weight: 900; font-stretch: 110%;
  font-size: 1.15rem; color: #fff; background: var(--blue);
  padding: 3px 9px 2px; transform: rotate(-3deg); box-shadow: 2px 2px 0 var(--ink);
}
.brand__sub { font-family: var(--f-hand); font-size: 1.35rem; color: var(--ink); }
.tabs { display: flex; gap: 4px; }
.tabs a {
  position: relative;
  font-family: var(--f-head); font-weight: 700; font-stretch: 85%; font-size: .95rem;
  color: var(--ink); text-decoration: none; padding: 6px 12px;
}
.tabs a::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 4px;
  background: var(--c); transform: scaleX(0); transform-origin: left; transition: transform .2s ease;
}
.tabs a:hover::after, .tabs a.is-active::after { transform: scaleX(1); }
@media (max-width: 900px) { .tabs { display: none; } }

/* ============================================================
   HERO: a classroom whiteboard that writes the story
   ============================================================ */
.wb-stage {
  background: var(--wall);
  padding: clamp(20px, 4vw, 52px) var(--gutter) clamp(28px, 4vw, 48px);
}
.wb { max-width: 1280px; margin: 0 auto; }
.wb__surface {
  --m-black: #1C1E24; --m-blue: #1F46C8; --m-red: #D23A2A; --m-green: #1E8050;
  position: relative;
  background:
    linear-gradient(112deg, transparent 38%, rgba(255,255,255,.9) 44%, transparent 52%),
    radial-gradient(120% 90% at 20% 0%, #FFFFFF, #F5F6F4 70%, #EEF0ED);
  border: 14px solid #C9CDD1;
  border-image: linear-gradient(160deg, #E4E7EA, #AEB4BA 40%, #D5D9DC 60%, #9DA3A9) 1;
  box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 30px 50px -30px rgba(40, 30, 10, .45), 0 2px 4px rgba(0,0,0,.08);
  padding: clamp(18px, 3vw, 40px) clamp(18px, 3.4vw, 48px) clamp(24px, 3vw, 40px);
  overflow: hidden;
  min-height: min(720px, calc(100svh - 170px));
}

/* ghosts of last period's physics class */
.wb__ghost { position: absolute; inset: 0; pointer-events: none; }
.wb__ghost span {
  position: absolute; font-family: var(--f-hand); font-size: clamp(1.6rem, 3vw, 2.6rem);
  color: #1C1E24; opacity: .055; filter: blur(.6px); transform: rotate(var(--r)); white-space: nowrap;
}

/* handwriting */
.w { margin: 0; font-family: var(--f-hand); font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.2; color: var(--mc, var(--m-black)); }
.w--sm { font-size: clamp(1.05rem, 1.45vw, 1.25rem); opacity: .9; }
.w--md { font-size: clamp(1.25rem, 2vw, 1.75rem); }
.w--lg { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
.w--xl { font-size: clamp(2.4rem, 4.2vw, 3.6rem); line-height: 1; }
.w--xxl { font-size: clamp(3rem, 6vw, 5.2rem); line-height: 1; }
.w--title { font-size: clamp(4rem, 9vw, 7.5rem); line-height: .9; letter-spacing: .01em; }
.m-black { --mc: var(--m-black); } .m-blue { --mc: var(--m-blue); } .m-red { --mc: var(--m-red); } .m-green { --mc: var(--m-green); }
.wd { white-space: nowrap; display: inline-block; }
.c { display: inline-block; white-space: pre; }
.wb.is-armed .c { clip-path: inset(-20% 100% -20% 0); }
.wb.is-armed .c.on { clip-path: inset(-20% -10% -20% 0); transition: clip-path var(--cd, 80ms) linear; }

.wb-draw { overflow: visible; }
.wb-draw path, .wb-draw circle, .wb-draw rect, .wb-draw line, .wb-draw ellipse, .wb-draw polyline {
  fill: none; stroke: var(--dc, #1C1E24); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round;
}
.wb-draw[data-c="red"] { --dc: #D23A2A; } .wb-draw[data-c="blue"] { --dc: #1F46C8; } .wb-draw[data-c="green"] { --dc: #1E8050; }
.wb-draw text { fill: var(--dc, #1C1E24); stroke: none; font-family: var(--f-hand); font-size: 17px; }
.wb.is-armed .wb-draw .dr { stroke-dasharray: 1 1; stroke-dashoffset: 1; }
.wb.is-armed .wb-draw .dr:not(.go) { opacity: 0; }
.wb.is-armed .wb-draw text { opacity: 0; transition: opacity .3s ease; }
.wb.is-armed .wb-draw.is-drawn text { opacity: 1; }
.wb-icon .accent { stroke: var(--m-red); }

/* stuck-on things */
.magnet { position: absolute; z-index: 2; top: -10px; left: 50%; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), transparent 40%), var(--mg);
  box-shadow: 0 3px 5px rgba(0,0,0,.3), inset 0 -2px 3px rgba(0,0,0,.2); }
.magnet--red { --mg: #D23A2A; } .magnet--blue { --mg: #1F46C8; }
.wb.is-armed [data-s="place"] { opacity: 0; transform: translateY(-18px) rotate(var(--pr, 0deg)) scale(1.04); }
[data-s="place"] { transition: opacity .35s ease, transform .5s cubic-bezier(.3, 1.6, .5, 1); }
.wb.is-armed [data-s="place"].on { opacity: 1; transform: rotate(var(--pr, 0deg)); }

/* layout */
.wb__head { position: relative; display: flex; align-items: center; gap: clamp(14px, 2vw, 28px); margin-bottom: clamp(18px, 3vw, 34px); }
.wb-logo { --pr: 0deg; position: relative; margin: 0; flex: none; width: clamp(72px, 8vw, 104px); transform: rotate(var(--pr)); }
.wb-logo img { width: 100%; height: auto; }
.wb-logo .magnet { top: -6px; }
.wb-title { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 22px; font-weight: 400; }

.wb__cols { position: relative; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); }
.wb__col--how { border-left: 2px dashed rgba(28, 30, 36, .12); padding-left: clamp(20px, 3vw, 48px); }

.wb-2004 { display: flex; gap: 22px; align-items: flex-start; }
.wb-photo { --pr: -3deg; position: relative; flex: none; margin: 4px 0 0; width: clamp(96px, 11vw, 138px); background: #fff; padding: 6px 6px 16px; box-shadow: 0 6px 12px -4px rgba(0,0,0,.28); }
.wb-photo img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: 72% 22%; }
.wb-arrow { width: clamp(110px, 12vw, 150px); margin: 4px 0 4px clamp(40px, 5vw, 70px); }
.wb-2025 .w:first-child { margin-bottom: 2px; }
.wb-circled { position: relative; display: inline-block; margin: 6px 0 4px; padding: 10px 28px 12px 22px; }
.wb-circle { position: absolute; inset: 0; width: 100%; height: 100%; }
.wb-circle path { stroke-width: 3.4; }
.wb-goal { margin-top: clamp(16px, 2.4vw, 28px); }
.wb-under { position: relative; display: inline-block; margin: 0; padding-bottom: 12px; }
.wb-underline { position: absolute; left: -4px; right: -8px; bottom: 0; width: calc(100% + 12px); height: 18px; }
.wb-under--sm { padding-bottom: 8px; margin-bottom: 14px; }
.wb-under--sm .wb-underline { height: 12px; }

.wb-flow { list-style: none; margin: 0; padding: 0; }
.wb-flow li { display: flex; align-items: center; gap: 16px; }
.wb-icon { flex: none; width: clamp(56px, 6vw, 74px); height: auto; }
.wb-icon path, .wb-icon circle, .wb-icon rect { stroke-width: 4; }
.wb-icon text { font-family: var(--f-head); font-weight: 800; font-size: 11px; fill: var(--dc, #1C1E24); }
.wb-flow__arrow svg { width: 26px; height: 24px; margin-left: clamp(16px, 2vw, 24px); }
.wb-sofar { margin-top: clamp(18px, 2.6vw, 30px); }
.wb-meter { width: min(100%, 360px); height: auto; margin: 6px 0 2px; }

/* the marker that does the writing */
.wb-pen { position: absolute; z-index: 5; left: 0; top: 0; width: 44px; pointer-events: none; opacity: 0;
  transition: opacity .25s ease; will-change: transform; }
.wb-pen.is-on { opacity: 1; }
.wb-pen .pen-cap { fill: var(--pc, #1C1E24); }

/* marker tray */
.wb__tray {
  position: relative; height: 30px; margin: 0 4%;
  background: linear-gradient(#D3D7DB, #A9AFB5); border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 12px -8px rgba(0,0,0,.4);
  display: flex; align-items: flex-start; gap: 14px; padding: 0 5%;
}
.tray-pen { width: 92px; height: 15px; margin-top: -6px; border-radius: 4px; background: linear-gradient(90deg, #F4F4F2 70%, var(--pc) 70%); border: 1.5px solid #1A1A1A; transition: transform .35s cubic-bezier(.3, 1.5, .5, 1), opacity .3s ease; }
.tray-pen[data-tray="black"] { --pc: #1C1E24; } .tray-pen[data-tray="blue"] { --pc: #1F46C8; }
.tray-pen[data-tray="red"] { --pc: #D23A2A; } .tray-pen[data-tray="green"] { --pc: #1E8050; }
.tray-pen.is-out { transform: translateY(-26px) rotate(-8deg); opacity: 0; }
.tray-eraser { margin-left: auto; width: 110px; height: 26px; margin-top: -14px; border-radius: 4px; background: linear-gradient(#2E3440 40%, #9A8F7E 40%); border: 1.5px solid #1A1A1A; transform: rotate(-3deg); }

.wb-controls { max-width: 1280px; margin: clamp(20px, 3vw, 30px) auto 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.wb-controls__play { margin-left: auto; display: flex; gap: 18px; }
.linkbtn { font: inherit; font-family: var(--f-hand); font-size: 1.25rem; color: var(--ink-2); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.linkbtn:hover { color: var(--ink); }
.linkbtn[hidden] { display: none; }

@media (max-width: 860px) {
  .wb__cols { grid-template-columns: 1fr; }
  .wb__col--how { border-left: 0; padding-left: 0; border-top: 2px dashed rgba(28, 30, 36, .12); padding-top: 22px; }
  .wb__surface { border-width: 10px; min-height: 0; }
  .tray-pen { width: 54px; } .tray-eraser { width: 70px; }
  .wb-controls__play { margin-left: 0; }
}

/* balance (section 2) */
.balance { position: relative; margin: 0 auto; max-width: 980px; }
.balance__note { position: absolute; left: 0; top: 0; color: var(--red); font-size: clamp(1.1rem, 1.8vw, 1.45rem); transform: rotate(-4deg); max-width: 24ch; }
.balance__svg { width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }
.balance__svg text { font-family: var(--f-head); }
.balance__svg .hand-t { font-family: var(--f-hand); }
.balance__svg [data-pan="right"] { cursor: pointer; }
.balance__svg [data-pan="right"]:focus-visible { outline: none; }
.balance__svg [data-pan="right"]:focus-visible .pan-dish { stroke: var(--yellow); stroke-width: 6; }
.balance__svg .ghost { transition: opacity .5s ease, transform .6s cubic-bezier(.5, 0, .75, 0); }
.balance__svg .ghost.is-gone { opacity: 0; transform: translate(160px, 60px) rotate(25deg); }
.balance__hint { margin: 10px 0 0; min-height: 1.3em; text-align: center; color: var(--red); font-size: 1.25rem; }
.balance__legend { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; margin-top: 8px; font-size: .95rem; color: var(--ink-2); }
.balance__legend span { display: inline-flex; align-items: center; gap: 8px; }
.balance__legend b { color: var(--ink); font-family: var(--f-head); font-weight: 800; font-stretch: 90%; font-variant-numeric: tabular-nums; }
.dot { width: 12px; height: 12px; border-radius: 3px; border: 1.5px solid var(--ink); }
.dot--iron { background: #3A3B3F; }
.dot--blue { background: var(--blue); }
.dot--ink { background: var(--yellow); border-radius: 50%; }

/* shared paper bits */
.snap {
  position: relative; margin: 0;
  background: var(--paper); padding: 10px 10px 12px;
  box-shadow: var(--shadow-md);
}
.snap img { width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: 60% 30%; filter: saturate(.9) contrast(1.02); }
.snap figcaption { text-align: center; margin-top: 8px; }
.tape {
  position: absolute; z-index: 2; top: -12px; left: 50%;
  width: 84px; height: 24px; margin-left: -42px;
  background: var(--tape);
  box-shadow: 0 1px 1px rgba(0,0,0,.06);
  transform: rotate(-4deg);
  clip-path: polygon(0 8%, 4% 0, 9% 10%, 14% 0, 20% 8%, 100% 0, 97% 20%, 100% 40%, 96% 60%, 100% 82%, 97% 100%, 0 100%, 3% 76%, 0 54%, 4% 32%);
}
.tape--l { left: 8%; margin-left: 0; transform: rotate(-38deg); top: 4px; }
.tape--r { left: auto; right: 8%; margin-left: 0; transform: rotate(40deg); top: 4px; }
.ca[hidden] { display: none; }
.ca { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: .85rem; }
.ca__label { font-family: var(--f-mono); color: var(--ink-3); }
.ca__value { font-family: var(--f-mono); background: var(--paper); border: 1px solid var(--rule); padding: 3px 8px; word-break: break-all; }
.ca__copy { font: inherit; font-weight: 700; background: none; border: 0; color: var(--blue); cursor: pointer; text-decoration: underline; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(72px, 10vw, 128px) var(--gutter) 0;
  scroll-margin-top: 40px;
}
.section--tight { padding-top: clamp(56px, 8vw, 96px); }
.sec-head { display: flex; gap: clamp(14px, 2vw, 24px); align-items: flex-start; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-num {
  flex: none;
  display: grid; place-items: center;
  width: clamp(52px, 6vw, 68px); aspect-ratio: 1;
  font-family: var(--f-head); font-weight: 900; font-stretch: 100%;
  font-size: clamp(1.8rem, 3vw, 2.4rem); color: #fff;
  background: var(--c); border-radius: 50%;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-6deg);
}
.sec-kicker {
  margin: 0 0 4px;
  font-family: var(--f-hand); font-size: 1.45rem; color: var(--ink-2);
}
.sec-title {
  margin: 0;
  font-family: var(--f-head); font-weight: 800; font-stretch: 78%;
  font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1; letter-spacing: -.015em;
  max-width: 20ch; text-wrap: balance;
}
.sec-sub { margin: 14px 0 0; color: var(--ink-2); max-width: 60ch; font-size: 1.05rem; }

/* ---------- 1 · story ---------- */
.story { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.mat { background: var(--c); padding: 12px; box-shadow: var(--shadow-md); transform: rotate(-1.2deg); }
.snap--big { padding: 12px 12px 14px; box-shadow: none; }
.hand--caption { margin-top: 16px; text-align: center; }
.big-p { margin: 0 0 32px; font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.5; }

.video__frame { position: relative; background: #111; aspect-ratio: 16 / 9; box-shadow: 0 0 0 10px var(--ink), var(--shadow-md); border-radius: 6px; overflow: hidden; margin: 10px; }
.video__frame video { width: 100%; height: 100%; object-fit: cover; }
.video__play {
  position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: flex-start; gap: 14px;
  padding: clamp(14px, 3vw, 26px); border: 0; cursor: pointer; text-align: left; color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.35), transparent 40%); align-items: flex-end;
  font: inherit;
}
.video__len { font-family: var(--f-head); font-weight: 700; font-stretch: 90%; font-size: .95rem; background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 4px; }
.video__icon { flex: none; width: 58px; height: 58px; border-radius: 50%; background: var(--yellow); border: 2px solid var(--ink); display: grid; place-items: center; box-shadow: 3px 3px 0 var(--ink); transition: transform .15s ease; }
.video__icon::before { content: ""; margin-left: 5px; border-left: 18px solid var(--ink); border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.video__play:hover .video__icon { transform: scale(1.06) rotate(-4deg); }
.video.is-playing .video__play { display: none; }
.video__src { margin: 18px 10px 0; font-size: .92rem; color: var(--ink-2); }

@media (max-width: 860px) {
  .story { grid-template-columns: 1fr; }
  .story__photo { max-width: 380px; margin: 0 auto; width: 88%; }
}

/* ---------- 3 · procedure (the rig) ---------- */
.rig { background: var(--paper); box-shadow: var(--shadow-md); padding: clamp(22px, 4vw, 44px); }
.rig__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 44px 1fr 44px 1fr 44px 1fr; align-items: start; }
.station { padding: 4px 4px 0; }
.station__art {
  width: 100%; max-width: 170px; aspect-ratio: 6 / 5; margin-bottom: 14px;
  display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 10px;
  background: var(--board); color: var(--ink);
  transition: background .3s ease, color .3s ease, transform .3s cubic-bezier(.3, 1.6, .4, 1);
}
.station__art svg { width: 76%; }
.station__art .accent { stroke: var(--ink-3); transition: stroke .3s ease; }
.station__n { margin: 0; font-family: var(--f-hand); font-size: 1.2rem; color: var(--ink-3); }
.station h3 { margin: 0 0 6px; font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 1.3rem; line-height: 1.1; }
.station p:last-child { margin: 0; font-size: .95rem; color: var(--ink-2); }
.station.is-on .station__art { background: var(--yellow); transform: rotate(-2deg) scale(1.03); }
.station.is-on .station__art .accent { stroke: var(--red); }
.station.is-done .station__art { background: #FFF4D2; }
.station.is-done .station__art .accent { stroke: var(--red); }

.pipe { position: relative; height: 16px; margin-top: calc(min(170px, 100%) * 0 + 64px); }
.pipe span { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: 8px; background: var(--board); overflow: hidden; }
.pipe span::after { content: ""; position: absolute; inset: 0; background: var(--blue); transform: scaleX(0); transform-origin: left; transition: transform .7s cubic-bezier(.5, 0, .5, 1); }
.pipe.is-full span::after { transform: scaleX(1); }

.rig__controls { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 32px; padding-top: 24px; border-top: 1.5px dashed #D6D0C3; }
.rig__status { margin: 0; font-family: var(--f-hand); font-size: 1.3rem; color: var(--ink-2); }
.play { width: 0; height: 0; border-left: 11px solid currentColor; border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

@media (max-width: 980px) {
  .rig__steps { grid-template-columns: 1fr; }
  .station { display: grid; grid-template-columns: 110px 1fr; column-gap: 18px; align-items: start; }
  .station__art { grid-row: span 3; margin: 0; }
  .pipe { width: 16px; height: 34px; margin: 6px 0 6px 47px; }
  .pipe span::after { transform: scaleY(0); transform-origin: top; }
  .pipe.is-full span::after { transform: scaleY(1); }
}

/* ---------- 4 · materials ---------- */
.catalog { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px, 3vw, 32px); }
.item { position: relative; background: var(--paper); box-shadow: var(--shadow-md); padding: 22px 22px 24px; display: flex; flex-direction: column; gap: 10px; }
.item:nth-child(1) { transform: rotate(-.8deg); }
.item:nth-child(2) { transform: rotate(.5deg); }
.item:nth-child(3) { transform: rotate(-.3deg); }
.item__art { height: 108px; color: var(--ink); display: grid; place-items: center; border-bottom: 1.5px dashed #D6D0C3; margin: -4px -4px 4px; padding-bottom: 12px; }
.item__art svg { height: 100%; }
.item__art .accent { stroke: var(--c); }
.item__cat { margin: 0; font-family: var(--f-hand); font-size: 1.2rem; color: var(--ink-3); }
.item__name { margin: 0; font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 1.35rem; line-height: 1.08; }
.item__desc { margin: 0; color: var(--ink-2); font-size: .95rem; }
.pricetag {
  position: absolute; top: 18px; right: -10px;
  font-family: var(--f-head); font-weight: 900; font-stretch: 90%; font-size: 1.2rem;
  background: var(--c); color: #fff; padding: 5px 12px 5px 18px;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
  transform: rotate(4deg);
  font-variant-numeric: tabular-nums;
}
.pricetag::before { content: ""; position: absolute; left: 9px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--paper); }
.cover { margin-top: auto; padding-top: 8px; }
.cover__bar { height: 12px; border: 1.5px solid var(--ink); background: #EFECE4; position: relative; overflow: hidden; }
.cover__bar span { position: absolute; inset: 0 auto 0 0; background: var(--c); min-width: 2px; }
.cover__t { margin: 6px 0 0; font-size: .84rem; color: var(--ink-2); }
.cover__t b { color: var(--ink); }
.item__src { font-size: .82rem; }

.about-tjpf { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: center; margin-top: clamp(40px, 6vw, 64px); }
.indexcard {
  background:
    linear-gradient(transparent 50px, var(--red) 50px, var(--red) 52px, transparent 52px),
    repeating-linear-gradient(transparent 0 27px, #BFD0EE 27px 28px) 0 52px / 100% calc(100% - 52px) no-repeat,
    #FFFEFA;
  box-shadow: var(--shadow-md);
  padding: 14px 24px 18px;
  transform: rotate(-1deg);
  line-height: 28px;
}
.indexcard__h { margin: 0 0 16px; font-family: var(--f-hand); font-size: 1.6rem; line-height: 36px; }
.indexcard p { margin: 0; }
.indexcard__facts { margin: 12px 0 0; display: grid; grid-template-columns: repeat(4, auto); gap: 0 18px; justify-content: start; }
.indexcard__facts dt { font-size: .8rem; color: var(--ink-3); line-height: 28px; }
.indexcard__facts dd { margin: 0; font-family: var(--f-head); font-weight: 800; font-stretch: 85%; line-height: 28px; }
.about-tjpf__note { margin: 0; padding: 16px 18px; border: 2px solid var(--ink); background: #FFF4D2; font-size: .95rem; box-shadow: 3px 3px 0 var(--ink); }

@media (max-width: 900px) {
  .catalog { grid-template-columns: 1fr; max-width: 520px; }
  .about-tjpf { grid-template-columns: 1fr; }
  .indexcard__facts { grid-template-columns: repeat(2, auto); }
}

/* ---------- 5 · data ---------- */
.lab { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.lab__cyl { background: var(--paper); box-shadow: var(--shadow-md); padding: 20px 18px 16px; }
.scale-toggle { display: inline-flex; border: 2px solid var(--ink); border-radius: 999px; padding: 3px; gap: 2px; margin-bottom: 10px; }
.scale-toggle button { font: inherit; font-family: var(--f-head); font-weight: 700; font-stretch: 85%; font-size: .9rem; background: none; border: 0; padding: 5px 14px; border-radius: 999px; cursor: pointer; color: var(--ink); }
.scale-toggle button[aria-checked="true"] { background: var(--ink); color: #fff; }
.cyl { position: relative; height: 600px; }
.cyl svg { width: 100%; height: 100%; overflow: visible; }
.cyl__note { margin: 6px 0 0; font-family: var(--f-hand); font-size: 1.15rem; color: var(--ink-2); min-height: 1.4em; }
.cyl .liquid { transition: transform 1.1s cubic-bezier(.3, .9, .3, 1); }
.cyl .bubble { animation: rise var(--d, 4s) linear infinite; animation-delay: var(--dl, 0s); opacity: 0; }
@keyframes rise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .7; } 100% { transform: translateY(var(--h, -100px)); opacity: 0; } }
.cyl .ms text { font-family: var(--f-body); font-size: 13px; fill: var(--ink-2); }
.cyl .ms .amt { font-family: var(--f-head); font-weight: 800; font-stretch: 85%; font-size: 14px; fill: var(--ink); }
.cyl .ms.is-hit .amt { fill: var(--green); }
.cyl .decade { font-family: var(--f-mono); font-size: 11px; fill: var(--ink-3); }
.cyl .here { font-family: var(--f-hand); font-size: 19px; fill: var(--red); }
.cyl .ms, .cyl .decade-g, .cyl .here-g { transition: transform 1.1s cubic-bezier(.3, .9, .3, 1), opacity .5s ease; }

.total { border-bottom: 2px solid var(--ink); padding-bottom: 22px; }
.total__k { margin: 0; font-family: var(--f-hand); font-size: 1.4rem; color: var(--ink-2); }
.total__v { margin: 0; font-family: var(--f-head); font-weight: 900; font-stretch: 95%; font-size: clamp(3.6rem, 9vw, 6.4rem); line-height: .95; color: var(--green); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.total__meta { margin: 10px 0 0; color: var(--ink-2); }
.total__meta b { color: var(--ink); }

.ledger { margin-top: 28px; }
.ledger__h { margin: 0 0 10px; font-family: var(--f-head); font-weight: 800; font-stretch: 82%; font-size: 1.35rem; }
.ledger table { width: 100%; border-collapse: collapse; font-size: .95rem; background: var(--paper); box-shadow: var(--shadow-sm); }
.ledger th { text-align: left; font-family: var(--f-mono); font-weight: 600; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); padding: 10px 14px; border-bottom: 1.5px solid var(--ink); }
.ledger td { padding: 12px 14px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.ledger td.num { font-family: var(--f-mono); color: var(--ink-3); }
.ledger td.amt { font-family: var(--f-head); font-weight: 800; font-stretch: 90%; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stamp { display: inline-block; font-family: var(--f-head); font-weight: 800; font-stretch: 80%; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--red); border: 2px solid var(--red); padding: 1px 7px; transform: rotate(-4deg); border-radius: 3px; opacity: .9; }
.stamp--ok { color: var(--green); border-color: var(--green); }
a.stamp { text-decoration: none; }

.award { display: flex; gap: 20px; align-items: flex-start; margin-top: 32px; padding: 20px; border: 1.5px dashed #C8C2B4; }
.award .ribbon { flex: none; width: 76px; filter: drop-shadow(2px 4px 4px rgba(0,0,0,.16)); transform: rotate(-6deg); }
.award__h { margin: 0 0 6px; font-family: var(--f-head); font-weight: 800; font-stretch: 85%; font-size: 1.2rem; line-height: 1.15; }
.award__p { margin: 0 0 8px; font-size: .92rem; color: var(--ink-2); }
.award__links { margin: 0; font-size: .9rem; color: var(--ink-3); }

@media (max-width: 900px) {
  .lab { grid-template-columns: 1fr; }
  .lab__log { order: -1; }
  .cyl { height: 540px; }
}

/* ---------- 6 · judges' questions ---------- */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(16px, 2.4vw, 26px); align-items: start; }
.qcard {
  background:
    linear-gradient(transparent 58px, rgba(224, 65, 43, .8) 58px, rgba(224, 65, 43, .8) 60px, transparent 60px),
    repeating-linear-gradient(transparent 0 27px, #C9D7F0 27px 28px) 0 60px / 100% calc(100% - 60px) no-repeat,
    #FFFEFA;
  box-shadow: var(--shadow-sm);
  line-height: 28px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.qcard:nth-child(odd) { transform: rotate(-.5deg); }
.qcard:nth-child(even) { transform: rotate(.4deg); }
.qcard:hover { box-shadow: var(--shadow-md); }
.qcard summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  min-height: 60px; padding: 10px 20px;
  font-family: var(--f-hand); font-size: 1.45rem; line-height: 1.15;
}
.qcard summary::-webkit-details-marker { display: none; }
.qcard summary::after {
  content: "+"; flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--f-head); font-weight: 800; font-size: 1.3rem; line-height: 1;
  border: 2px solid var(--ink); border-radius: 50%; transition: transform .25s ease, background .2s ease;
}
.qcard[open] summary::after { transform: rotate(45deg); background: var(--yellow); }
.qcard p { margin: 0; padding: 0 20px 20px; font-size: 1rem; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; } }

/* ---------- 7 · works cited ---------- */
.paper { background: var(--paper); box-shadow: var(--shadow-md); }
.cited { padding: clamp(28px, 5vw, 64px) clamp(22px, 6vw, 88px); max-width: 900px; font-family: "Times New Roman", Times, Georgia, serif; font-size: 1.08rem; line-height: 2; }
.cited__title { margin: 0 0 8px; text-align: center; font-size: 1.1rem; }
.cited__list { list-style: none; margin: 0; padding: 0; }
.cited__list li { padding-left: 2.2em; text-indent: -2.2em; overflow-wrap: anywhere; }
.cited__list a { color: var(--ink); text-decoration-color: rgba(37, 72, 216, .5); }
.cited__list a:hover { color: var(--blue); }

/* ---------- conclusion ---------- */
.conclusion {
  margin-top: clamp(80px, 11vw, 140px);
  background: var(--blue);
  color: #fff;
  padding: clamp(56px, 8vw, 96px) var(--gutter) 40px;
  position: relative;
}
.conclusion::before { /* torn top edge of construction paper */
  content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 15px;
  background: var(--blue);
  clip-path: polygon(0 100%, 0 40%, 3% 70%, 6% 20%, 9% 60%, 13% 30%, 17% 75%, 21% 35%, 25% 55%, 29% 15%, 33% 60%, 37% 40%, 41% 80%, 45% 30%, 49% 55%, 53% 20%, 57% 70%, 61% 40%, 65% 60%, 69% 25%, 73% 70%, 77% 45%, 81% 65%, 85% 20%, 89% 55%, 93% 35%, 97% 70%, 100% 45%, 100% 100%);
}
.conclusion__inner { max-width: var(--max); margin: 0 auto; }
.conclusion__logo { width: 84px; height: 84px; margin-bottom: 14px; }
.sec-kicker--light { color: rgba(255,255,255,.8); }
.conclusion__h { margin: 0 0 16px; font-family: var(--f-head); font-weight: 900; font-stretch: 80%; font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .95; letter-spacing: -.02em; max-width: 14ch; }
.conclusion__p { margin: 0 0 28px; max-width: 52ch; font-size: 1.1rem; color: rgba(255,255,255,.9); }
.fine { margin: clamp(48px, 7vw, 80px) 0 0; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.3); font-size: .85rem; color: rgba(255,255,255,.75); max-width: 90ch; }

/* ---------- motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .cyl .bubble { display: none; }
}

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) {
  .balance__note { position: static; margin: 0 0 12px; transform: rotate(-2deg); max-width: none; }
}
.story:has(> :only-child) { grid-template-columns: 1fr; max-width: 820px; }
