:root {
  color-scheme: dark;
  --ink: #f4f1e8;
  --muted: #8b8d91;
  --panel: #111316;
  --line: #292c30;
  --green: #2aff84;
  --red: #ff453a;
  --yellow: #ffd60a;
  --blue: #3279ff;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: #08090b; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -15%, #22262b 0, #0d0f12 32rem, transparent 52rem),
    #08090b;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.viewer-shell { width: min(1080px, calc(100% - 36px)); margin: 0 auto; }

.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; }
.brand > span:last-child { display: grid; line-height: 1; }
.brand strong { font-size: 17px; letter-spacing: .09em; }
.brand small { margin-top: 6px; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .3em; }
.brand-mark { width: 43px; height: 38px; flex: 0 0 auto; overflow: visible; }
.brand-mark-ghost { fill: #00b8c8; fill-rule: evenodd; opacity: .7; }
.brand-mark-face { fill: #f2ead7; fill-rule: evenodd; }

.page-search label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.input-wrap { display: flex; padding: 3px; border: 1px solid #363a40; border-radius: 8px; background: #0a0b0d; }
.input-wrap:focus-within { border-color: #666d77; box-shadow: 0 0 0 3px rgb(255 255 255 / 5%); }
.input-wrap input { width: 110px; border: 0; outline: 0; padding: 9px 12px; color: white; background: transparent; font-variant-numeric: tabular-nums; }
.input-wrap button { border: 0; border-radius: 5px; padding: 0 16px; cursor: pointer; color: #050706; background: var(--green); font-size: 12px; font-weight: 900; text-transform: uppercase; }

.screen-section { padding: 58px 0 36px; }
.screen-meta { display: flex; align-items: flex-end; justify-content: space-between; margin: 0 auto 18px; max-width: 820px; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .22em; }
h1 { margin: 0; font-size: clamp(24px, 4vw, 40px); line-height: 1; letter-spacing: -.04em; }
.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.status span { width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 10px currentColor; }
.status.ready span { background: var(--green); }
.status.error span { background: var(--red); }

.television { max-width: 880px; margin: auto; }
.screen-bezel {
  position: relative;
  padding: clamp(12px, 2.4vw, 25px);
  border: 1px solid #393d42;
  border-radius: 17px;
  background: linear-gradient(145deg, #292d31, #111316 45%, #25282c);
  box-shadow: 0 28px 70px rgb(0 0 0 / 60%), inset 0 1px 1px rgb(255 255 255 / 12%);
}
.screen-bezel::before { content: ""; position: absolute; inset: 7px; border: 1px solid rgb(255 255 255 / 4%); border-radius: 11px; pointer-events: none; }
.screen {
  position: relative;
  overflow: hidden;
  aspect-ratio: 32 / 25;
  border-radius: 5px;
  background: #000;
  box-shadow: 0 0 0 2px #050505, inset 0 0 30px #000;
}
.screen::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, transparent 0, transparent 3px, rgb(0 0 0 / 13%) 4px);
  mix-blend-mode: multiply;
}
canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: default; }
canvas.is-link { cursor: pointer; }
.screen-message { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: #000; font-family: monospace; font-size: clamp(12px, 2vw, 20px); letter-spacing: .08em; }
.screen-message[hidden] { display: none; }
.screen-caption { display: flex; justify-content: space-between; padding: 12px 6px 0; color: #686c72; font-size: 8px; font-weight: 800; letter-spacing: .16em; }

.page-controls { max-width: 820px; margin: 26px auto 0; display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; }
.page-controls button { min-height: 64px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #101215; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.page-controls button:hover:not(:disabled) { border-color: #4c5158; background: #181b1f; transform: translateY(-1px); }
.page-controls button:disabled { cursor: not-allowed; opacity: .35; }
.nav-button { display: flex; align-items: center; gap: 14px; padding: 0 18px; text-align: left; }
.nav-button.next { justify-content: flex-end; text-align: right; }
.nav-button > span[aria-hidden] { color: var(--green); font-size: 21px; }
.page-controls small { display: block; margin-bottom: 5px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.page-controls strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.subpage-controls { min-width: 172px; display: grid; grid-template-columns: 44px 1fr 44px; align-items: stretch; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #101215; text-align: center; }
.subpage-controls button { min-height: auto; border: 0; border-radius: 0; color: var(--muted); font-size: 20px; }
.subpage-controls span { align-self: center; }

.fasttext { max-width: 820px; min-height: 49px; margin: 14px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.fasttext a { position: relative; overflow: hidden; padding: 14px 12px 11px; border-radius: 6px; color: #e8e8e8; background: #131518; font-size: 11px; font-weight: 800; text-align: center; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.fasttext a::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--fast-color); }
.fasttext a:nth-child(1) { --fast-color: var(--red); }
.fasttext a:nth-child(2) { --fast-color: var(--green); }
.fasttext a:nth-child(3) { --fast-color: var(--yellow); }
.fasttext a:nth-child(4) { --fast-color: var(--blue); }

footer { display: flex; justify-content: flex-end; gap: 24px; padding: 23px 0 35px; border-top: 1px solid var(--line); color: #676a6f; font-size: 11px; }
footer p { margin: 0; }
kbd { padding: 2px 5px; border: 1px solid #373a3f; border-bottom-width: 2px; border-radius: 4px; color: #a7a9ad; background: #121417; font-family: inherit; font-size: 9px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 680px) {
  .viewer-shell { width: min(100% - 22px, 600px); }
  .topbar { min-height: 94px; }
  .brand small { display: none; }
  .page-search label { display: none; }
  .input-wrap input { width: 82px; }
  .screen-section { padding-top: 34px; }
  .screen-caption { display: none; }
  .page-controls { grid-template-columns: 1fr 1fr; }
  .subpage-controls { grid-column: 1 / -1; grid-row: 2; min-height: 54px; }
  .nav-button { min-width: 0; padding: 0 12px; }
  .fasttext { grid-template-columns: repeat(2, 1fr); }
  footer { display: block; line-height: 1.7; }
  footer p + p { margin-top: 8px; }
}

@media (prefers-reduced-motion: no-preference) {
  .screen-bezel { animation: arrive .45s ease-out both; }
  @keyframes arrive { from { opacity: 0; transform: translateY(10px); } }
}
