/* Corpus Bird landing: "The Watchtower" x the CRT perch photos.
   One deliberate night look (dark only): the page is the desk at night, the demo is the monitor, the log is its phosphor.
   Palette from the Corpus icon (ink #1c2838, cream #f0e4cc, amber #e3a54c) plus the photo's own slate wall and beige bezel. */
:root {
  color-scheme: dark;
  --night: #111922;      /* page */
  --wall: #26342f;       /* the photo's wall, sampled */
  --panel: #172230;      /* console panes */
  --ink: #1c2838;
  --line: #2a3a4a;
  --cream: #f0e4cc;
  --muted: #9aa3a6;
  --amber: #e3a54c;
  --phosphor: #f4b860;
  --bezel: #dcd0b6;
  --bezel-2: #c3b598;
  --bezel-ink: #6f6450;

  /* the mock X page inside the monitor (X "dim") */
  --x-bg: #15202b; --x-text: #e7e9ea; --x-muted: #8b98a5; --x-line: #2a3742; --x-chrome: #0f1721; --x-url: #1c2838; --x-ghost: #1e2a36;
  --theme-bird: #e3a54c;

  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --crt: "VT323", "IBM Plex Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--night); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--cream); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, video { max-width: 100%; display: block; }
a { color: var(--phosphor); }
h1, h2, h3 { margin: 0; font-family: var(--mono); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; text-wrap: balance; }
code { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 3px; }
section { padding-inline: var(--gutter); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; border: 0; cursor: pointer; text-decoration: none;
  font: 600 15px/1 var(--mono); background: var(--amber); color: #18120a; padding: 12px 18px; border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255,210,140,.35) inset, 0 0 24px rgba(227,165,76,.18); transition: box-shadow .2s, transform .2s; }
.btn:hover { box-shadow: 0 0 0 1px rgba(255,210,140,.5) inset, 0 0 34px rgba(227,165,76,.4); transform: translateY(-1px); }
.btn svg { width: 18px; height: 18px; }
.btn-sm { font-size: 13px; padding: 10px 14px; }
.btn-lg { font-size: 16px; padding: 16px 24px; }
.btn-term { background: transparent; color: var(--cream); box-shadow: 0 0 0 1px var(--line) inset; font-weight: 500; }
.btn-term:hover { box-shadow: 0 0 0 1px var(--amber) inset; transform: none; }
.btn-term[aria-pressed="true"] { color: var(--phosphor); box-shadow: 0 0 0 1px var(--amber) inset; }
@media (prefers-reduced-motion: reduce) { .btn, .btn:hover { transition: none; transform: none; } }

/* Status bar */
.statusbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(17,25,34,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.sb-in { display: flex; align-items: center; gap: 18px; padding: 10px var(--gutter); max-width: 1320px; margin: 0 auto; }
.sb-brand { display: flex; align-items: center; gap: 10px; color: var(--cream); text-decoration: none; font: 600 15px/1 var(--mono); }
.sb-brand img { width: 26px; height: 26px; border-radius: 6px; }
.led { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); margin-right: 8px; vertical-align: 1px; animation: blink 2.4s steps(1, end) infinite; }
@keyframes blink { 0%, 86% { opacity: 1; } 90% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .led { animation: none; } }

/* Hero: text over the wall, the photo bleeds into the page */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: center; gap: 0;
  padding-block: 0; padding-inline: max(var(--gutter), calc((100% - 1320px) / 2)); min-height: min(86vh, 860px);
  background: radial-gradient(70% 90% at 75% 45%, var(--wall) 0%, #1d2a28 45%, var(--night) 100%); }
.hero-text { position: relative; z-index: 2; padding-block: 64px; max-width: 620px; }
.hero h1 { font-size: clamp(38px, 5.6vw, 72px); }
.lede { margin: 22px 0 0; font-size: clamp(17px, 1.6vw, 20px); color: #c9c3b2; max-width: 34em; }
.cta-row { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.cta-note { margin: 0; font: 13px var(--mono); color: var(--muted); }

.hero-photo { position: relative; margin: 0; align-self: stretch; display: flex; align-items: center; justify-content: center; transform-origin: 45% 72%; }
.hero-photo > img { width: min(100%, 560px); height: auto; aspect-ratio: 710 / 886;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 86%, transparent 100%), linear-gradient(180deg, transparent 0, #000 14%, #000 84%, transparent 100%);
  -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent 0, #000 22%, #000 86%, transparent 100%), linear-gradient(180deg, transparent 0, #000 14%, #000 84%, transparent 100%); mask-composite: intersect; }
.hero-photo.zooming { transition: transform .55s cubic-bezier(.6,0,.4,1), opacity .55s; transform: scale(2.6); opacity: 0; }
.callouts { position: absolute; inset: 0; margin: auto; width: min(100%, 560px); aspect-ratio: 710 / 886; pointer-events: none; }
.co { position: absolute; font: 12px var(--mono); color: var(--phosphor); white-space: nowrap; display: flex; align-items: center; gap: 8px; text-shadow: 0 0 8px rgba(0,0,0,.6); }
.co i { display: block; height: 1px; background: var(--amber); opacity: .8; }
.co-bird { left: 63%; top: 30%; } .co-bird i { width: 28px; order: -1; }
.co-next { left: 6%; top: 12%; color: var(--muted); } .co-next b { color: var(--phosphor); font-weight: 500; font-variant-numeric: tabular-nums; }
.co-next i { width: 10px; height: 10px; border-radius: 50%; background: none; border: 1px solid var(--amber); opacity: 1; }

.screen-hit { all: unset; position: absolute; cursor: pointer; border-radius: 10px;
  left: 50%; top: 50%; width: calc(min(100%, 560px) * .41); height: calc(min(100%, 560px) * 1.248 * .31);
  transform: translate(calc(-50% - min(100%, 560px) * .045), calc(-50% + min(100%, 560px) * 1.248 * .225));
  display: grid; place-items: center; }
.screen-hit .play { display: inline-flex; align-items: center; gap: 8px; font: 26px/1 var(--crt); color: var(--phosphor); padding: 8px 14px; border-radius: 4px;
  background: rgba(10,10,6,.72); box-shadow: 0 0 0 1px rgba(244,184,96,.5), 0 0 26px rgba(244,184,96,.35); text-shadow: 0 0 10px rgba(244,184,96,.8); transition: box-shadow .2s, transform .2s; }
.screen-hit .play svg { width: 18px; height: 18px; filter: drop-shadow(0 0 6px rgba(244,184,96,.8)); }
.screen-hit:hover .play, .screen-hit:focus-visible .play { box-shadow: 0 0 0 1px var(--phosphor), 0 0 40px rgba(244,184,96,.6); transform: scale(1.04); }
.screen-hit:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .screen-hit .play { transition: none; } }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; min-height: 0; background: radial-gradient(120% 60% at 50% 30%, var(--wall) 0%, #1d2a28 50%, var(--night) 100%); }
  .hero-photo { order: -1; margin-top: 8px; }
  .hero-photo > img { width: min(100%, 460px); }
  .callouts { width: min(100%, 460px); }
  .screen-hit { width: calc(min(100%, 460px) * .41); height: calc(min(100%, 460px) * 1.248 * .31);
    transform: translate(calc(-50% - min(100%, 460px) * .045), calc(-50% + min(100%, 460px) * 1.248 * .225)); }
  .hero-text { padding-block: 8px 48px; margin-top: -36px; }
}

/* Video layer: the screen you clicked into */
.video-layer { position: fixed; inset: 0; z-index: 50; background: rgba(6,9,12,.9); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(16px, env(safe-area-inset-bottom, 0px)); }
.video-box { position: relative; width: min(1040px, 100%); background: linear-gradient(var(--bezel), var(--bezel-2)); padding: clamp(10px, 2vw, 22px) clamp(10px, 2vw, 22px) clamp(28px, 4vw, 44px); border-radius: clamp(10px, 2vw, 22px); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop .3s ease-out; }
.video-box video { width: 100%; height: auto; aspect-ratio: 1440 / 900; border-radius: 10px; background: #000; box-shadow: inset 0 0 30px rgba(0,0,0,.8); }
.video-close { all: unset; position: absolute; top: -48px; right: 0; width: 44px; height: 44px; display: grid; place-items: center; font: 28px/1 var(--mono); color: var(--cream); cursor: pointer; border-radius: 4px; }
.video-close:focus-visible { outline: 2px solid var(--phosphor); }
.video-cap { position: absolute; left: 0; right: 0; bottom: 6px; margin: 0; text-align: center; font: 12px var(--mono); color: var(--bezel-ink); padding: 0 12px; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@media (prefers-reduced-motion: reduce) { .video-box { animation: none; } }

/* Section heads */
.sec-head { max-width: 1240px; margin: 0 auto 28px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; }
.sec-head h2 { font-size: clamp(24px, 3vw, 34px); }
.sec-head p { margin: 0; color: var(--muted); font-size: 15px; max-width: 46ch; }
.hash { color: var(--amber); margin-right: 6px; }

/* Demo rig */
.demo { padding-block: clamp(56px, 8vw, 104px) clamp(48px, 7vw, 88px); border-top: 1px solid var(--line); }
.rig { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 980px) { .rig { grid-template-columns: 1fr; } }

.monitor { position: relative; padding-top: 30px; } /* room above the bezel for the perched bird */
.bezel { position: relative; background: linear-gradient(170deg, var(--bezel) 0%, #d2c5a9 60%, var(--bezel-2) 100%); border-radius: 20px; padding: 18px 18px 0;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.12), 0 30px 60px rgba(0,0,0,.45), 0 0 80px rgba(227,165,76,.08); }
.screen { position: relative; border-radius: 12px; overflow: hidden; background: var(--x-bg); box-shadow: 0 0 0 3px #a99b7e, inset 0 0 40px rgba(0,0,0,.6); }
.screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px), radial-gradient(120% 100% at 50% 50%, transparent 60%, rgba(0,0,0,.35) 100%); }
.bezel-foot { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 6px; }
.badge { font: 600 11px/1 var(--mono); letter-spacing: .18em; color: var(--bezel-ink); }
.knobs { display: flex; gap: 10px; align-items: center; }
.knobs i { width: 14px; height: 6px; border-radius: 2px; background: #b4a68a; box-shadow: inset 0 1px 1px rgba(0,0,0,.2); }
.knobs .pwr { width: 8px; height: 8px; border-radius: 50%; background: #e3a54c; box-shadow: 0 0 6px #e3a54c; }
.knobs .pwr.off { background: #7b7363; box-shadow: none; }

.chrome-bar { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--x-chrome); }
.url { flex: 1; min-width: 0; background: var(--x-url); color: var(--x-muted); font: 12px var(--mono); border-radius: 999px; padding: 6px 12px; }
.toolbar-bird { all: unset; position: relative; display: grid; place-items: center; width: 44px; height: 32px; border-radius: 6px; cursor: pointer; }
.toolbar-bird:hover { background: rgba(255,255,255,.08); }
.toolbar-bird:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 1px; }
.tb-icon { width: 20px; height: 15px; display: block; color: var(--bird, var(--theme-bird)); transition: color .3s; }
.tb-icon svg { width: 100%; height: 100%; display: block; overflow: visible; }
.tb-icon .fr { display: none; } .tb-icon .perched { display: inline; }
.toolbar-bird[aria-pressed="false"] .tb-icon { color: #7d858d; }
.tb-tip { position: absolute; top: calc(100% + 4px); right: 0; font: 11px var(--mono); background: var(--cream); color: var(--ink); padding: 2px 6px; border-radius: 3px; opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5; }
.toolbar-bird:hover .tb-tip, .toolbar-bird:focus-visible .tb-tip { opacity: 1; }

.x { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 500px; color: var(--x-text); background: var(--x-bg); }
.x-col { border-right: 1px solid var(--x-line); min-width: 0; }
.x-tabs { display: flex; height: 44px; border-bottom: 1px solid var(--x-line); font: 600 14px var(--sans); }
.x-tabs span { flex: 1; display: grid; place-items: center; color: var(--x-muted); }
.x-tabs .on { color: var(--x-text); box-shadow: inset 0 -3px 0 #1d9bf0; }
.x-side { padding: 16px; display: grid; gap: 12px; align-content: start; }
.ghost { height: 120px; border-radius: 14px; background: var(--x-ghost); } .ghost.short { height: 70px; }
.x.narrow { grid-template-columns: 1fr; min-height: 0; }
.x.narrow .x-side { display: none; }
.x.narrow .x-col { border-right: 0; }

.post { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--x-line); position: relative; font-family: var(--sans); transition: background .4s; }
.post.reading { background: rgba(227,165,76,.09); }
.post.target { background: rgba(227,165,76,.06); }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font: 600 15px/1 var(--sans); color: #fff; }
.p-head { display: flex; align-items: baseline; gap: 6px; font-size: 14px; min-width: 0; }
.p-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-handle { color: var(--x-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.p-text { margin: 3px 0 0; font-size: 14.5px; line-height: 1.42; }
.p-meta { display: flex; gap: 28px; margin-top: 8px; color: var(--x-muted); font-size: 12px; }
.score { margin-left: auto; flex: none; font: 18px/1 var(--crt); padding: 2px 7px; border-radius: 3px; border: 1px solid var(--x-line); color: var(--x-muted);
  opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s, background .25s, color .25s; font-variant-numeric: tabular-nums; }
.score.shown { opacity: 1; transform: none; }
.score.flag { background: var(--bird, var(--theme-bird)); border-color: transparent; color: #18120a; }
@media (prefers-reduced-motion: reduce) { .post, .score { transition: none; } }

/* The bird (geometry and flap timing from extension/src/content/bird-ui.ts) */
.bird { position: absolute; left: 0; top: 0; width: 30px; height: 22.5px; color: var(--bird, var(--theme-bird)); will-change: transform; z-index: 4; transition: opacity .25s; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.bird svg { display: block; width: 100%; height: 100%; overflow: visible; }
.bird .fr, .lg-art .fr { display: none; }
.bird:not(.flying) .perched { display: inline; }
.bird.flying .up { display: inline; animation: flap-a 220ms steps(1, end) infinite; }
.bird.flying .down { display: inline; animation: flap-b 220ms steps(1, end) infinite; }
.bird.face-left svg { transform: scaleX(-1); }
.bird.off { opacity: 0; }
@keyframes flap-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes flap-b { 0% { opacity: 0; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .bird.flying .up { animation: none; opacity: 1; } .bird.flying .down { display: none; } }
.trail { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
.trail path { fill: none; stroke: var(--bird, var(--theme-bird)); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .9; transition: opacity 1s; }
.trail path.fade { opacity: 0; }

/* The note card (styling from extension/src/content/bird-ui.ts) */
.note { position: absolute; left: 0; top: 0; width: 280px; z-index: 3; background: #171b1f; color: #e6e4de; border: 1px solid #323940; border-left: 3px solid var(--bird, var(--theme-bird));
  border-radius: 6px; padding: 8px 10px; box-shadow: 0 4px 18px rgba(0,0,0,.4); font: 13px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.note.pop { animation: pop .28s ease-out; }
@media (prefers-reduced-motion: reduce) { .note.pop { animation: none; } }
.note .top { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #a2a8ad; }
.note .tag { border: 1px solid var(--bird, var(--theme-bird)); color: var(--bird, var(--theme-bird)); border-radius: 3px; padding: 0 4px; font-size: 10px; font-weight: 600; line-height: 14px; }
.note .who { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note .close { all: unset; cursor: pointer; padding: 0 6px; font-size: 16px; line-height: 16px; color: #a2a8ad; border-radius: 4px; min-width: 24px; min-height: 24px; display: grid; place-items: center; }
.note .close:focus-visible { outline: 2px solid #8fb4e8; outline-offset: 2px; }
.note p { margin: 4px 0 0; }
.note .angle b { font-weight: 600; color: #a2a8ad; }
.note .open { display: inline-block; margin-top: 6px; font-size: 12px; color: #8fb4e8; text-decoration: underline; }

/* Console: log + controls */
.console { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 980px) and (min-width: 640px) { .console { grid-template-columns: 1fr 1fr; align-items: start; } }
.log-wrap, .controls, .term { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; min-width: 0; }
.pane-title { display: flex; justify-content: space-between; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--line); font: 12px var(--mono); color: var(--muted); }
.pane-title .tail { color: #5f6c78; }
.log { list-style: none; margin: 0; padding: 12px 14px; height: 248px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px;
  font: 19px/1.15 var(--crt); color: #c9b48a; text-shadow: 0 0 6px rgba(244,184,96,.25); }
.log li { white-space: pre-wrap; overflow-wrap: anywhere; }
.log .t { color: #6f7a74; margin-right: 8px; }
.log .k { display: inline-block; min-width: 5ch; color: #8f9a8f; }
.log .hot { color: var(--phosphor); text-shadow: 0 0 8px rgba(244,184,96,.6); }
.log .idle { color: #7f8a90; }
.log li:last-child::after { content: "▌"; color: var(--phosphor); margin-left: 4px; animation: blink 1s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) { .log li:last-child::after { animation: none; } }

.controls { padding-bottom: 16px; }
.controls > :not(.pane-title) { margin-inline: 14px; }
.field { border: 0; padding: 0; margin-top: 16px; min-width: 0; }
.field legend, .field label { font: 13px/1.4 var(--mono); color: var(--cream); padding: 0; margin-bottom: 8px; }
.flag { color: var(--phosphor); margin-right: 6px; }
.row-between { display: flex; justify-content: space-between; align-items: baseline; }
.row-between label { margin-bottom: 0; }
output { font: 22px/1 var(--crt); color: var(--phosphor); }
.chips { display: grid; gap: 6px; }
.chip { all: unset; cursor: pointer; display: block; min-height: 44px; box-sizing: border-box; font: 14px/1.35 var(--sans); padding: 11px 12px; border-radius: 4px; border: 1px solid var(--line); color: #d6cfbd; }
.chip:hover { border-color: #4a5d70; }
.chip[aria-checked="true"] { border-color: var(--amber); color: var(--cream); background: rgba(227,165,76,.08); }
.chip[aria-checked="true"]::before { content: "> "; color: var(--phosphor); font-family: var(--mono); }
.chip:focus-visible { outline: 2px solid var(--phosphor); outline-offset: 2px; }
input[type="range"] { width: 100%; accent-color: var(--amber); margin: 10px 0 0; min-height: 28px; }
.swatches { display: flex; flex-wrap: wrap; margin: -6px; }
.swatch { all: unset; cursor: pointer; width: 30px; height: 30px; margin: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); position: relative; }
.swatch[aria-checked="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--cream); }
.swatch:focus-visible { outline: 2px solid var(--cream); outline-offset: 5px; }
.panel-actions { display: flex; gap: 10px; margin-top: 18px; }
.panel-actions .btn { flex: 1; }
.soon { margin: 16px 14px 0; font: 13px/1.5 var(--mono); color: #b4ad9b; }
.soon .c { color: #6f7a74; }
.fineprint { max-width: 1240px; margin: 14px auto 0; font: 12px var(--mono); color: #6f7a80; }

/* Story */
.story { max-width: 1240px; margin: 0 auto; padding-block: clamp(56px, 8vw, 104px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: center; border-top: 1px solid var(--line); }
@media (max-width: 820px) { .story { grid-template-columns: 1fr; } }
.story-photo { margin: 0; }
.story-photo img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; filter: saturate(.9); }
.story-text h2 { font-size: clamp(26px, 3.2vw, 38px); }
.story-text p { margin: 18px 0 0; color: #c9c3b2; font-size: clamp(17px, 1.6vw, 19px); max-width: 36em; }

/* Legend */
.legend { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.legend-list { list-style: none; margin: 0 auto; padding: 0; max-width: 1240px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
@media (max-width: 980px) { .legend-list { grid-template-columns: 1fr; } }
.legend-list li { display: grid; grid-template-rows: auto auto 1fr; gap: 6px; padding: 18px; border-right: 1px solid var(--line); font-size: 15px; }
.legend-list li:last-child { border-right: 0; }
@media (max-width: 980px) {
  .legend-list li { grid-template-columns: 64px 64px minmax(0, 1fr); grid-template-rows: auto; align-items: center; gap: 12px; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .legend-list li:last-child { border-bottom: 0; }
}
.legend-list code { font: 22px/1 var(--crt); color: var(--phosphor); }
.legend-list li > span:last-child { color: var(--muted); }
.lg-art { height: 64px; border-radius: 6px; background: #0f1620; display: grid; place-items: center; position: relative; overflow: hidden; color: var(--bird, var(--theme-bird)); margin-bottom: 6px; }
@media (max-width: 980px) { .lg-art { height: 52px; margin: 0; } }
.lg-art svg { width: 30px; height: 22.5px; overflow: visible; }
.lg-art .perched { display: inline; }
.lg-art[data-legend="off"] { color: #7d858d; }
.lg-art[data-legend="off"] svg, .lg-art[data-legend="on"] svg { width: 22px; height: 16.5px; }
.lg-art .tb { display: grid; place-items: center; width: 40px; height: 32px; border-radius: 6px; background: var(--x-chrome); box-shadow: 0 0 0 1px var(--line); }
.lg-art[data-legend="fly"] .perched { display: none; }
.lg-art[data-legend="fly"] .up { display: inline; animation: flap-a 220ms steps(1, end) infinite; }
.lg-art[data-legend="fly"] .down { display: inline; animation: flap-b 220ms steps(1, end) infinite; }
.lg-art[data-legend="fly"] svg { animation: hover 1.6s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translate(-12px, 4px); } to { transform: translate(12px, -4px); } }
@media (prefers-reduced-motion: reduce) {
  .lg-art[data-legend="fly"] .up { animation: none; opacity: 1; } .lg-art[data-legend="fly"] .down { display: none; }
  .lg-art[data-legend="fly"] svg { animation: none; }
}
.lg-art .mini-note { position: absolute; left: 50%; top: 26px; transform: translateX(-38%); width: 80px; height: 28px; border-radius: 3px; background: #171b1f; border-left: 3px solid var(--bird, var(--theme-bird)); box-shadow: 0 0 0 1px #323940; }
.lg-art .mini-note::before, .lg-art .mini-note::after { content: ""; position: absolute; left: 8px; height: 3px; border-radius: 2px; background: #5a6168; }
.lg-art .mini-note::before { top: 8px; width: 52px; } .lg-art .mini-note::after { top: 16px; width: 36px; }
.lg-art[data-legend="note"] svg { position: absolute; left: calc(50% - 34px); top: 8px; width: 22px; height: 16.5px; }
.lg-art .mini-pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px; border-radius: 999px; background: #171b1f; box-shadow: 0 0 0 1px #323940, 0 2px 0 var(--bird, var(--theme-bird)); font: 600 13px/1 var(--mono); color: var(--cream); }
.lg-art .mini-pill b { color: var(--bird, var(--theme-bird)); font-weight: 600; }
.lg-art .zz { position: absolute; right: calc(50% - 30px); top: 12px; font: 18px/1 var(--crt); color: var(--muted); }

/* Setup */
.setup { max-width: 1240px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(28px, 6vw, 80px); align-items: center; padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
@media (max-width: 820px) { .setup { grid-template-columns: 1fr; } }
.setup .sec-head { margin: 0; }
.steps { list-style: none; counter-reset: s; padding: 0; margin: 26px 0 32px; display: grid; gap: 16px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; align-items: baseline; color: var(--muted); }
.steps li::before { content: "0" counter(s); font: 600 14px/1 var(--mono); color: var(--phosphor); }
.steps p { margin: 0; font: 16px/1.55 var(--sans); max-width: 46ch; }
.steps b { color: var(--cream); font-weight: 600; }
.popup-shot { margin: 0; }
.mini-bezel { background: linear-gradient(170deg, var(--bezel), var(--bezel-2)); padding: 12px; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.mini-bezel img { width: 100%; height: 460px; object-fit: cover; object-position: top; border-radius: 6px; }
.popup-shot figcaption { font: 12px var(--mono); color: #6f7a80; margin-top: 10px; text-align: center; }

/* Never */
.never { padding-block: clamp(56px, 8vw, 104px); border-top: 1px solid var(--line); }
.term { max-width: 1240px; margin: 0 auto; }
.never-list { margin: 0; padding: 8px 0; }
.never-list > div { display: grid; grid-template-columns: minmax(0, 300px) 120px minmax(0, 1fr); gap: 4px 24px; align-items: baseline; padding: 12px 16px; border-bottom: 1px dashed var(--line); }
.never-list > div:last-child { border-bottom: 0; }
.never-list dt { font: 14px var(--mono); color: var(--cream); }
.never-list dd { margin: 0; font: 22px/1 var(--crt); color: var(--phosphor); }
.never-list p { margin: 0; color: var(--muted); font-size: 15px; }
@media (max-width: 720px) { .never-list > div { grid-template-columns: minmax(0, 1fr) auto; } .never-list p { grid-column: 1 / -1; } }

/* Final */
.final { position: relative; overflow: hidden; border-top: 1px solid var(--line); padding-inline: 0; }
.final-photo { width: 100%; height: clamp(320px, 42vw, 520px); object-fit: cover; object-position: 30% 50%; opacity: .75; }
.final::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17,25,34,.15) 0%, rgba(17,25,34,.55) 45%, rgba(17,25,34,.92) 70%); pointer-events: none; }
.final-in { position: absolute; z-index: 2; right: var(--gutter); top: 50%; transform: translateY(-50%); width: min(520px, calc(100% - 2 * var(--gutter))); display: grid; gap: 24px; justify-items: start; }
.final h2 { font-size: clamp(28px, 4vw, 48px); }
@media (max-width: 640px) {
  .final-photo { height: 260px; opacity: .9; }
  .final::after { background: linear-gradient(180deg, transparent 30%, rgba(17,25,34,.6) 55%, var(--night) 62%); }
  .final-in { position: relative; transform: none; top: auto; right: auto; margin: -30px var(--gutter) 56px; width: auto; }
}

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 24px var(--gutter) calc(32px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); font: 13px var(--mono); color: #6f7a80; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--cream); color: var(--ink); padding: 12px 18px; border-radius: 4px; font: 14px var(--mono); box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 60; width: max-content; max-width: calc(100% - 32px); }

/* Phones */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .btn-lg { width: 100%; }
  .final .btn-lg { width: auto; }
  .bezel { padding: 10px 10px 0; border-radius: 14px; }
  .bezel-foot { height: 28px; }
  .monitor { padding-top: 26px; }
  .post { padding: 12px; grid-template-columns: 34px minmax(0, 1fr); }
  .avatar { width: 34px; height: 34px; }
  .p-meta { gap: 18px; }
  .log { height: 168px; font-size: 18px; }
  .mini-bezel img { height: 380px; }
}
.screen-hit .play { white-space: nowrap; }
@media (max-width: 560px) {
  .co-bird { left: auto; right: 3%; top: 22%; }
  .co-bird i { display: none; }
  .screen-hit .play { font-size: 20px; padding: 6px 10px; }
}

/* Status-bar perch and the bird that visits the cursor */
.sb-perch { flex: 1; min-width: 0; height: 22px; position: relative; }
.cursor-bird { position: absolute; left: 0; top: 0; width: 24px; height: 18px; z-index: 30; pointer-events: none; color: var(--bird, var(--theme-bird)); will-change: transform; filter: drop-shadow(0 2px 3px rgba(0,0,0,.5)); }
.cursor-bird svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cursor-bird .fr { display: none; }
.cursor-bird:not(.flying) .perched { display: inline; }
.cursor-bird.flying .up { display: inline; animation: flap-a 220ms steps(1, end) infinite; }
.cursor-bird.flying .down { display: inline; animation: flap-b 220ms steps(1, end) infinite; }
.cursor-bird.face-left svg { transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .cursor-bird.flying .up { animation: none; opacity: 1; } .cursor-bird.flying .down { display: none; } }

/* Privacy page: a plain document in the same tokens */
.doc { padding: clamp(40px, 7vw, 88px) var(--gutter) clamp(56px, 8vw, 104px); }
.doc-in { max-width: 720px; margin: 0 auto; }
.doc h1 { font-size: clamp(32px, 5vw, 48px); }
.doc h2 { font-size: clamp(19px, 2.2vw, 24px); margin: 44px 0 14px; padding-top: 22px; border-top: 1px dashed var(--line); }
.doc p, .doc li { color: #d7cfba; max-width: 66ch; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 14px; padding-left: 1.2em; display: grid; gap: 8px; }
.doc li::marker { color: var(--amber); }
.doc strong { color: var(--cream); font-weight: 600; }
.doc code { font-size: .9em; color: var(--phosphor); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
.doc-meta { margin: 14px 0 28px; font: 13px var(--mono); color: var(--muted) !important; }
.todo { background: var(--amber); color: #18120a; font: 600 .92em var(--mono); padding: 2px 6px; border-radius: 3px; }

/* QA (Unit 11) fixes: 44 px hit areas and AA contrast on small text */
.swatches { margin: -2px; }
.swatch { width: 44px; height: 44px; margin: 0; padding: 7px; box-sizing: border-box; background: var(--sw) content-box; box-shadow: none; }
.swatch::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.swatch[aria-checked="true"]::after { inset: 2px; }
.toolbar-bird { height: 44px; }
input[type="range"] { min-height: 44px; }
.note .close { min-width: 44px; min-height: 44px; margin: -14px -12px -14px 0; }
.foot a { display: inline-block; padding-block: 13px; margin-block: -13px; }
.pane-title .tail { color: #8b96a0; }
.log .t, .soon .c { color: #8e9890; }
.fineprint, .foot, .popup-shot figcaption { color: #8f9aa0; }
