/* cheapllm.shop
   Two cities stacked: the Spire (marble, brass, cold gold light) and the Sump (soot, rust,
   teal and magenta glow). Scrolling the landing page goes down from one to the other;
   --depth (0 at the top, 1 at the bottom) drives the light. */

:root {
  --soot: #0e0c11;
  --soot-2: #17141b;
  --soot-3: #221d27;
  --smog: #2c2532;
  --ink: #efe6d6;
  --ink-2: #c9bfae;
  --ink-3: #8f8676;
  --brass: #c9a35c;
  --brass-2: #8f6f34;
  --gold: #f1cf86;
  --teal: #33e3cc;
  --teal-2: #139c8c;
  --magenta: #ff3f8e;
  --magenta-2: #b81f5f;
  --rust: #a5492f;
  --paper: #e9dcc0;
  --paper-ink: #2a2119;
  --ok: #33e3cc;
  --warn: #f1b04a;
  --bad: #ff4d5e;
  --depth: 0;
  --accent-text: #f4ead9;
  --art-spire: url('/media/spire.webp');
  --art-sump: url('/media/sump.webp');
  --glow: color-mix(in oklab, var(--gold) calc((1 - var(--depth)) * 100%), var(--teal));

  --f-spire: 'Cormorant Garamond', 'Georgia', serif;
  --f-sump: 'Permanent Marker', 'Comic Sans MS', cursive;
  --f-label: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --f-body: 'Barlow', 'Helvetica Neue', Arial, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  --f-hand: 'Permanent Marker', 'Comic Sans MS', cursive;

  --gutter: clamp(16px, 4vw, 48px);
  --maxw: 1200px;
  color-scheme: dark;
}

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

body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--soot); color: var(--ink);
  font-family: var(--f-body); font-size: 17px; line-height: 1.6;
  overflow-x: hidden;
}
/* painted grain + vignette, once for every page */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 90; opacity: 0.16; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
body::after {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(120% 70% at 50% -10%, color-mix(in srgb, var(--glow) 16%, transparent), transparent 60%),
    radial-gradient(90% 60% at 100% 110%, color-mix(in srgb, var(--magenta) calc(var(--depth) * 14%), transparent), transparent 70%),
    var(--soot);
}
body.app::after {
  background:
    linear-gradient(180deg, rgba(14,12,17,.86), rgba(14,12,17,.96)),
    var(--art-sump) center / contain no-repeat,
    var(--soot);
}

main { flex: 1; position: relative; z-index: 2; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
::selection { background: var(--magenta); color: #fff; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }

h1, h2, h3 { font-family: var(--f-spire); font-weight: 600; line-height: 1.02; margin: 0; letter-spacing: -0.005em; }
h1 { font-size: clamp(46px, 7.4vw, 104px); }
h2 { font-size: clamp(36px, 5vw, 66px); }
h3 { font-size: clamp(24px, 2.4vw, 30px); }
p { margin: 0 0 1em; }
code, pre { font-family: var(--f-mono); font-size: 0.88em; }
:not(pre) > code { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); padding: 0.05em 0.36em; border-radius: 3px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); position: relative; }
.muted { color: var(--ink-3); }
.mono { font-family: var(--f-mono); }
.hand { font-family: var(--f-hand); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
[data-auth='in'] [data-when='out'], [data-auth='out'] [data-when='in'] { display: none !important; }

/* ------------------------------------------------------------------ header */
.topbar { position: sticky; top: 0; z-index: 50; padding: 12px 0; background: linear-gradient(180deg, rgba(14,12,17,.92), rgba(14,12,17,.55) 70%, transparent); }
.topbar .wrap { display: flex; align-items: center; gap: 16px 22px; flex-wrap: wrap; }
.tag {
  font-family: var(--f-sump); font-size: 27px; line-height: 1; text-decoration: none; color: var(--accent-text);
  text-shadow: 0 2px 0 rgba(0,0,0,.35), 0 0 16px color-mix(in srgb, var(--magenta) 35%, transparent); transform: rotate(-3deg); display: inline-block; position: relative;
}
.tag small { font-family: var(--f-label); font-size: 13px; letter-spacing: 0.18em; color: var(--brass); text-shadow: none; margin-left: 4px; text-transform: uppercase; vertical-align: 4px; }
.tag::after { /* a drip */
  content: ''; position: absolute; left: 34%; top: 82%; width: 3px; height: 12px; border-radius: 0 0 3px 3px; background: var(--magenta);
  animation: drip 6s ease-in infinite;
}
@keyframes drip { 0%, 70% { height: 4px; opacity: 1; } 95% { height: 16px; opacity: 1; } 100% { height: 16px; opacity: 0; } }
.tag:hover { color: var(--accent-text); }

.nav { display: flex; gap: 4px 22px; align-items: center; margin-left: auto; flex-wrap: wrap; }
.nav a:not(.btn), .nav .linkish { text-decoration: none; font: 600 15px var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:not(.btn):hover, .nav a:not(.btn)[aria-current='page'] { color: var(--ink); border-bottom-color: var(--glow); }
.open-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); margin-right: 7px; vertical-align: 1px; }
.open-dot[data-state='open'] { background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.open-dot[data-state='busy'] { background: var(--warn); box-shadow: 0 0 10px var(--warn); }
.open-dot[data-state='closed'] { background: var(--bad); }
.sound-toggle { background: none; border: 1px solid rgba(201,163,92,.35); color: var(--brass); border-radius: 20px; padding: 5px 12px 5px 10px; font: 600 13px var(--f-label); letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.sound-toggle .bars { display: inline-flex; gap: 2px; align-items: flex-end; height: 12px; }
.sound-toggle .bars i { width: 2px; height: 3px; background: currentColor; }
.sound-toggle[aria-pressed='true'] { color: var(--teal); border-color: var(--teal); }
.sound-toggle[aria-pressed='true'] .bars i { animation: eq 0.9s ease-in-out infinite; }
.sound-toggle .bars i:nth-child(2) { animation-delay: -.3s !important; }
.sound-toggle .bars i:nth-child(3) { animation-delay: -.6s !important; }
@keyframes eq { 0%, 100% { height: 3px; } 50% { height: 12px; } }
@media (max-width: 820px) { .nav { width: 100%; margin-left: 0; gap: 2px 16px; } .nav a:not(.btn), .nav .linkish { font-size: 13px; } }

/* ----------------------------------------------------------------- buttons */
.btn {
  --c: var(--teal);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 700 16px/1 var(--f-label); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
  padding: 16px 26px; color: #071311; background: var(--c); border: 0; cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  transition: transform .15s ease, filter .15s ease;
  isolation: isolate;
}
.btn:hover { color: #071311; transform: translateY(-2px); filter: brightness(1.1) drop-shadow(0 0 14px var(--c)); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .55; cursor: progress; }
.btn-primary { --c: var(--teal); }
.btn-hot { --c: var(--magenta); color: #fff; }
.btn-hot:hover { color: #fff; }
.btn-ghost { --c: var(--brass); background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--c); }
.btn-ghost:hover { color: var(--ink); background: rgba(201,163,92,.12); }
.btn-small { padding: 10px 16px; font-size: 14px; clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.btn-danger { --c: var(--bad); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn .arc { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); pointer-events: none; overflow: visible; z-index: 2; }
.btn .arc path { fill: none; stroke: #e9fffb; stroke-width: 1.4; filter: drop-shadow(0 0 4px var(--c)); }
.btn-wrap { position: relative; display: inline-block; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ------------------------------------------------------------ chapters */
.chapter { position: relative; padding: clamp(80px, 12vw, 160px) 0 0; scroll-margin-top: 60px; }
.lvl { font: 600 13px/1 var(--f-label); letter-spacing: 0.28em; text-transform: uppercase; color: var(--brass); display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.lvl::before { content: ''; width: 34px; height: 1px; background: currentColor; }
.lvl b { color: var(--glow); font-weight: 700; }
.lede { font-size: 19px; color: var(--ink-2); max-width: 56ch; }
.spray { font-family: var(--f-sump); color: var(--accent-text); text-shadow: 0 2px 12px rgba(0,0,0,.5); font-weight: 400; }
.note { font-family: var(--f-hand); color: var(--teal); font-size: 24px; transform: rotate(-3deg); display: inline-block; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px 64px; align-items: center; }
@media (max-width: 900px) { .two { grid-template-columns: 1fr; } }

/* -------------------------------------------------------------- hero */
.hero { position: relative; min-height: min(100vh, 980px); display: flex; align-items: flex-end; padding: 0 0 clamp(40px, 7vw, 90px); margin-top: -72px; overflow: hidden; }
.hero-bg { position: absolute; inset: -4% -4% 0 18%; background: var(--art-spire) right center / contain no-repeat; will-change: transform; }
@media (max-width: 820px) { .hero-bg { inset: 0 -30% 20% -10%; opacity: .55; } }
.hero-bg::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 70%, var(--soot) 100%); }
.hero .wrap { z-index: 2; }
.hero h1 { color: var(--gold); max-width: 13ch; text-shadow: 0 4px 30px rgba(0,0,0,.5); font-style: italic; }
.hero .over {
  display: inline-block; font-family: var(--f-sump); font-style: normal; font-weight: 400; font-size: clamp(30px, 4.2vw, 58px); color: var(--accent-text);
  transform: rotate(-3deg) translate(.15em, 0); line-height: 1.1; margin-top: 14px; padding: 0 .2em .12em;
  text-shadow: 0 3px 14px rgba(0,0,0,.55);
  background: linear-gradient(transparent 72%, color-mix(in srgb, var(--magenta) 70%, transparent) 72%, color-mix(in srgb, var(--magenta) 70%, transparent) 88%, transparent 88%);
  -webkit-mask: linear-gradient(90deg, #000 var(--reveal, 0%), transparent calc(var(--reveal, 0%) + 8%));
  mask: linear-gradient(90deg, #000 var(--reveal, 0%), transparent calc(var(--reveal, 0%) + 8%));
}
.hero-sub { display: flex; gap: 28px 48px; align-items: flex-end; flex-wrap: wrap; margin-top: 30px; }
.hero-sub p { font-size: 19px; max-width: 40ch; color: var(--ink); margin: 0; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
.cta-row { display: flex; gap: 16px 22px; align-items: center; flex-wrap: wrap; }
.stub { display: inline-flex; align-items: stretch; margin-top: 22px; max-width: 100%; background: rgba(14,12,17,.7); border: 1px solid rgba(201,163,92,.4); font-family: var(--f-mono); font-size: 14px; }
.stub span { padding: 10px 12px; overflow-x: auto; white-space: nowrap; }
.stub b { color: var(--teal); font-weight: 500; }
.stub button { border: 0; border-left: 1px solid rgba(201,163,92,.4); background: none; color: var(--brass); padding: 0 14px; cursor: pointer; font: 600 12px var(--f-label); letter-spacing: .14em; text-transform: uppercase; }
.stub button:hover { background: var(--brass); color: var(--soot); }
.scroll-hint { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); font: 600 11px var(--f-label); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); z-index: 2; }
.scroll-hint::after { content: ''; display: block; width: 1px; height: 34px; margin: 8px auto 0; background: linear-gradient(var(--gold), transparent); animation: fall 2s ease-in-out infinite; }
@keyframes fall { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* --------------------------------------------------------- the notice */
.wall { position: relative; min-height: 460px; display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(60% 60% at 50% 50%, rgba(255,63,142,.08), transparent 70%),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 2px, transparent 2px 38px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.25) 0 2px, transparent 2px 76px), linear-gradient(rgba(14,12,17,.8), rgba(14,12,17,.88)), var(--art-sump) center / cover, var(--soot-2);
  border: 1px solid rgba(255,255,255,.05);
}
.wall .under { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 4px; padding: 20px; }
.wall .under .spray { font-size: clamp(38px, 6vw, 76px); line-height: 1; transform: rotate(-5deg); }
.wall .under .spray.t { color: var(--teal); text-shadow: 0 0 24px color-mix(in srgb, var(--teal) 50%, transparent); transform: rotate(3deg); font-size: clamp(26px, 3.6vw, 44px); }
.notice {
  position: relative; z-index: 2; width: min(420px, 100%); background: var(--paper); color: var(--paper-ink); padding: 30px 30px 44px; cursor: pointer;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,.7); transform: rotate(-2deg); transition: transform .3s;
  background-image: radial-gradient(circle at 20% 10%, rgba(120,90,40,.18), transparent 40%), radial-gradient(circle at 90% 80%, rgba(90,60,20,.22), transparent 45%);
  clip-path: polygon(0 2%, 8% 0, 30% 1.5%, 55% 0, 78% 1%, 100% 0, 99% 30%, 100% 62%, 98.5% 100%, 70% 98.5%, 45% 100%, 20% 98.6%, 0 100%, 1% 60%);
}
.notice:hover { transform: rotate(-1deg) scale(1.01); }
.notice::before { content: ''; position: absolute; top: 10px; left: 50%; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #d9d4cc, #6d6a66); transform: translateX(-50%); box-shadow: 0 2px 2px rgba(0,0,0,.4); }
.notice h3 { font-family: var(--f-spire); font-size: 27px; text-align: center; text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 2px; }
.notice .seal { text-align: center; font: 600 11px var(--f-label); letter-spacing: .3em; text-transform: uppercase; color: #6b5a3c; margin-bottom: 16px; }
.notice p { font-family: var(--f-spire); font-size: 18px; line-height: 1.4; margin-bottom: 10px; }
.notice .stamp { position: absolute; right: 14px; bottom: 10px; font: 700 34px var(--f-label); color: #b0222e; border: 3px solid #b0222e; padding: 2px 10px; transform: rotate(-14deg); opacity: .8; letter-spacing: .06em; }
.notice .pull { display: block; text-align: center; font: 600 12px var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: #7a6a4c; margin-top: 16px; }
.notice.torn { animation: tear 1s cubic-bezier(.5,0,.75,0) forwards; pointer-events: none; }
@keyframes tear { 0% { transform: rotate(-2deg); } 25% { transform: rotate(4deg) translate(6px, -10px); } 100% { transform: rotate(38deg) translate(220px, 900px); opacity: 0; } }
.notice-x { position: absolute; inset: 0; pointer-events: none; z-index: 3; }

/* -------------------------------------------------------------- the tap */
.wren-stage { position: relative; min-height: 560px; }
.wren-stage .wren { position: absolute; left: 4%; bottom: 0; width: 52%; max-width: 330px; z-index: 2; transform-origin: 50% 100%; transition: transform .25s ease-out; filter: drop-shadow(0 0 30px rgba(51,227,204,.12)); }
.wren-stage .relay { position: absolute; right: 0; bottom: 6%; width: 56%; max-width: 360px; z-index: 1; filter: drop-shadow(0 0 calc(18px + var(--charge, 0) * 50px) color-mix(in srgb, var(--teal) calc(35% + var(--charge, 0) * 50%), transparent)); transition: filter .2s; }
.wren-stage .note { position: absolute; right: 6%; top: 4%; }
@media (max-width: 900px) { .wren-stage { min-height: 440px; } }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs button { font: 600 14px var(--f-label); letter-spacing: .14em; text-transform: uppercase; background: none; border: 1px solid transparent; border-bottom: 0; color: var(--ink-3); padding: 9px 14px; cursor: pointer; }
.tabs button[aria-selected='true'] { color: var(--teal); border-color: rgba(51,227,204,.35); background: rgba(14,12,17,.8); }
.codebox { position: relative; background: rgba(9,8,11,.92); border: 1px solid rgba(51,227,204,.35); box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 30px 60px -30px rgba(51,227,204,.3); }
.codebox pre { margin: 0; padding: 24px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; color: #e3dccd; }
.codebox .copy { position: absolute; top: 10px; right: 10px; }
.tok-k { color: var(--gold); }
.tok-s { color: #8fe9d9; }
.tok-c { color: #7c7466; font-style: italic; }
.tok-add { background: rgba(51,227,204,.12); display: inline-block; width: 100%; }
.tok-del { background: rgba(255,63,142,.14); display: inline-block; width: 100%; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }
.copy { font: 600 11px var(--f-label); letter-spacing: .16em; text-transform: uppercase; background: rgba(255,255,255,.06); color: var(--ink-2); border: 1px solid rgba(255,255,255,.14); padding: 6px 10px; cursor: pointer; }
.copy:hover { background: var(--teal); color: var(--soot); border-color: var(--teal); }
.copy.done { background: var(--teal); color: var(--soot); }
.checklist { list-style: none; padding: 0; margin: 22px 0 0; }
.checklist li { padding: 10px 0 10px 30px; border-top: 1px solid rgba(255,255,255,.07); position: relative; }
.checklist li::before { content: ''; position: absolute; left: 4px; top: 19px; width: 10px; height: 10px; background: var(--teal); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); box-shadow: 0 0 8px var(--teal); }

/* -------------------------------------------------------------- the wire */
.wire { position: relative; padding-top: 34px; }
.wire > svg.cable { position: absolute; left: 0; top: 0; width: 100%; height: 60px; overflow: visible; pointer-events: none; }
.wire > svg.cable path { fill: none; stroke: #050406; stroke-width: 4; }
.tags { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 46px 26px; }
@media (max-width: 960px) { .tags { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .tags { grid-template-columns: 1fr; } }
.hang { position: relative; transform-origin: 50% -26px; animation: sway 6s ease-in-out infinite; }
.hang:nth-child(2n) { animation-duration: 7.4s; animation-delay: -2s; }
.hang:nth-child(3n) { animation-duration: 8.2s; animation-delay: -4s; }
.hang:hover { animation-play-state: paused; }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.4deg); } }
.hang::before { content: ''; position: absolute; left: 50%; top: -26px; width: 1px; height: 26px; background: var(--brass-2); }
.hang .plate { background: linear-gradient(160deg, #2a2330, #17131b); border: 1px solid rgba(201,163,92,.35); padding: 22px 22px 20px; position: relative; transition: border-color .2s, box-shadow .2s; height: 100%; }
.hang .plate::before { content: ''; position: absolute; top: 8px; left: 50%; width: 8px; height: 8px; border-radius: 50%; transform: translateX(-50%); background: var(--brass); box-shadow: inset 0 -1px 2px rgba(0,0,0,.6); }
.hang:hover .plate { border-color: var(--teal); box-shadow: 0 0 30px -6px rgba(51,227,204,.45); }
.hang .num { font: 600 12px var(--f-label); letter-spacing: .24em; color: var(--brass); }
.hang h3 { margin: 6px 0 8px; font-size: 26px; }
.hang p { margin: 0; color: var(--ink-2); font-size: 16px; }

.graffiti { position: relative; margin-top: 90px; height: clamp(320px, 42vw, 460px); overflow: hidden; cursor: crosshair; touch-action: pan-y;
  background: var(--art-sump) center / cover no-repeat, var(--soot-2); border: 1px solid rgba(255,255,255,.06); }
.graffiti .dark { position: absolute; inset: 0; background: rgba(8,7,10,.86); -webkit-mask: radial-gradient(circle 150px at var(--mx, -500px) var(--my, -500px), transparent 0, transparent 60%, #000 100%); mask: radial-gradient(circle 150px at var(--mx, -500px) var(--my, -500px), transparent 0, transparent 60%, #000 100%); z-index: 2; pointer-events: none; }
.graffiti .scrawl { position: absolute; font-family: var(--f-sump); color: #ff8ab5; line-height: 1; white-space: nowrap; text-shadow: 0 0 18px color-mix(in srgb, var(--magenta) 50%, transparent); z-index: 1; }
.graffiti .scrawl.t { color: var(--teal); text-shadow: 0 0 18px color-mix(in srgb, var(--teal) 50%, transparent); }
.graffiti .scrawl.h { font-family: var(--f-hand); color: var(--paper); text-shadow: none; }
.graffiti .hint { position: absolute; z-index: 3; left: 18px; bottom: 14px; font: 600 12px var(--f-label); letter-spacing: .24em; text-transform: uppercase; color: var(--ink-3); }

/* -------------------------------------------------------------- the stall */
.stall-stage { position: relative; max-width: 560px; margin: 0 auto; }
.stall-stage img { width: 100%; filter: drop-shadow(0 0 40px rgba(241,207,134,.15)); }
.neon-sign { position: absolute; left: 50%; top: 4.5%; transform: translateX(-50%) rotate(-2deg); font-family: var(--f-sump); font-size: clamp(22px, 3.6vw, 40px); color: #fff; white-space: nowrap;
  text-shadow: 0 0 4px #fff, 0 0 12px var(--magenta), 0 0 28px var(--magenta), 0 0 48px var(--magenta); }
.neon-sign .flick { animation: flick 6s infinite; }
@keyframes flick { 0%, 93%, 100% { opacity: 1; } 94% { opacity: .2; } 95% { opacity: 1; } 96.5% { opacity: .35; } }
.board { background: linear-gradient(170deg, #1f1a24, #120f15); border: 1px solid rgba(201,163,92,.4); padding: 26px 28px; position: relative; }
.board h3 { color: var(--gold); font-style: italic; }
.board dl { margin: 16px 0 0; font-family: var(--f-mono); font-size: 14px; }
.board dl div { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; }
.board dt { white-space: nowrap; color: var(--ink-2); }
.board dd { margin: 0; white-space: nowrap; color: var(--teal); font-weight: 600; }
.board .dots { flex: 1; border-bottom: 1px dotted rgba(255,255,255,.2); transform: translateY(-4px); }
.board .strike { text-decoration: line-through; color: var(--ink-3); font-weight: 400; margin-right: 6px; }
.calc { margin-top: 22px; }
.calc .row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 16px; align-items: center; }
.calc label { font: 600 14px var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.calc output { font: 500 14px var(--f-mono); color: var(--ink); }
.calc input[type='range'] { grid-column: 1 / -1; width: 100%; accent-color: var(--magenta); }
.bill { margin-top: 22px; border-top: 1px solid rgba(201,163,92,.3); padding-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bill .big { font-family: var(--f-spire); font-size: clamp(34px, 4vw, 46px); line-height: 1; color: var(--gold); }
.bill .lbl { font: 600 12px var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }

/* -------------------------------------------------------------- the crowd */
.overheard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
@media (max-width: 820px) { .overheard { grid-template-columns: 1fr; } }
.overheard details { border-top: 1px solid rgba(201,163,92,.25); }
.overheard summary { list-style: none; cursor: pointer; padding: 16px 40px 16px 0; position: relative; font-family: var(--f-spire); font-size: 23px; font-weight: 600; line-height: 1.25; }
.overheard summary::-webkit-details-marker { display: none; }
.overheard summary::after { content: '+'; position: absolute; right: 6px; top: 12px; font: 300 30px var(--f-body); color: var(--brass); transition: transform .2s, color .2s; }
.overheard details[open] summary::after { transform: rotate(45deg); color: var(--magenta); }
.overheard .who { display: block; font: 600 12px var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.overheard details > div { padding: 0 0 20px; color: var(--ink-2); }

.finale { position: relative; margin-top: clamp(90px, 12vw, 160px); min-height: 680px; display: flex; align-items: center; overflow: hidden; }
.finale .beam { position: absolute; left: 50%; top: -10%; width: 60%; height: 120%; transform: translateX(-50%); background: radial-gradient(50% 60% at 50% 0%, rgba(51,227,204,.35), transparent 70%); pointer-events: none; }
.finale .crowd { position: absolute; left: 0; right: 0; margin: 0 auto; bottom: 0; width: min(980px, 130%); opacity: .95; pointer-events: none; -webkit-mask: linear-gradient(180deg, #000 70%, transparent); mask: linear-gradient(180deg, #000 70%, transparent); }
.finale .wrap { text-align: center; z-index: 2; padding-bottom: 330px; }
.finale h2 { color: var(--ink); max-width: 16ch; margin: 0 auto; text-shadow: 0 4px 30px rgba(0,0,0,.8); }
.finale p { color: var(--ink-2); margin: 16px auto 26px; max-width: 46ch; text-shadow: 0 2px 10px rgba(0,0,0,.8); }

/* -------------------------------------------------- depth gauge (landing) */
.gauge { position: fixed; right: 14px; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 0; }
.gauge ol { list-style: none; margin: 0; padding: 0 16px 0 0; position: relative; }
.gauge ol::after { content: ''; position: absolute; right: 4px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--gold), var(--magenta), var(--teal)); opacity: .5; }
.gauge li { margin: 0; }
.gauge a { display: block; text-align: right; padding: 6px 0; font: 600 11px var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: var(--ink-3); text-decoration: none; }
.gauge a span { opacity: 0; transition: opacity .2s; margin-right: 6px; }
.gauge:hover a span, .gauge a.on span { opacity: 1; }
.gauge a.on { color: var(--glow); }
.gauge .needle { position: absolute; right: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--glow); box-shadow: 0 0 12px var(--glow); transform: translateY(-50%); transition: top .15s linear; }
@media (max-width: 1100px) { .gauge { display: none; } }

/* --------------------------------------------------- fx canvases */
.fx-paint, .fx-sparks { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; }
.fx-paint { z-index: 3; opacity: .8; }
.fx-sparks { z-index: 80; }

/* ------------------------------------------------------------- footer */
.footer { position: relative; z-index: 2; padding: 30px 0 60px; font-size: 14px; color: var(--ink-2); margin-top: 80px; }
.skyline { display: block; width: 100%; height: 70px; color: #08070a; margin-bottom: 30px; }
.skyline path { fill: currentColor; }
.footer .cols { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 26px; }
.footer h4 { font: 600 12px var(--f-label); letter-spacing: .22em; text-transform: uppercase; margin: 0 0 10px; color: var(--brass); }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin: 5px 0; }
.footer a { text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer .sig { font-family: var(--f-hand); font-size: 22px; color: var(--teal); transform: rotate(-3deg); display: inline-block; margin-top: 10px; }
@media (max-width: 720px) { .footer .cols { grid-template-columns: 1fr 1fr; } }

/* -------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font: 600 13px var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.input, textarea.input, select.input { width: 100%; font: 16px var(--f-body); color: var(--ink); background: rgba(9,8,11,.75); border: 1px solid rgba(201,163,92,.35); padding: 12px 13px; border-radius: 0; transition: border-color .2s, box-shadow .2s; }
.input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(51,227,204,.15), 0 0 24px -6px var(--teal); }
.input.typing { box-shadow: 0 0 0 3px rgba(51,227,204,.2), 0 0 30px -4px var(--teal); }
.hint { font-size: 13px; color: var(--ink-3); }
.form-error { color: var(--bad); font-weight: 600; font-size: 14px; min-height: 1.4em; margin: 4px 0 10px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* -------------------------------------------------------- auth (the door) */
.doorman { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 56px; align-items: center; padding: clamp(28px, 6vw, 80px) 0; }
@media (max-width: 880px) { .doorman { grid-template-columns: 1fr; } }
.doorman h1 { color: var(--gold); font-style: italic; }
.clipboard { background: linear-gradient(165deg, #241e29, #121015); border: 1px solid rgba(201,163,92,.45); padding: 30px 28px; position: relative; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.clipboard::before { content: ''; position: absolute; inset: 6px; border: 1px solid rgba(201,163,92,.15); pointer-events: none; }
.clipboard h2 { font-size: 36px; margin-bottom: 4px; }
.switcher { display: flex; margin: 16px 0 22px; border: 1px solid rgba(201,163,92,.45); }
.switcher button { flex: 1; padding: 10px; font: 600 14px var(--f-label); letter-spacing: .14em; text-transform: uppercase; border: 0; background: transparent; cursor: pointer; color: var(--ink-2); }
.switcher button[aria-pressed='true'] { background: var(--brass); color: var(--soot); }

/* ---------------------------------------------------------- app pages */
.app-head { padding: 34px 0 10px; display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; }
.app-head h1 { font-size: clamp(40px, 5.4vw, 64px); color: var(--gold); font-style: italic; }
.kicker { font: 600 13px/1 var(--f-label); letter-spacing: .28em; text-transform: uppercase; color: var(--brass); display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.kicker::before { content: ''; width: 30px; height: 1px; background: currentColor; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; }
@media (max-width: 960px) { .grid-2 { grid-template-columns: 1fr; } }
.card { background: linear-gradient(165deg, rgba(36,30,41,.92), rgba(18,16,21,.94)); border: 1px solid rgba(201,163,92,.28); padding: 24px; margin-bottom: 24px; }
.card h2 { font-size: 30px; margin-bottom: 4px; }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid rgba(201,163,92,.28); background: rgba(18,16,21,.9); margin: 18px 0 24px; }
.stats > div { padding: 18px 20px; border-left: 1px solid rgba(201,163,92,.2); }
.stats > div:first-child { border-left: 0; }
.stats .lbl { font: 600 12px var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); }
.stats .val { font-family: var(--f-spire); font-size: clamp(30px, 3.4vw, 44px); line-height: 1.05; margin-top: 4px; color: var(--gold); overflow-wrap: anywhere; }
.stats .sub { font-size: 13px; color: var(--ink-3); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stats > div:nth-child(3) { border-left: 0; } .stats > div:nth-child(n+3) { border-top: 1px solid rgba(201,163,92,.2); } }
.keys { list-style: none; margin: 0; padding: 0; }
.keyrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: center; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.07); }
.keyrow:first-child { border-top: 0; }
.keyrow .name { font-weight: 600; }
.keyrow .name button { font-weight: 400; font-size: 13px; color: var(--ink-3); margin-left: 6px; }
.keyrow .meta { font-size: 13px; color: var(--ink-3); }
.keyrow .hintcode { font: 13px var(--f-mono); color: var(--teal); background: rgba(51,227,204,.08); padding: 2px 6px; }
.empty { padding: 18px 0; color: var(--ink-3); font-style: italic; }
.chart { width: 100%; height: 190px; display: block; }
.chart .bar { fill: var(--brass); }
.chart .bar-c { fill: var(--teal); }
.chart .axis { stroke: rgba(255,255,255,.2); stroke-width: 1; }
.chart text { font: 10px var(--f-mono); fill: var(--ink-3); }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.seg { display: inline-flex; border: 1px solid rgba(201,163,92,.45); }
.seg button { border: 0; background: none; padding: 7px 11px; font: 600 13px var(--f-label); letter-spacing: .1em; cursor: pointer; color: var(--ink-2); }
.seg button[aria-pressed='true'] { background: var(--brass); color: var(--soot); }
table.log { width: 100%; border-collapse: collapse; font-size: 13px; }
table.log th { text-align: left; font: 600 11px var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid rgba(201,163,92,.35); }
table.log td { padding: 8px; border-bottom: 1px solid rgba(255,255,255,.06); font-family: var(--f-mono); white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.pill { display: inline-block; padding: 1px 7px; font-size: 11px; font-weight: 600; }
.pill.ok { background: rgba(51,227,204,.15); color: var(--teal); }
.pill.bad { background: rgba(255,77,94,.15); color: var(--bad); }

dialog.ticket-dialog { border: 0; padding: 0; background: transparent; max-width: min(640px, calc(100vw - 32px)); width: 100%; color: inherit; }
dialog.ticket-dialog::backdrop { background: rgba(5,4,7,.78); }
.ticket { background: linear-gradient(160deg, #1b2a29, #0d1514); border: 1px solid var(--teal); padding: 30px 30px 26px; position: relative; box-shadow: 0 0 60px -10px rgba(51,227,204,.5); }
.ticket .admit { font: 600 12px var(--f-label); letter-spacing: .24em; text-transform: uppercase; display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(51,227,204,.5); padding-bottom: 10px; margin-bottom: 16px; color: var(--teal); }
.ticket h2 { font-size: 34px; margin-bottom: 8px; color: var(--ink); }
.ticket .keybox { display: flex; background: #071110; border: 1px solid rgba(51,227,204,.6); margin: 12px 0; }
.ticket .keybox code { flex: 1; padding: 12px; font-size: 13.5px; overflow-x: auto; white-space: nowrap; background: none; border: 0; color: var(--teal); }
.ticket .keybox button { border: 0; background: var(--teal); color: var(--soot); padding: 0 16px; font: 700 12px var(--f-label); letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.ticket .warn { font-size: 14px; color: var(--ink-2); }
.ticket pre { background: #050807; color: #d9e9e5; padding: 14px; font-size: 12.5px; overflow-x: auto; margin: 10px 0 16px; border: 1px solid rgba(255,255,255,.06); }

.pg { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; padding-bottom: 40px; }
@media (max-width: 960px) { .pg { grid-template-columns: 1fr; } .pg aside { order: -1; } }
.window { background: rgba(14,12,17,.92); border: 1px solid rgba(51,227,204,.3); display: flex; flex-direction: column; min-height: 62vh; }
.window-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid rgba(51,227,204,.25); font: 500 12px var(--f-mono); gap: 10px; flex-wrap: wrap; color: var(--ink-2); }
.window-head .relay-mini { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 0 calc(4px + var(--charge, 0) * 16px) var(--teal)); transition: filter .12s; vertical-align: middle; margin-right: 8px; }
.convo { flex: 1; overflow-y: auto; padding: 18px; max-height: 64vh; }
.msg { margin-bottom: 20px; max-width: 780px; }
.msg .who { font: 600 12px var(--f-label); letter-spacing: .2em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.msg.user .body { background: rgba(201,163,92,.12); border-left: 2px solid var(--brass); padding: 10px 14px; display: inline-block; white-space: pre-wrap; max-width: 100%; overflow-wrap: anywhere; }
.msg.assistant .body { overflow-wrap: anywhere; }
.msg.assistant .body pre { background: #070609; color: #e3dccd; padding: 12px 14px; overflow-x: auto; border: 1px solid rgba(255,255,255,.07); }
.msg.assistant .body p:last-child { margin-bottom: 0; }
.msg .thinking { font-size: 14px; color: var(--ink-3); border-left: 2px solid rgba(255,63,142,.4); padding-left: 12px; margin: 4px 0 10px; white-space: pre-wrap; }
.msg .thinking summary { cursor: pointer; font: 600 12px var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--magenta); }
.msg .err { color: var(--bad); font-weight: 600; }
.msg .metrics { font: 11px var(--f-mono); color: var(--ink-3); margin-top: 6px; }
.composer { border-top: 1px solid rgba(51,227,204,.25); padding: 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.composer textarea { resize: vertical; min-height: 52px; max-height: 260px; }
.pg aside .card { margin-bottom: 16px; padding: 18px; }
.caret::after { content: ''; display: inline-block; width: .5em; height: 1em; background: var(--teal); vertical-align: -2px; margin-left: 2px; animation: caret 1s steps(1) infinite; box-shadow: 0 0 8px var(--teal); }
@keyframes caret { 50% { opacity: 0; } }
.empty-convo { color: var(--ink-3); text-align: center; padding: 50px 10px; }
.empty-convo .hand { font-size: 26px; display: block; margin-bottom: 16px; color: var(--teal); }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.suggest button { font: 15px var(--f-body); border: 1px dashed rgba(201,163,92,.5); background: none; padding: 8px 12px; cursor: pointer; color: var(--ink); }
.suggest button:hover { border-style: solid; border-color: var(--teal); color: var(--teal); }

.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding: 30px 0 40px; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .docs nav { position: static !important; } }
.docs nav { position: sticky; top: 80px; align-self: start; font-size: 15px; }
.docs nav ol { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.docs nav li { counter-increment: s; margin: 2px 0; }
.docs nav a { text-decoration: none; display: block; padding: 4px 0; color: var(--ink-2); }
.docs nav a::before { content: counter(s, decimal-leading-zero) '  '; font: 12px var(--f-mono); color: var(--brass); white-space: pre; }
.docs nav a:hover { color: var(--teal); }
.docs article section { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid rgba(201,163,92,.18); scroll-margin-top: 80px; }
.docs article h2 { font-size: clamp(30px, 3.6vw, 42px); margin-bottom: 14px; color: var(--gold); }
.docs article h3 { font-size: 23px; margin: 24px 0 10px; }
.docs pre.block { background: rgba(7,6,9,.95); color: #e3dccd; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.6; border: 1px solid rgba(255,255,255,.07); }
.docs table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 8px 0 16px; }
.docs th, .docs td { text-align: left; padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
.docs th { font: 600 12px var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid rgba(201,163,92,.4); }
.docs td code { white-space: nowrap; }
.callout { border-left: 3px solid var(--teal); background: rgba(51,227,204,.06); padding: 12px 16px; margin: 14px 0; font-size: 15.5px; }
.prewrap { position: relative; }
.prewrap .copy { position: absolute; top: 8px; right: 8px; }

.neon { display: inline-block; font-family: var(--f-sump); font-size: clamp(56px, 10vw, 128px); line-height: 1; padding: 18px 34px 22px; border: 3px solid currentColor; border-radius: 16px; color: var(--ink-3); background: #08070a; transform: rotate(-3deg); }
.neon[data-state='open'] { color: #fff; border-color: var(--teal); text-shadow: 0 0 4px #fff, 0 0 14px var(--teal), 0 0 36px var(--teal); box-shadow: 0 0 18px rgba(51,227,204,.6), inset 0 0 18px rgba(51,227,204,.4); }
.neon[data-state='busy'] { color: #fff; border-color: var(--warn); text-shadow: 0 0 4px #fff, 0 0 14px var(--warn), 0 0 36px var(--warn); box-shadow: 0 0 18px rgba(241,176,74,.55); }
.neon[data-state='closed'] { color: #6e6470; }
.neon[data-state='open'] .flick { animation: flick 7s infinite; }
.status-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 44px; align-items: center; padding: 40px 0 10px; }
@media (max-width: 760px) { .status-hero { grid-template-columns: 1fr; } }
.ticks { display: grid; gap: 3px; margin: 12px 0 6px; }
.ticks.h24 { grid-template-columns: repeat(24, 1fr); }
.ticks.d30 { grid-template-columns: repeat(30, 1fr); }
.ticks i { height: 38px; background: rgba(255,255,255,.07); display: block; }
.ticks i[data-s='ok'] { background: var(--teal); box-shadow: 0 0 8px -2px var(--teal); }
.ticks i[data-s='busy'] { background: var(--warn); }
.ticks i[data-s='bad'] { background: var(--bad); }
.ticks-axis { display: flex; justify-content: space-between; font: 11px var(--f-mono); color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); opacity: 0; background: var(--teal); color: var(--soot); padding: 10px 18px; font: 700 14px var(--f-label); letter-spacing: .1em; text-transform: uppercase; transition: opacity .2s, transform .2s; z-index: 200; pointer-events: none; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.page-404 { padding: 60px 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 30px; align-items: center; }
.page-404 .big { font-family: var(--f-spire); font-style: italic; font-size: clamp(110px, 22vw, 250px); line-height: .9; color: var(--gold); }
.page-404 img { max-height: 520px; margin: 0 auto; }
@media (max-width: 760px) { .page-404 { grid-template-columns: 1fr; } }
.prose { max-width: 70ch; padding: 30px 0 60px; }
.prose h1 { color: var(--gold); font-style: italic; }
.prose h2 { font-size: 30px; margin: 32px 0 10px; }

@media (prefers-reduced-motion: reduce) {
  .hang, .tag::after, .neon-sign .flick, .neon .flick, .scroll-hint::after { animation: none !important; }
  .hero .over { -webkit-mask: none; mask: none; }
}
.window-head > span:first-child { display: inline-flex; align-items: center; }
@media (max-width: 820px) { .nav .btn { display: none; } }

/* ======================================================================
   Style switch
   ====================================================================== */
.theme-toggle { background: none; border: 1px solid rgba(201,163,92,.35); color: var(--brass); border-radius: 20px; padding: 5px 12px 5px 8px; font: 600 13px var(--f-label); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; display: inline-flex; gap: 7px; align-items: center; }
.theme-toggle .sw { width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #c8102e 0 45%, #f3ede1 46%); box-shadow: 0 0 0 1px currentColor; }
:root[data-theme='ink'] .theme-toggle .sw { background: conic-gradient(#33e3cc 0 25%, #ff3f8e 0 50%, #c9a35c 0 75%, #0e0c11 0); }
.theme-toggle:hover, .sound-toggle:hover { color: var(--ink); border-color: var(--ink-2); }

/* ======================================================================
   INK: sumi-e on rice paper, black ink, one vermilion accent
   ====================================================================== */
:root[data-theme='ink'] {
  --soot: #f4eee2;
  --soot-2: #ece4d4;
  --soot-3: #e2d8c5;
  --smog: #d9cdb8;
  --ink: #1d1b19;
  --ink-2: #45403a;
  --ink-3: #7d756b;
  --brass: #6f655a;
  --brass-2: #a99c89;
  --gold: #1d1b19;
  --teal: #c8102e;
  --teal-2: #9b0b22;
  --magenta: #c8102e;
  --paper: #fbf8f1;
  --paper-ink: #1d1b19;
  --ok: #4d7c5a;
  --accent-text: #1d1b19;
  --glow: #c8102e;
  --art-spire: url('/media/ink/spire.webp');
  --art-sump: url('/media/ink/sump.webp');
  --f-spire: 'Shippori Mincho B1', 'Georgia', serif;
  --f-sump: 'Yuji Syuku', 'Shippori Mincho B1', serif;
  --f-hand: 'Yuji Syuku', serif;
  color-scheme: light;
}
:root[data-theme='ink'] body::before { mix-blend-mode: multiply; opacity: .22; }
:root[data-theme='ink'] body::after { background: radial-gradient(70% 50% at 50% 0%, rgba(255,255,255,.6), transparent 70%), var(--soot); }
:root[data-theme='ink'] body.app::after { background: linear-gradient(rgba(244,238,226,.9), rgba(244,238,226,.95)), var(--art-sump) center / contain no-repeat, var(--soot); }
:root[data-theme='ink'] h1, :root[data-theme='ink'] h2, :root[data-theme='ink'] h3 { font-weight: 700; font-style: normal !important; letter-spacing: 0; }
:root[data-theme='ink'] .hero h1 { text-shadow: 0 0 24px rgba(244,238,226,.9), 0 0 2px rgba(244,238,226,.9); }
:root[data-theme='ink'] .hero .over { text-shadow: none; background: linear-gradient(transparent 70%, rgba(200,16,46,.85) 70%, rgba(200,16,46,.85) 86%, transparent 86%); }
:root[data-theme='ink'] .hero-sub p { text-shadow: 0 0 12px rgba(244,238,226,.95); }
:root[data-theme='ink'] .hero-bg::after { background: linear-gradient(180deg, transparent 75%, var(--soot) 100%); }
:root[data-theme='ink'] img[data-art], :root[data-theme='ink'] .finale .crowd { filter: none !important; }
:root[data-theme='ink'] ::selection { background: #c8102e; color: #fff; }
:root[data-theme='ink'] :not(pre) > code { background: rgba(29,27,25,.06); border-color: rgba(29,27,25,.12); }

:root[data-theme='ink'] .topbar { background: #f4eee2; border-bottom: 1px solid rgba(29,27,25,.08); }
:root[data-theme='ink'] .tag { color: var(--ink); text-shadow: none; transform: none; font-size: 26px; }
:root[data-theme='ink'] .tag::after { background: #c8102e; width: 9px; height: 9px !important; border-radius: 50%; left: auto; right: -14px; top: 4px; animation: none; }
:root[data-theme='ink'] .tag small { color: var(--ink-3); }
:root[data-theme='ink'] .theme-toggle, :root[data-theme='ink'] .sound-toggle { border-color: rgba(29,27,25,.25); color: var(--ink-2); }
:root[data-theme='ink'] .sound-toggle[aria-pressed='true'] { color: #c8102e; border-color: #c8102e; }

:root[data-theme='ink'] .btn { color: #fff; clip-path: none; border-radius: 2px 14px 3px 12px / 12px 3px 14px 2px; }
:root[data-theme='ink'] .btn:hover { color: #fff; filter: none; box-shadow: 0 6px 0 -2px rgba(29,27,25,.2); }
:root[data-theme='ink'] .btn-ghost { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink); }
:root[data-theme='ink'] .btn-ghost:hover { color: var(--ink); background: rgba(29,27,25,.05); }
:root[data-theme='ink'] .btn .arc { display: none; }

:root[data-theme='ink'] .stub { background: rgba(251,248,241,.85); border-color: rgba(29,27,25,.3); }
:root[data-theme='ink'] .stub b { color: #c8102e; }
:root[data-theme='ink'] .stub button { color: var(--ink-2); border-left-color: rgba(29,27,25,.3); }
:root[data-theme='ink'] .stub button:hover { background: var(--ink); color: var(--paper); }
:root[data-theme='ink'] .lvl::before, :root[data-theme='ink'] .kicker::before { background: #c8102e; height: 2px; }
:root[data-theme='ink'] .scroll-hint::after { background: linear-gradient(var(--ink), transparent); }

:root[data-theme='ink'] .wall { background: linear-gradient(rgba(244,238,226,.82), rgba(244,238,226,.9)), var(--art-sump) center / cover, var(--soot-2); border-color: rgba(29,27,25,.12); }
:root[data-theme='ink'] .wall .under .spray { color: var(--ink); }
:root[data-theme='ink'] .wall .under .spray.t { color: #c8102e; text-shadow: none; }
:root[data-theme='ink'] .notice { background-color: #fbf8f1; box-shadow: 0 16px 30px -12px rgba(29,27,25,.35); }
:root[data-theme='ink'] .notice .stamp { color: #c8102e; border-color: #c8102e; border-radius: 4px; }

:root[data-theme='ink'] .tabs button[aria-selected='true'] { color: #c8102e; border-color: rgba(29,27,25,.25); background: var(--paper); }
:root[data-theme='ink'] .codebox { background: #1d1b19; border-color: #1d1b19; box-shadow: 0 20px 40px -24px rgba(29,27,25,.6); }
:root[data-theme='ink'] .codebox pre { color: #efe9dd; }
:root[data-theme='ink'] .tok-k { color: #f2b3a0; }
:root[data-theme='ink'] .tok-s { color: #d9d2c4; }
:root[data-theme='ink'] .tok-add { background: rgba(255,255,255,.08); }
:root[data-theme='ink'] .tok-del { background: rgba(200,16,46,.25); }
:root[data-theme='ink'] .copy { background: rgba(29,27,25,.06); color: var(--ink-2); border-color: rgba(29,27,25,.2); }
:root[data-theme='ink'] .codebox .copy { background: rgba(255,255,255,.08); color: #efe9dd; border-color: rgba(255,255,255,.2); }
:root[data-theme='ink'] .copy:hover, :root[data-theme='ink'] .copy.done { background: #c8102e; color: #fff; border-color: #c8102e; }
:root[data-theme='ink'] .checklist li { border-top-color: rgba(29,27,25,.1); }
:root[data-theme='ink'] .checklist li::before { box-shadow: none; border-radius: 50%; clip-path: none; }
:root[data-theme='ink'] .wren-stage .relay { filter: none; }

:root[data-theme='ink'] .wire > svg.cable path { stroke: #1d1b19; stroke-width: 3; }
:root[data-theme='ink'] .hang::before { background: #1d1b19; }
:root[data-theme='ink'] .hang .plate { background: var(--paper); border-color: rgba(29,27,25,.25); }
:root[data-theme='ink'] .hang .plate::before { background: #c8102e; box-shadow: none; }
:root[data-theme='ink'] .hang:hover .plate { border-color: #1d1b19; box-shadow: 0 10px 24px -14px rgba(29,27,25,.5); }
:root[data-theme='ink'] .hang .num { color: #c8102e; }

:root[data-theme='ink'] .graffiti { background: var(--art-sump) center / cover no-repeat, var(--paper); border-color: rgba(29,27,25,.12); cursor: crosshair; }
:root[data-theme='ink'] .graffiti .dark { background: rgba(244,238,226,.93); }
:root[data-theme='ink'] .graffiti .scrawl { color: var(--ink); text-shadow: none; }
:root[data-theme='ink'] .graffiti .scrawl.t { color: #c8102e; text-shadow: none; }
:root[data-theme='ink'] .graffiti .scrawl.h { color: var(--ink-2); }

:root[data-theme='ink'] .neon-sign { color: #fff; background: #c8102e; padding: 4px 14px 6px; border-radius: 3px; text-shadow: none; font-size: clamp(18px, 2.6vw, 28px); }
:root[data-theme='ink'] .stall-stage img { filter: none; }
:root[data-theme='ink'] .board, :root[data-theme='ink'] .card, :root[data-theme='ink'] .clipboard, :root[data-theme='ink'] .window, :root[data-theme='ink'] .stats {
  background: rgba(251,248,241,.92); border-color: rgba(29,27,25,.2); box-shadow: none; }
:root[data-theme='ink'] .clipboard::before { border-color: rgba(29,27,25,.08); }
:root[data-theme='ink'] .board dd { color: #c8102e; }
:root[data-theme='ink'] .board .dots { border-bottom-color: rgba(29,27,25,.25); }
:root[data-theme='ink'] .bill { border-top-color: rgba(29,27,25,.2); }
:root[data-theme='ink'] .calc input[type='range'] { accent-color: #c8102e; }
:root[data-theme='ink'] .overheard details { border-top-color: rgba(29,27,25,.18); }
:root[data-theme='ink'] .finale .beam { background: radial-gradient(40% 50% at 50% 30%, rgba(200,16,46,.85), rgba(200,16,46,.85) 35%, transparent 36%); opacity: .9; top: 4%; height: 50%; width: 30%; }
:root[data-theme='ink'] .finale h2, :root[data-theme='ink'] .finale p { text-shadow: 0 0 18px rgba(244,238,226,.95); }
:root[data-theme='ink'] .gauge ol::after { background: linear-gradient(var(--ink), #c8102e); }
:root[data-theme='ink'] .gauge .needle { box-shadow: none; }

:root[data-theme='ink'] .skyline { color: #d9cfbd; }
:root[data-theme='ink'] .footer .sig { color: #c8102e; }
:root[data-theme='ink'] .input { background: #fffdf8; border-color: rgba(29,27,25,.3); color: var(--ink); }
:root[data-theme='ink'] .input:focus, :root[data-theme='ink'] .input.typing { border-color: #1d1b19; box-shadow: 0 0 0 3px rgba(200,16,46,.12); }
:root[data-theme='ink'] .switcher { border-color: #1d1b19; }
:root[data-theme='ink'] .switcher button { color: var(--ink); }
:root[data-theme='ink'] .switcher button[aria-pressed='true'] { background: #1d1b19; color: var(--paper); }
:root[data-theme='ink'] .seg { border-color: #1d1b19; }
:root[data-theme='ink'] .seg button { color: var(--ink); }
:root[data-theme='ink'] .seg button[aria-pressed='true'] { background: #1d1b19; color: var(--paper); }
:root[data-theme='ink'] .stats > div, :root[data-theme='ink'] .stats > div:nth-child(n+3) { border-color: rgba(29,27,25,.15); }
:root[data-theme='ink'] .keyrow, :root[data-theme='ink'] table.log td { border-color: rgba(29,27,25,.1); }
:root[data-theme='ink'] table.log th { border-bottom-color: rgba(29,27,25,.35); }
:root[data-theme='ink'] .keyrow .hintcode { color: #c8102e; background: rgba(200,16,46,.07); }
:root[data-theme='ink'] .chart .bar { fill: #1d1b19; }
:root[data-theme='ink'] .chart .bar-c { fill: #c8102e; }
:root[data-theme='ink'] .chart .axis { stroke: rgba(29,27,25,.3); }
:root[data-theme='ink'] .pill.ok { background: rgba(77,124,90,.14); color: #3c6a48; }
:root[data-theme='ink'] .window-head, :root[data-theme='ink'] .composer { border-color: rgba(29,27,25,.15); }
:root[data-theme='ink'] .msg.user .body { background: rgba(29,27,25,.05); border-left-color: #c8102e; }
:root[data-theme='ink'] .msg.assistant .body pre, :root[data-theme='ink'] .docs pre.block, :root[data-theme='ink'] .ticket pre { background: #1d1b19; color: #efe9dd; }
:root[data-theme='ink'] .msg .thinking { border-left-color: rgba(200,16,46,.35); }
:root[data-theme='ink'] .caret::after { background: #c8102e; box-shadow: none; }
:root[data-theme='ink'] .suggest button { border-color: rgba(29,27,25,.3); }
:root[data-theme='ink'] .docs th { border-bottom-color: rgba(29,27,25,.35); }
:root[data-theme='ink'] .docs th, :root[data-theme='ink'] .docs td { border-bottom-color: rgba(29,27,25,.1); }
:root[data-theme='ink'] .docs article section { border-bottom-color: rgba(29,27,25,.12); }
:root[data-theme='ink'] .callout { background: rgba(200,16,46,.05); }
:root[data-theme='ink'] .ticket { background: var(--paper); border-color: #1d1b19; box-shadow: 0 30px 60px -20px rgba(29,27,25,.5); }
:root[data-theme='ink'] .ticket .admit { color: #c8102e; border-bottom-color: rgba(29,27,25,.3); }
:root[data-theme='ink'] .ticket .keybox { background: #fffdf8; border-color: #1d1b19; }
:root[data-theme='ink'] .ticket .keybox code { color: #1d1b19; }
:root[data-theme='ink'] .ticket .keybox button { background: #1d1b19; color: var(--paper); }
:root[data-theme='ink'] dialog.ticket-dialog::backdrop { background: rgba(29,27,25,.45); }
:root[data-theme='ink'] .neon { background: transparent; border: 0; color: #fff; }
:root[data-theme='ink'] .neon[data-state] { background: #c8102e; color: #fff; text-shadow: none; box-shadow: none; border-radius: 6px; }
:root[data-theme='ink'] .neon[data-state='busy'] { background: #b07a1e; }
:root[data-theme='ink'] .neon[data-state='closed'] { background: #7d756b; }
:root[data-theme='ink'] .ticks i { background: rgba(29,27,25,.08); }
:root[data-theme='ink'] .ticks i[data-s='ok'] { background: #1d1b19; box-shadow: none; }
:root[data-theme='ink'] .ticks i[data-s='busy'] { background: #c9a35c; }
:root[data-theme='ink'] .ticks i[data-s='bad'] { background: #c8102e; }
:root[data-theme='ink'] .toast { background: #1d1b19; color: var(--paper); }
:root[data-theme='ink'] .page-404 .big { color: #c8102e; }
:root[data-theme='ink'] .open-dot[data-state='open'] { background: #4d7c5a; box-shadow: none; }
/* let ink drawings multiply onto the page paper (needs no stacking context on main) */
:root[data-theme='ink'] main { z-index: auto; }
:root[data-theme='ink'] .finale .beam { left: 74%; top: 2%; width: 16%; height: 34%; background: radial-gradient(circle closest-side, rgba(200,16,46,.82) 0 96%, transparent 100%); opacity: .85; }
@media (max-width: 760px) { :root[data-theme='ink'] .finale .beam { left: 82%; width: 28%; } }
/* city hero: keep the painting clear of the headline */
.hero-bg { inset: -2% -6% 0 30%; }
.hero-bg::after { background: linear-gradient(90deg, var(--soot) 0%, transparent 22%), linear-gradient(180deg, transparent 70%, var(--soot) 100%); }
:root[data-theme='ink'] .hero-bg { inset: -2% -4% 0 24%; }
:root[data-theme='ink'] .hero-bg::after { background: linear-gradient(180deg, transparent 75%, var(--soot) 100%); }
.hero h1 { text-shadow: 0 4px 24px rgba(0,0,0,.7); }
@media (max-width: 820px) { .hero-bg, :root[data-theme='ink'] .hero-bg { inset: 0 -30% 25% 0; opacity: .5; } }
:root[data-theme='ink'] .hero-bg::after { display: none; }
:root[data-theme='ink'] .finale .beam { left: 86%; top: 0; width: 11%; height: 24%; }
@media (max-width: 760px) { :root[data-theme='ink'] .finale .beam { left: 88%; width: 22%; height: 16%; } }

/* animated hero: same framing as the still painting, which stays underneath until the video plays */
.hero-video { position: absolute; inset: -2% -6% 0 22%; width: 106%; height: 100%; max-width: none; object-fit: contain; object-position: right center; opacity: 0; transition: opacity 1.2s ease; mix-blend-mode: lighten; pointer-events: none; clip-path: inset(3px); }
.hero.has-video .hero-video { opacity: 1; }
.hero.has-video .hero-bg { opacity: 0; transition: opacity 1.2s ease; }
:root[data-theme='ink'] .hero-video { mix-blend-mode: multiply; inset: -2% -4% 0 16%; }
@media (max-width: 820px) { .hero-video, :root[data-theme='ink'] .hero-video { inset: 0 -30% 25% 0; width: 130%; } .hero.has-video .hero-video { opacity: .5; } }
.hero-video { inset: 0 -8% 4% 34%; width: auto; height: auto; }
:root[data-theme='ink'] .hero-video { inset: 0 -6% 4% 28%; }
@media (max-width: 820px) { .hero-video, :root[data-theme='ink'] .hero-video { inset: 0 -30% 25% 0; width: auto; } }
.hero-video { inset: -6% -14% 0 30%; }

/* ---------------------------------------------- hero: the offer, first */
.hero-badge { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 22px; padding: 7px 14px 7px 10px; font: 600 14px var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); background: rgba(14,12,17,.72); border: 1px solid rgba(51,227,204,.55); }
.hero-badge i { width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 10px var(--teal); }
.hero-title { max-width: none !important; font-size: clamp(44px, 6.6vw, 96px); }
.hero-title .model { display: block; max-width: 11ch; }
.hero-title .claim { display: inline-block; }
:root[data-theme='ink'] .hero-badge { background: transparent; border: 0; padding: 0; color: #c8102e; letter-spacing: .22em; }
:root[data-theme='ink'] .hero-badge i { width: 14px; height: 14px; border-radius: 2px; background: #c8102e; box-shadow: none; }
/* ink: no slanted marker line, the claim is part of the calm headline */
:root[data-theme='ink'] .hero .over.claim {
  display: block; transform: none; background: none; padding: 0; margin-top: 10px;
  font-family: var(--f-spire); font-weight: 500; font-size: .6em; line-height: 1.15; color: var(--ink-2);
  -webkit-mask: none; mask: none;
}

/* features as one spec sheet hanging from the cable (not a grid of cards) */
.spec-board { max-width: 980px; margin: 0 auto; animation-duration: 9s; }
.spec-board .plate { padding: 30px 34px 26px; }
.spec { margin: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 44px; }
.spec div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(201,163,92,.2); }
.spec div:nth-child(-n+2) { border-top: 0; }
.spec dt { font: 600 13px var(--f-label); letter-spacing: .18em; text-transform: uppercase; color: var(--brass); padding-top: 2px; }
.spec dd { margin: 0; color: var(--ink); font-size: 16px; }
@media (max-width: 760px) { .spec { grid-template-columns: 1fr; } .spec div:nth-child(2) { border-top: 1px solid rgba(201,163,92,.2); } .spec div { grid-template-columns: 100px 1fr; } }
:root[data-theme='ink'] .spec div { border-top-color: rgba(29,27,25,.12); }
:root[data-theme='ink'] .spec dt { color: #c8102e; }
.finale .wrap { text-align: left; }
.finale h2 { margin: 0; max-width: 14ch; }
.finale p { margin: 16px 0 26px; }
.hero-title .model { max-width: 13ch; }
/* finale: text left, crowd on the right so they don't collide */
.finale .crowd { left: auto; right: -4%; margin: 0; width: min(760px, 62%); }
.finale .beam { left: 72%; }
@media (max-width: 820px) {
  .finale .crowd { right: 0; width: 100%; opacity: .55; }
  .finale .beam { left: 50%; }
  .hero-bg, :root[data-theme='ink'] .hero-bg, .hero-video, :root[data-theme='ink'] .hero-video { inset: 70px -10% 52% -10%; }
  .hero.has-video .hero-video { opacity: .75; }
}
@media (min-width: 821px) {
  .hero-video, .hero-bg { inset: 9% -10% 3% 32%; }
  :root[data-theme='ink'] .hero-video, :root[data-theme='ink'] .hero-bg { inset: 6% -6% 3% 28%; }
}

/* ======================================================================
   Single style: ink. Additions for the hero note, the drawing that replaced
   the notice, the features handscroll and the stall seal.
   ====================================================================== */
.hero-note { margin: 18px 0 0; font: 600 14px var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.hero-note::before { content: ''; display: inline-block; width: 8px; height: 8px; background: #c8102e; margin-right: 10px; vertical-align: 1px; }
.ink-figure { margin: 0; display: flex; justify-content: center; }
.ink-figure img { max-height: 520px; width: auto; }

/* handscroll (emakimono): washi paper between two wooden rollers, read by unrolling sideways */
.handscroll { position: relative; display: flex; align-items: stretch; margin: 0 -10px; }
.handscroll .roller { width: 34px; height: auto; flex: none; object-fit: fill; position: relative; z-index: 2; filter: drop-shadow(2px 4px 6px rgba(29,27,25,.25)); }
.handscroll .roller-end { transform: scaleX(-1); }
.handscroll .paper {
  flex: 1; display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; cursor: grab;
  margin: 26px -6px; padding: 34px 10px 30px;
  background:
    linear-gradient(#2f3b52, #2f3b52) top / 100% 9px no-repeat,
    linear-gradient(#b3955a, #b3955a) 0 9px / 100% 1px no-repeat,
    linear-gradient(#2f3b52, #2f3b52) bottom / 100% 9px no-repeat,
    linear-gradient(#b3955a, #b3955a) 0 calc(100% - 9px) / 100% 1px no-repeat,
    radial-gradient(120% 90% at 50% 50%, #fbf6ea, #efe5cf);
  box-shadow: inset 0 0 40px rgba(120, 95, 50, .12), 0 18px 30px -22px rgba(29,27,25,.5);
  scrollbar-width: thin; scrollbar-color: #8f8270 transparent;
}
.handscroll .paper.dragging { cursor: grabbing; user-select: none; }
.handscroll .paper:focus-visible { outline: 2px solid #c8102e; outline-offset: -4px; }
.handscroll .col {
  flex: 0 0 218px; scroll-snap-align: start; position: relative;
  display: grid; grid-template-columns: 1fr 34px; grid-template-rows: auto 1fr; column-gap: 12px;
  padding: 6px 22px 4px 18px;
}
/* brush line between columns, drawn like a dry stroke */
.handscroll .col + .col::before {
  content: ''; position: absolute; left: 0; top: 4%; bottom: 6%; width: 2px;
  background: linear-gradient(180deg, transparent, rgba(29,27,25,.55) 8%, rgba(29,27,25,.35) 60%, rgba(29,27,25,.05) 92%, transparent);
  border-radius: 2px; transform: rotate(.6deg);
}
.handscroll .vlabel {
  grid-column: 2; grid-row: 1 / span 2; writing-mode: vertical-rl; text-orientation: mixed;
  font-family: var(--f-spire); font-weight: 700; font-size: 25px; letter-spacing: .08em; margin: 0; color: var(--ink);
}
.handscroll .mark { grid-column: 1; position: relative; width: 96px; height: 96px; margin: 0 0 14px -6px; }
.handscroll .mark img { width: 100%; height: 100%; opacity: .85; }
.handscroll .mark span { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-spire); font-size: 34px; color: #c8102e; }
.handscroll .col p { grid-column: 1; margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.handscroll .col code { font-size: .82em; white-space: normal; word-break: break-word; }
.handscroll .seal-mark { grid-column: 1; width: 104px; height: 104px; margin: 0 0 14px -4px; background: url('/media/ink/seal.webp') center / contain no-repeat; display: grid; place-items: center; transform: rotate(-4deg); }
.handscroll .seal-mark span { font-family: var(--f-spire); font-weight: 700; font-size: 30px; color: #c8102e; letter-spacing: .04em; }
.unroll { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 4px; font: 600 12px var(--f-label); letter-spacing: .3em; text-transform: uppercase; color: var(--ink-3); }
.unroll .linkish { text-decoration: none; font-size: 20px; color: var(--ink); padding: 2px 8px; }
.unroll .linkish:hover { color: #c8102e; }
@media (max-width: 600px) { .handscroll .roller { width: 22px; } .handscroll .col { flex-basis: 78vw; } }

/* stall sign: a red seal with one word */
:root[data-theme='ink'] .neon-sign { background: url('/media/ink/seal.webp') center / contain no-repeat; color: #c8102e; padding: 18px 22px; border-radius: 0; font-family: var(--f-spire); font-weight: 700; font-size: clamp(22px, 3vw, 32px); text-shadow: none; transform: translateX(-50%) rotate(-4deg); }
.handscroll .col code { background: none; border: 0; padding: 0; color: #9b0b22; font-size: .84em; overflow-wrap: anywhere; }
:root[data-theme='ink'] .neon-sign { top: 2%; padding: 26px 30px; font-size: clamp(26px, 3.4vw, 38px); }

/* ======================================================================
   Mobile
   ====================================================================== */
/* grids must never be widened by long code lines */
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 960px) { .grid-2, .pg { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .docs { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 880px) { .doorman { grid-template-columns: minmax(0, 1fr); } }
pre, .codebox, .stub { max-width: 100%; }

.menu-toggle, .bar-cta { display: none; }
body.no-scroll { overflow: hidden; }

@media (max-width: 820px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }

  /* compact bar: logo, one call to action, menu */
  .topbar { padding: 10px 0; background: #f4eee2; border-bottom: 1px solid rgba(29,27,25,.08); }
  .topbar .wrap { flex-wrap: nowrap; gap: 10px; }
  .tag { font-size: 22px; margin-right: auto; }
  .bar-cta { display: inline-flex; padding: 9px 12px; font-size: 12.5px; }
  .menu-toggle { display: inline-flex; flex-direction: column; justify-content: center; gap: 5px; width: 42px; height: 42px; padding: 0 10px; background: none; border: 1px solid rgba(29,27,25,.25); border-radius: 4px; cursor: pointer; }
  .menu-toggle i { display: block; height: 1.5px; background: var(--ink); transition: transform .2s, opacity .2s; }
  .menu-open .menu-toggle i:nth-child(2) { transform: translateY(6.5px) rotate(45deg); }
  .menu-open .menu-toggle i:nth-child(3) { opacity: 0; }
  .menu-open .menu-toggle i:nth-child(4) { transform: translateY(-6.5px) rotate(-45deg); }
  .nav {
    position: fixed; left: 0; right: 0; top: 63px; bottom: 0; margin: 0; width: auto;
    display: none; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 18px 30px;
    background: var(--soot); overflow-y: auto; z-index: 60;
  }
  .menu-open .nav { display: flex; }
  .nav a:not(.btn), .nav .linkish { font-size: 17px !important; padding: 15px 2px; border-bottom: 1px solid rgba(29,27,25,.1) !important; text-align: left; }
  .nav .sound-toggle { align-self: flex-start; margin-top: 18px; padding: 9px 14px; }
  .nav .btn { display: none; }

  /* hero: art above, text below, buttons full width */
  .hero { min-height: auto; margin-top: 0; padding: 56vw 0 40px; align-items: flex-start; }
  .hero-bg, :root[data-theme='ink'] .hero-bg, .hero-video, :root[data-theme='ink'] .hero-video { inset: 4px -6% auto -6% !important; height: 60vw !important; width: auto !important; opacity: 1 !important; object-position: center; background-position: center; }
  .hero.has-video .hero-video { opacity: 1 !important; }
  .hero-title { font-size: clamp(36px, 10.5vw, 54px); }
  .hero-title .model { max-width: none; }
  :root[data-theme='ink'] .hero .over.claim { font-size: .62em; }
  .hero-sub { margin-top: 20px; gap: 20px; }
  .hero-sub > div, .hero .cta-row { width: 100%; }
  .hero .cta-row .btn { flex: 1 1 100%; }
  .stub { display: flex; width: 100%; font-size: 12.5px; }
  .stub span { flex: 1; min-width: 0; }
  .scroll-hint { display: none; }

  .chapter { padding-top: 72px; }
  h2 { font-size: clamp(30px, 8.4vw, 42px); }
  .lede { font-size: 17px; }

  .ink-figure img { max-height: 340px; }

  /* tinkerer and machine side by side, smaller */
  .wren-stage { min-height: 0; height: 92vw; max-height: 460px; }
  .wren-stage .wren { width: 54%; left: 0; }
  .wren-stage .relay { width: 50%; right: 0; bottom: 4%; }
  .tabs button { padding: 9px 10px; font-size: 13px; }
  .codebox pre { font-size: 12px; padding: 18px 14px; }

  /* handscroll: one column at a time, swipe to unroll */
  .handscroll { margin: 0 -4px; }
  .handscroll .roller { width: 20px; }
  .handscroll .paper { margin: 18px -4px; padding: 28px 4px 24px; scroll-snap-type: x mandatory; }
  .handscroll .col { flex-basis: calc(100vw - 92px); padding: 4px 16px; }
  .handscroll .vlabel { font-size: 22px; }

  /* mist wall: on phones the words surface on their own, stacked */
  .graffiti { height: auto; min-height: 0; padding: 30px 22px 54px; display: flex; flex-direction: column; gap: 20px; cursor: default; }
  .graffiti .scrawl { position: static !important; white-space: normal; transform: none !important; font-size: 21px !important; line-height: 1.4; opacity: 0; translate: 0 8px; transition: opacity 1.2s ease, translate 1.2s ease; }
  .graffiti .scrawl.h { font-size: 18px !important; }
  .graffiti.seen .scrawl { opacity: 1; translate: 0 0; }
  .graffiti.seen .scrawl:nth-child(2) { transition-delay: .5s; }
  .graffiti.seen .scrawl:nth-child(3) { transition-delay: 1s; }
  .graffiti.seen .scrawl:nth-child(4) { transition-delay: 1.5s; }
  .graffiti.seen .scrawl:nth-child(5) { transition-delay: 2s; }
  .graffiti.seen .scrawl:nth-child(6) { transition-delay: 2.5s; }
  .graffiti .dark { display: none; }
  .graffiti .hint { display: none; }

  .stall-stage { max-width: 420px; }
  .board { padding: 22px 18px; }
  .board dl { font-size: 13px; }
  .bill { grid-template-columns: 1fr 1fr; gap: 10px; }

  .overheard summary { font-size: 20px; }
  .finale { min-height: 0; padding-bottom: 0; }
  .finale .wrap { padding-bottom: 62vw; }
  .finale .crowd { width: 110%; right: -5%; opacity: 1; }
  .finale .btn { width: 100%; }

  .footer .cols { grid-template-columns: 1fr 1fr; gap: 22px; }
  .footer .cols > div:first-child { grid-column: 1 / -1; }

  /* app pages */
  .app-head { padding-top: 22px; }
  .app-head > div:last-child { width: 100%; }
  .card { padding: 18px 16px; }
  .stats .val { font-size: 30px; }
  .card-head .btn, .card-head .seg { flex: none; }
  .keyrow { grid-template-columns: minmax(0, 1fr); }
  .keyrow .actions { justify-content: flex-start; }
  .convo { max-height: 56vh; padding: 14px; }
  .composer { grid-template-columns: minmax(0, 1fr); }
  .composer > div { flex-direction: row !important; }
  .composer .btn { flex: 1; }
  .window { min-height: 0; }
  .docs nav { border-bottom: 1px solid rgba(29,27,25,.12); padding-bottom: 14px; }
  .docs nav ol { display: flex; flex-wrap: wrap; gap: 2px 16px; }
  .docs table { display: block; overflow-x: auto; white-space: normal; }
  .docs td code { white-space: normal; overflow-wrap: anywhere; }
  .status-hero { gap: 22px; padding-top: 24px; }
  .neon { font-size: 56px; padding: 12px 24px 16px; }
  .ticks i { height: 28px; }
  .ticket { padding: 22px 18px; }
  .ticket h2 { font-size: 26px; }
  .clipboard { padding: 22px 18px; }
  .page-404 { padding-top: 24px; }
  .page-404 img { max-height: 300px; }
}
/* the dark mobile menu text must stay readable on the paper style */
:root[data-theme='ink'] .nav { color: var(--ink); }
@media (max-width: 820px) {
  :root[data-theme='ink'] .graffiti { background: linear-gradient(rgba(251,248,241,.55), rgba(251,248,241,.55)), var(--art-sump) center bottom / 100% auto no-repeat, var(--paper); padding-bottom: 56vw; }
  :root[data-theme='ink'] .finale .beam { display: none; }
}
@media (max-width: 960px) { .pg aside { order: 2; } }
:root[data-theme='ink'] input[type='range'], :root[data-theme='ink'] input[type='checkbox'] { accent-color: #c8102e; }

/* analytics consent notice: a slip of paper, bottom left */

/* ---------------------------------------------------------------- admin */
[data-role='user'] [data-admin-only] { display: none !important; }
.admin .kpis { margin: 0 0 16px; }
.admin .kpis .sub { line-height: 1.4; }
.admin .up { color: #3c6a48; font-weight: 600; }
.admin .down { color: #c8102e; font-weight: 600; }
.admin .bad { color: #c8102e; }
.chart.big { height: 230px; }
.hbar { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px 12px; align-items: center; padding: 7px 0; border-top: 1px solid rgba(29,27,25,.08); }
.hbar-l { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-t { height: 10px; background: rgba(29,27,25,.06); }
.hbar-t i { display: block; height: 100%; background: var(--ink); }
.hbar-v { grid-column: 2; font-size: 12.5px; color: var(--ink-3); }
.heat-grid { display: grid; grid-template-columns: 34px repeat(24, 1fr); gap: 2px; align-items: center; }
.heat-grid i { display: block; aspect-ratio: 1; background: #c8102e; border-radius: 1px; }
.heat-d { font: 600 11px var(--f-label); letter-spacing: .1em; color: var(--ink-3); }
.heat-axis { display: flex; justify-content: space-between; margin-left: 36px; font: 11px var(--f-mono); color: var(--ink-3); }
.pillrow { padding: 6px 0; font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; }
@media (max-width: 820px) { .hbar { grid-template-columns: 1fr; } .hbar-v { grid-column: 1; } }

/* --------------------------------------------------------- integrations */
.keyfill { margin: 16px 0 22px; padding: 16px 18px; }
.keyfill label { font: 600 13px var(--f-label); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
.keyfill-row { display: flex; gap: 10px; margin-top: 8px; }
.keyfill-row .input { flex: 1; font-family: var(--f-mono); font-size: 14px; }
.integ { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; }
.integ-list { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; padding-right: 6px; }
.integ-list h4 { font: 600 11px var(--f-label); letter-spacing: .22em; text-transform: uppercase; color: #c8102e; margin: 18px 0 6px; }
.integ-list h4:first-child { margin-top: 0; }
.integ-list button { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; text-align: left; background: none; border: 0; border-left: 2px solid transparent; padding: 7px 10px; font: 15px var(--f-body); color: var(--ink-2); cursor: pointer; }
.integ-list button small { font: 11px var(--f-mono); color: var(--ink-3); }
.integ-list button:hover { color: var(--ink); background: rgba(29,27,25,.04); }
.integ-list button[aria-current='true'] { color: var(--ink); border-left-color: #c8102e; background: rgba(200,16,46,.05); font-weight: 600; }
.integ-panel { min-height: 420px; }
.integ-panel h2 { font-size: 32px; }
.integ-panel .tag-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 16px; }
.integ-panel .chip { font: 600 11px var(--f-label); letter-spacing: .14em; text-transform: uppercase; padding: 3px 8px; border: 1px solid rgba(29,27,25,.2); color: var(--ink-2); }
.integ-panel .chip.red { border-color: #c8102e; color: #c8102e; }
.integ-panel ol.steps { padding-left: 20px; margin: 0 0 16px; }
.integ-panel ol.steps li { margin: 6px 0; }
.integ-panel .snip { position: relative; margin: 10px 0 16px; }
.integ-panel .snip-name { font: 500 12px var(--f-mono); color: var(--ink-3); margin-bottom: 4px; }
.integ-panel pre { background: #1d1b19; color: #efe9dd; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 0; }
.integ-panel .snip .copy { position: absolute; top: 26px; right: 8px; background: rgba(255,255,255,.08); color: #efe9dd; border-color: rgba(255,255,255,.2); }
.integ-panel .note { display: block; transform: none; font-family: var(--f-body, Barlow, system-ui, sans-serif); letter-spacing: normal; line-height: 1.55; font-size: 14.5px; color: var(--ink-2); border-left: 3px solid #c8102e; padding: 4px 12px; margin: 12px 0; }
.integ-panel .note code { word-break: break-word; }
.integ-panel .src { font-size: 12.5px; color: var(--ink-3); margin-top: 18px; }
@media (max-width: 900px) {
  .integ { grid-template-columns: minmax(0, 1fr); }
  .integ-list { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
  .integ-list h4 { display: none; }
  .integ-list button { flex: none; width: auto; border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; }
  .integ-list button small { display: none; }
  .integ-list button[aria-current='true'] { border-bottom-color: #c8102e; }
}

.works-with { margin: 18px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.8; }
.works-with a { color: var(--ink); }

/* one-line setup + tools band (home) */
.install { margin-top: 24px; max-width: 100%; }
.install-label { font: 600 12px/1.3 var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.install .stub { margin-top: 0; display: flex; width: fit-content; max-width: 100%; }
.install .stub > span { flex: 1 1 auto; min-width: 0; }
.install .stub b { margin-right: 4px; }
.install-more { margin: 8px 0 0; font-size: 14px; color: var(--ink-2); }
.install-more a { color: var(--ink); }
.tools-band { padding: 56px 0 64px; border-top: 1px solid rgba(29,27,25,.12); border-bottom: 1px solid rgba(29,27,25,.12); background: rgba(251,248,241,.55); position: relative; z-index: 2; }
.tools-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 26px; }
.tools-head h2 { margin: 0; max-width: 22ch; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr)); gap: 10px; }
.tool-tile { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: #fbf8f1; border: 1px solid rgba(29,27,25,.2); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-tile b { font: 600 17px/1.25 var(--f-body); }
.tool-tile small { font: 500 11px/1.3 var(--f-label); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.tool-tile:hover, .tool-tile:focus-visible { border-color: #c8102e; transform: translateY(-2px); box-shadow: 0 8px 18px -12px rgba(29,27,25,.5); }
@media (max-width: 600px) {
  .tools-band { padding: 40px 0 44px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool-tile { padding: 12px; }
  .install .stub { font-size: 12.5px; }
}
/* integrations page: one-line setup box */
.integ-install { margin: 0 0 22px; padding: 18px 20px; background: #fbf8f1; border: 1px solid rgba(29,27,25,.2); border-left: 4px solid #c8102e; }
.integ-install h2 { font-size: 22px; margin: 0 0 6px; }
.integ-install p { margin: 8px 0 0; font-size: 14.5px; color: var(--ink-2); }
.integ-install .stub { margin-top: 10px; display: flex; max-width: 100%; }
.integ-install .stub > span { flex: 1 1 auto; min-width: 0; }
.install .stub span span, .integ-install .stub span span { padding: 0; }
.install .stub > span, .integ-install .stub > span { white-space: normal; overflow-wrap: anywhere; word-break: break-all; line-height: 1.45; }
.install .stub span, .integ-install .stub span { white-space: normal; overflow: visible; }

/* OS switch (macOS / Linux vs Windows commands) */
html[data-os="windows"] [data-os-show="unix"], html:not([data-os="windows"]) [data-os-show="windows"] { display: none; }
.os-switch { display: inline-flex; border: 1px solid rgba(29,27,25,.3); background: #fbf8f1; }
.os-switch button { appearance: none; border: 0; background: none; padding: 5px 10px; font: 600 11.5px/1.2 var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; }
.os-switch button + button { border-left: 1px solid rgba(29,27,25,.3); }
.os-switch button[aria-pressed="true"] { background: var(--ink); color: #fbf8f1; }
.os-switch button:focus-visible { outline: 2px solid #c8102e; outline-offset: 1px; }
.install-head, .keyfill-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 8px; }
.install-head .install-label { margin-bottom: 0; }
.keyfill-head label { margin: 0; }

/* blog */
.blog-post h1, .blog-index h1 { font-style: normal; }
.blog-post .kicker a, .post-list a { color: inherit; text-decoration: none; }
.blog-post ul { padding-left: 1.2em; }
.blog-post li { margin: 6px 0; }
.post-list { list-style: none; padding: 0; margin: 24px 0 0; }
.post-list li { padding: 22px 0; border-top: 1px solid rgba(29,27,25,.15); }
.post-list time { font: 600 12px var(--f-label); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3, #6b645c); }
.post-list h2 { margin: 6px 0 6px; font-size: clamp(22px, 3vw, 28px); }
.post-list a:hover h2 { color: #c8102e; }
.post-list p { margin: 0; color: var(--ink-2); }
.table-scroll { overflow-x: auto; margin: 16px 0 8px; border: 1px solid rgba(29,27,25,.18); background: #fbf8f1; }
.price-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.price-table th { position: sticky; top: 0; background: #f4eee2; text-align: right; font: 600 11px var(--f-label); letter-spacing: .12em; text-transform: uppercase; padding: 9px 10px; border-bottom: 1px solid rgba(29,27,25,.25); white-space: nowrap; }
.price-table td { padding: 7px 10px; border-bottom: 1px solid rgba(29,27,25,.08); text-align: right; font-family: var(--f-mono); white-space: nowrap; }
.price-table th:first-child, .price-table td:first-child { text-align: left; font-family: var(--f-body); }
.price-table tr.ours td { background: rgba(200,16,46,.07); border-bottom: 2px solid #c8102e; }
.price-table .muted { color: var(--ink-3, #6b645c); font-size: 12.5px; }
.blog-post { padding-top: 44px; }

/* admin controls */
.admin-links { font-size: 14px; }
.admin-tabs { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid rgba(29,27,25,.2); margin: 6px 0 22px; overflow-x: auto; }
.admin-tabs button { appearance: none; border: 0; background: none; padding: 10px 14px; font: 600 13px var(--f-label); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.admin-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: #c8102e; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-title { margin: 0; font-size: 26px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { width: auto; flex: 1 1 200px; padding: 9px 11px; font-size: 15px; background: #fbf8f1; }
.toolbar select.input { flex: 0 1 220px; }
.toolbar .check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.small { font-size: 13.5px; }
.admin-table td.num, .admin-table th.num { text-align: right; }
.admin-table tr.clickable { cursor: pointer; }
.admin-table tr.clickable:hover td { background: rgba(200,16,46,.05); }
.admin-table td.wrap-cell { white-space: normal; min-width: 240px; }
.linkish.danger, .btn.danger { color: #c8102e; }
.red-text { color: #c8102e; }
.st { display: inline-block; min-width: 38px; text-align: center; padding: 1px 6px; font: 600 12px var(--f-mono); border: 1px solid currentColor; }
.st-ok { color: #2f6b3a; } .st-busy { color: #9a7420; } .st-left { color: var(--ink-3, #6b645c); } .st-bad { color: #c8102e; }
.admin-dialog { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); border: 1px solid rgba(29,27,25,.3); padding: 22px 24px; background: #fbf8f1; color: var(--ink); }
.admin-dialog::backdrop { background: rgba(29,27,25,.45); }
.ud-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ud-head h2 { margin: 0; font-size: 24px; word-break: break-all; }
.admin-dialog h3 { margin: 22px 0 8px; font-size: 18px; }
.ud-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 6px; }
.small-kpis .val { font-size: 26px; }
.probe-strip { display: flex; flex-wrap: wrap; gap: 2px; }
.probe-strip i { width: 6px; height: 18px; background: #2f6b3a; }
.probe-strip i.busy { background: #c9a35c; } .probe-strip i.bad { background: #c8102e; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 8px 20px; padding: 12px 0; border-top: 1px solid rgba(29,27,25,.1); align-items: start; }
.setting-label label { font-weight: 600; }
.setting-label p { margin: 2px 0 0; }
.setting-input .input { background: #fff; padding: 9px 11px; font-size: 15px; }
.settings-group .btn { margin-top: 10px; }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: rgba(29,27,25,.25); transition: background .15s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--ink); }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid #c8102e; outline-offset: 2px; }
@media (max-width: 700px) { .setting { grid-template-columns: minmax(0, 1fr); } .admin-dialog { padding: 16px; } }

/* site-wide announcement set from /admin */
.announce { background: #1d1b19; color: #fbf8f1; text-align: center; padding: 8px 16px; font-size: 14.5px; position: relative; z-index: 49; }

/* chat component (home demo, Ask AI, playground images) */
.cb { display: flex; flex-direction: column; min-height: 0; background: #fbf8f1; border: 1px solid rgba(29,27,25,.22); }
.cb.drop { outline: 2px dashed #c8102e; outline-offset: -6px; }
.cb-convo { flex: 1 1 auto; min-height: 200px; max-height: 520px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.cb-empty p { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; }
.cb-suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.cb-suggest button { appearance: none; text-align: left; border: 1px solid rgba(29,27,25,.25); background: #fff; padding: 8px 11px; font: 14.5px/1.35 var(--f-body); color: var(--ink); cursor: pointer; }
.cb-suggest button:hover { border-color: #c8102e; }
.cb-msg { max-width: 92%; font-size: 15.5px; line-height: 1.55; }
.cb-msg.user { align-self: flex-end; background: #1d1b19; color: #fbf8f1; padding: 9px 13px; }
.cb-msg.assistant { align-self: flex-start; }
.cb-msg .cb-body > :first-child { margin-top: 0; } .cb-msg .cb-body > :last-child { margin-bottom: 0; }
.cb-msg pre { background: #1d1b19; color: #f4eee2; padding: 10px 12px; overflow-x: auto; font-size: 13.5px; }
.cb-msg code { font-family: var(--f-mono); font-size: .92em; }
.cb-msg .err { color: #c8102e; }
.cb-msg a { color: #c8102e; }
.cb-img { display: block; max-width: 220px; max-height: 220px; margin-bottom: 6px; border: 1px solid rgba(251,248,241,.3); }
.cb-think { font-size: 13.5px; color: var(--ink-2); margin-bottom: 6px; }
.cb-think summary { cursor: pointer; font: 600 11.5px var(--f-label); letter-spacing: .12em; text-transform: uppercase; }
.cb-tt { white-space: pre-wrap; max-height: 180px; overflow-y: auto; padding: 6px 0 0 10px; border-left: 2px solid rgba(29,27,25,.15); }
.cb-wait { color: var(--ink-3, #6b645c); font-size: 14px; }
.cb-pending { display: flex; gap: 8px; padding: 8px 12px 0; flex-wrap: wrap; }
.cb-thumb { position: relative; }
.cb-thumb img { width: 56px; height: 56px; object-fit: cover; border: 1px solid rgba(29,27,25,.25); display: block; }
.cb-thumb button { position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: #1d1b19; color: #fff; font-size: 13px; line-height: 20px; cursor: pointer; padding: 0; }
.cb-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid rgba(29,27,25,.15); }
.cb-attach { flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(29,27,25,.3); cursor: pointer; font-size: 22px; line-height: 1; color: var(--ink-2); background: #fff; }
.cb-attach:hover { border-color: #c8102e; color: #c8102e; }
.cb-attach:focus-within { outline: 2px solid #c8102e; outline-offset: 1px; }
.cb-input { flex: 1 1 auto; min-width: 0; resize: none; border: 1px solid rgba(29,27,25,.3); background: #fff; padding: 9px 11px; font: 16px/1.4 var(--f-body); color: var(--ink); max-height: 160px; }
.cb-input:focus { outline: 2px solid #c8102e; outline-offset: -1px; }
.cb-send, .cb-stop { flex: 0 0 auto; height: 38px; padding: 0 16px; border: 1.5px solid #1d1b19; background: #1d1b19; color: #fbf8f1; font: 600 13px var(--f-label); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.cb-stop { background: transparent; color: #1d1b19; }
.cb-foot { display: flex; justify-content: space-between; padding: 0 12px 8px; font-size: 13px; color: var(--ink-3, #6b645c); }

/* home: try band */
.try-band { padding: 60px 0; position: relative; z-index: 2; }
.try-head { display: flex; justify-content: space-between; align-items: end; gap: 12px 30px; flex-wrap: wrap; margin-bottom: 18px; }
.try-head h2 { margin: 0 0 6px; }
.try-head .lede { margin: 0; }
.try-side { max-width: 34ch; margin: 0; }
.try-chat .cb-convo { min-height: 260px; }
@media (max-width: 600px) { .try-band { padding: 40px 0; } .try-chat .cb-convo { min-height: 220px; max-height: 60vh; } }

/* Ask AI */
.askai-btn { position: fixed; right: 16px; bottom: 16px; z-index: 2147482000; display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1.5px solid #1d1b19; background: #1d1b19; color: #fbf8f1; font: 600 13px var(--f-label); letter-spacing: .12em; text-transform: uppercase; cursor: pointer; box-shadow: 0 10px 28px -12px rgba(29,27,25,.6); transition: transform .15s, background .15s; }
.askai-btn:hover { background: #c8102e; border-color: #c8102e; transform: translateY(-1px); }
.askai-btn:focus-visible { outline: 3px solid #c8102e; outline-offset: 2px; }
.askai-dot { width: 8px; height: 8px; border-radius: 50%; background: #c8102e; box-shadow: 0 0 0 3px rgba(200,16,46,.25); }
.askai-btn:hover .askai-dot { background: #fbf8f1; }
.askai-panel { position: fixed; right: 16px; bottom: 16px; z-index: 2147482001; width: min(420px, calc(100vw - 32px)); height: min(620px, calc(100vh - 100px)); display: flex; flex-direction: column; background: #fbf8f1; border: 1px solid rgba(29,27,25,.35); box-shadow: 0 24px 60px -20px rgba(29,27,25,.55); }
.askai-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 12px 14px; border-bottom: 1px solid rgba(29,27,25,.15); }
.askai-head b { display: block; font: 700 17px var(--f-display, Georgia, serif); }
.askai-head span { font-size: 13px; color: var(--ink-2); }
.askai-chat { flex: 1 1 auto; min-height: 0; display: flex; }
.askai-chat .cb { flex: 1 1 auto; border: 0; }
.askai-chat .cb-convo { max-height: none; }
@media (max-width: 600px) {
  .askai-btn { padding: 10px 13px; }
  .askai-panel { right: 0; left: 0; bottom: 0 !important; width: 100%; height: 88vh; border-left: 0; border-right: 0; }
}
#composer { grid-template-columns: auto minmax(0, 1fr) auto; }
.pg .window.drop { outline: 2px dashed #c8102e; outline-offset: -6px; }
.try-band { z-index: 81; } /* the chat sits above the falling petals (.fx-sparks, z 80) */

/* languages */
.foot-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 36px; }
.lang-pick { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--f-label); color: var(--ink-2); }
.lang-pick select { font: inherit; color: var(--ink); background: transparent; border: 1px solid color-mix(in oklab, var(--ink-3) 60%, transparent); border-radius: 6px; padding: 6px 28px 6px 10px; max-width: 60vw; cursor: pointer; }
.lang-pick select:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; }
.lang-pick option { color: #1d1b19; background: #fbf8f1; }
.i18n-pill { position: fixed; right: 16px; bottom: 16px; z-index: 2147482000; font: 600 13px var(--f-label); color: var(--ink); background: color-mix(in oklab, var(--soot) 88%, transparent); border: 1px solid color-mix(in oklab, var(--ink-3) 50%, transparent); border-radius: 999px; padding: 7px 14px; pointer-events: none; }
.i18n-pill.ready { pointer-events: auto; cursor: pointer; }
[dir="rtl"] .footer .cols, [dir="rtl"] .wrap { text-align: right; }

/* admin: prompt cache per day */
.cache-days { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0 18px; margin-bottom: 12px; }
.cache-days > div { flex: 1 1 0; min-width: 6px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; position: relative; }
.cache-days i { display: flex; flex-direction: column; justify-content: flex-end; background: color-mix(in oklab, var(--ink-3) 35%, transparent); border-radius: 2px 2px 0 0; overflow: hidden; }
.cache-days b { display: block; background: var(--magenta); }
.cache-days span { position: absolute; bottom: -16px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-3); }
