/* Layout: a game, not a scroll. Title screen (boot log, cutout name, live sim, player profile) -> pause menu over a live scene that changes per hovered item -> one file screen per project, its README framed as a quest log over the same scene. Hidden "???" leads to the fog. Single dark world by choice. */
:root {
  --void: #100d17;
  --void-2: #1a1624;
  --bone: #ece4d6;
  --ash: #9b93a6;
  --signal: #e8192f;
  --gold: #e9b44c;
  --line: #2c2638;
  --stage: #100d17;

  --f-display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --f-body: "Zen Kaku Gothic New", "Hiragino Sans", "Helvetica Neue", Arial, sans-serif;
  --f-term: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --f-hand: "Reenie Beanie", "Bradley Hand", cursive;

  --t-s: clamp(0.82rem, 0.79rem + 0.12vw, 0.9rem);
  --t-m: clamp(0.98rem, 0.94rem + 0.2vw, 1.08rem);
  --t-l: clamp(1.2rem, 1.08rem + 0.6vw, 1.5rem);
  --t-xl: clamp(2rem, 1.2rem + 4vw, 4.4rem);
  --t-menu: clamp(2.5rem, 1.1rem + 5.6vw, 5.6rem);
  --t-name: clamp(2.8rem, 1.6rem + 6vw, 6.8rem);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--void); }
body { margin: 0; background: var(--stage); color: var(--bone); font-family: var(--f-body); font-size: var(--t-m); line-height: 1.65; overflow-x: hidden; transition: background-color 0.4s; }
a { color: var(--bone); text-decoration-color: var(--signal); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--signal); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }
button { font: inherit; }
kbd { font-family: var(--f-term); color: var(--bone); border: 1px solid var(--line); padding: 0 5px; font-size: 0.9em; }
.hand { font-family: var(--f-hand); font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.75rem); line-height: 1; color: var(--ash); }
.screen { min-height: 100vh; padding-inline: clamp(16px, 4vw, 56px); padding-block: 20px 56px; position: relative; z-index: 2; }
.inner { max-width: 1100px; margin-inline: auto; position: relative; }
.ph { color: var(--gold); }

/* ---------- scene canvas behind menu + files ---------- */
#scene { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s; }
body.on-menu #scene, body.on-title #scene { opacity: 1; }
body.on-file #scene { opacity: 0.28; }
.slash { position: fixed; z-index: 1; left: -20%; right: -20%; height: 46vh; top: 30vh; background: var(--signal); opacity: 0; pointer-events: none;
  transform: rotate(var(--slash-a, -14deg)); transition: transform 0.45s cubic-bezier(.2,.9,.3,1.2), background-color 0.35s, opacity 0.3s; }
.slash::after { content: ""; position: absolute; left: 0; right: 0; top: 18%; height: 22%; background: var(--void); opacity: 0.85; }
body.on-menu .slash { opacity: 0.9; }

/* ---------- HUD ---------- */
.hud { position: fixed; z-index: 30; right: max(12px, env(safe-area-inset-right)); top: calc(10px + env(safe-area-inset-top, 0px)); display: flex; gap: 8px; }
.hud button { background: rgba(16, 13, 23, 0.85); color: var(--ash); border: 1px solid var(--line); padding: 4px 10px; font-family: var(--f-term); font-size: 0.78rem; cursor: pointer; }
.hud button:hover { color: var(--bone); }
.hud button[aria-pressed="true"] { color: var(--bone); border-color: var(--signal); }
.files-found { position: fixed; z-index: 30; left: max(12px, env(safe-area-inset-left)); top: calc(10px + env(safe-area-inset-top, 0px)); font-family: var(--f-term); font-size: 0.78rem; color: var(--ash); background: rgba(16, 13, 23, 0.85); border: 1px solid var(--line); padding: 4px 10px; }
.files-found b { color: var(--gold); font-weight: 600; }

/* ---------- atmosphere ---------- */
.grain { position: fixed; inset: 0; z-index: 25; pointer-events: none; opacity: 0.05; mix-blend-mode: screen; background-size: 170px 170px; animation: grain 0.8s steps(5) infinite; transition: opacity 3s; }
@keyframes grain { 0%{background-position:0 0} 25%{background-position:-50px 30px} 50%{background-position:40px -40px} 75%{background-position:-30px -60px} 100%{background-position:0 0} }
/* idle fog: a grey wash, soft fog banks behind and in front of the sharks, all drifting */
.fogwrap { position: fixed; inset: 0; z-index: 24; pointer-events: none; opacity: 0; transition: opacity 2.5s ease-out; overflow: hidden; }
body.idle .fogwrap { opacity: 1; transition: opacity 10s ease-in; }
.fog-back { position: absolute; inset: 0; background: rgba(118, 112, 128, 0.42); }
.fog-back i, .fog-front i { position: absolute; display: block; width: 150vw; height: 70vh; border-radius: 50%; will-change: transform;
  background: radial-gradient(closest-side, rgba(214, 208, 222, var(--a, 0.55)), rgba(214, 208, 222, 0) 100%); filter: blur(30px); animation: bank var(--d, 50s) ease-in-out infinite alternate; }
.fog-back i:nth-child(1) { left: -40vw; top: 5vh; --d: 46s; }
.fog-back i:nth-child(2) { left: -10vw; top: 45vh; --d: 63s; animation-direction: alternate-reverse; }
.fog-back i:nth-child(3) { left: -60vw; top: 70vh; --d: 80s; }
.fog-front i { --a: 0.38; height: 55vh; }
.fog-front i:nth-child(1) { left: -30vw; top: 25vh; --d: 38s; animation-direction: alternate-reverse; }
.fog-front i:nth-child(2) { left: -70vw; top: 60vh; --d: 52s; }
.fog-front i:nth-child(3) { left: 10vw; top: -10vh; --d: 70s; --a: 0.28; }
@keyframes bank { from { transform: translate3d(-12vw, 0, 0); } to { transform: translate3d(18vw, -4vh, 0); } }
#lurker { position: absolute; inset: 0; width: 100%; height: 100%; filter: blur(2.5px); }
.idlenote { position: fixed; z-index: 26; left: 50%; bottom: 8vh; transform: translateX(-50%) rotate(-2deg); opacity: 0; transition: opacity 1s; pointer-events: none; color: var(--signal); white-space: nowrap; margin: 0; text-shadow: 0 0 12px rgba(232, 25, 47, 0.45); }
body.idle .idlenote { opacity: 0.9; transition: opacity 6s 10s; }
.idlenote .and { opacity: 0; transition: opacity 0.5s; }
body.idle .idlenote .and { opacity: 1; transition: opacity 4s 19s; }
.wipe { position: fixed; inset: -20vh -20vw; z-index: 40; pointer-events: none; background: var(--signal); transform: translateX(-130%) skewX(-18deg); }
.wipe::after { content: ""; position: absolute; inset: 0 0 0 55%; background: var(--void); }
.wipe.go { animation: wipe 0.55s cubic-bezier(.7,0,.3,1); }
@keyframes wipe { 0% { transform: translateX(-130%) skewX(-18deg); } 100% { transform: translateX(130%) skewX(-18deg); } }
.toast { position: fixed; z-index: 35; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: min(320px, calc(100vw - 32px)); background: var(--bone); color: var(--void); padding: 10px 16px 12px; transform: translateY(160%) rotate(-2deg); transition: transform 0.4s cubic-bezier(.2,.9,.3,1.3);
  clip-path: polygon(0 6%, 100% 0, 98% 100%, 2% 94%); box-shadow: 6px 6px 0 var(--signal); }
.toast.show { transform: translateY(0) rotate(-2deg); }
.toast small { display: block; font-family: var(--f-term); font-size: 0.72rem; color: var(--signal); font-weight: 600; }
.toast strong { font-family: var(--f-display); font-weight: 400; font-size: 1.1rem; }

/* ---------- title screen ---------- */
#title { background: transparent; }
.title-grid { display: grid; gap: 26px; padding-top: clamp(36px, 6vw, 64px); }
.term { font-family: var(--f-term); font-size: var(--t-s); color: var(--ash); line-height: 1.8; }
.term .ok { color: var(--bone); } .term .red { color: var(--signal); } .term .warn { color: #cfc8d4; text-shadow: 0 0 8px rgba(207, 200, 212, 0.5); }
.term div { opacity: 1; }
.term.typing div { animation: line 0.01s both; }
@keyframes line { from { opacity: 0; } to { opacity: 1; } }
.cmd { position: relative; display: flex; align-items: center; gap: 0.6ch; margin: 0; cursor: text; max-width: 60ch; }
.cmd-p { color: var(--ash); }
.cmd input { flex: 1 1 auto; min-width: 0; font: inherit; color: var(--bone); background: transparent; border: 0; padding: 2px 0; margin: 0; outline: none; caret-color: var(--signal); }
.cmd .cursor { position: absolute; left: 1.6ch; top: 50%; transform: translateY(-50%); pointer-events: none; display: none; }
.cmd input:placeholder-shown:not(:focus) ~ .cursor { display: inline-block; }
.cmd:focus-within { outline: 1px dashed rgba(232, 25, 47, 0.5); outline-offset: 4px; }
.cmd-out div { white-space: pre-wrap; }
.cmd-out .err { color: var(--signal); }
.cmd-out .ok { color: var(--bone); }
body.glitch .title-grid { animation: glitch 0.12s steps(2) infinite; }
@keyframes glitch { 0% { transform: translate(2px, -1px); filter: hue-rotate(20deg); } 50% { transform: translate(-3px, 1px); filter: contrast(1.6); } 100% { transform: translate(1px, 2px); } }
.cursor { display: inline-block; width: 0.6em; height: 1.05em; background: var(--signal); vertical-align: -0.15em; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.cutout { font-family: var(--f-display); font-weight: 400; font-size: var(--t-name); line-height: 0.95; display: flex; flex-wrap: wrap; gap: 0.04em; margin: 0; }
.cutout span { display: inline-block; padding: 0.04em 0.1em 0.08em; }
.cutout span:nth-child(5n+1) { background: var(--signal); color: var(--bone); transform: rotate(-4deg); }
.cutout span:nth-child(5n+2) { background: var(--bone); color: var(--void); transform: rotate(3deg) translateY(0.05em); }
.cutout span:nth-child(5n+3) { color: var(--bone); transform: rotate(-2deg); }
.cutout span:nth-child(5n+4) { background: var(--void-2); color: var(--signal); transform: rotate(5deg); border: 2px solid var(--bone); }
.cutout span:nth-child(5n) { background: var(--bone); color: var(--signal); transform: rotate(-6deg) translateY(-0.04em); }
.lede { font-size: var(--t-l); max-width: 30ch; margin: 0; font-weight: 500; text-wrap: balance; }
.start-row { display: flex; flex-wrap: wrap; gap: 14px 26px; align-items: center; }
.start { font-family: var(--f-display); font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem); color: var(--void); background: var(--bone); border: 0; padding: 0.25em 0.9em 0.3em; cursor: pointer;
  clip-path: polygon(0 8%, 100% 0, 96% 100%, 3% 92%); transform: rotate(-3deg); box-shadow: 0.18em 0.18em 0 var(--signal); }
.start:hover, .start:focus-visible { background: var(--signal); color: var(--bone); }
.blink { animation: blink 1.2s steps(1) infinite; }
.sim { margin: 0; background: var(--void-2); border: 1px solid var(--line); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); }
.sim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 14px 16px 10px; }
.sim-head h2 { font-family: var(--f-term); font-size: var(--t-s); font-weight: 600; margin: 0; }
.sim-head p { margin: 0; font-size: var(--t-s); color: var(--ash); max-width: 62ch; }
#road { display: block; width: 100%; height: 210px; background: var(--void); image-rendering: pixelated; }
.sim-ctl { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; padding: 12px 16px 16px; font-family: var(--f-term); font-size: var(--t-s); color: var(--ash); }
.seg { display: inline-flex; border: 1px solid var(--line); }
.seg button, .play { color: var(--ash); background: transparent; border: 0; padding: 6px 12px; cursor: pointer; font-family: var(--f-term); }
.seg button[aria-pressed="true"] { background: var(--signal); color: var(--bone); }
.play { border: 1px solid var(--line); }
.play:hover, .seg button:hover { color: var(--bone); }
.sim-ctl label { display: inline-flex; align-items: center; gap: 8px; }
input[type=range] { accent-color: var(--signal); width: 120px; }
.readout { margin-left: auto; color: var(--bone); font-variant-numeric: tabular-nums; }
.legend { display: inline-flex; gap: 14px; }
.sw { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; }

/* ---------- player profile ---------- */
.profile { padding-top: 48px; }
.profile-h { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin: 0 0 22px; }
.profile-h h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.6rem); background: var(--bone); color: var(--void); padding: 0.05em 0.45em 0.12em; transform: rotate(-2deg); clip-path: polygon(0 6%, 100% 0, 97% 100%, 1% 94%); }
.profile-h .hand { transform: rotate(2deg); }
.pgrid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; }
.pcard { min-width: 0; background: var(--void-2); border: 1px solid var(--line); padding: 20px; position: relative; }
.pcard h3 { margin: 0 0 14px; font-family: var(--f-term); font-size: var(--t-s); font-weight: 600; color: var(--ash); }
.player { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; align-items: center; }
.avatar { width: 110px; aspect-ratio: 1; max-width: 100%; background: #1f1b26; border: 2px solid var(--bone); position: relative; overflow: hidden; display: grid; place-items: center; transform: rotate(-3deg); }
.avatar canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.55; }
.avatar span { position: relative; font-family: var(--f-display); font-size: 3rem; color: var(--signal); }
a.avatar { text-decoration: none; cursor: pointer; transition: transform 0.2s; }
a.avatar:hover { transform: rotate(3deg) scale(1.04); }
a.avatar:hover span { color: var(--bone); text-shadow: 0 0 12px rgba(232, 25, 47, 0.8); }
.player .nm { font-family: var(--f-display); font-size: 1.5rem; line-height: 1.1; }
.player dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: var(--t-s); }
.player dt { color: var(--ash); } .player dd { margin: 0; }
.bars { display: grid; gap: 10px; margin-top: 18px; }
.bar { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr) 2.6em; gap: 10px; align-items: center; font-size: var(--t-s); }
.bar .track { display: block; height: 14px; background: var(--void); border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.6); }
.bar .fill { display: block; height: 100%; width: var(--v); border-radius: 8px; background: linear-gradient(180deg, rgba(255,255,255,0.35) 0 30%, transparent 30%), linear-gradient(90deg, var(--c1), var(--c2)); box-shadow: 0 0 10px var(--c2); transition: width 1.2s cubic-bezier(.2,.9,.3,1); }
.bar.c-red { --c1: #8f0e1d; --c2: #ff3048; }
.bar.c-gold { --c1: #b5781c; --c2: #ffd36b; }
.bar.c-teal { --c1: #0c6f7a; --c2: #3ee6e0; }
.bar.c-violet { --c1: #4b2a8a; --c2: #b78bff; }
.bar .n { font-family: var(--f-term); text-align: right; color: var(--ash); font-variant-numeric: tabular-nums; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { min-width: 0; padding: 12px 12px 14px; background: var(--void); border: 1px solid var(--line); display: grid; gap: 4px; align-content: start; transition: transform 0.2s; }
.badge:hover { transform: rotate(-2deg) scale(1.03); }
.badge .ic { font-family: var(--f-display); font-size: 1.5rem; line-height: 1; color: var(--gold); }
.badge b { font-size: var(--t-s); line-height: 1.3; }
.badge span { font-size: 0.8rem; color: var(--ash); line-height: 1.35; }
.badge.locked { border-style: dashed; }
.badge.locked .ic { color: var(--ash); }
.badge .lock { display: block; }
.badge.locked:hover .lock { animation: rattle 0.35s; }
@keyframes rattle { 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
.facts { margin-top: 20px; }
.facts ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.facts li { min-width: 0; background: var(--bone); color: var(--void); padding: 12px 14px 14px; font-weight: 500; transform: rotate(var(--r, -1.5deg)); clip-path: polygon(0 4%, 100% 0, 98% 100%, 2% 96%); }
.facts li:nth-child(2) { --r: 1.5deg; } .facts li:nth-child(3) { --r: -0.5deg; }
.facts li small { display: block; font-family: var(--f-term); font-size: 0.72rem; color: var(--signal); font-weight: 600; }
.facts li .ph { color: #9b6a12; }

/* ---------- menu ---------- */
#menu { display: flex; overflow: hidden; background: transparent; }
#menu[hidden] { display: none; }
#menu .inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 32px; align-items: center; width: 100%; padding-block: 56px 80px; }
.menu-cue { margin: 0 0 14px; font-family: var(--f-hand); font-size: clamp(2.4rem, 1.8rem + 2.4vw, 3.8rem); line-height: 1; color: var(--bone); transform: rotate(-4deg); text-decoration: underline wavy var(--signal); text-decoration-thickness: 3px; text-underline-offset: 8px; }
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.04em; }
.menu li:nth-child(2) { margin-left: 1.1em; } .menu li:nth-child(3) { margin-left: 0.4em; } .menu li:nth-child(4) { margin-left: 1.5em; } .menu li:nth-child(5) { margin-left: 0.9em; }
.menu a { position: relative; display: inline-block; font-family: var(--f-display); font-size: var(--t-menu); line-height: 1.05; padding: 0.04em 0.25em; text-decoration: none; isolation: isolate;
  color: transparent; -webkit-text-stroke: 2px var(--bone); transform: rotate(-6deg); transition: transform 0.22s cubic-bezier(.2,.9,.3,1.4); text-shadow: 0 0 0 transparent; }
.menu li:nth-child(even) a { transform: rotate(-3deg); }
.menu a.on { color: var(--void); -webkit-text-stroke: 0; transform: rotate(-6deg) translateX(0.3em) scale(1.06); }
.menu a.on::before { content: ""; position: absolute; inset: 0.1em -0.15em 0.02em -0.2em; z-index: -1; background: var(--bone); clip-path: polygon(3% 10%, 100% 0, 97% 88%, 0 100%); }
.menu a.on::after { content: ""; position: absolute; inset: 0.24em -0.4em -0.1em 0.12em; z-index: -2; background: var(--signal); clip-path: polygon(0 0, 100% 12%, 94% 100%, 4% 86%); }
.menu a .seen { position: absolute; right: -0.2em; top: 0.05em; font-family: var(--f-term); font-size: 0.75rem; -webkit-text-stroke: 0; color: var(--gold); transform: rotate(8deg); }
.menu .q { -webkit-text-stroke-color: rgba(236, 228, 214, 0.28); font-size: 0.55em; }
.menu .q.on { color: #d8d2dc; } .menu .q.on::before { background: #4a4550; } .menu .q.on::after { background: #2a272e; }
.preview { min-width: 0; align-self: end; background: rgba(16, 13, 23, 0.88); border-left: 4px solid var(--signal); padding: 20px 22px; transform: rotate(-1.5deg); }
.preview .st { font-family: var(--f-hand); font-size: 1.7rem; line-height: 1; color: var(--signal); }
.preview h2 { font-family: var(--f-display); font-weight: 400; font-size: var(--t-l); line-height: 1.15; margin: 6px 0 8px; text-wrap: balance; }
.preview p { margin: 0; color: var(--ash); }
.keys { position: absolute; z-index: 3; left: clamp(16px, 4vw, 56px); bottom: 18px; font-family: var(--f-term); font-size: 0.78rem; color: var(--ash); display: flex; gap: 18px; flex-wrap: wrap; }
.keys button { background: none; border: 0; padding: 0; color: var(--bone); cursor: pointer; font-family: inherit; font-size: inherit; text-decoration: underline; text-decoration-color: var(--signal); }

/* ---------- file screens ---------- */
.file { background: rgba(16, 13, 23, 0.55); }
.file-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding-top: 40px; font-family: var(--f-term); font-size: var(--t-s); color: var(--ash); }
.back { background: var(--void); border: 1px solid var(--line); color: var(--bone); padding: 5px 12px; cursor: pointer; font-family: var(--f-term); }
.back:hover { border-color: var(--signal); }
.file-head { position: relative; margin: 30px 0 40px; padding-top: 20px; }
.file-head .big-n { position: absolute; right: 0; top: -30px; font-family: var(--f-display); font-size: clamp(6rem, 3rem + 14vw, 13rem); line-height: 1; color: transparent; -webkit-text-stroke: 2px rgba(236, 228, 214, 0.14); pointer-events: none; }
.file-head .slab { display: inline-block; background: var(--signal); padding: 0.12em 0.45em 0.2em; transform: rotate(-4deg); clip-path: polygon(0 8%, 100% 0, 97% 100%, 1% 92%); box-shadow: none; }
.file:not([hidden]) .file-head .slab { animation: slam 0.5s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes slam { 0% { transform: rotate(-12deg) scale(1.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-4deg) scale(1); } }
.file-head h1 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: var(--t-xl); line-height: 1; color: var(--bone); }
.file-head .tagline { margin: 20px 0 0; font-size: var(--t-l); max-width: 40ch; font-weight: 500; position: relative; }
.stamp { display: inline-block; margin-top: 14px; font-family: var(--f-display); font-size: 0.95rem; letter-spacing: 0.06em; color: var(--signal); border: 3px solid var(--signal); padding: 2px 12px 4px; transform: rotate(-7deg); opacity: 0.9; }
.stamp.fun { color: var(--gold); border-color: var(--gold); }
.dossier { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 36px; align-items: start; }
.readme { min-width: 0; background: rgba(26, 22, 36, 0.96); border: 1px solid var(--line); padding: clamp(18px, 3vw, 36px); position: relative; }
.readme::before { content: "QUEST LOG  /  README.md"; position: absolute; top: -13px; left: 18px; background: var(--bone); color: var(--void); font-family: var(--f-term); font-weight: 600; font-size: 0.74rem; padding: 2px 10px; transform: rotate(-2deg); white-space: pre; }
.readme > h1:first-child { display: none; }
.readme h2 { position: relative; font-family: var(--f-display); font-weight: 400; font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.65rem); margin: 1.9em 0 0.7em; line-height: 1.2; padding-left: 1.1em; }
.readme h2::before { content: ""; position: absolute; left: 0; top: 0.32em; width: 0.6em; height: 0.6em; background: var(--signal); transform: rotate(45deg); }
.readme h2:first-of-type { margin-top: 0.4em; }
.readme h3, .readme h4 { font-size: 1.05rem; margin: 1.4em 0 0.4em; color: var(--gold); font-family: var(--f-term); font-weight: 600; }
.readme p, .readme li { max-width: 68ch; }
.readme ul, .readme ol { padding-left: 1.3em; }
.readme li::marker { color: var(--signal); }
.readme code { font-family: var(--f-term); font-size: 0.88em; background: var(--void); padding: 1px 5px; border: 1px solid var(--line); }
.readme pre { background: var(--void); border: 1px solid var(--line); border-left: 3px solid var(--gold); padding: 14px 16px; overflow-x: auto; }
.readme pre code { border: 0; padding: 0; background: none; font-size: 0.84rem; line-height: 1.6; }
.readme blockquote { margin: 0 0 1em; padding: 10px 16px; border-left: 3px solid var(--signal); background: var(--void); }
.readme blockquote p { margin: 0; }
.readme img { display: block; max-width: 100%; height: auto; margin: 1em 0; border: 3px solid var(--bone); background: #fff; transform: rotate(-0.6deg); }
.tbl { overflow-x: auto; margin: 1em 0; }
.readme table { border-collapse: collapse; font-size: 0.92rem; min-width: 100%; }
.readme th, .readme td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.readme th { color: var(--ash); font-weight: 700; background: var(--void); }
.readme tr:hover td { background: rgba(232, 25, 47, 0.08); }
.readme .task { list-style: none; margin-left: -1.3em; }
.readme .box { display: inline-grid; place-items: center; width: 1.05em; height: 1.05em; border: 2px solid var(--ash); margin-right: 10px; vertical-align: -0.15em; transform: rotate(-4deg); }
.readme .box.done { background: var(--gold); border-color: var(--gold); }
.readme .box.done::after { content: ""; width: 0.45em; height: 0.25em; border: solid var(--void); border-width: 0 0 3px 3px; transform: rotate(-45deg) translate(1px, -1px); }
.readme .task:has(.done) { color: var(--ash); text-decoration: line-through; text-decoration-color: var(--gold); }
.side { display: grid; gap: 16px; position: sticky; top: 52px; }
.item { background: var(--bone); color: var(--void); padding: 16px 16px 18px; clip-path: polygon(0 3%, 100% 0, 98% 100%, 2% 97%); transform: rotate(1.5deg); }
.item .rar { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-term); font-size: 0.74rem; font-weight: 600; }
.item .rar b { color: var(--signal); }
.item .stars { color: var(--signal); letter-spacing: 0.1em; }
.item .big { font-family: var(--f-display); font-size: 2.6rem; line-height: 1; color: var(--signal); margin-top: 10px; }
.item p { margin: 2px 0 12px; font-size: var(--t-s); line-height: 1.35; font-weight: 500; }
.item h4 { margin: 12px 0 6px; font-family: var(--f-term); font-size: 0.74rem; font-weight: 600; }
.item .langs { display: grid; gap: 6px; }
.item .lang { display: grid; grid-template-columns: 4.5em minmax(0, 1fr) 3em; gap: 8px; align-items: center; font-size: 0.8rem; font-weight: 500; }
.item .lang i { height: 8px; background: rgba(16, 13, 23, 0.12); display: block; }
.item .lang i::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--void); }
.item .lang span:last-child { font-family: var(--f-term); text-align: right; }
.item ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px; }
.item li { font-size: 0.76rem; font-weight: 700; padding: 1px 7px; border: 1.5px solid var(--void); }
.quest { background: var(--void-2); border: 1px solid var(--line); padding: 12px 14px; font-size: var(--t-s); }
.quest .t { display: flex; justify-content: space-between; font-family: var(--f-term); font-size: 0.78rem; color: var(--ash); margin-bottom: 6px; }
.quest .t b { color: var(--gold); }
.quest .track { height: 10px; background: var(--void); border: 1px solid var(--line); }
.quest .fill { height: 100%; width: var(--v); background: var(--gold); }
.side .gh { display: inline-block; justify-self: start; font-family: var(--f-display); color: var(--void); background: var(--bone); text-decoration: none; padding: 0.2em 0.7em 0.3em; transform: rotate(-2deg); box-shadow: 4px 4px 0 var(--signal); }
.side .gh:hover { background: var(--signal); color: var(--bone); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.pager button { background: var(--void); border: 1px solid var(--line); color: var(--ash); cursor: pointer; font-family: var(--f-term); font-size: var(--t-s); padding: 10px 16px; text-align: left; transition: transform 0.15s; }
.pager button:last-child { text-align: right; }
.pager button:hover { color: var(--bone); border-color: var(--signal); transform: rotate(-1.5deg); }
.pager b { display: block; color: var(--bone); font-family: var(--f-display); font-weight: 400; font-size: 1.25rem; }

/* ---------- fog room ---------- */
#fog { background: #2b2830; display: flex; align-items: center; overflow: hidden; }
#fog[hidden] { display: none; }
#fog .mist { position: absolute; inset: 0; pointer-events: none; }
#fog .mist i { position: absolute; width: 100vmax; height: 40vmax; border-radius: 50%; background: radial-gradient(closest-side, rgba(225, 220, 230, 0.22), transparent); filter: blur(20px); animation: drift 40s ease-in-out infinite alternate; }
#fog .mist i:nth-child(1) { left: -20%; bottom: -10%; } #fog .mist i:nth-child(2) { left: 30%; top: 20%; animation-duration: 55s; animation-direction: alternate-reverse; } #fog .mist i:nth-child(3) { left: -10%; top: -15%; animation-duration: 70s; }
@keyframes drift { from { transform: translateX(-12vmax); } to { transform: translateX(12vmax); } }
#fog .inner { width: 100%; }
#fog .last { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.8rem, 1.2rem + 3vw, 3.6rem); line-height: 1.1; color: #d6d0da; max-width: 15ch; margin: 0 0 22px; animation: flick 8s infinite; }
@keyframes flick { 0%, 88%, 100% { opacity: 1; } 89% { opacity: 0.25; } 90% { opacity: 0.9; } 92% { opacity: 0.45; } 93% { opacity: 1; } }
#fog p { color: #bdb6c2; max-width: 46ch; }
#fog .back { color: #d6d0da; border-color: #5a5560; background: transparent; }


/* =================== per-project worlds =================== */
/* shared old-RPG window used by the 1996-style file */
.win { background: linear-gradient(180deg, #143c80, #071c44); border: 4px double #e8e8f0; box-shadow: 0 0 0 2px #071c44, 6px 6px 0 rgba(0,0,0,0.5); border-radius: 4px; color: #eef0f6; }

/* ---- menu theming ---- */
body[data-theme="p3"] .preview { border-left-color: #3fb8ff; }
body[data-theme="p3"] .preview .st { color: #3fb8ff; }
body[data-theme="p3"] .preview h2 { font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; text-transform: uppercase; font-size: 1.8rem; }
body[data-theme="p3"] .menu a.on::after { background: #1b6dff; }
body[data-theme="p2"] .preview { border-left-color: #d8b25a; background: rgba(20, 10, 36, 0.9); }
body[data-theme="p2"] .preview .st { color: #d8b25a; }
body[data-theme="p2"] .preview h2 { font-family: "Cormorant SC", Georgia, serif; font-weight: 700; color: #e7c977; font-size: 1.7rem; }
body[data-theme="p2"] .menu a.on::after { background: #d8b25a; }
body[data-theme="p1"] .preview { border: 4px double #e8e8f0; background: linear-gradient(180deg, #143c80, #071c44); transform: none; }
body[data-theme="p1"] .preview .st { color: #ffd76a; font-family: "DotGothic16", monospace; font-size: 1rem; }
body[data-theme="p1"] .preview h2 { font-family: "DotGothic16", monospace; font-size: 1.35rem; }
body[data-theme="p1"] .preview p { color: #c9d2e6; }
body[data-theme="p1"] .menu a.on::after { background: #2e9ab0; }
body[data-theme="p5"] .menu a.on::after { background: #e8192f; }
body.on-menu[data-theme="p3"] .slash, body.on-menu[data-theme="p2"] .slash, body.on-menu[data-theme="p1"] .slash { opacity: 0.32; height: 30vh; top: 38vh; }
body[data-theme="p5"] .preview { border-left-color: #2b6cff; }

/* ---- 3: DocAssist — deep water, moonlight, blue ---- */
.theme-p3.file { background: rgba(2, 10, 26, 0.5); }
.theme-p3 .file-head .slab { background: linear-gradient(100deg, #0f4fd6, #3fb8ff); transform: skewX(-12deg) rotate(-2deg); clip-path: none; padding: 0.02em 0.6em 0.08em; }
.theme-p3 .file-head h1 { font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(3.2rem, 2rem + 6vw, 7rem); line-height: 1; transform: skewX(12deg); color: #fff; }
.theme-p3 .big-n { font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; -webkit-text-stroke-color: rgba(63, 184, 255, 0.25); }
.theme-p3 .tagline { font-family: "Saira Extra Condensed", var(--f-body); font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.9rem); letter-spacing: 0.02em; }
.theme-p3 .stamp { color: #3fb8ff; border-color: #3fb8ff; font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; transform: skewX(-12deg); }
.theme-p3 .readme { background: rgba(5, 18, 42, 0.95); border-color: #16407a; }
.theme-p3 .readme::before { content: "LOG  /  README.md"; background: #3fb8ff; color: #04122a; }
.theme-p3 .readme h2 { font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; text-transform: uppercase; font-size: clamp(1.5rem, 1.3rem + 1vw, 2.1rem); letter-spacing: 0.02em; }
.theme-p3 .readme h2::before { background: none; border: 2px solid #3fb8ff; border-radius: 50%; transform: none; box-shadow: 0 0 8px #3fb8ff; }
.theme-p3 .readme h3 { color: #9fe0ff; }
.theme-p3 .readme li::marker { color: #3fb8ff; }
.theme-p3 .readme pre { border-left-color: #3fb8ff; background: #020b1c; }
.theme-p3 .readme code { background: #020b1c; border-color: #16407a; }
.theme-p3 .readme tr:hover td { background: rgba(63, 184, 255, 0.08); }
.theme-p3 .readme .box.done { background: #3fb8ff; border-color: #3fb8ff; }
.theme-p3 .readme .task:has(.done) { text-decoration-color: #3fb8ff; }
.theme-p3 .readme a { text-decoration-color: #3fb8ff; }
.theme-p3 .item { background: #e2f3ff; color: #04122a; clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%); transform: none; }
.theme-p3 .item .big, .theme-p3 .item .rar b, .theme-p3 .item .stars { color: #0f4fd6; }
.theme-p3 .item .big { font-family: "Saira Extra Condensed", var(--f-display); font-weight: 700; font-size: 3.4rem; }
.theme-p3 .item .lang i::after { background: #0f4fd6; }
.theme-p3 .item li { border-color: #0f4fd6; }
.theme-p3 .quest .fill { background: #3fb8ff; } .theme-p3 .quest .t b { color: #3fb8ff; }
.theme-p3 .gh { box-shadow: 4px 4px 0 #3fb8ff; } .theme-p3 .gh:hover { background: #3fb8ff; color: #04122a; }
.theme-p3 .pager button:hover { border-color: #3fb8ff; }
.depth { background: linear-gradient(180deg, #0b2a5c, #020a1a); border: 1px solid #16407a; padding: 14px 16px; display: grid; grid-template-columns: 14px 1fr; gap: 14px; align-items: stretch; }
.depth .gauge { background: #020b1c; border: 1px solid #16407a; position: relative; overflow: hidden; }
.depth .gauge::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 76.8%; background: linear-gradient(180deg, #3fb8ff, #0f4fd6); animation: tide 4s ease-in-out infinite alternate; }
@keyframes tide { from { height: 72%; } to { height: 80%; } }
.depth small { font-family: var(--f-term); font-size: 0.72rem; color: #9fe0ff; display: block; }
.depth b { font-family: "Saira Extra Condensed", var(--f-display); font-size: 2.6rem; line-height: 1; color: #fff; display: block; }
.depth span { font-size: 0.8rem; color: #9fb6d6; line-height: 1.35; display: block; }

/* ---- 2: SB 253 — rumor city under a zodiac sky ---- */
.theme-p2.file { background: rgba(14, 6, 26, 0.55); }
.theme-p2 .file-head .slab { background: #1a0f2e; border: 2px solid #d8b25a; outline: 1px solid #d8b25a; outline-offset: 5px; clip-path: none; transform: rotate(-2deg); padding: 0.1em 0.5em 0.15em; }
.theme-p2 .file-head h1 { font-family: "Cormorant SC", Georgia, serif; font-weight: 700; color: #e7c977; font-size: clamp(3.2rem, 2rem + 5vw, 6.4rem); letter-spacing: 0.04em; }
.theme-p2 .big-n { font-family: "Cormorant SC", Georgia, serif; -webkit-text-stroke-color: rgba(216, 178, 90, 0.22); }
.theme-p2 .tagline { font-family: "Cormorant SC", Georgia, serif; font-weight: 600; font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem); color: #efe3c4; }
.theme-p2 .zodiac { position: absolute; right: 8%; top: -40px; width: clamp(180px, 22vw, 300px); aspect-ratio: 1; max-width: 100%; opacity: 0.55; pointer-events: none; animation: spin 120s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.theme-p2 .stamp { color: #d8b25a; border: 4px double #d8b25a; font-family: "Cormorant SC", Georgia, serif; }
.theme-p2 .readme { background: rgba(24, 12, 42, 0.95); border-color: #4a3268; }
.theme-p2 .readme::before { content: "RUMOR FILE  /  README.md"; background: #d8b25a; color: #1a0f2e; }
.theme-p2 .readme h2 { font-family: "Cormorant SC", Georgia, serif; font-weight: 700; color: #e7c977; font-size: clamp(1.45rem, 1.25rem + 1vw, 2rem); }
.theme-p2 .readme h2::before { content: "✦"; background: none; transform: none; width: auto; height: auto; top: 0.05em; color: #d23a5a; font-family: var(--f-body); }
.theme-p2 .readme h3 { color: #d8b25a; }
.theme-p2 .readme li::marker { color: #d8b25a; }
.theme-p2 .readme pre { border-left-color: #d8b25a; background: #10081e; }
.theme-p2 .readme blockquote { border-left-color: #d8b25a; background: #10081e; }
.theme-p2 .readme code { background: #10081e; border-color: #4a3268; }
.theme-p2 .readme a { text-decoration-color: #d8b25a; }
.theme-p2 .item { background: #f1e7cf; color: #1a0f2e; }
.theme-p2 .item .big, .theme-p2 .item .rar b, .theme-p2 .item .stars { color: #a0103a; }
.theme-p2 .item .big { font-family: "Cormorant SC", Georgia, serif; font-weight: 700; font-size: 3.2rem; }
.theme-p2 .item .lang i::after { background: #1a0f2e; }
.theme-p2 .item li { border-color: #1a0f2e; }
.theme-p2 .gh { box-shadow: 4px 4px 0 #d8b25a; } .theme-p2 .gh:hover { background: #d8b25a; color: #1a0f2e; }
.theme-p2 .pager button:hover { border-color: #d8b25a; }
.rumor { background: #1a0f2e; border: 1px solid #d8b25a; outline: 1px solid rgba(216, 178, 90, 0.4); outline-offset: 3px; padding: 14px 16px; }
.rumor small { display: block; font-family: "Cormorant SC", Georgia, serif; font-weight: 700; color: #d8b25a; font-size: 1rem; }
.rumor p { margin: 6px 0 12px; font-size: 0.92rem; line-height: 1.45; color: #efe3c4; min-height: 2.9em; }
.rumor button { background: #d8b25a; color: #1a0f2e; border: 0; padding: 5px 12px; font-family: "Cormorant SC", Georgia, serif; font-weight: 700; font-size: 1rem; cursor: pointer; }
.rumor button:hover { background: #efe3c4; }

/* ---- 1: Chopsticks — 1996 PlayStation RPG ---- */
.theme-p1.file { background: rgba(3, 6, 12, 0.62); }
.theme-p1.file::after { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 3; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.22) 0 1px, transparent 1px 3px); }
.theme-p1 .file-head .slab { background: linear-gradient(180deg, #143c80, #071c44); border: 4px double #e8e8f0; box-shadow: 0 0 0 2px #071c44, 6px 6px 0 rgba(0,0,0,0.5); border-radius: 4px; clip-path: none; transform: none; padding: 0.15em 0.6em 0.2em; }
.theme-p1 .file-head h1 { font-family: "DotGothic16", monospace; color: #fff; text-shadow: 3px 3px 0 #000; font-size: clamp(2.6rem, 1.8rem + 4vw, 5rem); }
.theme-p1 .big-n { font-family: "DotGothic16", monospace; -webkit-text-stroke-color: rgba(120, 200, 220, 0.2); }
.theme-p1 .tagline { font-family: "DotGothic16", monospace; font-size: clamp(1.1rem, 1rem + 0.6vw, 1.45rem); }
.theme-p1 .stamp { font-family: "DotGothic16", monospace; color: #ffd76a; border-color: #ffd76a; transform: none; }
.theme-p1 .file-top, .theme-p1 .pager button { font-family: "DotGothic16", monospace; }
.theme-p1 .readme { background: linear-gradient(180deg, #102f66, #061633); border: 4px double #e8e8f0; box-shadow: 0 0 0 2px #071c44; border-radius: 4px; color: #eef0f6; }
.theme-p1 .readme::before { content: "▶ README.TXT"; background: #ffd76a; color: #071c44; font-family: "DotGothic16", monospace; transform: none; }
.theme-p1 .readme h2 { font-family: "DotGothic16", monospace; padding-left: 1.3em; }
.theme-p1 .readme h2::before { content: "▶"; background: none; width: auto; height: auto; transform: none; top: 0; color: #ffd76a; font-size: 0.8em; animation: blink 1s steps(1) infinite; }
.theme-p1 .readme code, .theme-p1 .readme pre, .theme-p1 .readme th { background: #04102a; border-color: #2a4a8a; }
.theme-p1 .readme li::marker { color: #ffd76a; }
.theme-p1 .readme a { text-decoration-color: #ffd76a; }
.theme-p1 .readme td, .theme-p1 .readme th { border-color: #2a4a8a; }
.theme-p1 .item { background: linear-gradient(180deg, #143c80, #071c44); border: 4px double #e8e8f0; color: #eef0f6; clip-path: none; transform: none; border-radius: 4px; }
.theme-p1 .item .big, .theme-p1 .item .rar b, .theme-p1 .item .stars { color: #ffd76a; }
.theme-p1 .item .big { font-family: "DotGothic16", monospace; }
.theme-p1 .item h4, .theme-p1 .item .rar { font-family: "DotGothic16", monospace; }
.theme-p1 .item .lang i { background: rgba(255,255,255,0.15); } .theme-p1 .item .lang i::after { background: #ffd76a; }
.theme-p1 .item li { border-color: #e8e8f0; }
.theme-p1 .shows b { font-family: "DotGothic16", monospace; }
.theme-p1 .gh { font-family: "DotGothic16", monospace; background: #ffd76a; box-shadow: 4px 4px 0 #000; transform: none; } .theme-p1 .gh:hover { background: #fff; color: #071c44; }
.theme-p1 .pager button:hover { border-color: #ffd76a; transform: none; }
.moon, .contact { padding: 12px 14px; font-family: "DotGothic16", monospace; }
.moon small, .contact small { display: block; color: #ffd76a; font-size: 0.85rem; }
.phases { display: flex; gap: 6px; margin: 8px 0 6px; }
.phases i { width: 18px; height: 18px; border-radius: 50%; background: #0a1a3a; border: 1px solid #5a6a9a; position: relative; overflow: hidden; }
.phases i.now { outline: 2px solid #ffd76a; outline-offset: 2px; }
.phases i::after { content: ""; position: absolute; inset: 0; background: #f2efd8; border-radius: 50%; transform: translateX(var(--sh, 100%)); }
.moon p, .contact p { margin: 0; font-size: 0.86rem; line-height: 1.45; }
.contact p { min-height: 2.9em; }
.contact .opts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.contact button { background: transparent; color: #eef0f6; border: 1px solid #e8e8f0; padding: 2px 10px; font-family: "DotGothic16", monospace; cursor: pointer; }
.contact button:hover, .contact button:focus-visible { background: #ffd76a; color: #071c44; }

/* ---- 5: Traffic — comic red, black and white, blue for the selected thing ---- */
.theme-p5 .file-head h1.cut { display: flex; flex-wrap: wrap; gap: 0.03em; font-size: clamp(3rem, 2rem + 5vw, 6.2rem); }
.theme-p5 .file-head .slab { background: none; clip-path: none; padding: 0; transform: rotate(-3deg); }
.theme-p5 h1.cut span { display: inline-block; padding: 0.04em 0.1em 0.08em; }
.theme-p5 h1.cut span:nth-child(4n+1) { background: #e8192f; color: #fff; transform: rotate(-5deg); }
.theme-p5 h1.cut span:nth-child(4n+2) { background: #fff; color: #100d17; transform: rotate(4deg); }
.theme-p5 h1.cut span:nth-child(4n+3) { background: #100d17; color: #fff; border: 3px solid #fff; transform: rotate(-2deg); }
.theme-p5 h1.cut span:nth-child(4n) { background: #fff; color: #e8192f; transform: rotate(6deg); }
.theme-p5 .file-head::before { content: ""; position: absolute; right: 2%; top: -50px; width: clamp(160px, 22vw, 280px); aspect-ratio: 1; max-width: 100%; background: #e8192f; opacity: 0.85; z-index: -1;
  clip-path: polygon(50% 0, 58% 30%, 85% 8%, 70% 38%, 100% 35%, 74% 52%, 98% 72%, 66% 66%, 72% 98%, 52% 74%, 34% 100%, 36% 68%, 4% 80%, 28% 56%, 0 38%, 30% 36%, 14% 8%, 42% 28%); }
.theme-p5 .big-n { -webkit-text-stroke-color: rgba(255, 255, 255, 0.35); }
.theme-p5 .readme { background-image: radial-gradient(rgba(232, 25, 47, 0.08) 1.3px, transparent 1.6px); background-size: 11px 11px; background-color: rgba(26, 22, 36, 0.97); border: 3px solid #fff; box-shadow: 8px 8px 0 #e8192f; }
.theme-p5 .readme::before { content: "TARGET FILE  /  README.md"; background: #fff; }
.theme-p5 .readme a:hover, .theme-p5 .pager button:hover b { color: #4d8bff; }
.theme-p5 .pager button:hover { border-color: #4d8bff; }
.theme-p5 .gh:hover { background: #2b6cff; color: #fff; }
.target { background: #fff; color: #100d17; padding: 14px 16px; transform: rotate(-2deg); box-shadow: 5px 5px 0 #100d17, 9px 9px 0 #e8192f; }
.target small { display: block; font-family: var(--f-display); color: #e8192f; font-size: 1.1rem; }
.target dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.85rem; }
.target dt { font-weight: 700; } .target dd { margin: 0; }

.touch-only { display: none; }
@media (hover: none) and (pointer: coarse) {
  .touch-only { display: inline; } .kb-only { display: none; }
  .file-top > span { display: none; }
}
@media (max-width: 600px) {
  .screen { overflow-x: clip; }
  .theme-p3 .file-head h1 { font-size: 2.7rem; }
  .theme-p2 .file-head h1 { font-size: 2.8rem; }
  .theme-p1 .file-head h1 { font-size: 2.2rem; }
  .theme-p5 .file-head h1.cut { font-size: 2.6rem; }
  .file-head .big-n { font-size: 5.5rem; top: -10px; }
  .term .dots { font-size: 0; } .term .dots::after { content: ":"; font-size: var(--t-s); }
  .term { font-size: 0.8rem; }
  .idlenote { white-space: normal; width: 88vw; text-align: center; }
  .keys { gap: 14px; }
}
@media (max-width: 820px) {
  #menu .inner { grid-template-columns: 1fr; padding-block: 70px 90px; }
  .preview { align-self: start; }
  .dossier, .pgrid { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .readout { margin-left: 0; }
  #road { height: 170px; }
}
@media (max-width: 460px) {
  .player { grid-template-columns: 1fr; }
  .bar { grid-template-columns: minmax(0, 7em) minmax(0, 1fr) 2.4em; }
}
@media (prefers-reduced-motion: reduce) {
  .grain, .blink, .cursor, #fog .mist i, #fog .last, .fog-back i, .fog-front i, .theme-p2 .zodiac, .depth .gauge::after, .theme-p1 .readme h2::before { animation: none; }
  .wipe { display: none; }
  .menu a, .slash, .toast, .badge, .pager button { transition: none; }
  .file:not([hidden]) .file-head .slab { animation: none; }
}

/* ---------- sim: close-up lane + followed car ---------- */
#lane { display: block; width: 100%; height: 84px; background: var(--void); }
#lane-where { font-variant-numeric: tabular-nums; }
.st-cap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--void); font-family: var(--f-term); font-size: 0.72rem; color: var(--ash); }
.st-cap span:first-child { color: var(--bone); }
.follow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: center; padding: 14px 16px 6px; border-top: 1px solid var(--line); }
.f-now { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; min-width: 0; min-height: 5.6em; align-content: start; }
.f-tag { font-family: var(--f-term); font-size: var(--t-s); color: var(--gold); }
#f-phase { font-family: var(--f-display); font-weight: 400; font-size: var(--t-l); line-height: 1.15; color: var(--bone); }
#f-phase[data-ph="jam"], #f-phase[data-ph="wait"] { color: var(--signal); }
#f-phase[data-ph="away"], #f-phase[data-ph="speed"] { color: var(--gold); }
#f-why { flex-basis: 100%; font-size: var(--t-s); color: var(--bone); }
.f-stats { flex-basis: 100%; font-family: var(--f-term); font-size: 0.74rem; color: var(--ash); font-variant-numeric: tabular-nums; }
.f-speed { display: grid; justify-items: end; gap: 4px; }
#spark { display: block; width: 180px; height: 50px; }
.f-ax { font-family: var(--f-term); font-size: 0.7rem; color: var(--ash); }
@media (max-width: 560px) {
  .follow { grid-template-columns: minmax(0, 1fr); }
  .f-speed { justify-items: start; }
  #spark { width: 100%; max-width: 320px; }
  #lane-where { display: none; }
}
