:root {
  --black: #121315;
  --accent-rgb: 255, 118, 102;
  --accent: rgb(var(--accent-rgb));
  --accent-soft: rgba(var(--accent-rgb), .5);
  --accent-line: rgba(var(--accent-rgb), .85);
  --white: #dedede;
  --muted: #999999;
  --mono-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --mono: 12px/1.5 var(--mono-family);
  --interface-font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { background: var(--black); color: var(--white); font-family: var(--mono-family); font-size: 16px; }
h1, h2, h3, h4, h5, h6, p { font-family: var(--interface-font); }
button, input { font: inherit; }
button { cursor: pointer; }
/* Shared, solid violet terminal action. Hover intentionally does not restyle it. */
.terminal-button { border: 0; background: #4a2aa8; color: var(--white); font: 800 12px var(--mono-family); letter-spacing: .05em; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 16px; color: var(--white); background: var(--black); padding: 12px; border: 1px solid var(--accent); }
.skip-link:focus { top: 16px; }
.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; }

.world { height: 100dvh; min-height: 440px; width: 100%; overflow: hidden; isolation: isolate; position: relative; background: var(--black); }
.world::after { content: ''; pointer-events: none; position: absolute; inset: 0; z-index: 10; opacity: .19; background: repeating-linear-gradient(to bottom, transparent 0px, transparent 3px, rgba(var(--accent-rgb),.17) 4px); }
/* The permanent title and prompt are siblings of this swappable experience area. */
slashcheer-experience-host, .experience-surface { position: absolute; inset: 0; display: block; }
#network-canvas { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
#network-canvas.dragging { cursor: grabbing; }

/* The first memory */
.introduction { position: absolute; z-index: 30; inset: 0; background: var(--black); display: flex; align-items: center; justify-content: center; overflow: hidden; transition: opacity .8s ease, visibility .8s ease; }
.introduction.finished { opacity: 0; visibility: hidden; pointer-events: none; }
.cheer { position: absolute; font: 500 clamp(35px,5.8vw,85px)/1.2 var(--interface-font); letter-spacing: -.105em; color: #ffffff; opacity: 0; transform: scale(.94); text-shadow: 0 0 30px rgba(255,255,255,.16); transition: opacity .85s ease, transform .9s ease; white-space: nowrap; }
.cheer.visible { opacity: 1; transform: scale(1); }
.cheer.leave { opacity: 0; transform: scale(1.03); }
.cheer .cheer-wink { display: none; }
.cheer.wink .cheer-open { display: none; }
.cheer.wink .cheer-wink { display: inline; }
.boot { opacity: 0; pointer-events: none; position: absolute; inset: 17% 7% auto; max-width: 850px; min-height: 340px; color: var(--accent); font: 500 clamp(14px,1.55vw,20px)/1.65 var(--mono-family); transition: opacity .35s; }
.boot.visible { opacity: 1; }
.boot-history { opacity: .8; white-space: pre-wrap; }
.boot-history p { margin: 0 0 4px; font-family: var(--mono-family); }
.boot-line { display: flex; align-items: baseline; gap: 0; white-space: pre-wrap; min-height: 1.5em; }
.prompt-character { color: var(--accent); font-weight: 900; margin-right: 12px; }
.boot-online.flicker-off { visibility: hidden; }
/* A final blinking cursor remains, aligned with the text but without a lonely >. */
.boot.boot-complete > .boot-line > .prompt-character { visibility: hidden; }
.block-cursor { display: inline-block; position: relative; top: .12em; background: var(--accent); width: .62em; height: .86em; animation: blink 1s steps(1,end) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.skip-intro { position: absolute; z-index: 2; right: 5%; bottom: 7%; padding: 10px 13px; }

/* The persistent world UI */
.hud-header, .command-form { opacity: 0; transition: opacity 1.7s ease; pointer-events: none; }
.world.ready .hud-header, .world.ready .command-form { opacity: 1; pointer-events: auto; }
.hud-header { position: absolute; z-index: 12; top: 0; left: 0; right: 0; min-height: 86px; padding: 23px clamp(20px,4vw,64px); display: flex; align-items: flex-start; justify-content: space-between; gap: 25px; font-family: var(--interface-font); background: linear-gradient(to bottom, rgba(18,19,21,.93) 0%,transparent 100%); }
.identity { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 13px; min-width: 0; }
.identity-heading { display: inline-flex; align-items: baseline; flex-wrap: nowrap; gap: 13px; min-width: 0; white-space: nowrap; }
.identity-name { color: var(--white); font: 700 16px/1.55 var(--interface-font); letter-spacing: -.01em; }
.identity-meta { display: inline-flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; font: var(--mono); letter-spacing: .07em; }
.identity-experiment { color: var(--accent); font: var(--mono); letter-spacing: .07em; white-space: nowrap; }
.identity-mode { color: var(--accent); white-space: nowrap; }
.identity-utility { color: #808080; white-space: nowrap; }
.header-controls { display: flex; align-items: flex-start; flex: 0 0 auto; gap: 8px; }
.header-mascot { display: block; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }

.mobile-signal-rail { display: none; }

/* The canvas-drawn signals are not DOM controls. The existing native signal
   buttons also provide a keyboard route on desktop, revealed on focus only. */
@media (min-width: 761px) {
  .mobile-signal-rail { position: absolute; z-index: 22; top: 76px; right: clamp(20px,4vw,64px); display: flex; flex-direction: column; gap: 4px; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); visibility: hidden; }
  .world.ready .mobile-signal-rail { visibility: visible; }
  .mobile-signal-rail:focus-within { width: auto; height: auto; overflow: visible; clip-path: none; background: rgba(7,4,9,.95); border: 1px solid var(--accent); padding: 12px; }
  .world.ready.canvas-unavailable .mobile-signal-rail { width: auto; height: auto; overflow: visible; clip-path: none; background: rgba(7,4,9,.95); border: 1px solid var(--accent); padding: 12px; }
  .mobile-signal-rail button { display: flex; align-items: center; gap: 10px; min-width: 128px; padding: 9px 12px; border: 0; background: transparent; color: var(--white); font: 800 14px/1.4 var(--mono-family); text-align: left; }
  .mobile-signal-rail .rail-mark { display: none; }
}

/* No layout box or containing block: the authored native form keeps its exact positioning. */
slashcheer-prompt { display: contents; }
.command-form { position: absolute; z-index: 21; left: clamp(20px,4vw,64px); right: clamp(20px,4vw,64px); bottom: 45px; height: 52px; border: 1px solid transparent; display: flex; align-items: center; gap: 13px; padding: 0 12px 0 18px; background: rgba(0,0,0,.1); -webkit-backdrop-filter: blur(46px); backdrop-filter: blur(46px); transition: opacity 1.7s ease, border-color .35s ease, box-shadow .35s ease; }
.command-form:focus-within { border-color: var(--accent); box-shadow: 0 0 18px rgba(var(--accent-rgb),.16); }
.input-label { color: var(--accent); font-size: 14px; font-weight: 800; white-space: nowrap; }
.command-form input { flex: 1; min-width: 0; font-size: 14px; color: var(--white); outline: none; border: 0; background: transparent; padding: 12px 0; caret-color: var(--accent); caret-shape: block; }
.command-form input::placeholder { color: transparent; transition: color .2s ease; }
.command-form input:focus::placeholder { color: #aaaaaa; }
.input-enter { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px; height: 30px; padding: 0 14px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .2s ease, visibility .2s ease; }
.return-icon { font-size: 19px; line-height: 1; transform: translateY(-2px); }
.command-form:focus-within .input-enter { opacity: 1; visibility: visible; pointer-events: auto; }
.input-help { position: absolute; z-index: 11; bottom: 16px; left: clamp(20px,4vw,64px); margin: 0; font: var(--mono); color: #aaaaaa; letter-spacing: .03em; }
.command-feedback { position: absolute; z-index: 23; left: clamp(20px,4vw,64px); right: clamp(20px,4vw,64px); bottom: 108px; max-height: 35vh; overflow-y: auto; padding: 12px 14px; margin: 0; border: 1px solid var(--accent); background: rgba(7,4,9,.96); box-shadow: 0 0 24px rgba(var(--accent-rgb),.12); color: var(--white); font: var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.command-feedback[hidden] { display: none; }
.command-feedback:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* A quiet hint that the constellation is a scrollable journey, not a zoom map. */
.scroll-cue { position: absolute; z-index: 11; right: clamp(20px,4vw,64px); top: 50%; transform: translateY(-50%); width: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; opacity: 0; pointer-events: auto; transition: opacity 1.5s ease; }
.world.ready .scroll-cue { opacity: 1; }
.scroll-cue-arrow { color: #fff; font: 800 18px/1 var(--mono-family); }
/* The upward direction appears only after the journey leaves its starting point. */
.scroll-cue-arrow:first-child { opacity: 0; transition: opacity .3s ease; }
.world.journey-active .scroll-cue-arrow:first-child { opacity: 1; }
.scroll-cue-mouse { position: relative; display: block; width: 25px; height: 38px; border: 2px solid #fff; border-radius: 14px; }
.scroll-cue-mouse::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 11px; background: #fff; transform: translateX(-50%); }
.scroll-cue-wheel { position: absolute; top: 8px; left: 50%; width: 3px; height: 8px; border-radius: 2px; background: #fff; transform: translateX(-50%); animation: scroll-cue-wheel 2s ease-in-out infinite; }
@keyframes scroll-cue-wheel { 0%, 100% { top: 8px; opacity: 1; } 50% { top: 13px; opacity: .4; } }
.world.ambient-paused .scroll-cue-wheel { animation-play-state: paused; }

/* The host and its authored content remain light DOM; frame chrome is shadow-owned. */
.detail-panel { position: absolute; z-index: 18; right: clamp(25px,6vw,110px); top: 19%; width: min(430px, calc(100vw - 40px)); background: rgba(7,4,9,.95); border: 1px solid var(--accent); box-shadow: 13px 13px 0 rgba(var(--accent-rgb),.21); }
.panel-id { font: var(--mono); color: var(--accent); letter-spacing: .16em; margin: 0 0 17px; }
.panel-content h1 { font: 800 clamp(29px,3vw,39px)/1.1 var(--interface-font); letter-spacing: -.04em; margin: 0 0 21px; color: var(--white); }
/* A corner illustration, independent of the heading's line height and flow. */
.about-mascot { position: absolute; top: clamp(52px,6vw,78px); right: clamp(24px,6vw,80px); width: clamp(88px,12vw,132px); height: auto; pointer-events: none; }
.about-mascot[hidden] { display: none; }
.panel-content > p:not(.panel-id) { font-size: 15px; line-height: 1.7; margin-bottom: 23px; color: #bebebe; }
.panel-link { display: inline-flex; align-items: center; color: var(--white); text-decoration: none; border: 1px solid var(--accent); padding: 11px 13px; font: 800 14px var(--mono-family); }
.panel-link:hover { background: var(--accent); color: var(--black); }
.panel-tag { font: var(--mono); color: var(--muted); letter-spacing: .04em; }
.signal-bars { display: inline-flex; font-family: var(--mono-family); white-space: nowrap; }
.signal-bar { display: inline-block; }
.signal-bar.flashing { animation: signal-bar-five-flashes 140ms steps(1,end) 5; }
@keyframes signal-bar-five-flashes { 0%, 49% { color: #ffffff; opacity: 1; } 50%, 100% { color: #ffffff; opacity: 0; } }

/* Every signal unfolds from its title bar to fill the space between HUD and prompt. */
.detail-panel.signal-window { left: clamp(20px,4vw,64px); right: clamp(20px,4vw,64px); top: var(--panel-top); width: auto; height: var(--panel-height); max-height: none; display: flex; flex-direction: column; overflow: hidden; }
/* Keep the shadow-owned scrollbar full-width while centering the slotted reading area. */
.signal-window .panel-content { position: relative; width: 100%; max-width: var(--panel-content-width, 100%); margin-inline: auto; }
.signal-window .panel-content h1 { font-size: clamp(32px,5vw,64px); max-width: 18ch; }
.signal-window .panel-content > p:not(.panel-id) { max-width: 65ch; font-size: 16px; line-height: 1.8; }
/* The Watch signal opens straight onto a VOD shelf, not another text header. */
.watch-library { width: 100%; max-width: 100%; }
.vod-placeholder { aspect-ratio: 16 / 9; background: #1C024F; }
.vod-live-preview { position: relative; overflow: hidden; }
.vod-play { cursor: pointer; display: grid; place-items: center; width: 100%; height: 100%; min-height: 120px; border: 0; background: transparent; color: #fff; font: 800 16px/1.4 var(--interface-font); text-shadow: 0 2px 5px #121315; }
.vod-play:hover, .vod-play:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.vod-live-thumbnail { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.5); z-index: 0; }
.vod-play { isolation: isolate; }
.vod-play::after { content: '▶'; position: absolute; display: grid; place-items: center; width: 50px; height: 50px; border: 2px solid #fff; background: #4a2aa8; border-radius: 50%; font-size: 22px; z-index: 2; }
.vod-live-player { width: 100%; height: 100%; min-height: 200px; border: 0; aspect-ratio: 16 / 9; }
.vod-featured-art { min-height: 220px; }
.vod-featured-caption { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
.vod-featured-caption h3 { margin: 0; color: var(--white); font: 800 clamp(25px,3vw,36px)/1.2 var(--interface-font); letter-spacing: -.04em; }
.vod-kicker { margin: 0 0 4px; color: var(--accent); font: 700 12px/1.5 var(--mono-family); letter-spacing: .06em; }
.vod-label { color: var(--accent); border: 1px solid rgba(var(--accent-rgb),.55); padding: 7px 10px; font: 700 11px/1.5 var(--mono-family); letter-spacing: .05em; }
.vod-archive-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 10px 22px; margin: clamp(52px,8vw,95px) 0 22px; border-bottom: 1px solid rgba(var(--accent-rgb),.34); padding-bottom: 16px; }
.vod-archive-heading h3 { margin: 0; color: var(--white); font: 800 clamp(24px,3vw,32px)/1.2 var(--interface-font); letter-spacing: -.04em; }
.vod-archive-heading span { color: #999; font: 12px/1.5 var(--mono-family); }
.vod-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); column-gap: clamp(14px,2vw,26px); row-gap: clamp(30px,4vw,44px); }
.vod-card h4 { margin: 12px 0 2px; color: var(--white); font: 750 clamp(16px,1.9vw,19px)/1.4 var(--interface-font); }
.vod-card p { margin: 0; color: #aaa; font: 12px/1.6 var(--mono-family); }
.vod-library-note { max-width: 65ch; margin: 50px 0 0; color: #aaa; font: 13px/1.8 var(--mono-family); }
.conduct { margin: clamp(48px,8vh,108px) auto 0; padding-top: clamp(30px,5vw,54px); max-width: 68ch; border-top: 2px solid rgba(var(--accent-rgb),.55); }
.conduct h2, .conduct h3, .conduct h4 { font-family: var(--interface-font); color: var(--white); letter-spacing: -.025em; }
.conduct h2 { font-size: clamp(28px,4vw,42px); line-height: 1.15; margin: 0 0 25px; }
.conduct h3 { font-size: clamp(23px,3vw,30px); line-height: 1.25; margin: 48px 0 19px; }
.conduct h4 { font-size: clamp(19px,2.5vw,23px); line-height: 1.3; margin: 34px 0 15px; }
.conduct p, .conduct li { font: 400 16px/1.75 var(--interface-font); color: #c9c9c9; }
.conduct p { margin: 0 0 24px; }
.conduct ul { margin: 0 0 28px; padding-left: 1.4em; }
.conduct li { margin: 0 0 11px; padding-left: .3em; }
.conduct li::marker { color: var(--accent); }
.conduct a { color: var(--white); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; overflow-wrap: anywhere; }
.conduct a:hover, .conduct a:focus-visible { color: var(--accent); }
.conduct code { display: inline; font: 600 14px/1.6 var(--mono-family); color: var(--accent); overflow-wrap: anywhere; }
.detail-panel.signal-window.rollout { animation: panel-rollout .82s cubic-bezier(.18,.72,.18,1) both; }
@keyframes panel-rollout { from { height: 38px; } to { height: var(--panel-height); } }
.detail-panel.signal-window.closing { animation: journey-collapse .36s cubic-bezier(.7,0,1,.6) both; transform-origin: center center; }
@keyframes journey-collapse { from { opacity: 1; transform: scale(1); } to { opacity: 0; transform: scale(.07); } }

.cheer-burst { position: absolute; z-index: 22; left: 50%; top: 43%; transform: translate(-50%,-50%) scale(.6) rotate(-8deg); font: 900 clamp(40px,6vw,92px) var(--mono-family); white-space: nowrap; color: var(--accent); text-shadow: 0 0 40px rgba(var(--accent-rgb),.65); pointer-events: none; opacity: 0; }
.cheer-burst.burst { animation: cheerBurst 1.3s ease-out forwards; }
@keyframes cheerBurst { 0% {opacity:0; transform: translate(-50%,-50%) scale(.4) rotate(-8deg);} 20% {opacity:1; transform: translate(-50%,-50%) scale(1.12) rotate(4deg);} 60% {opacity:1; transform: translate(-50%,-50%) scale(1) rotate(-2deg);} 100% {opacity:0; transform: translate(-50%,-50%) scale(1.2) rotate(0deg);} }

/* Every experience owns its interior and the whole window; the persistent
   title and prompt stay on top of it, readable over anything it draws. */
.ssh-surface { width: 100%; height: 100%; overflow: hidden; background: #101116; }
.ssh-surface iframe { display: block; width: 100%; height: 100%; border: 0; background: #101116; }
.ssh-curtain { position: absolute; z-index: 19; inset: 0; display: grid; place-items: center; padding: 86px 24px 130px; color: var(--accent); background: #121315; font: 700 clamp(13px,2.5vw,23px)/1.8 var(--mono-family); letter-spacing: .11em; text-align: center; opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.ssh-curtain.visible { opacity: 1; }
.world.ssh-transitioning:not(.ssh-active) .hud-header { z-index: 24; }
.world.ssh-transitioning .command-form { z-index: 25; }
.world.ssh-transitioning .command-feedback { z-index: 26; }
@media (prefers-reduced-motion: reduce) { .ssh-curtain { transition: none; } }
.ssh-curtain-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* SSH capsules own the content. Keep the permanent title and prompt, but
   remove the constellation's metadata, navigation hints, mascot and motion control. */
.world.ssh-active .identity-experiment,
.world.ssh-active .identity-meta { display: none !important; }
.world.ssh-active .scroll-cue,
.world.ssh-active .mobile-signal-rail,
.world.ssh-active .header-controls,
.world.ssh-active .input-help { display: none; }

/* No band behind the title: the experience runs to the top edge. The header
   must not form a stacking context here, or the title's blend layers (see
   components/legible-text.js) could not see the experience behind them. */
.world.ssh-active .hud-header { z-index: auto; background: none; pointer-events: none; }

/* The iframe is opaque-origin. Only its verified theme message changes this
   small amount of persistent shell chrome; homepage styles stay untouched. */
.world.ssh-light .command-form { background: rgba(255,255,255,.88); border: 0; border-color: transparent; box-shadow: none; outline: none; }
.world.ssh-light .command-form:focus-within { border: 0; border-color: transparent; box-shadow: none; outline: none; }
.world.ssh-light .command-form input { color: #252525; caret-color: #176e55; }
.world.ssh-light .command-form input:focus::placeholder { color: #4c4c4c; }
.world.ssh-light .input-label { color: #444444; }
.world.ssh-light .input-enter { color: #ffffff; }
.world.ssh-light .command-feedback { color: #252525; border-color: #176e55; background: rgba(255,255,255,.97); box-shadow: 0 0 24px rgba(23,110,85,.12); }
.world.ssh-light .ssh-surface,
.world.ssh-light .ssh-surface iframe { background: #f4f4f1; }

/* The prompt as a dock (runtime/experiences/dock.js). It sits low, and
   collapsed it is only its identity: no bar, no stacking context (so the
   identity's blend layers reach the experience), and no hit area beyond the
   identity itself. The input stays focusable, so Tab still reaches it. */
.world.ssh-active { --dock-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); --dock-zone-height: 10px; }
.world.ssh-active .command-form { bottom: var(--dock-bottom); transition: opacity 1.7s ease, border-color .35s ease, box-shadow .35s ease, background-color .2s ease; }
.world.ssh-active .command-feedback { bottom: calc(var(--dock-bottom) + 64px); }
.world.ssh-active.dock-collapsed .command-form { z-index: auto; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; box-shadow: none; pointer-events: none; }
.world.ssh-active.dock-collapsed .command-form .input-label { pointer-events: auto; cursor: pointer; }
.world.ssh-active.dock-collapsed .command-form input,
.world.ssh-active.dock-collapsed .command-form .input-enter { opacity: 0; }
.world.ssh-active .command-form input { transition: opacity .2s ease; }
.world.ssh-active.dock-collapsed .command-form input::placeholder { color: transparent; }

/* The strip along the bottom of the window that brings the bar back. Only
   for a fine pointer; touch reaches the bar by tapping its identity. */
.prompt-dock-zone { display: none; }
@media (hover: hover) and (pointer: fine) {
  .world.ssh-active.dock-collapsed .prompt-dock-zone { position: absolute; z-index: 20; left: 0; right: 0; bottom: 0; height: var(--dock-zone-height); display: block; }
}

@media (max-width: 760px) {
  .world.ssh-active:not(.keyboard-open) { --mobile-command-bottom: var(--dock-bottom); }
  .world.ssh-active .command-form { bottom: var(--mobile-command-bottom); }
  .world.ssh-active .command-feedback { bottom: calc(var(--mobile-command-bottom) + 60px); }
}
@media (prefers-reduced-motion: reduce) {
  .world.ssh-active .command-form, .world.ssh-active .command-form input { transition: none; }
}

/* Opened from a link: the prompt fades away while the experience arrives, then
   returns (with the ssh-active fade) as the docked identity. */
.world.ssh-link-entry .command-form,
.world.ssh-link-entry .command-feedback { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
@media (prefers-reduced-motion: reduce) { .world.ssh-link-entry .command-form, .world.ssh-link-entry .command-feedback { transition: none; } }
/* Four wide-screen steps; narrower screens continue using the full available width. */
@media (min-width: 900px) { .signal-window { --panel-content-width: 760px; } }
@media (min-width: 1200px) { .signal-window { --panel-content-width: 980px; } }
@media (min-width: 1440px) { .signal-window { --panel-content-width: 1180px; } }
@media (min-width: 2560px) { .signal-window { --panel-content-width: 1520px; } }

@media (max-width: 900px) {
  .identity-meta { gap: 5px 9px; }
}

@media (max-width: 760px) {
  /* Share one keyboard-aware anchor so the hint always sits above the prompt. */
  .world { --mobile-command-bottom: calc(42px + env(safe-area-inset-bottom, 0px)); }
  .world.keyboard-open { --mobile-command-bottom: calc(12px + var(--keyboard-inset, 0px)); }
  .scroll-cue { display: none; }
  .hud-header { padding: 17px 19px; gap: 8px; }
  .world.panel-open .hud-header { z-index: 20; pointer-events: none; background: transparent; }
  .world.panel-open .header-controls { pointer-events: auto; }
  .header-controls { gap: 4px; }
  .identity { flex-direction: column; align-items: flex-start; gap: 4px; }
  .identity-heading { gap: 10px; }
  .identity-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; transition: transform .55s cubic-bezier(.22,.7,.22,1), opacity .45s ease, visibility .55s; }
  .world.panel-open .identity-meta { transform: translateX(calc(-100% - 32px)); opacity: 0; visibility: hidden; pointer-events: none; }
  .mobile-signal-rail { position: absolute; z-index: 20; top: 72px; right: 19px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(0); transition: transform .55s cubic-bezier(.22,.7,.22,1), opacity .45s ease, visibility .55s; }
  .world.ready .mobile-signal-rail { opacity: 1; visibility: visible; pointer-events: auto; }
  /* The rail is inert while a panel is open. Keep visibility from transitioning
     so WebKit can return focus to its buttons immediately when the panel closes. */
  .world.ready.panel-open .mobile-signal-rail { transform: translateX(calc(100% + 24px)); opacity: 0; pointer-events: none; }
  .mobile-signal-rail button { display: flex; justify-content: flex-end; align-items: center; gap: 11px; height: 44px; min-width: 126px; padding: 0; color: #b9b9b9; border: 0; background: transparent; font: 800 14px/1.4 var(--mono-family); letter-spacing: .04em; text-align: right; }
  .mobile-signal-rail button:hover, .mobile-signal-rail button:focus-visible { color: var(--white); }
  .rail-mark { display: inline-block; flex: 0 0 auto; width: 22px; height: 22px; border: 2px solid var(--accent); background: rgba(var(--accent-rgb),.18); box-shadow: 0 0 8px rgba(var(--accent-rgb),.26); }
  .command-form { bottom: var(--mobile-command-bottom); }
  .command-form input { font-size: 16px; }
  .command-form input::placeholder { font-size: 12px; }
  .input-enter { flex: 0 0 44px; width: 44px; min-width: 44px; height: 44px; padding: 0; gap: 0; }
  .input-enter span:not(.return-icon) { display: none; }
  .input-enter .return-icon { font-size: 22px; transform: translateY(-1px); }
  .input-help { bottom: calc(var(--mobile-command-bottom) + 52px + 12px); z-index: 22; }
  .command-feedback { bottom: calc(var(--mobile-command-bottom) + 60px); }
  .detail-panel.signal-window { left: 19px; right: 19px; }
  .signal-window .panel-content h1 { font-size: clamp(29px, 7vw, 42px); }
  .about-mascot { top: 6px; right: 12px; width: 70px; }
  .signal-window .panel-content > p:not(.panel-id) { font-size: 16px; }
  .vod-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .vod-featured-art { min-height: 160px; }
}

@media (max-width: 520px) {
  .vod-grid { grid-template-columns: 1fr; }
  .vod-archive-heading { margin-top: 50px; }
}

@media (max-width: 600px) {
  .hud-header { padding: 17px 19px; min-height: 70px; }
  .identity { gap: 4px 10px; }
  .identity-heading { gap: 8px; }
  .identity-experiment { letter-spacing: .04em; }
  .boot { top: 23%; left: 22px; right: 20px; font-size: 13px; }
  .skip-intro { bottom: 10%; right: 20px; }
  .command-form { left: 19px; right: 19px; padding-inline: 10px; gap: 7px; }
  .input-label { font-size: 11px; }
  .input-help { left: 19px; max-width: calc(100vw - 38px); font-size: 11px; }
  .command-feedback { left: 19px; right: 19px; }
  .cheer { font-size: clamp(33px,8vw,52px); }
}

/* At 400% desktop zoom, a 1280x1024 screen becomes a 320x256 CSS-pixel
   viewport. The 440px-tall world must remain reachable by normal page
   scrolling instead of clipping the terminal below the visual viewport. */
@media (max-height: 439px) {
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; }
  .world { height: 440px; }
  #network-canvas { touch-action: pan-y; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
