/* 05 — Terminal Dungeon. Jade phosphor, one very eager servant.
   Themes: class on <html> = accent-none (default, jade only) | accent-blue | accent-violet.
   The accent is used only for: the CTAs, the ERR 429 tag, money (gold saved, "up to ~40%"), the Chinese one's glyph.
   In jade only, the accent is the hot phosphor core: the CTAs are the brightest solid blocks on screen.
   Rules: solid fill = an action (or the servant's reply box). Dashed border = a command you can copy.
   Glow = display type (VT323) only; mono text stays crisp. Smallest text: 12px. */

:root {
  --bg: #040907;
  --bg-2: #071109;
  --ph: #67e4ae;          /* phosphor */
  --ph-rgb: 103, 228, 174;
  --ph-hot: #d6ffec;      /* phosphor core, for the biggest type */
  --ink: #a3dcc3;         /* body text */
  --muted: #62a789;
  --jade: #2fa36b;        /* brand jade: lines and dim fills */
  --jade-rgb: 47, 163, 107;
  --line: rgba(var(--jade-rgb), .62);
  --line-2: rgba(var(--jade-rgb), .3);
  --wall: #1f6b49;
  --glow: 0 0 1px rgba(var(--ph-rgb), .85), 0 0 9px rgba(var(--ph-rgb), .42), 0 0 26px rgba(var(--ph-rgb), .18);
  --glow-soft: 0 0 7px rgba(var(--ph-rgb), .28);
  --display: "VT323", ui-monospace, monospace;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: 40px;
  /* accent: blue (default). Text on --acc uses --acc-ink. */
  --acc: #4fb3ff;
  --acc-hot: #b8e1ff;
  --acc-ink: #03111d;
  --acc-rgb: 79, 179, 255;
  --ico-glyph: url(icons/glyph-blue.svg);
  --ico-coins: url(icons/coins-blue.svg);
  --ico-pouch-acc: url(icons/pouch-blue.svg);
}
.accent-violet {
  --acc: #a98bff;
  --acc-hot: #ddd2ff;
  --acc-ink: #120a24;
  --acc-rgb: 169, 139, 255;
  --ico-glyph: url(icons/glyph-violet.svg);
  --ico-coins: url(icons/coins-violet.svg);
  --ico-pouch-acc: url(icons/pouch-violet.svg);
}
.accent-none { /* jade only: accent = the hot phosphor core, text on it = the screen black */
  --acc: #d6ffec;
  --acc-hot: #f2fff9;
  --acc-ink: #040907;
  --acc-rgb: 103, 228, 174;
  --ico-glyph: url(icons/glyph-jade.svg);
  --ico-coins: url(icons/coins-jade.svg);
  --ico-pouch-acc: url(icons/pouch.svg);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scrollbar-color: var(--wall) var(--bg); }
body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% 18%, rgba(var(--ph-rgb), .07), transparent 70%),
    var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--mono);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
img { display: block; }
p { margin: 0; text-wrap: pretty; }
::selection { background: var(--ph); color: var(--bg); text-shadow: none; }
:focus-visible { outline: 2px solid var(--ph); outline-offset: 3px; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 200; background: var(--ph); color: var(--bg); padding: 8px 12px; }
.skip:focus { left: 8px; }

/* ---------- CRT layer: 3px scanlines, vignette, slow refresh roll ---------- */
.crt::before, .crt::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.crt::before {
  background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0, 0, 0, .26) 2px 3px);
}
.crt::after { background: radial-gradient(ellipse 85% 80% at 50% 50%, transparent 58%, rgba(0, 0, 0, .55) 100%); }
.crt__roll {
  position: fixed; left: 0; right: 0; top: -20vh; height: 18vh; z-index: 91; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(var(--ph-rgb), .035) 60%, transparent);
  animation: roll 9s linear infinite;
}
@keyframes roll { to { transform: translateY(140vh); } }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- 1-bit art: crisp pixels + a phosphor bloom twin ---------- */
.px { image-rendering: pixelated; width: 100%; height: auto; }
.bloom { position: absolute; inset: 0; filter: blur(5px) brightness(1.6); opacity: .55; mix-blend-mode: screen; pointer-events: none; }

/* ---------- icons: traced SVGs, phosphor baked in (CSS masks are blocked on file://) ---------- */
.ico {
  display: inline-block; width: 1em; height: 1em; flex: none;
  background: var(--m) center / contain no-repeat;
  filter: drop-shadow(0 0 4px rgba(var(--ph-rgb), .55));
}
.ico-key { --m: url(icons/key.svg); }
.ico-term { --m: url(icons/term.svg); }
.ico-scrolls { --m: url(icons/scrolls.svg); }
.ico-pouch { --m: url(icons/pouch.svg); }
.ico-door { --m: url(icons/door.svg); }
.ico-lantern { --m: url(icons/lantern.svg); }
.ico-flask { --m: url(icons/flask.svg); }
.ico-quill { --m: url(icons/quill.svg); }
.ico-anvil { --m: url(icons/anvil.svg); }
.ico-seal { --m: url(icons/seal.svg); }
.ico-hourglass { --m: url(icons/hourglass.svg); }
/* accent set: the Chinese one's glyph and money */
.ico-glyph, .ico-coins, .ico-pouch-acc { filter: drop-shadow(0 0 5px rgba(var(--acc-rgb), .6)); }
.ico-glyph { --m: var(--ico-glyph); }
.ico-coins { --m: var(--ico-coins); }
.ico-pouch-acc { --m: var(--ico-pouch-acc); }

/* ---------- frames: double-line box drawing ---------- */
.frame {
  position: relative;
  border: 1px solid var(--line);
  box-shadow: inset 0 0 0 4px var(--bg), inset 0 0 0 5px var(--line-2), 0 0 40px rgba(var(--jade-rgb), .06);
  background: rgba(7, 17, 9, .6);
}
.frame__title {
  position: absolute; top: -11px; left: 22px; z-index: 3;
  padding: 0 10px; background: var(--bg);
  font: 500 12px/20px var(--mono); letter-spacing: .2em; color: var(--ph);
  text-shadow: var(--glow);
}

/* ---------- status bar ---------- */
.statusbar { position: sticky; top: 0; z-index: 50; background: rgba(4, 9, 7, .92); border-bottom: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.statusbar__in { display: flex; align-items: center; gap: 28px; height: 52px; font-size: 13px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ph); }
.brand .ico { font-size: 22px; }
.brand__name { font: 400 26px/1 var(--display); letter-spacing: .06em; text-shadow: var(--glow); white-space: nowrap; }
.brand__tty { font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); padding: 0 6px; letter-spacing: .1em; }
.statusbar__path { color: var(--muted); }
.fkeys { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.fkeys a { text-decoration: none; color: var(--ink); white-space: nowrap; }
.fkeys a:hover { color: var(--ph-hot); }
.fkeys .fkeys__cta { background: var(--acc); color: var(--acc-ink); padding: 6px 12px 6px 6px; font-weight: 600; text-shadow: none; box-shadow: 0 0 18px rgba(var(--acc-rgb), .4); }
.fkeys .fkeys__cta kbd { background: var(--acc-ink); color: var(--acc); box-shadow: none; }
.fkeys .fkeys__cta:hover { background: var(--acc-hot); color: var(--acc-ink); }
kbd { font: 500 12px/1 var(--mono); color: var(--ph); padding: 2px 5px; margin-right: 6px; box-shadow: inset 0 0 0 1px var(--line); } /* outlined: only actions are solid */
.statusbar__live { color: var(--muted); display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.dot { width: 8px; height: 8px; background: var(--ph); box-shadow: 0 0 8px var(--ph); }
.clock { color: var(--ph); }

/* ---------- HERO: viewport + party + message log ---------- */
.hero {
  display: grid; gap: 20px 24px; padding-top: 18px; padding-bottom: 24px;
  grid-template-columns: minmax(0, 1fr) clamp(372px, 40vw, 580px); /* a wider quest log keeps the scene short enough for the CTA to sit above the fold */
  grid-template-areas: "view quest" "log log";
}
.viewport { grid-area: view; margin: 0; padding: 5px; display: flex; flex-direction: column; }
.scene { position: relative; aspect-ratio: 476 / 236; overflow: hidden; background: #000; }
.scene .px { position: absolute; inset: 0; width: 100%; height: 100%; }
.msgline {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 5px;
  padding: 10px 16px; font-size: 15px; color: var(--ink); border-top: 1px solid var(--line-2); background: #000;
}
.msgline::before { content: "»"; color: var(--ph); }
.msgline .tag { align-self: center; }
.compass { position: absolute; top: 14px; right: 18px; z-index: 2; font: 400 20px/0.9 var(--display); color: var(--ph); text-align: center; text-shadow: var(--glow); }

.stat__k { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.bar {
  display: block; height: 9px; margin-top: 3px;
  background:
    linear-gradient(90deg, var(--ph) calc(var(--v) * 100%), transparent 0) ,
    var(--line-2);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 11px);
          mask: repeating-linear-gradient(90deg, #000 0 8px, transparent 8px 11px);
  filter: drop-shadow(0 0 4px rgba(var(--ph-rgb), .6));
}

/* QUEST LOG: same slot, size and frame as v0's PARTY panel */
.quest { grid-area: quest; padding: 26px 24px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.frame__sub { color: var(--muted); letter-spacing: .12em; text-shadow: none; }
.summoned { display: flex; align-items: center; gap: 14px; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.summoned__glyph { font-size: 48px; animation: spin 40s linear infinite; }
.summoned p { font-size: 13px; line-height: 1.45; color: var(--muted); }
.summoned b { display: block; margin-bottom: 4px; font: 400 26px/1 var(--display); color: var(--ph-hot); letter-spacing: .03em; text-shadow: var(--glow); }
@keyframes spin { to { transform: rotate(360deg); } }
.tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.task { display: grid; grid-template-columns: 20px minmax(0, 1fr) 58px; grid-template-rows: auto auto; align-items: center; gap: 2px 12px; font-size: 13px; line-height: 1.3; color: var(--muted); }
.task .ico { grid-row: 1 / 3; }
.task__state { grid-column: 3; grid-row: 1 / 3; }
.task .ico { font-size: 18px; opacity: .55; }
.task__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task__name { grid-column: 2; }
.task__model { grid-column: 2; grid-row: 2; font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.task__model::before { content: "→ tco/"; opacity: .8; }
.task__state { justify-self: end; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.task.is-done { color: var(--ink); }
.task.is-done .ico { opacity: 1; }
.task.is-done .task__state { color: var(--ph); }
.task.is-done .task__state::before { content: "✓ "; }
.task.is-run { color: var(--ph-hot); }
.task.is-run .ico { opacity: 1; animation: blink 1s steps(1) infinite; }
.task__bar { display: block; width: 58px; height: 8px; background: linear-gradient(90deg, var(--ph) calc(var(--p) * 100%), var(--line-2) 0);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 7px); }
.purse { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.purse p { display: flex; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.purse b { display: block; margin-top: 5px; font: 400 40px/.9 var(--display); letter-spacing: .01em; }
.purse__gold .ico { font-size: 40px; }
.purse__gold b { color: var(--acc); text-shadow: 0 0 1px rgba(var(--acc-rgb), .9), 0 0 9px rgba(var(--acc-rgb), .45), 0 0 26px rgba(var(--acc-rgb), .18); }
.purse__plan b { color: var(--ph-hot); text-shadow: var(--glow); }
.quest__note { font-size: 12px; color: var(--muted); margin-top: -6px; }

/* message log */
.log {
  grid-area: log; padding: 24px 40px 28px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 48px;
  grid-template-areas: "cmd cmd" "reply lede" "actions actions";
}
.cmd { grid-area: cmd; }
.reply { grid-area: reply; }
.lede { grid-area: lede; }
.actions { grid-area: actions; }
.tag--acc { background: var(--acc) !important; color: var(--acc-ink) !important; box-shadow: 0 0 14px rgba(var(--acc-rgb), .45) !important; }
.accent-none .tag--acc { background: transparent !important; color: var(--ph-hot) !important; box-shadow: inset 0 0 0 1px var(--ph) !important; } /* jade only: solid = action, so the error is outlined */
.tag { font-weight: 600; font-size: 12px; letter-spacing: .14em; padding: 2px 8px; background: var(--ph); color: var(--bg); text-shadow: none; box-shadow: 0 0 14px rgba(var(--ph-rgb), .45); }
.cmd { margin-top: 0; }
.ps1 { font-size: 13px; color: var(--muted); }
.ps1 b { font-weight: 500; color: var(--ph); }
.cmd__line {
  margin: 0; display: flex; align-items: baseline; gap: .28em;
  font: 400 clamp(52px, 6.4vw, 92px)/.95 var(--display); letter-spacing: .005em;
  color: var(--ph-hot); text-shadow: 0 0 16px rgba(var(--ph-rgb), .3); /* one soft halo: the pixel edges stay sharp */
}
.ps1__arrow { font-size: .42em; color: var(--muted); text-shadow: none; transform: translateY(-.25em); }
.type { position: relative; display: inline-block; }
.type__ghost { visibility: hidden; }
.type__ghost::after { content: ""; display: inline-block; width: .56em; } /* room for the cursor */
.type__live { position: absolute; inset: 0; }
.type__live::after, .cursor {
  content: ""; display: inline-block; width: .5em; height: .82em; margin-left: .06em; vertical-align: -.06em;
  background: currentColor; box-shadow: 0 0 12px currentColor; animation: blink 1.06s steps(1) infinite;
}
.type__live::after { visibility: hidden; }
.is-typing .type__live::after { visibility: visible; animation: none; }
.cmd .type__live::after { visibility: visible; }
.reply.is-shown .type__live::after { visibility: visible; }
.cmd.is-done .type__live::after { visibility: hidden; }

.reply { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.reply__who { font-size: 12px; letter-spacing: .2em; color: var(--muted); }
.reply__who b { font-weight: 400; color: var(--ph); }
.reply__sub { display: block; margin-top: 3px; font-size: 12px; letter-spacing: .06em; color: var(--muted); }
.reply__box {
  font: 400 clamp(36px, 4vw, 56px)/1 var(--display); color: var(--bg); background: var(--ph);
  padding: .08em .32em .1em; text-shadow: none;
  box-shadow: 0 0 22px rgba(var(--ph-rgb), .3);
}
.reply__box .type__live::after { box-shadow: none; }

.lede { margin-top: 16px; max-width: 74ch; font-size: 16px; line-height: 1.6; color: var(--ink); }
.actions { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
.cta {
  display: inline-flex; align-items: center; gap: 12px; text-decoration: none;
  font: 400 34px/1 var(--display); letter-spacing: .02em;
  color: var(--acc-ink); background: var(--acc); padding: 12px 22px 13px 18px; text-shadow: none;
  box-shadow: 0 0 0 1px var(--acc-hot) inset, 0 0 24px rgba(var(--acc-rgb), .5), 0 0 70px rgba(var(--acc-rgb), .2);
  transition: background .15s, box-shadow .15s;
}
.cta:hover { background: var(--acc-hot); box-shadow: 0 0 0 1px #fff inset, 0 0 34px rgba(var(--acc-rgb), .75), 0 0 90px rgba(var(--acc-rgb), .3); }
.trust { font-size: 15px; color: var(--ink); }
.cta .cursor { height: .78em; box-shadow: none; }
.cta__chev { font-size: 1.1em; }
.install {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  font: 400 16px/1 var(--mono); color: var(--ink);
  background: transparent; border: 1px dashed var(--line); padding: 16px 16px 16px 18px;
}
.install code { font: inherit; color: var(--ph-hot); }
.install__dollar { color: var(--muted); }
.install__hint { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); border-left: 1px solid var(--line-2); padding-left: 12px; }
.install:hover { border-style: solid; }
.install.is-copied .install__hint { color: var(--ph); }

/* ---------- HOW IT WORKS: the dungeon map ---------- */
.mapsec { padding-top: 96px; padding-bottom: 40px; }
.mapsec__head { margin-bottom: 52px; }
.mapsec h2 { margin: 0; max-width: 1180px; text-wrap: balance; font: 400 clamp(44px, 5.4vw, 80px)/.95 var(--display); color: var(--ph-hot); text-shadow: var(--glow); }

.dungeon {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 8fr 1.6fr 6fr 1.6fr 7fr;   /* rooms 8 : 6 : 7, joined by corridors */
  padding: 44px 0;
}
.dungeon::before { /* map paper: faint grid of floor dots */
  content: ""; position: absolute; inset: 0 calc(-1 * var(--pad)); z-index: -1;
  background-image: radial-gradient(rgba(var(--jade-rgb), .32) 1px, transparent 1.6px);
  background-size: 24px 24px; background-position: 12px 12px;
  -webkit-mask: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
          mask: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.room { position: relative; padding: 18px; }
.room::before { /* stone wall, traced tile */
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url(tiles/wall.svg) 0 0 / 76px 76px repeat;
  filter: drop-shadow(0 0 6px rgba(var(--jade-rgb), .5));
}
.room::after { content: ""; position: absolute; inset: 0; z-index: 0; border: 1px solid var(--line); pointer-events: none; }
.room__floor { position: relative; z-index: 1; height: 100%; padding: 30px 30px 32px; background: var(--bg); box-shadow: 0 0 0 1px var(--line), inset 0 0 60px rgba(0, 0, 0, .8); overflow: hidden; }
.room__floor::before { /* flagstones, very faint */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07;
  background: url(tiles/floor.svg) 0 0 / 150px 150px repeat;
}
.room__floor > * { position: relative; }
.room--2 { margin-top: 70px; }
.room--3 { margin-top: -30px; }
.room__no { font-size: 12px; letter-spacing: .2em; color: var(--muted); }
.room__no span { color: var(--ph); }
.room__ico { display: block; font-size: 58px; margin: 26px 0 18px; }
.room h3 { margin: 0 0 12px; font: 400 44px/1 var(--display); color: var(--ph-hot); text-shadow: var(--glow); }
.room p:not(.room__no) { font-size: 15px; line-height: 1.6; }
.room__code { margin: 4px 0 14px; padding: 10px 12px; border: 1px dashed var(--line); color: var(--ph-hot); font-size: 15px !important; white-space: nowrap; overflow-x: auto; background: rgba(0, 0, 0, .5); }
.room__code span { color: var(--muted); }
.room__art { position: relative; margin: 16px -10px 14px; max-width: 360px; }
.room__art .px { width: 100%; }
.room__glyph { position: absolute; right: 2%; top: -6%; font-size: 64px; animation: spin 60s linear infinite; }
.loot { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 14px 16px; border: 1px solid rgba(var(--acc-rgb), .6); background: rgba(var(--acc-rgb), .06); box-shadow: 0 0 30px rgba(var(--acc-rgb), .1); }
.loot .ico { font-size: 40px; }
.loot p { font-size: 15px !important; line-height: 1.35 !important; }
.loot strong .tilde { font: 500 .6em/1 var(--mono); vertical-align: .2em; margin: 0 .04em; }
.loot strong { display: block; font: 400 40px/1 var(--display); color: var(--acc); text-shadow: 0 0 1px rgba(var(--acc-rgb), .9), 0 0 9px rgba(var(--acc-rgb), .45), 0 0 26px rgba(var(--acc-rgb), .18); font-weight: 400; }
.loot sup, .fineprint sup { color: var(--acc); }

.hall .door { position: absolute; z-index: 2; font-size: 42px; left: -24px; top: 50%; transform: translateY(-50%); }
.tile-stairs { position: absolute; z-index: 2; right: -14px; bottom: -14px; width: 54px; height: 54px; background: #000 url(tiles/stairs.svg) center / cover; border: 1px solid var(--line); filter: drop-shadow(0 0 6px rgba(var(--ph-rgb), .5)); }

.hall { position: relative; align-self: center; height: 64px; }
.hall::before { /* corridor walls */
  content: ""; position: absolute; inset: 0;
  background: url(tiles/wall.svg) 0 0 / 76px 76px repeat;
}
.hall .steps {
  position: absolute; left: 0; right: 0; top: 14px; bottom: 14px; background: var(--bg);
  box-shadow: 0 1px 0 var(--line) inset, 0 -1px 0 var(--line) inset;
}
.hall .steps::after { /* footprints marching toward the next room */
  content: ""; position: absolute; left: 10px; right: 26px; top: 50%; height: 6px; margin-top: -3px;
  background: repeating-linear-gradient(90deg, var(--ph) 0 6px, transparent 6px 18px);
  box-shadow: 0 0 8px rgba(var(--ph-rgb), .4);
  animation: march 1.2s linear infinite; background-size: 18px 6px;
}
@keyframes march { to { background-position: 18px 0; } }

.mapsec__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px; margin-top: 34px; padding-top: 22px; border-top: 1px solid var(--line-2); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; font-size: 12px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.legend span { display: inline-flex; align-items: center; gap: 10px; }
.legend .ico { font-size: 22px; }
.cta--small { font-size: 30px; padding: 10px 18px 11px 14px; }
.fineprint { margin-top: 22px; font-size: 13px; color: var(--muted); }

.sitefoot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; padding-top: 28px; padding-bottom: 40px; margin-top: 40px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--ink); }

/* wide quest log: task, model and state on one line */
@media (min-width: 1181px) {
  .task { grid-template-columns: 20px minmax(0, 1fr) auto 64px; grid-template-rows: auto; }
  .task .ico { grid-row: 1; }
  .task__model { grid-column: 3; grid-row: 1; }
  .task__state { grid-column: 4; grid-row: 1; }
}

/* ---------- tablet ---------- */
@media (max-width: 1180px) {
  .brand__tty, .statusbar__path { display: none; }
  .hero { grid-template-columns: 1fr; grid-template-areas: "view" "log" "quest"; }
  .scene { aspect-ratio: auto; height: min(36vw, 340px); }
  .scene .px { object-fit: contain; }
  .dungeon { grid-template-columns: 1fr; padding: 24px 0; justify-items: stretch; }
  .room--2, .room--3 { margin-top: 0; }
  .room { max-width: 640px; width: 100%; justify-self: center; }
  .room:nth-of-type(2) { justify-self: center; }
  .hall { width: 64px; height: 58px; justify-self: center; }
  .hall .steps { top: 0; bottom: 0; left: 14px; right: 14px; box-shadow: 1px 0 0 var(--line) inset, -1px 0 0 var(--line) inset; }
  .hall .steps::after { left: 50%; right: auto; top: 6px; bottom: 6px; height: auto; width: 6px; margin: 0 0 0 -3px; background: repeating-linear-gradient(180deg, var(--ph) 0 6px, transparent 6px 18px); background-size: 6px 18px; animation-name: march-y; }
  .hall .door { left: 50%; top: -22px; transform: translateX(-50%); }
}
@keyframes march-y { to { background-position: 0 18px; } }

@media (max-width: 960px) {
  .log { grid-template-columns: minmax(0, 1fr); grid-template-areas: "cmd" "reply" "lede" "actions"; }
  .lede { margin-top: 22px; }
}

/* ---------- phone ---------- */
@media (max-width: 760px) {
  :root { --pad: 16px; }
  body { font-size: 15px; }
  .statusbar__in { gap: 12px; height: 48px; }
  .brand__name { font-size: 22px; }
  .brand__tty, .statusbar__path, .statusbar__live, .fkeys a:first-child { display: none; }
  .fkeys { gap: 0; }
  .hero { padding-top: 26px; gap: 26px; }
  .viewport { padding: 4px; }
  .scene .px { image-rendering: auto; }
  .msgline { font-size: 13px; padding: 10px 12px; }
  .compass { top: 12px; right: 14px; }
  .quest { padding: 22px 14px 14px; }
  .task { grid-template-columns: 18px minmax(0, 1fr) 58px; }
  .log { padding: 26px 18px 26px; }
  .msgline .muted { font-size: 12px; }
  .cmd__line { display: block; font-size: 60px; line-height: .92; }
  .ps1__arrow { display: none; }
  .reply__box { font-size: 40px; }
  .lede { font-size: 16px; }
  /* phone: the CTA comes right after the reply, so it sits in the first screen */
  .log { grid-template-areas: "cmd" "reply" "cta" "lede" "install" "trust"; }
  .actions { display: contents; }
  .cta { grid-area: cta; margin-top: 22px; }
  .lede { grid-area: lede; margin-top: 20px; }
  .install { grid-area: install; margin-top: 18px; }
  .trust { grid-area: trust; margin-top: 12px; font-size: 14px; }
  .cta { justify-content: flex-start; font-size: 32px; }
  .install { justify-content: space-between; font-size: 15px; }
  .mapsec { padding-top: 64px; }
  .mapsec__head { margin-bottom: 28px; }
  .room { padding: 14px; }
  .room__floor { padding: 24px 20px 26px; }
  .room__ico { font-size: 48px; margin: 20px 0 14px; }
  .room h3 { font-size: 38px; }
  .room__art .px { image-rendering: auto; }
  .mapsec__foot { flex-direction: column; align-items: stretch; }
  .legend { gap: 10px 20px; }
  .cta--small { justify-content: flex-start; }
  .sitefoot { flex-direction: column; }
}

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

.msgline.is-flash { animation: flash .18s steps(1) 3; }
@keyframes flash { 50% { background: var(--ph); color: var(--bg); } }

/* automated full-page screenshots: fixed vignette/roll would leave a seam at the first fold */
.is-shot.crt::after, .is-shot .crt__roll { display: none; }
