/* starksi.dev comic design system: shared by the Issue #1 homepage and every Gadget Lab page.
   Original art only: halftone, ink, misprinted CMYK plates, motion "on twos". No studio logos, characters or emblems.

   Themes: <html data-theme="print"> (paper comic, default) or "hud" (night armour HUD). No attribute = follow the OS
   (dark -> hud). home.js / lab.js store the reader's choice.

   Building blocks (all opt-in classes):
     .panel          inked panel: thick ink border + hard offset shadow
     .ht / .ht-fade  Ben-Day halftone layer (::before), uses --ht-color
     .misprint       text with cyan/magenta plates knocked out of register (CSS variables --mis-x/--mis-y)
     .caption        narrator caption box (typewriter); .caption--alt for a second voice
     .bubble         speech bubble with a tail; .bubble--left
     .sfx            sound-effect lettering (Bangers, outlined, skewed); .burst gives it a starburst behind
     .btn            chunky comic button; .btn--primary, .btn--ghost
     .chip           small label; .stamp: rotated rubber stamp
     .twos           steps() timing so animations move at 12 fps, like hand-drawn animation on twos
*/

@font-face { font-family: "Bangers"; src: url("/assets/fonts/bangers.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Oswald"; src: url("/assets/fonts/oswald.woff2") format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("/assets/fonts/special-elite.woff2") format("woff2"); font-display: swap; }

:root, :root[data-theme="print"] {
  /* Suede-teal edition (2026-11), taken from a teal / grey / off-white / warm-yellow sneaker. The slots keep their
     old names: --yellow is the field colour (dusty teal), --red the strong accent (deep teal), --cyan and --magenta
     the two misprint plates (light teal and warm yellow), --blue the dark grey. */
  --paper: #eceae4; --paper-2: #f5f4ef; --ink: #23282d; --ink-2: #454b52; --muted: #6a7077;
  --red: #2b6777; --blue: #4a5560; --yellow: #6fa5b3; --cyan: #8fc3cf; --magenta: #f2bd4f;
  --panel: #fbfaf6; --panel-ink: var(--ink); --line: var(--ink);
  --accent: #1f5c6b; --accent-ink: #fff; --live: #0a7a5c;   /* text-safe on paper */
  --ht-color: rgba(35, 40, 45, .16); --shadow-off: 6px; --sfx: #f2bd4f;   /* sound-effect lettering: the warm yellow */
  --glow: none;
  --font-display: "Bangers", Impact, "Arial Black", sans-serif;
  --font-label: "Oswald", "Arial Narrow", sans-serif;
  --font-type: "Special Elite", "Courier New", monospace;
  --font-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --paper: #070b14; --paper-2: #0c1322; --ink: #e9f3ff; --ink-2: #b6c6dc; --muted: #7d8fa8;
    --red: #ff4d5e; --blue: #4d8dff; --yellow: #ffd23f; --cyan: #34e1ff; --magenta: #ff4fb0;
    --panel: #0d1526; --panel-ink: #34e1ff; --line: #2b4466;
    --accent: #ff4d5e; --accent-ink: #12060a; --live: #3df2a8;
    --ht-color: rgba(52, 225, 255, .14); --glow: 0 0 18px rgba(52, 225, 255, .35);
    color-scheme: dark;
  }
}
:root[data-theme="hud"] {
  /* Dark background preview (not in the edition menu; open with ?edition=hud). Same teal family on a near-black page. */
  --paper: #0f1518; --paper-2: #151d21; --ink: #e7edef; --ink-2: #b9c5ca; --muted: #7f8e95;
  --red: #3f8ea3; --blue: #33424b; --yellow: #6fa5b3; --cyan: #8fc3cf; --magenta: #f2bd4f;
  --panel: #161f24; --panel-ink: #8fc3cf; --line: #32444d;
  --accent: #8fc3cf; --accent-ink: #0f1518; --live: #5fd0a0;
  --ht-color: rgba(143, 195, 207, .14); --glow: 0 0 18px rgba(111, 165, 179, .3); --sfx: #f2bd4f;
  color-scheme: dark;
}

/* Glass: frosted, translucent panels floating over a soft colour field (a clean-skin edition; see the Glass block below) */

/* clean themes: same structure, quiet surfaces (ornaments are switched off under [data-skin="clean"] below) */

/* editions (palettes from the Fable review; text pairs measured at 4.5:1 or better) */

:root[data-theme="sunday"] {
  --paper: #f4f1ea; --paper-2: #fbf9f4; --ink: #1b1a18; --ink-2: #3d3a35; --muted: #625d55;
  --red: #a3231b; --blue: #2b4a7a; --yellow: #e9dfc4; --cyan: #5b7a8c; --magenta: #8c5b6e;
  --panel: #fbf9f4; --panel-ink: #1b1a18; --line: #1b1a18;
  --accent: #a3231b; --accent-ink: #fff; --live: #2f6b3a;
  --ht-color: transparent; --glow: none; --shadow-off: 0px;
  --font-display: "Oswald", "Arial Narrow", sans-serif;
  --font-label: "Oswald", "Arial Narrow", sans-serif;
  --font-type: "Special Elite", "Courier New", monospace;
  --font-body: Georgia, "Iowan Old Style", Charter, ui-serif, serif;
  color-scheme: light;
}
:root[data-theme="sunday"][data-mode="dark"] {   /* Newspaper, dark appearance */
  --paper: #121110; --paper-2: #191816; --ink: #ece8df; --ink-2: #c9c4b9; --muted: #9a9488;
  --red: #e0685c; --blue: #8fb0e0; --yellow: #2a2824; --cyan: #8fa9b8; --magenta: #b88fa0;
  --panel: #191816; --panel-ink: #ece8df; --line: #ece8df;
  --accent: #e0685c; --accent-ink: #121110; --live: #7fc08a;
  color-scheme: dark;
}

/* paper grain + halftone wash on the page itself */
.comic-page {
  margin: 0; color: var(--ink); background-color: var(--paper);
  background-image:
    radial-gradient(var(--ht-color) 1px, transparent 1.6px),
    radial-gradient(var(--ht-color) 1px, transparent 1.6px);
  background-size: 14px 14px; background-position: 0 0, 7px 7px;
  font: 16px/1.6 var(--font-body); -webkit-font-smoothing: antialiased;
}

/* panels */
.panel {
  position: relative; background: var(--panel); border: 3px solid var(--panel-ink); border-radius: 4px;
  box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--panel-ink), var(--glow);
}
:root[data-theme="hud"] .panel { border-width: 1.5px; border-radius: 10px; box-shadow: var(--glow); }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .panel { border-width: 1.5px; border-radius: 10px; box-shadow: var(--glow); } }

/* Ben-Day halftone layer: put .ht on a positioned element; tune with --ht-size / --ht-dot / --ht-color */
.ht { position: relative; isolation: isolate; }
.ht::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; border-radius: inherit;
  background-image: radial-gradient(var(--ht-color) var(--ht-dot, 1.6px), transparent calc(var(--ht-dot, 1.6px) + .6px));
  background-size: var(--ht-size, 9px) var(--ht-size, 9px);
}
.ht-fade::before {
  -webkit-mask-image: linear-gradient(135deg, #000 10%, transparent 75%);
  mask-image: linear-gradient(135deg, #000 10%, transparent 75%);
}

/* misprinted plates: the text's cyan and magenta copies sit a little off register */
.misprint {
  --mis-x: 3px; --mis-y: 2px;
  /* --gx/--gy: an extra page-wide offset a page script may drive from the pointer (0 when unset) */
  text-shadow: calc((var(--mis-x) + var(--gx, 0px)) * -1) calc((var(--mis-y) + var(--gy, 0px)) * -1) 0 var(--cyan),
    calc(var(--mis-x) + var(--gx, 0px)) calc(var(--mis-y) + var(--gy, 0px)) 0 var(--magenta);
}
.misprint.jitter { animation: misjit 1.2s steps(1) infinite; }
@keyframes misjit {
  0%, 100% { --mis-x: 3px; --mis-y: 2px; }
  25% { --mis-x: -2px; --mis-y: 3px; }
  50% { --mis-x: 4px; --mis-y: -1px; }
  75% { --mis-x: 1px; --mis-y: 4px; }
}
@property --mis-x { syntax: "<length>"; inherits: true; initial-value: 3px; }
@property --mis-y { syntax: "<length>"; inherits: true; initial-value: 2px; }

/* captions and bubbles */
.caption {
  display: inline-block; background: var(--yellow); color: #141210; border: 2.5px solid #141210;
  padding: 6px 12px; font: 15px/1.45 var(--font-type); box-shadow: 3px 3px 0 #141210;
}
.caption--alt { background: var(--cyan); }
.caption--dark { background: #141210; color: #fff; border-color: #141210; }
.bubble {
  position: relative; display: inline-block; background: #fff; color: #141210; border: 3px solid #141210;
  border-radius: 24px; padding: 12px 18px; font: 600 15px/1.45 var(--font-body);
}
.bubble::after {
  content: ""; position: absolute; bottom: -18px; right: 34px; width: 26px; height: 20px; background: #fff;
  border-right: 3px solid #141210; border-bottom: 3px solid #141210; transform: skewX(-38deg); border-bottom-right-radius: 6px;
}
.bubble--left::after { right: auto; left: 34px; transform: skewX(38deg) scaleX(-1); }

/* sound effects */
.sfx {
  font-family: var(--font-display); letter-spacing: .04em; line-height: .9; color: var(--sfx, var(--yellow));
  -webkit-text-stroke: 2px #141210; paint-order: stroke fill;
  text-shadow: 4px 4px 0 #141210; transform: rotate(-6deg) skewX(-6deg); display: inline-block;
}
.burst {
  position: relative; display: inline-grid; place-items: center; padding: 1.4em 1.8em; isolation: isolate;
}
.burst::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: var(--red);
  clip-path: polygon(50% 0, 61% 22%, 85% 8%, 78% 33%, 100% 38%, 80% 54%, 96% 76%, 70% 72%, 66% 100%, 50% 80%, 33% 98%, 30% 72%, 4% 80%, 20% 56%, 0 40%, 22% 32%, 14% 8%, 38% 22%);
}

/* controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px;
  font: 600 15px/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--panel); border: 2.5px solid var(--panel-ink); border-radius: 4px;
  box-shadow: 4px 4px 0 var(--panel-ink); cursor: pointer; transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--panel-ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--panel-ink); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--ghost { background: transparent; box-shadow: none; }
.btn--ghost:hover { box-shadow: 3px 3px 0 var(--panel-ink); }
.chip {
  display: inline-block; font: 500 12px/1 var(--font-label); letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 8px; border: 2px solid var(--panel-ink); border-radius: 3px; background: var(--paper-2); color: var(--ink);
}
.stamp {
  display: inline-block; font: 700 13px/1 var(--font-label); letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); border: 2.5px solid var(--accent); padding: 5px 9px; border-radius: 4px; transform: rotate(-8deg);
  opacity: .9;
}

/* motion on twos */
.twos { animation-timing-function: steps(1, end) !important; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* Gadget Lab page chrome (lab pages only) */
.lab-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 3px solid var(--panel-ink);
  background: var(--panel); font: 600 14px/1 var(--font-label); letter-spacing: .06em; text-transform: uppercase;
}
.lab-bar a { color: var(--ink); text-decoration: none; }
.lab-bar .lab-title { font: 22px/1 var(--font-display); letter-spacing: .05em; margin-left: 4px; }
.lab-bar .lab-sp { margin-left: auto; }
@media (max-width: 480px) {
  .lab-bar { gap: 8px; padding: 8px 12px; }
  .lab-bar .lab-title { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .lab-bar .btn { padding: 8px 10px; font-size: 12px; }
}
.lab-credit { font: 12px/1.5 var(--font-type); color: var(--muted); text-align: center; padding: 16px; }
html.embed .lab-bar, html.embed .lab-credit { display: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

/* ---------- motion levels (lab.js sets data-motion) ---------- */
/* off: nothing animates (same as the OS reduced-motion setting) */
:root[data-motion="off"] *, :root[data-motion="off"] *::before, :root[data-motion="off"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
/* calm (default): nothing loops on its own; pages add their own ambient loops to this list */
:root[data-motion="calm"] .misprint.jitter { animation: none; }

/* ---------- clean skin: the same structure with the comic ornament switched off ---------- */
:root[data-skin="clean"] .comic-page { background-image: none; }
:root[data-skin="clean"] .misprint { text-shadow: none; }
:root[data-skin="clean"] .ht::before { display: none; }
:root[data-skin="clean"] .panel { border-width: 1px; border-radius: 14px; box-shadow: 0 1px 2px rgba(0,0,0,.04), 0 10px 30px -18px rgba(0,0,0,.18); }

:root[data-skin="clean"] .btn {
  border-width: 1px; border-color: var(--line); border-radius: 10px; box-shadow: none; letter-spacing: .02em;
  text-transform: none; font-weight: 600; transition: transform .15s ease, border-color .15s ease, background .15s ease;
}
:root[data-skin="clean"] .btn:hover { transform: translateY(-1px); box-shadow: none; border-color: var(--ink-2); }
:root[data-skin="clean"] .btn:active { transform: none; box-shadow: none; }
:root[data-skin="clean"] .btn--primary { border-color: var(--accent); }
:root[data-skin="clean"] .btn--ghost { border-color: transparent; }
:root[data-skin="clean"] .chip { border-width: 1px; border-color: var(--line); border-radius: 999px; letter-spacing: .04em; text-transform: none; font-weight: 600; }
:root[data-skin="clean"] .caption, :root[data-skin="clean"] .caption--alt {
  background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); box-shadow: none; border-radius: 8px; font-size: 13px;
}
:root[data-skin="clean"] .caption--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
:root[data-skin="clean"] .bubble {
  background: transparent; color: var(--ink-2); border: 0; border-left: 3px solid var(--accent); border-radius: 0;
  padding: 2px 0 2px 14px; font-weight: 500;
}
:root[data-skin="clean"] .bubble::after { display: none; }
:root[data-skin="clean"] .sfx { color: var(--ink); -webkit-text-stroke: 0; text-shadow: none; transform: none; letter-spacing: -.01em; font-weight: 800; }
:root[data-skin="clean"] .burst::before { display: none; }
:root[data-skin="clean"] .stamp { transform: none; border-width: 1px; border-radius: 999px; letter-spacing: .06em; }
:root[data-skin="clean"] .lab-bar { border-bottom-width: 1px; }
:root[data-skin="clean"] .lab-bar .lab-title { font-weight: 800; letter-spacing: -.01em; }
:root[data-skin="clean"] .misprint.jitter { animation: none; }

/* touch screens: every control at least 44px tall */
@media (pointer: coarse) { .btn, .chip, .flip { min-height: 44px; } }

/* ---------- edition details (shared) ---------- */
/* Inks: comic structure in black ink with one spot colour; no CMYK misprint */

:root[data-theme="sunday"] .caption--dark { color: var(--ink); background: transparent; }
/* Sunday Edition: ruled newsprint columns, serif body, pull quotes */
:root[data-theme="sunday"] .panel { border: 0; border-top: 3px double var(--ink); border-bottom: 1px solid var(--ink); border-radius: 0; box-shadow: none; }
:root[data-theme="sunday"] .btn { border-radius: 2px; border-color: var(--ink); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-label); }
:root[data-theme="sunday"] .chip { border-radius: 0; border-color: var(--ink); text-transform: uppercase; letter-spacing: .12em; }
:root[data-theme="sunday"] .caption, :root[data-theme="sunday"] .caption--alt { background: transparent; border: 0; border-bottom: 1px solid var(--ink); border-radius: 0; padding: 2px 0; text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-type); }
:root[data-theme="sunday"] .bubble { font-family: var(--font-body); font-style: italic; font-size: 1.05em; border-left: 3px solid var(--ink); }
:root[data-theme="sunday"] .lab-bar { border-bottom: 3px double var(--ink); }
/* Blueprint: drafting grid, dashed outlines, monospace annotations, yellow highlighter */

/* ---------- edition switch: the new edition grows out of the tapped button (lab.js animates the circle) ---------- */
html.reveal::view-transition-old(root), html.reveal::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.reveal::view-transition-group(root) { animation: none; }

/* ---------- Glass edition ----------
   A soft colour field behind everything, and frosted panels that let it through (backdrop blur + a bright rim and a
   specular top edge). Readability first: text sits on at least 56% white, and anyone whose device asks for reduced
   transparency (or a browser without backdrop-filter) gets solid panels. */

/* ---------- Studio look (playground + showpieces) ----------
   The same tokens as the Studio homepage (/preview/studio.css): white paper, near-black ink, one blue for actions,
   system type, soft grey cards with big radii. Not an edition a reader cycles to: lab.js applies it for visitors who
   come from the Studio site (?edition=studio), and turns the lab bar into the site header. */

/* the lab bar as the site header: frosted, fixed, same height and type as the Studio nav */

 

.sfoot { display: none; }

 

