: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); }
#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; }
.header-mascot { display: block; width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }

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

.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; }

/* 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); }
.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; } }

/* Unframed, native-feeling signal inspector */
.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-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 15px; border-bottom: 1px solid var(--accent); color: var(--accent); font-family: var(--interface-font); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.panel-header #panel-path { font: var(--mono); }
.panel-header button { background: none; border: none; color: var(--muted); font-size: 27px; line-height: .8; }
.panel-header button:hover { color: var(--white); }
.panel-inner { position: relative; padding: 30px 29px 33px; }
.panel-id { font: var(--mono); color: var(--accent); letter-spacing: .16em; margin: 0 0 17px; }
.panel-inner 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; }
.panel-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px 15px; border-top: 1px solid var(--accent-line); padding: 12px 15px; color: var(--accent); font: var(--mono); letter-spacing: .06em; }
.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; }
.signal-window .panel-header { flex: 0 0 auto; }
.signal-window .panel-inner { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; overflow-anchor: none; touch-action: pan-y; padding: clamp(26px,5vw,70px); }
.signal-window .panel-inner { scrollbar-gutter: stable; scrollbar-width: auto; scrollbar-color: var(--accent) #1b1421; }
/* Keep the window and its retro scrollbar full-width while centering the reading area. */
.signal-window .panel-content { position: relative; width: 100%; max-width: var(--panel-content-width, 100%); margin-inline: auto; }
/* Square, mechanical scrollbar: double-edged track, striped thumb, pixel arrows. */
.signal-window .panel-inner::-webkit-scrollbar { width: 20px; height: 20px; }
.signal-window .panel-inner::-webkit-scrollbar-track { background: repeating-linear-gradient(0deg, rgba(var(--accent-rgb),.10) 0 3px, #1b1421 3px 8px); border-left: 2px solid rgba(var(--accent-rgb),.6); box-shadow: inset 2px 0 0 #09080a; }
.signal-window .panel-inner::-webkit-scrollbar-thumb { border: 3px solid #1b1421; border-radius: 0; background: repeating-linear-gradient(0deg, transparent 0 6px, rgba(18,19,21,.38) 6px 10px), var(--accent); box-shadow: inset 0 0 0 2px rgba(18,19,21,.28); }
.signal-window .panel-inner::-webkit-scrollbar-thumb:hover { background-color: var(--accent); }
.signal-window .panel-inner::-webkit-scrollbar-button:single-button { display: block; height: 20px; border: 3px solid #1b1421; background-color: var(--accent); background-position: center; background-repeat: no-repeat; background-size: 13px 13px; }
.signal-window .panel-inner::-webkit-scrollbar-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23121315' d='M7 2h2v2h2v2h2v2H3V6h2V4h2z'/%3E%3C/svg%3E"); }
.signal-window .panel-inner::-webkit-scrollbar-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' shape-rendering='crispEdges'%3E%3Cpath fill='%23121315' d='M3 6h10v2h-2v2H9v2H7v-2H5V8H3z'/%3E%3C/svg%3E"); }
.signal-window .panel-inner::-webkit-scrollbar-corner { background: var(--black); }
.signal-window .panel-inner 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-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; }
.signal-window .panel-footer { flex: 0 0 auto; }
.detail-panel.signal-window.rollout { animation: panel-rollout .82s cubic-bezier(.18,.72,.18,1) both; }
.signal-window.rollout .panel-inner, .signal-window.rollout .panel-footer { animation: panel-reveal .38s ease .55s both; }
@keyframes panel-rollout { from { height: 38px; } to { height: var(--panel-height); } }
@keyframes panel-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.detail-panel.signal-window.closing { animation: journey-collapse .36s cubic-bezier(.7,0,1,.6) both; transform-origin: center center; }
.detail-panel.signal-window.closing .panel-inner, .detail-panel.signal-window.closing .panel-footer { animation: none; }
@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);} }

/* 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; }
  .world.panel-open .hud-header { z-index: 20; pointer-events: none; background: transparent; }
  .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; }
  .world.ready.panel-open .mobile-signal-rail { transform: translateX(calc(100% + 24px)); opacity: 0; visibility: hidden; 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; }
  .detail-panel.signal-window { left: 19px; right: 19px; }
  .signal-window .panel-inner { padding: 22px; }
  .signal-window .panel-inner 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; }
  .cheer { font-size: clamp(33px,8vw,52px); }
}

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