/* The Open Workbench — museum of things that went sideways.
   Visual language: specimen cabinet. One bold device (the jar shelf);
   everything else is quiet museum labelling. */

:root {
  --glass: #e6ebe4;
  --glass-deep: #d6ddd3;
  --paper: #fbfbf6;
  --ink: #17201c;
  --ink-soft: #3b4a43;
  --rule: #9aa79f;
  --tag: #8c1c2b;
  --wood: #5b4632;
  --wood-edge: #3e3022;
  --formalin: #cfd98f;
  --formalin-edge: #a8b464;
  --jar-glass: rgba(255,255,255,.22);
  --jar-line: #55645c;
  --focus: #1d4ed8;

  --st-quoted: #23602f;
  --st-para: #234a86;
  --st-recon: #7a4f0c;
  --st-new: #74285f;
  --st-sealed: #4a4a4a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", P052, Georgia, serif;
  --type: "Courier Prime", "Courier New", Courier, "Nimbus Mono PS", monospace;

  --measure: 66ch;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --glass: #0f1613; --glass-deep: #16201b; --paper: #1b2621; --ink: #e4e9df; --ink-soft: #b6c2b9;
    --rule: #4b5c53; --tag: #f08a95; --wood: #3a2c1f; --wood-edge: #251b12;
    --formalin: #4e5a24; --formalin-edge: #7f8f3a; --jar-glass: rgba(210,230,215,.07); --jar-line: #8fa398;
    --focus: #8ab4ff;
    --st-quoted: #7fd08e; --st-para: #93b6f2; --st-recon: #e6b05c; --st-new: #e796d2; --st-sealed: #b5b5b5;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --glass: #0f1613; --glass-deep: #16201b; --paper: #1b2621; --ink: #e4e9df; --ink-soft: #b6c2b9;
  --rule: #4b5c53; --tag: #f08a95; --wood: #3a2c1f; --wood-edge: #251b12;
  --formalin: #4e5a24; --formalin-edge: #7f8f3a; --jar-glass: rgba(210,230,215,.07); --jar-line: #8fa398;
  --focus: #8ab4ff;
  --st-quoted: #7fd08e; --st-para: #93b6f2; --st-recon: #e6b05c; --st-new: #e796d2; --st-sealed: #b5b5b5;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--glass);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.62;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 20;
  background: var(--paper); color: var(--ink); padding: .6rem 1rem; border: 2px solid var(--ink);
}
.skip:focus { top: 1rem; }

.wrap { width: min(100% - 2rem, 70rem); margin-inline: auto; }
.prose { max-width: var(--measure); }

/* ---------- Header: the museum lintel ---------- */
.lintel {
  border-bottom: 1px solid var(--rule);
  padding-block: 1rem .9rem;
}
.lintel .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.5rem; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand svg { width: 1.3rem; height: auto; flex: none; }
.brand-name { font-size: 1.2rem; letter-spacing: .01em; }
.brand-name small { display: block; font-size: .78rem; color: var(--ink-soft); letter-spacing: .02em; font-variant-caps: small-caps; }
.halls { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; list-style: none; margin: 0; padding: 0; font-size: 1rem; }
.halls a { text-decoration: none; padding-block: .2rem; display: inline-block; }
.halls a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.theme-toggle {
  font: inherit; font-size: .9rem; background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 99px; padding: .2rem .8rem; cursor: pointer;
}

/* ---------- Footer ---------- */
.plinth {
  margin-top: 5rem; border-top: 1px solid var(--rule); padding-block: 1.6rem 3rem;
  font-size: .95rem; color: var(--ink-soft);
}
.plinth p { margin: .3rem 0; max-width: var(--measure); }

/* ---------- Home: entrance + the jar shelf ---------- */
.entrance { padding-block: 3.2rem 1.2rem; display: grid; gap: 1.5rem; grid-template-columns: 1fr; align-items: end; }
@media (min-width: 760px) { .entrance { grid-template-columns: 1fr auto; } }
.entrance h1 {
  font-weight: 400; font-size: clamp(2.3rem, 6.4vw, 4.4rem); line-height: 1.02; margin: 0;
  letter-spacing: -.012em; max-width: 14ch;
}
.entrance .lede { font-size: 1.22rem; max-width: 44ch; margin: 1rem 0 0; color: var(--ink-soft); }
.watchman { display: flex; gap: .9rem; align-items: flex-end; max-width: 22rem; }
.watchman svg { width: 3.3rem; flex: none; }
.watchman p { margin: 0; font-size: .98rem; font-style: italic; color: var(--ink-soft); }

.shelf-hall { margin-top: 2.2rem; }
.shelf {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
}
@media (min-width: 640px) { .shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .shelf { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.shelf li {
  position: relative; padding: 1.4rem .6rem 0;
  border-bottom: 14px solid var(--wood);
  box-shadow: inset 0 -3px 0 var(--wood-edge);
}
.shelf li::after { /* shelf lip shadow */
  content: ""; position: absolute; left: 0; right: 0; bottom: -20px; height: 6px;
  background: linear-gradient(var(--wood-edge), transparent); opacity: .35;
}
.jar-link { display: block; text-decoration: none; text-align: center; padding-bottom: .4rem; }
.jar-link svg { width: 100%; max-width: 9.5rem; height: auto; display: block; margin-inline: auto; transition: transform .25s ease; transform-origin: 50% 100%; }
.jar-link:hover svg, .jar-link:focus-visible svg { transform: rotate(-2.5deg) translateY(-3px); }
.jar-link .jar-name { display: block; font-size: 1rem; line-height: 1.25; margin-top: .3rem; min-height: 2.5em; }
.jar-link .jar-no { display: block; font-size: .82rem; color: var(--ink-soft); font-variant-caps: small-caps; letter-spacing: .03em; }

/* jar parts */
.jar-body { fill: var(--jar-glass); stroke: var(--jar-line); stroke-width: 2; }
.jar-fluid { fill: var(--formalin); }
.jar-meniscus { fill: none; stroke: var(--formalin-edge); stroke-width: 2; }
.jar-lid { fill: var(--wood); stroke: var(--wood-edge); stroke-width: 2; }
.jar-shine { fill: none; stroke: #fff; stroke-opacity: .55; stroke-width: 3; stroke-linecap: round; }
.jar-label { fill: var(--paper); stroke: var(--jar-line); stroke-width: 1.2; }
.jar-label-text { fill: var(--ink); font-family: var(--serif); font-size: 11px; }
.glyph { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.glyph-fill { fill: var(--ink); stroke: none; }
.glyph-soft { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 3 4; stroke-linecap: round; }
.glyph-tag { fill: var(--tag); stroke: none; }

.wings { display: grid; gap: 1.6rem 3rem; margin-top: 4.2rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .wings { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.wing h2 { font-weight: 400; font-size: 1.55rem; margin: 0 0 .3rem; }
.wing p { margin: 0; color: var(--ink-soft); max-width: 46ch; }

/* ---------- Specimen page ---------- */
.catalog-head { padding-block: 2.6rem 1rem; display: grid; gap: 1.2rem 2.4rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 820px) { .catalog-head { grid-template-columns: 11rem 1fr; } }
.catalog-head .jar-portrait svg { width: 100%; max-width: 11rem; display: block; }
.catalog-no { font-variant-caps: small-caps; letter-spacing: .04em; color: var(--tag); font-size: 1rem; margin: 0; }
.catalog-head h1 { font-weight: 400; font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.06; margin: .15rem 0 .35rem; letter-spacing: -.01em; }
.binomial { font-style: italic; color: var(--ink-soft); margin: 0; font-size: 1.15rem; }
.status-line { margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .95rem; color: var(--ink-soft); }

.stamp {
  display: inline-block; font-family: var(--type); font-weight: 700; font-size: .78rem; letter-spacing: .08em;
  padding: .12rem .5rem .08rem; border: 2px solid currentColor; border-radius: 3px; transform: rotate(-2deg);
  color: var(--st-new); background: transparent; line-height: 1.35; white-space: nowrap;
}
.stamp--quoted { color: var(--st-quoted); }
.stamp--paraphrased { color: var(--st-para); }
.stamp--reconstructed { color: var(--st-recon); }
.stamp--new { color: var(--st-new); }
.stamp--sealed { color: var(--st-sealed); border-style: dashed; }

.section { margin-top: 3rem; }
.section > h2 { font-weight: 400; font-size: 1.5rem; margin: 0 0 .7rem; display: flex; gap: .8rem; align-items: baseline; flex-wrap: wrap; }

/* the stage: dramatization */
.stage {
  position: relative; margin: 0; padding: 1.6rem 1.4rem 1.4rem 1.8rem; max-width: 48rem;
  background: var(--paper); border-left: 6px double var(--tag);
}
.stage p { margin: 0 0 .9rem; font-size: 1.2rem; line-height: 1.6; }
.stage p:last-child { margin-bottom: 0; }
.stage .line { font-style: italic; }
.stage .who { font-style: normal; font-variant-caps: small-caps; letter-spacing: .03em; color: var(--ink-soft); margin-right: .35rem; }
.stage .direction { color: var(--ink-soft); font-size: 1.02rem; }
.stage-cap { font-size: .92rem; color: var(--ink-soft); margin: .6rem 0 0; max-width: 48rem; }

/* lineage: problem → misunderstanding → reaction → joke → artifact */
.lineage { list-style: none; margin: 0; padding: 0; counter-reset: step; max-width: 48rem; }
.lineage li { position: relative; padding: .2rem 0 1.1rem 3rem; counter-increment: step; }
.lineage li::before {
  content: counter(step); position: absolute; left: 0; top: .15rem; width: 2rem; height: 2rem; border-radius: 50%;
  border: 2px solid var(--ink); display: grid; place-items: center; font-size: .95rem;
}
.lineage li::after { content: ""; position: absolute; left: .95rem; top: 2.35rem; bottom: .1rem; width: 2px; background: var(--rule); }
.lineage li:last-child::after, .js .lineage[data-stepper] li::after { display: none; }
.lineage .stage-name { font-variant-caps: small-caps; letter-spacing: .04em; color: var(--tag); display: block; font-size: 1rem; }
.lineage p { margin: .1rem 0 0; }
.js .lineage[data-stepper] li { display: none; }
.js .lineage[data-stepper] li.is-current { display: block; }
.stepper-bar { display: none; gap: .6rem; align-items: center; margin-top: .4rem; flex-wrap: wrap; }
.js .stepper-bar { display: flex; }
.stepper-dots { display: flex; gap: .35rem; margin-left: .3rem; }
.stepper-dots span { width: .6rem; height: .6rem; border-radius: 50%; border: 1.5px solid var(--ink); }
.stepper-dots span.on { background: var(--ink); }

.btn {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: .4rem .95rem; cursor: pointer;
}
.btn:hover { background: var(--glass-deep); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-quiet { border-color: var(--rule); }

/* the sealed drawer: where real source passages live */
.drawer { max-width: 48rem; border: 2px solid var(--wood); background: var(--glass-deep); border-radius: 3px; }
.drawer summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem;
}
.drawer summary::-webkit-details-marker { display: none; }
.drawer .pull { width: 3.4rem; height: .9rem; border-radius: 99px; background: var(--wood); box-shadow: inset 0 -2px 0 var(--wood-edge); flex: none; }
.drawer .drawer-title { flex: 1; }
.drawer .drawer-body { padding: 0 1.1rem 1.1rem; }
.record {
  font-family: var(--type); font-size: .98rem; line-height: 1.55; background: var(--paper); padding: 1rem 1.1rem;
  border: 1px solid var(--rule); margin: 0;
}
.record p { margin: 0 0 .5rem; }
.record .redact { background: var(--ink); color: var(--ink); border-radius: 1px; padding-inline: .2rem; }

/* habitat, sightings, field notes */
.facts { display: grid; grid-template-columns: 1fr; gap: 0; max-width: 48rem; margin: 0; }
.facts > div { display: grid; grid-template-columns: 1fr; gap: .1rem 1.4rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
@media (min-width: 640px) { .facts > div { grid-template-columns: 11rem 1fr; } }
.facts dt { font-variant-caps: small-caps; letter-spacing: .04em; color: var(--ink-soft); }
.facts dd { margin: 0; }

.fieldnote { display: grid; grid-template-columns: 2.2rem 1fr; gap: 1rem; max-width: 48rem; align-items: start; }
.fieldnote svg { width: 2.2rem; }
.fieldnote p { margin: 0 0 .7rem; }

.next-specimens { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--rule); }

/* ---------- Withheld portrait (canon is Darren's) ---------- */
.withheld { display: grid; grid-template-columns: 7rem 1fr; gap: 1.1rem; align-items: center; max-width: 36rem; margin-top: 1rem; }
.withheld .frame { aspect-ratio: 4 / 5; border: 6px solid var(--wood); outline: 1px solid var(--wood-edge); background: var(--glass-deep); display: grid; place-items: center; font-size: .78rem; text-align: center; padding: .4rem; color: var(--ink-soft); }
.withheld p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Exhibit toys ---------- */
.toy { max-width: 48rem; background: var(--paper); border: 1px solid var(--rule); padding: 1.2rem; }
.toy h3 { margin: 0 0 .6rem; font-weight: 400; font-size: 1.2rem; }

/* zero-dollar estimator */
.estimator { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
@media (min-width: 700px) { .estimator { grid-template-columns: 1fr 13rem; } }
.est-options { display: grid; gap: .35rem; }
.est-options label { display: flex; gap: .6rem; align-items: baseline; cursor: pointer; }
.est-options input { accent-color: var(--tag); transform: translateY(2px); }
.ledger { font-family: var(--type); font-size: .92rem; margin-top: .9rem; border-top: 1px dashed var(--rule); padding-top: .6rem; }
.ledger-lines > div, .ledger .total { display: flex; justify-content: space-between; gap: 1rem; }
.ledger .total { border-top: 2px solid var(--ink); margin-top: .4rem; padding-top: .3rem; font-weight: 700; }
.tower { width: 100%; max-width: 12rem; height: auto; margin-inline: auto; display: block; align-self: end; }
.tower .t-floor { fill: var(--glass-deep); stroke: var(--ink); stroke-width: 1.5; }
.tower .t-win { fill: var(--formalin); }
.tower .t-ground { stroke: var(--ink); stroke-width: 2; }
.tower .t-extra { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-hide { display: none; }

/* the beach chair & "Action." */
.scene { width: 100%; max-width: 30rem; display: block; }
.scene .s-line { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.scene .s-fill { fill: var(--glass-deep); stroke: var(--ink); stroke-width: 2; }
.scene .s-sand { fill: var(--formalin); }
.scene .s-flame { fill: var(--tag); opacity: 0; transform-origin: 50% 100%; transform-box: fill-box; }
.scene.is-burning .s-flame { opacity: 1; animation: flick .5s ease-in-out infinite alternate; }
.scene .s-bubble { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.scene .s-say { font-family: var(--serif); font-style: italic; font-size: 20px; fill: var(--ink); }
@keyframes flick { from { transform: scaleY(.88) skewX(-3deg); } to { transform: scaleY(1.08) skewX(3deg); } }

/* the outburst — controlled blast radius */
.blast { position: relative; overflow: hidden; min-height: 9rem; display: grid; place-items: center; text-align: center; }
.blast-idle { margin: 0; font-style: italic; color: var(--ink-soft); }
.blast.is-firing .blast-idle, .blast.is-done .blast-idle { display: none; }
.blast .blast-word, .blast .blast-after { display: none; }
.blast.is-firing .blast-word, .blast.is-done .blast-word, .blast.is-firing .blast-after, .blast.is-done .blast-after { display: block; }
.blast-word {
  font-family: var(--serif); font-weight: 700; font-size: clamp(2.4rem, 11vw, 6.2rem); line-height: .95; letter-spacing: -.02em;
  margin: 0; color: var(--tag); opacity: 0; transform: scale(.3);
}
.blast.is-firing .blast-word { animation: slam .55s cubic-bezier(.2,1.6,.4,1) forwards, shudder .5s .5s linear 1; }
.blast.is-done .blast-word { opacity: 1; transform: none; }
.blast-after { margin: .6rem 0 0; font-style: italic; color: var(--ink-soft); opacity: 0; transition: opacity .6s ease 1.4s; }
.blast.is-done .blast-after, .blast.is-firing .blast-after { opacity: 1; }
@keyframes slam { 0% { opacity: 0; transform: scale(.3); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shudder { 0%,100% { translate: 0 0; } 20% { translate: -6px 2px; } 40% { translate: 5px -3px; } 60% { translate: -4px 1px; } 80% { translate: 3px 0; } }
.controls { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .9rem; }
.small { font-size: .9rem; color: var(--ink-soft); }

/* dictation engine */
.engine { display: grid; gap: 1rem; }
.engine label { font-variant-caps: small-caps; letter-spacing: .04em; color: var(--ink-soft); }
.engine textarea {
  width: 100%; min-height: 5.5rem; font: inherit; font-size: 1.1rem; color: var(--ink); background: var(--glass);
  border: 1.5px solid var(--ink); border-radius: 4px; padding: .6rem .8rem; resize: vertical;
}
.gearbox { display: flex; align-items: center; gap: .8rem; }
.gearbox svg { width: 3.2rem; height: 3.2rem; }
.gear { fill: none; stroke: var(--ink); stroke-width: 2.2; transform-origin: 50% 50%; transform-box: fill-box; }
.gearbox.is-turning .gear-a { animation: spin 1s linear infinite; }
.gearbox.is-turning .gear-b { animation: spin 1s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.output { font-size: 1.25rem; font-style: italic; background: var(--glass); border-left: 4px solid var(--tag); padding: .7rem 1rem; margin: 0; min-height: 3.2rem; }
.output mark { background: transparent; color: var(--tag); text-decoration: underline wavy; text-underline-offset: .25em; font-style: normal; }
.verdict { font-family: var(--type); font-size: .9rem; margin: 0; }

/* the evidence wall */
.wall-board {
  background: #b98e5a; border: 14px solid var(--wood); border-radius: 4px; padding: .6rem; margin-top: 1rem;
  box-shadow: inset 0 0 40px rgba(60,35,10,.35);
}
:root[data-theme="dark"] .wall-board { background: #5c4429; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wall-board { background: #5c4429; } }
.wall-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
.wall-svg { width: 100%; min-width: 760px; height: auto; display: block; }
.wall-hint { display: none; font-size: .9rem; color: var(--ink-soft); margin: .4rem 0 0; }
@media (max-width: 800px) { .wall-hint { display: block; } }
.w-string { stroke: #b0151f; stroke-width: 3; fill: none; }
.w-string.dashed { stroke-dasharray: 9 7; }
.w-string.dim { opacity: .18; }
.w-card { fill: #fdfbf3; stroke: #6e5a3d; stroke-width: 1; }
.w-card-text { font-family: var(--serif); font-size: 15px; fill: #1d1a14; }
.w-card-small { font-family: var(--serif); font-size: 11.5px; fill: #4a4436; }
.w-sticky { fill: #f3e27a; }
.w-sticky-text { font-family: "Comic Neue", "Chalkboard SE", "Marker Felt", var(--serif); font-size: 15px; fill: #2b2510; }
.w-pin { fill: #b0151f; stroke: #5d0a10; stroke-width: 1.5; }
.w-node { cursor: pointer; }
.w-node:focus { outline: none; }
.w-node:focus-visible .w-card, .w-node.is-on .w-card { stroke: #b0151f; stroke-width: 3; }
.wall-key { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin-top: 1rem; font-size: .95rem; }
.wall-key span { display: inline-flex; align-items: center; gap: .5rem; }
.wall-key svg { width: 2.6rem; height: .8rem; }
.wall-readout { margin-top: 1rem; min-height: 3.2rem; max-width: 48rem; }
.wall-list { columns: 2 18rem; column-gap: 2rem; padding-left: 1.1rem; }
.wall-list li { break-inside: avoid; margin-bottom: .5rem; }

/* offcuts */
.offcuts { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; max-width: 52rem; }
.offcuts li { padding: 1.1rem 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: 1fr; gap: .2rem 1.6rem; }
@media (min-width: 720px) { .offcuts li { grid-template-columns: 15rem 1fr; } }
.offcuts h3 { margin: 0; font-weight: 400; font-size: 1.12rem; }
.offcuts p { margin: 0; }
.offcuts .why { color: var(--ink-soft); }
.offcuts .cause { font-variant-caps: small-caps; letter-spacing: .04em; color: var(--tag); font-size: .95rem; display: block; }

/* legend on the about page */
.legend { display: grid; gap: .9rem; max-width: 48rem; padding: 0; list-style: none; }
.legend li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; align-items: baseline; }
@media (max-width: 480px) { .legend li { grid-template-columns: 1fr; gap: .2rem; } }

.lost { padding-block: 4rem; display: grid; gap: 2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 700px) { .lost { grid-template-columns: 9rem 1fr; } }
.lost svg { width: 9rem; }

/* screw character */
.screw .sc-metal { fill: #b9c0bd; stroke: #2b302e; stroke-width: 2; stroke-linejoin: round; }
.screw .sc-thread { fill: none; stroke: #2b302e; stroke-width: 2; stroke-linecap: round; }
.screw .sc-slot { stroke: #2b302e; stroke-width: 3; stroke-linecap: round; }
.screw .sc-eye { fill: #17201c; }
.screw .sc-lid { fill: none; stroke: #17201c; stroke-width: 2.2; stroke-linecap: round; }
.screw .sc-z { font-family: var(--serif); font-style: italic; fill: var(--ink-soft); font-size: 14px; }
.screw .sc-medal { fill: #c9a227; stroke: #6b5410; stroke-width: 1.2; }
.screw .sc-ribbon { fill: var(--tag); }

/* Reduced motion: every joke still lands, just without the moving parts */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; }
  .blast.is-firing .blast-word { animation: none; opacity: 1; transform: none; }
  .scene.is-burning .s-flame { animation: none; }
  .gearbox.is-turning .gear-a, .gearbox.is-turning .gear-b { animation: none; }
  .jar-link:hover svg, .jar-link:focus-visible svg { transform: none; }
}

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Specimen layout: labels beside the exhibit on wide screens ---------- */
.specimen-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 3rem; }
@media (min-width: 1100px) {
  .specimen-body { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
  .col-side { position: sticky; top: 1.5rem; }
  .col-side .facts > div { grid-template-columns: 1fr; }
  .col-side .section:first-child { margin-top: 3rem; }
}
.col-side .drawer-title { font-size: 1rem; }

/* ---------- Header on small screens: brand and switch on one row, halls below ---------- */
@media (max-width: 760px) {
  .lintel nav { order: 3; width: 100%; }
  .halls { gap: .1rem 1rem; }
  .theme-toggle { order: 2; }
  .catalog-head .jar-portrait svg { max-width: 7.5rem; }
}

.stamp--suspected { color: var(--st-sealed); border-style: dashed; }

/* The watchman keeps his own hours: asleep whenever the lights are off */
.watchman--night { display: none; }
.watchman .screw--asleep { width: 7rem; }
:root[data-theme="dark"] .watchman--day { display: none; }
:root[data-theme="dark"] .watchman--night { display: flex; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .watchman--day { display: none; }
  :root:not([data-theme="light"]) .watchman--night { display: flex; }
}
@media (max-width: 760px) {
  .lintel .brand { flex: 1 1 auto; min-width: 0; }
}
.lost h1 { font-weight: 400; font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.08; margin: 0 0 .6rem; }

.legend li > .stamp { justify-self: start; }
@media (max-width: 480px) {
  .brand-name small { display: none; }
  .lintel .wrap { flex-wrap: wrap; }
  .lintel .brand { flex: 1 1 0; }
}

/* ---------- RC-0003: quoted records, Six's keypad, corrections ---------- */
.record--quoted { max-width: 48rem; }
.record--quoted blockquote { margin: 0 0 .9rem; padding-left: .9rem; border-left: 3px solid var(--st-quoted); }
.record--quoted blockquote p { margin: 0 0 .2rem; }
.record--quoted .cite { font-family: var(--serif); font-size: .95rem; color: var(--ink-soft); margin: .4rem 0 0; }
.six-board { display: grid; gap: 1rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 560px) { .six-board { grid-template-columns: 1fr 10rem; } }
.six-display { font-family: var(--type); font-size: clamp(2.4rem, 9vw, 3.6rem); margin: 0; padding: .4rem .9rem; background: var(--glass-deep); border: 1px solid var(--rule); text-align: right; min-height: 1.4em; }
.six-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.six-keys { max-width: 11rem; }
.six-key { font-family: var(--type); text-align: center; padding: .25rem 0; border-bottom: 2px solid var(--rule); color: var(--ink-soft); cursor: default; user-select: none; }
.six-key--nine { transition: opacity .6s ease, transform .6s ease; }
.six-key--nine.is-winked { opacity: 0; transform: scale(.2); }
.corrections { padding-left: 1.2rem; }
.corrections li { margin-bottom: .5rem; }
/* The offcuts drawer gets a full bottom shelf when it would otherwise stand alone */
@media (min-width: 1040px) { .shelf li:last-child:nth-child(5n+1) { grid-column: 1 / -1; }
  .shelf li:last-child:nth-child(5n+1) .jar-link { max-width: 20%; } }

/* ---------- RC-0004: open source drawers ---------- */
.stamp--missing, .stamp--notexported, .stamp--held { color: var(--st-sealed); border-style: dashed; }
a.drawer--open { display: flex; align-items: center; gap: .9rem; padding: .9rem 1.1rem; color: var(--ink); text-decoration: none; }
a.drawer--open:hover, a.drawer--open:focus-visible { background: var(--paper); }
.drawer--open .drawer-title small { display: block; font-size: .85rem; color: var(--ink-soft); margin-top: .15rem; }
.record--source { max-width: 48rem; overflow-wrap: anywhere; }
.record--source .msg-head { font-weight: 700; font-variant-caps: small-caps; letter-spacing: .03em; color: var(--ink-soft); margin: 1.1rem 0 .4rem; padding-top: .7rem; border-top: 1px dashed var(--rule); }
.record--source .msg-head:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.record .held { color: var(--ink-soft); font-style: italic; }
.source-excerpt .cite, .record--quoted .cite { font-size: .9rem; color: var(--ink-soft); max-width: 48rem; margin: .5rem 0 0; }
.method { margin-top: 2rem; }
.missing, .source-files, .source-index { list-style: none; padding: 0; margin: 0; max-width: 48rem; }
.missing li, .source-files li, .source-index li { padding: .8rem 0; border-top: 1px solid var(--rule); }
.missing p { margin: .3rem 0 0; color: var(--ink-soft); }
.miss-head { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: baseline; }
.source-files code { font-size: .8rem; overflow-wrap: anywhere; }
.source-index a { font-size: 1.15rem; }
.source-index .jar-no { font-variant-caps: small-caps; color: var(--ink-soft); margin-right: .3rem; }
.source-index .small { display: block; margin-top: .2rem; }
