/* ============================================================
   PHOSPHOR OS v4 — Ainesh Sabharwal
   Fullscreen snap sections. One app frame on screen at a time.
   Content lives in script.js DATA.
   ============================================================ */

:root {
  --bg: #04060a;
  --bg-soft: #0b1016;
  --panel: #0c1219;
  --panel-bar: #141f29;
  --edge: #223440;
  --edge-soft: #17242e;
  --ink: #d3ecd9;
  --ink-dim: #6f8c7c;
  --phos: #7fdc7f;
  --phos-bright: #c4ffca;
  --phos-glow: rgba(127, 220, 127, 0.35);
  --amber: #ffcf6b;
  --rose: #ff8f8f;
  --font-display: "VT323", "Courier New", monospace;
  --font-mono: "JetBrains Mono", ui-monospace, "Courier New", monospace;
  --ease: cubic-bezier(.2, .75, .2, 1);
  --bar-h: 42px;
  --tick-h: 30px;
  --dock-h: 78px;
}
body[data-theme="amber"] {
  --ink: #f4e6c6; --ink-dim: #a98d5e;
  --phos: #ffbf49; --phos-bright: #ffe3ab; --phos-glow: rgba(255,191,73,.35); --amber: #8fe0d0;
}
body[data-theme="cyan"] {
  --ink: #d0eef4; --ink-dim: #6d9aa2;
  --phos: #5fe6ff; --phos-bright: #bff5ff; --phos-glow: rgba(95,230,255,.35); --amber: #ff9ce0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  height: 100vh; height: 100dvh; overflow: hidden;      /* screens container scrolls, not body */
  background: radial-gradient(130% 100% at 50% -10%, var(--bg-soft), var(--bg) 70%);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 15px; line-height: 1.6;
}
::selection { background: var(--phos); color: #04120a; }
a { color: var(--phos-bright); text-decoration: none; border-bottom: 1px dotted var(--ink-dim); transition: border-color .15s; }
a:hover { border-bottom-color: var(--phos-bright); }
code { font-family: var(--font-mono); background: color-mix(in srgb, var(--phos) 12%, transparent); border: 1px solid var(--edge); padding: .04em .4em; border-radius: 3px; color: var(--phos-bright); }
button { font: inherit; }

/* ===================== BOOT ===================== */
.boot { position: fixed; inset: 0; z-index: 9999; background: var(--bg); padding: 9vh 7vw; display: flex; flex-direction: column; gap: 1.4rem; transition: opacity .45s ease, visibility .45s; }
.boot.done { opacity: 0; visibility: hidden; pointer-events: none; }
.boot__log { white-space: pre-wrap; max-width: 68ch; color: var(--phos); text-shadow: 0 0 6px var(--phos-glow); font-size: 14px; }
.boot__bar { width: min(340px, 70vw); height: 13px; border: 1px solid var(--phos); padding: 2px; }
.boot__bar span { display: block; height: 100%; width: 0; background: var(--phos); box-shadow: 0 0 10px var(--phos-glow); transition: width .2s linear; }
.boot__hint { color: var(--ink-dim); font-size: 12px; letter-spacing: .16em; }

/* ===================== GLOBAL FX ===================== */
.crt-power { position: fixed; inset: 0; z-index: 9000; pointer-events: none; background: #fff; opacity: 0; }
.crt-power.fire { animation: powerOn .55s var(--ease) forwards; }
@keyframes powerOn { 0%{opacity:0;transform:scaleY(.002)} 8%{opacity:.9;transform:scaleY(.004)} 35%{opacity:.7;transform:scaleY(1)} 100%{opacity:0;transform:scaleY(1)} }

.crt-scanlines, .crt-vignette, .crt-flicker { position: fixed; inset: 0; pointer-events: none; z-index: 5000; }
.crt-scanlines { background: repeating-linear-gradient(to bottom, transparent 0 2px, rgba(0,0,0,.26) 2px 3px); mix-blend-mode: multiply; opacity: .5; }
.crt-vignette { background: radial-gradient(125% 125% at 50% 50%, transparent 52%, rgba(0,0,0,.6) 100%); }
.crt-flicker { background: var(--phos); opacity: 0; mix-blend-mode: overlay; animation: flick 7s steps(1) infinite; }
@keyframes flick { 0%,96%,100%{opacity:0} 97%{opacity:.02} 98%{opacity:.05} 99%{opacity:.02} }

/* dot grid drifting behind everything */
.dotgrid {
  position: fixed; inset: -60px; pointer-events: none; z-index: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--phos) 18%, transparent) 1px, transparent 1.6px);
  background-size: 26px 26px;
  animation: drift 40s linear infinite;
  opacity: .5;
}
@keyframes drift { to { transform: translate(26px, 26px); } }

/* cursor spotlight */
.spotlight {
  position: fixed; inset: 0; pointer-events: none; z-index: 1;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 40%),
    color-mix(in srgb, var(--phos) 7%, transparent), transparent 70%);
}

/* ===================== MENU BAR ===================== */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 4000; height: var(--bar-h);
  display: flex; align-items: center; gap: .9rem;
  padding: 0 1.1rem;
  background: linear-gradient(var(--panel-bar), var(--panel));
  border-bottom: 1px solid var(--edge);
  font-size: 13px;
}
.menubar__logo { font-family: var(--font-display); font-size: 24px; color: var(--phos-bright); text-shadow: 0 0 8px var(--phos-glow); }
.crumbs { display: flex; align-items: center; gap: .4rem; color: var(--ink-dim); letter-spacing: .03em; overflow: hidden; white-space: nowrap; }
.crumbs i { color: var(--edge); font-style: normal; }
.crumbs__file { color: var(--phos-bright) !important; text-shadow: 0 0 6px var(--phos-glow); }
.menubar__links { display: flex; align-items: center; gap: .15rem; margin-left: .4rem; font-size: 12px; letter-spacing: .06em; }
.menubar__links a { color: var(--ink-dim); border: 1px solid transparent; border-bottom: 1px solid transparent; padding: .18rem .45rem; border-radius: 3px; transition: color .15s, border-color .15s, background .15s; }
.menubar__links a:hover { color: var(--phos-bright); background: var(--edge-soft); border-color: var(--edge); text-shadow: 0 0 6px var(--phos-glow); }
.menubar__links a::before { content: "["; color: var(--edge); }
.menubar__links a::after { content: "]"; color: var(--edge); }
.menubar__links-all { color: var(--amber) !important; }
.menubar__right { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.menubar__clock { font-family: var(--font-display); font-size: 20px; color: var(--phos); text-shadow: 0 0 8px var(--phos-glow); letter-spacing: .08em; }
#themeToggle { background: none; border: 1px solid var(--edge); color: var(--amber); padding: .2rem .55rem; cursor: pointer; }
#themeToggle:hover { border-color: var(--phos); color: var(--phos-bright); }
.menubar__progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--phos); box-shadow: 0 0 8px var(--phos-glow); transition: width .15s linear; }

/* ---- mobile jump strip (hidden on desktop) ---- */
.mobilenav { display: none; }

/* ===================== LAYOUT ===================== */
.layout { position: relative; z-index: 2; height: 100vh; height: 100dvh; padding-top: var(--bar-h); display: grid; grid-template-columns: minmax(0, 1fr); }

/* ---- file tree ---- */
.filetree {
  border-right: 1px solid var(--edge);
  padding: 1rem .5rem calc(var(--tick-h) + 1rem);
  font-size: 13px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.filetree__head, .filetree__foot { color: var(--ink-dim); font-size: 11px; letter-spacing: .12em; padding: .2rem .6rem; }
.filetree__foot { border-top: 1px solid var(--edge-soft); padding-top: .6rem; }
.filetree__ascii { margin: auto .6rem 0; color: var(--edge); font-size: 11px; line-height: 1.25; text-align: center; user-select: none; }
.filetree ul { list-style: none; margin-top: .6rem; display: flex; flex-direction: column; gap: .1rem; }
.filetree li { display: flex; align-items: center; gap: .45rem; padding: .32rem .6rem; border-radius: 4px; cursor: pointer; color: var(--ink-dim); transition: color .15s, background .15s, transform .15s var(--ease); }
.filetree li .cur { opacity: 0; color: var(--phos); transform: translateX(-4px); transition: opacity .15s, transform .2s var(--ease); }
.filetree li .fi { color: var(--edge); width: 1.2em; text-align: center; transition: color .15s; }
.filetree li:hover { color: var(--ink); background: var(--edge-soft); }
.filetree li.is-active { color: var(--phos-bright); background: color-mix(in srgb, var(--phos) 9%, transparent); transform: translateX(3px); }
.filetree li.is-active .cur { opacity: 1; transform: translateX(0); }
.filetree li.is-active .fi { color: var(--phos); }

/* ---- fullscreen snapping screens: only one frame visible ---- */
/* apps live in an absolutely-positioned slot on the desktop; only the active one is shown */
.apps { position: absolute; top: 44px; left: 196px; right: 26px; bottom: calc(var(--dock-h) + 14px); z-index: 6; perspective: 1600px; perspective-origin: 0% 50%; }
.screen { position: absolute; inset: 0; display: none; align-items: stretch; justify-content: stretch; padding: 0; }
.screen.is-on { display: flex; }
.screen.is-off { display: flex; pointer-events: none; }

/* ===================== WINDOW ===================== */
.window {
  width: 100%; height: 100%;
  max-height: 100%;
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--edge); border-radius: 7px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  overflow: hidden;
  transition: box-shadow .4s, border-color .4s;
}
/* ===================== macOS DESKTOP (hero) ===================== */
.desktop { position: relative; width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif; color: #fff; }
.desktop__wall { position: absolute; inset: 0; background: linear-gradient(180deg, #0f2440 0%, #274f80 30%, #5f8bb8 58%, #a99a86 72%, #4d5750 82%, #1f2823 100%); }
.desktop__clouds { position: absolute; inset: 0 0 35% 0; opacity: .45;
  background:
    radial-gradient(60% 40% at 20% 45%, rgba(255,255,255,.55), transparent 70%),
    radial-gradient(50% 35% at 60% 35%, rgba(255,255,255,.5), transparent 70%),
    radial-gradient(45% 30% at 85% 55%, rgba(255,255,255,.45), transparent 70%),
    radial-gradient(35% 25% at 40% 70%, rgba(255,255,255,.4), transparent 70%);
  filter: blur(10px); animation: drift 60s linear infinite alternate; }
@keyframes drift { to { transform: translateX(3%); } }
.desktop__city { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 26%; color: #232c2a; opacity: .85; }
.desktop__wall::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,.35)); }
body[data-theme="amber"] .desktop__wall { filter: sepia(.35) saturate(1.1); }
body[data-theme="cyan"] .desktop__wall { filter: hue-rotate(-15deg) saturate(1.15); }

.macbar { position: absolute; top: 0; left: 0; right: 0; height: 30px; display: flex; align-items: center; gap: 1.1rem; padding: 0 1rem; font-size: 13.5px; background: rgba(20,24,32,.45); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); color: #fff; z-index: 5; }
.macbar b { font-weight: 700; }
.macbar__right { margin-left: auto; display: flex; gap: .9rem; align-items: center; font-size: 12.5px; }
.macbar__right i { font-style: normal; opacity: .9; }

.widget { position: absolute; border-radius: 20px; background: rgba(22,30,48,.62); backdrop-filter: blur(24px) saturate(1.3); -webkit-backdrop-filter: blur(24px) saturate(1.3); box-shadow: 0 10px 30px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08); z-index: 3; }
.widget--rings { top: 60px; left: 220px; width: 330px; height: 150px; display: flex; align-items: center; justify-content: space-around; padding: 0 .6rem; }
.ring { display: flex; flex-direction: column; align-items: center; gap: .45rem; font-size: 15px; font-weight: 600; }
.ring__c { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--phos) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); position: relative; }
.ring__c::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #1b2436; }
.ring__c span { position: relative; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; }
.widget--weather { top: 60px; right: 50px; width: 150px; height: 150px; padding: 1rem 1rem .9rem; background: linear-gradient(180deg, rgba(60,120,200,.85), rgba(40,90,170,.85)); display: flex; flex-direction: column; }
.weather__city { font-size: 13px; font-weight: 600; }
.weather__temp { font-size: 34px; font-weight: 300; line-height: 1.05; }
.weather__ico { margin-top: auto; font-size: 16px; }
.weather__desc { font-size: 11.5px; line-height: 1.3; font-weight: 500; }

.deskicons { position: absolute; top: 64px; right: 40px; display: flex; flex-direction: column; gap: 1.2rem; align-items: center; z-index: 3; }
.deskicon { display: flex; flex-direction: column; align-items: center; gap: .3rem; font-size: 12px; font-weight: 600; text-align: center; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.8); border: 0; padding: .3rem; border-radius: 6px; line-height: 1.2; }
.deskicon:hover { background: rgba(255,255,255,.12); }
.deskicon__drive { width: 54px; height: 54px; border-radius: 8px; background: linear-gradient(180deg, #f4f4f4, #cfd2d6); box-shadow: 0 4px 10px rgba(0,0,0,.4), inset 0 -8px 0 #9ea3aa; display: block; }
.deskicon__folder { width: 60px; height: 46px; border-radius: 6px; background: linear-gradient(180deg, #58b6ff, #2a7ee6); box-shadow: 0 4px 10px rgba(0,0,0,.4); position: relative; display: block; margin-top: 8px; }
.deskicon__folder::before { content: ""; position: absolute; left: 0; top: -7px; width: 40%; height: 12px; border-radius: 5px 5px 0 0; background: #2f8bf0; }

/* stage manager rail — hidden off the left edge, slides in with a spring */
.stage { position: absolute; left: 0; top: 48px; bottom: calc(var(--dock-h) + 14px); width: 180px; display: flex; flex-direction: column; justify-content: center; gap: 18px; z-index: 4; perspective: 900px; perspective-origin: 100% 50%; padding-left: 10px; }
.stage__card { position: relative; width: 150px; height: 74px; cursor: pointer; transform-origin: 0 50%;
  transform: translateX(-72%) rotateY(28deg) scale(.86); opacity: .55;
  transition: transform .42s cubic-bezier(.2, .85, .25, 1), opacity .3s, filter .3s; transition-delay: calc(var(--i, 0) * 28ms);
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.5)); }
.stage.is-open .stage__card { transform: none; opacity: 1; }
.stage.is-open .stage__card:hover { transform: translateX(8px) scale(1.05); }
.stage__card.is-active { display: none; }
.stage.no-anim .stage__card { transition: none !important; }
/* a card taking over a slot: its chrome fades in while the window shrinks onto it */
.stage__card.is-landing .stage__app, .stage__card.is-landing .stage__name { animation: stageChromeIn .5s ease .1s both; }
@keyframes stageChromeIn { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: none; } }
.stage__card.is-landing .stage__name { transform-origin: 0 50%; }
.stage__thumb { position: absolute; left: 22px; top: 0; right: 0; bottom: 8px; border-radius: 6px; background: var(--panel); border: 1px solid var(--edge); overflow: hidden; }
.stage__snap { position: absolute; left: 0; top: 0; transform-origin: 0 0; pointer-events: none; user-select: none; }
.stage__snap .window { position: static !important; inset: auto !important; opacity: 1 !important; transform: none !important; border-radius: 0; box-shadow: none; }
.stage__snap .window__bar::after, .stage__snap .crt-flicker, .stage__snap .qt__grain { display: none; }
.stage__snap * { animation: none !important; transition: none !important; }
/* vw-sized things inside a clone would scale off the viewport, not the thumbnail */
.stage__snap .qt__badge { width: 26%; border-radius: 10px; box-shadow: none; }
.stage__thumb.has-snap::before, .stage__thumb.has-snap .stage__lines { display: none; }
.stage__thumb::before { content: ""; display: block; height: 10px; background: var(--panel-bar); border-bottom: 1px solid var(--edge); }
.stage__lines { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.stage__lines i { display: block; height: 3px; border-radius: 2px; background: var(--phos); opacity: .55; }
.stage__lines i:nth-child(2) { width: 70%; opacity: .35; } .stage__lines i:nth-child(3) { width: 50%; background: var(--amber); opacity: .5; } .stage__lines i:nth-child(4) { width: 85%; opacity: .25; }
.stage__app { position: absolute; left: 0; bottom: 0; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.5); background: var(--ac, #4a7cff); }
.stage__name { position: absolute; left: 24px; bottom: -14px; font-size: 10.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0,0,0,.8); opacity: 0; transition: opacity .2s; white-space: nowrap; }
.stage.is-open .stage__name { opacity: 1; }

.screen--home { pointer-events: none; left: -170px; }   /* span the full desktop so the terminal centres on screen */
.hero__hi { font-family: var(--font-display); font-size: clamp(26px, 3.2vw, 46px); color: var(--amber); letter-spacing: .06em; line-height: 1; margin-bottom: .25rem; text-shadow: 0 0 10px color-mix(in srgb, var(--amber) 40%, transparent); }
.window--term { position: absolute; left: 15%; right: 15%; top: 11%; bottom: 8%; width: auto; height: auto; max-height: none; font-family: var(--font-mono); pointer-events: auto; }
.window--term .window__body { overflow-y: auto; }

.window--term .window__body { flex: 0 1 auto; }
.screen.is-on .window {
  box-shadow: 0 22px 74px rgba(0,0,0,.62), 0 0 44px -12px var(--phos-glow);
  border-color: color-mix(in srgb, var(--phos) 32%, var(--edge));
  transition: box-shadow .4s, border-color .4s;
}
.window.is-flying, .window.is-parking { will-change: transform, opacity; box-shadow: 0 30px 60px rgba(0,0,0,.45) !important; backface-visibility: hidden; }
.window.is-flying { transition: transform .46s cubic-bezier(.42, .04, .22, 1) !important; opacity: 1; z-index: 3; }
.window.is-parking { transition: transform .46s cubic-bezier(.42, .04, .22, 1) !important; opacity: 1; z-index: 2; }

.window__bar {
  position: relative; display: flex; align-items: center; gap: .6rem;
  padding: .45rem .8rem;
  background: linear-gradient(var(--panel-bar), #0f1720);
  border-bottom: 1px solid var(--edge);
  user-select: none; font-size: 12.5px;
  flex-shrink: 0;
}
.window__bar::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--phos-glow), transparent); transform: translateX(-110%); pointer-events: none; }
@keyframes sweep { to { transform: translateX(110%); } }

.tb-traffic { display: flex; gap: 5px; }
.tb-traffic i { width: 9px; height: 9px; border-radius: 50%; background: var(--edge); display: block; }
.tb-traffic i:nth-child(1) { background: var(--rose); }
.tb-traffic i:nth-child(2) { background: var(--amber); }
.tb-traffic i:nth-child(3) { background: var(--phos); box-shadow: 0 0 6px var(--phos-glow); }
.tb-title { font-family: var(--font-display); font-size: 17px; color: var(--ink); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-menu { color: var(--ink-dim); }
.tb-actions { margin-left: auto; color: var(--ink-dim); display: flex; align-items: center; gap: .4rem; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--edge); display: inline-block; }
.dot.live { background: var(--phos); box-shadow: 0 0 8px var(--phos-glow); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }

.window__body { padding: 1.3rem 1.5rem 1.5rem; overflow-y: auto; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.window__body::-webkit-scrollbar { width: 8px; }
.window__body::-webkit-scrollbar-thumb { background: var(--edge); }

/* headings */
h2.decode { font-family: var(--font-display); font-size: 24px; color: var(--phos-bright); text-shadow: 0 0 10px var(--phos-glow); margin-bottom: 1rem; letter-spacing: .04em; min-height: 1.1em; }

/* staggered reveal children */
.meter, .trophy, .ports li, .folder { opacity: 1; transform: none; }

/* ===================== HERO / SHELL ===================== */
.hero__ascii {
  font-family: var(--font-mono);
  font-size: clamp(6px, 1.65vw, 17px);
  line-height: 1.15;
  color: var(--phos-bright);
  text-shadow: 0 0 12px var(--phos-glow);
  white-space: pre; overflow-x: auto;
  margin-bottom: .9rem;
}
.glitchable.glitch { animation: glitch .28s steps(2) 3; }
@keyframes glitch {
  0% { transform: translate(0); text-shadow: 0 0 12px var(--phos-glow); }
  25% { transform: translate(-3px, 1px); text-shadow: 3px 0 var(--rose), -3px 0 var(--amber); }
  50% { transform: translate(3px, -1px); text-shadow: -3px 0 var(--rose), 3px 0 var(--phos); }
  100% { transform: translate(0); }
}
.hero__banner { overflow: hidden; }
/* the terminal body is a flex column: without this its children get squeezed on
   short screens and the text lines end up drawn on top of each other */
.window--term .window__body > * { flex: 0 0 auto; }
.hero__sub { white-space: pre-wrap; color: var(--phos); text-shadow: 0 0 6px var(--phos-glow); font-size: 15.5px; margin-bottom: .8rem; min-height: 3.2em; }
.hero__sub .accent { color: var(--phos-bright); font-weight: 700; }
.hero__sub .amber { color: var(--amber); }

.term__live { display: flex; align-items: baseline; gap: .5ch; flex-wrap: wrap; font-size: 15.5px; }
.term__prompt { color: var(--amber); white-space: nowrap; }
.term__input { flex: 1; min-width: 4ch; color: var(--phos-bright); outline: none; caret-color: transparent; word-break: break-word; }
.term__caret { color: var(--phos-bright); animation: blink 1s steps(1) infinite; margin-left: -.4ch; }
@keyframes blink { 50% { opacity: 0; } }
.term__scrollout { max-height: 60vh; overflow-y: auto; font-size: 14px; }
.term__tip { margin-top: .85rem; color: var(--ink-dim); font-size: 12px; }
.term__echo { color: var(--ink-dim); margin-top: .5rem; }
.term__echo b { color: var(--amber); font-weight: 400; }
.term__out { white-space: pre-wrap; color: var(--ink); margin: .25rem 0 .5rem; }
.term__out .k { color: var(--phos-bright); }

/* ===================== EDITOR ===================== */
.editor { display: flex; flex: 1; min-height: 0; border: 1px solid var(--edge); border-radius: 5px; background: #060b0f; overflow: auto; }
.editor__gutter { padding: .9rem .6rem; text-align: right; color: var(--edge); background: var(--bg-soft); border-right: 1px solid var(--edge); user-select: none; font-size: 13px; white-space: pre; min-width: 3ch; }
.editor__code { padding: .9rem 1rem; font-size: 13.5px; white-space: pre-wrap; color: var(--ink); min-height: 9em; flex: 1; }
.editor__code .kw { color: var(--amber); }
.editor__code .str { color: var(--phos-bright); }
.editor__code .cm { color: var(--ink-dim); }
.editor__code .cursor { background: var(--phos); color: #04120a; animation: blink 1s steps(1) infinite; }
.editor__statusbar { display: flex; gap: 1.2rem; margin-top: .5rem; font-size: 11px; letter-spacing: .1em; color: var(--ink-dim); }
.editor__hint { margin-left: auto; }

/* ===================== MONITOR ===================== */
.meters { display: flex; flex-direction: column; gap: 1.25rem; }
.meter { display: grid; grid-template-columns: 5.5rem 1fr; grid-template-rows: auto auto; gap: .2rem .8rem; align-items: center; }
.meter__label { font-family: var(--font-display); font-size: 17px; color: var(--amber); grid-row: 1 / 3; }
.meter__track { height: 14px; border: 1px solid var(--edge); background: var(--bg-soft); position: relative; overflow: hidden; }
.meter__fill { position: absolute; inset: 0 100% 0 0; background: repeating-linear-gradient(90deg, var(--phos) 0 6px, transparent 6px 9px); box-shadow: 0 0 12px var(--phos-glow); transition: inset 1.1s var(--ease); }
.screen.is-on .meter__fill { inset: 0 calc(100% - var(--pct)) 0 0; }
.meter__val { font-size: 12px; color: var(--ink-dim); }
.monitor__graphs { margin-top: 1.4rem; flex: 1; min-height: 120px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; }
.graph { border: 1px solid var(--edge); border-radius: 5px; background: var(--bg-soft); padding: .55rem .7rem .6rem; display: flex; flex-direction: column; min-height: 0; }
.graph__t { font-size: 11.5px; letter-spacing: .1em; color: var(--ink-dim); text-transform: uppercase; margin-bottom: .45rem; }
.graph__t b { color: var(--amber); font-weight: 400; margin-left: .4rem; font-family: var(--font-display); font-size: 16px; letter-spacing: .05em; }
.graph__plot { position: relative; flex: 1; min-height: 0; }
.graph__bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--edge); }
.graph__bars i { flex: 1; height: 0; background: var(--phos); opacity: .7; box-shadow: 0 0 6px var(--phos-glow); transition: height .18s linear, background .3s, opacity .3s; }
.graph__bars i.warm { background: var(--amber); box-shadow: 0 0 7px color-mix(in srgb, var(--amber) 55%, transparent); opacity: .85; }
.graph__bars i.hot { background: var(--rose); box-shadow: 0 0 9px color-mix(in srgb, var(--rose) 60%, transparent); opacity: 1; }
.graph__bars i:last-child { opacity: 1; filter: brightness(1.35); }
/* peak line, sits where the highest sample in the window was */
.graph__peak { position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: repeating-linear-gradient(90deg, var(--ink-dim) 0 3px, transparent 3px 7px); opacity: .5; transition: bottom .35s var(--ease); pointer-events: none; }
.graph__hint { font-size: 10px; letter-spacing: .08em; color: var(--edge); margin-top: .35rem; text-transform: uppercase; transition: color .2s; }
.graph__hint i { font-style: normal; color: var(--ink-dim); }
.graph:hover .graph__hint { color: var(--ink-dim); }
.graph.is-live { border-color: color-mix(in srgb, var(--phos) 45%, var(--edge)); box-shadow: 0 0 18px -8px var(--phos-glow); }
.graph.is-live .graph__t { color: var(--ink); }

/* ===================== QUICKTIME (experience) ===================== */
.window--qt { width: 100%; }
.window__bar--qt { position: relative; justify-content: center; }
.window__bar--qt .tb-traffic { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); }
.qt__title { display: inline-flex; align-items: center; gap: .45rem; font-family: var(--font-display); font-size: 18px; color: var(--ink); letter-spacing: .03em; }
.qt__ico { width: 15px; height: 15px; color: var(--phos); }

.qt { padding: 0; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.qt__video {
  position: relative; flex: 1; min-height: 0; overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 110%, color-mix(in srgb, var(--phos) 16%, transparent), transparent 60%),
    radial-gradient(80% 60% at 20% 0%, color-mix(in srgb, var(--phos) 9%, transparent), transparent 60%),
    linear-gradient(180deg, #071018 0%, #040a0f 60%, #02060a 100%);
  box-shadow: inset 0 0 90px rgba(0,0,0,.75);
}
.qt__grain {
  position: absolute; inset: 0; opacity: .05; pointer-events: none;
  /* cheap static film grain: one small SVG tile, no animation (a conic-gradient tile animated at 60fps pinned the renderer) */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  background-size: 120px 120px;
}
.qt__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.qt__flash.roll { animation: qtcut .35s ease-out 1; }
@keyframes qtcut { 0% { opacity: .18; } 100% { opacity: 0; } }

.qt__content { position: absolute; inset: 0; padding: 2rem 2.2rem 7.2rem; display: flex; flex-direction: column; justify-content: center; }
.qt__badge {
  position: absolute; right: 6%; top: 50%; transform: translateY(-58%);
  width: clamp(230px, 34vw, 460px); aspect-ratio: 1;
  border-radius: 32px; display: grid; place-items: center; padding: 6%;
  background: radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.97), rgba(226,235,240,.9));
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.8), 0 0 60px -10px var(--phos-glow), inset 0 1px 0 rgba(255,255,255,.9);
}
.qt__badge img { width: 100%; height: 100%; object-fit: contain; display: block; }
.qt__badge.in { animation: badgeIn .5s var(--ease) both; }
@keyframes badgeIn { from { opacity: 0; transform: translateY(-58%) scale(.9) rotate(-3deg); } to { opacity: 1; transform: translateY(-58%) scale(1) rotate(0); } }
.qt__content .vhs__role, .qt__content .vhs__org, .qt__content .vhs__when, .qt__content .vhs__note, .qt__chapter { max-width: min(52ch, 52%); }
.qt__chapter { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: .5rem; }
.vhs__role { font-family: var(--font-display); font-size: clamp(26px, 4.2vw, 40px); color: var(--phos-bright); text-shadow: 0 0 16px var(--phos-glow); line-height: 1; }
.vhs__org { color: var(--amber); margin-top: .35rem; font-size: 14px; }
.vhs__when { color: var(--ink-dim); font-size: 12px; margin-top: .15rem; }
.vhs__note { color: var(--ink); font-size: 13.5px; margin-top: .8rem; max-width: 56ch; line-height: 1.55; }

.qt__paused { position: absolute; top: 1rem; right: 1.1rem; font-family: var(--font-display); font-size: 16px; letter-spacing: .12em; color: #fff; text-shadow: 0 0 8px rgba(255,255,255,.6); opacity: 0; transition: opacity .2s; }
.qt__paused.show { opacity: .9; }

/* floating HUD */
.qt__hud {
  position: absolute; left: 50%; bottom: 1.1rem; transform: translateX(-50%);
  width: min(560px, calc(100% - 2rem));
  background: color-mix(in srgb, var(--panel-bar) 72%, #000 28%);
  border: 1px solid color-mix(in srgb, var(--edge) 70%, transparent);
  border-radius: 12px; padding: .7rem 1rem .75rem;
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: 0 10px 30px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.05);
  display: flex; flex-direction: column; gap: .55rem;
  transition: opacity .25s, transform .25s var(--ease);
}
.qt__row { display: flex; align-items: center; gap: .6rem; }
.qt__btn { background: none; border: 0; color: var(--ink); width: 34px; height: 30px; padding: 0; display: grid; place-items: center; cursor: pointer; border-radius: 6px; transition: color .15s, background .15s, transform .08s; }
.qt__btn svg { width: 20px; height: 20px; display: block; }
.qt__btn:hover { color: var(--phos-bright); background: rgba(255,255,255,.06); }
.qt__btn:active { transform: scale(.92); }
.qt__btn--play svg { width: 26px; height: 26px; }
.qt__btn--play .qt__i-play { display: none; }
.qt.is-paused .qt__btn--play .qt__i-play { display: block; }
.qt.is-paused .qt__btn--play .qt__i-pause { display: none; }
.qt__transport { flex: 1; display: flex; justify-content: center; align-items: center; gap: 1.1rem; }
.qt__right { display: flex; gap: .2rem; }
.qt__btn.is-muted .qt__wave { display: none; }

.qt__vol { -webkit-appearance: none; appearance: none; width: 110px; height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--ink) var(--v, 55%), rgba(255,255,255,.18) var(--v, 55%)); outline: none; cursor: pointer; }
.qt__vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.qt__vol::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 0; }
.qt__vol::-moz-range-track { background: transparent; }

.qt__time { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.qt__scrub { position: relative; flex: 1; height: 16px; cursor: pointer; }
.qt__scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; transform: translateY(-50%); border-radius: 2px; background: rgba(255,255,255,.2); }
.qt__fill { position: absolute; left: 0; top: 50%; height: 4px; width: 0; transform: translateY(-50%); border-radius: 2px; background: var(--phos); box-shadow: 0 0 8px var(--phos-glow); transition: width .25s linear; }
.qt__marks { position: absolute; inset: 0; pointer-events: none; }
.qt__marks i { position: absolute; top: 50%; width: 2px; height: 8px; transform: translate(-50%, -50%); background: rgba(0,0,0,.55); }
.qt__head { position: absolute; top: 50%; left: 0; width: 3px; height: 14px; transform: translate(-50%, -50%); border-radius: 2px; background: #fff; box-shadow: 0 0 6px rgba(255,255,255,.7); transition: left .25s linear; }

/* chapters popover */
.qt__chapters {
  position: absolute; right: 1.2rem; bottom: 7.4rem; list-style: none; min-width: 240px; z-index: 3;
  background: color-mix(in srgb, var(--panel-bar) 82%, #000 18%); border: 1px solid var(--edge); border-radius: 10px;
  padding: .4rem; backdrop-filter: blur(14px); box-shadow: 0 12px 30px rgba(0,0,0,.5);
}
.qt__chapters li { display: flex; gap: .7rem; align-items: baseline; padding: .45rem .6rem; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--ink); }
.qt__chapters li:hover { background: rgba(255,255,255,.07); }
.qt__chapters li.cur { color: var(--phos-bright); }
.qt__chapters li .n { color: var(--ink-dim); font-variant-numeric: tabular-nums; min-width: 4.2ch; }
.qt__chapters li .t { flex: 1; }
.qt__chapters li .w { color: var(--ink-dim); font-size: 11px; }

/* ===================== FINDER (projects) ===================== */
.window--finder { --fbg: #0a1218; --fside: #0d151d; }
.finder { flex: 1; min-height: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); height: 100%; }
.finder svg { width: 18px; height: 18px; flex-shrink: 0; }

.finder__side { background: var(--fside); border-right: 1px solid var(--edge); padding: .8rem .7rem 1rem; overflow-y: auto; font-size: 13.5px; }
.finder__traffic { margin: .1rem .3rem 1.3rem; }
.finder__h { font-size: 11.5px; color: var(--ink-dim); margin: .9rem .5rem .3rem; letter-spacing: .01em; font-weight: 500; }
.finder__list { list-style: none; }
.finder__list li { display: flex; align-items: center; gap: .55rem; padding: .34rem .5rem; border-radius: 6px; color: var(--ink); cursor: pointer; transition: background .12s; }
.finder__list li:hover { background: rgba(255,255,255,.05); }
.finder__list li svg { color: var(--phos); }
.finder__list li.cur { background: rgba(255,255,255,.08); color: var(--phos-bright); }
.finder__cloud { margin-left: auto; color: var(--ink-dim); font-size: 12px; }
.finder__tags li i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: var(--tc, var(--phos)); box-shadow: 0 0 6px var(--tc, var(--phos)); }
.finder__tags li.cur { color: var(--ink); }

.finder__main { display: flex; flex-direction: column; min-width: 0; background: var(--fbg); }
.finder__toolbar { display: flex; align-items: center; gap: .8rem; padding: .55rem .9rem; border-bottom: 1px solid var(--edge); background: linear-gradient(var(--panel-bar), var(--fbg)); flex-shrink: 0; }
.finder__navbtns { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; }
.finder__navbtns button { background: none; border: 0; color: var(--ink); width: 32px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.finder__navbtns button + button { border-left: 1px solid var(--edge); }
.finder__navbtns button:hover { background: rgba(255,255,255,.06); color: var(--phos-bright); }
.finder__title { font-size: 15px; font-weight: 700; color: var(--ink); }
.finder__tools { margin-left: auto; display: flex; align-items: center; gap: .45rem; }
.finder__tool { background: none; border: 1px solid var(--edge); border-radius: 8px; color: var(--ink); height: 28px; padding: 0 .5rem; display: inline-flex; align-items: center; gap: .2rem; cursor: pointer; font-size: 10px; }
.finder__tool:hover { background: rgba(255,255,255,.06); color: var(--phos-bright); }
.finder__tool i { font-style: normal; color: var(--ink-dim); }
.finder__toolgroup { display: inline-flex; border: 1px solid var(--edge); border-radius: 8px; overflow: hidden; }
.finder__toolgroup .finder__tool { border: 0; border-radius: 0; }
.finder__toolgroup .finder__tool + .finder__tool { border-left: 1px solid var(--edge); }
.finder__search { display: inline-flex; align-items: center; gap: .3rem; border: 1px solid var(--edge); border-radius: 8px; height: 28px; padding: 0 .5rem; color: var(--ink-dim); width: 150px; transition: width .2s var(--ease), border-color .2s; }
.finder__search:focus-within { border-color: var(--phos); width: 200px; color: var(--phos); }
.finder__search input { background: none; border: 0; outline: 0; color: var(--ink); font: inherit; font-size: 12.5px; width: 100%; min-width: 0; }
.finder__search input::placeholder { color: var(--ink-dim); }

.finder__content { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(260px, .9fr); }
.finder__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 1.2rem .6rem; align-content: start; padding: 1.4rem 1.2rem; overflow-y: auto; }
.folder { background: none; border: 0; padding: .4rem .2rem; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .55rem; border-radius: 8px; transition: opacity .5s var(--ease), transform .5s var(--ease); }
.folder:hover .folder__ico { transform: translateY(-3px) scale(1.04); }
.folder.is-sel .folder__ico { filter: brightness(1.15) drop-shadow(0 0 10px var(--phos-glow)); }
/* CSS folder icon */
.folder__ico { position: relative; width: 78px; height: 58px; margin-top: 8px; transition: transform .18s var(--ease), filter .18s; }
.folder__ico::before { content: ""; position: absolute; left: 0; top: -8px; width: 38%; height: 14px; border-radius: 5px 5px 0 0; background: color-mix(in srgb, var(--phos) 70%, #1a4a2a); }
.folder__ico::after { content: ""; position: absolute; inset: 0; border-radius: 5px; background: linear-gradient(180deg, color-mix(in srgb, var(--phos) 90%, #fff) 0%, var(--phos) 55%, color-mix(in srgb, var(--phos) 75%, #000) 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 4px 10px -4px rgba(0,0,0,.7); }
.folder__ico i { position: absolute; left: 0; right: 0; top: 4px; height: 3px; background: rgba(0,0,0,.18); z-index: 1; border-radius: 2px; }
.folder__name { font-size: 13px; color: var(--ink); line-height: 1.25; padding: .12rem .45rem; border-radius: 5px; max-width: 100%; word-break: break-word; }
.folder.is-sel .folder__name { background: var(--phos); color: #04140a; font-weight: 500; }
.folder__tag { font-size: 10.5px; color: var(--ink-dim); margin-top: -.3rem; }
.folder.is-hidden { display: none; }

.finder__preview { border-left: 1px solid var(--edge); background: color-mix(in srgb, var(--fbg) 70%, #000); padding: 1.4rem 1.4rem; font-size: 13.5px; overflow-y: auto; }
.finder__preview .finder__bigico { width: 110px; height: 82px; margin: .6rem auto 1.2rem; }
.finder__preview .finder__bigico::before { height: 18px; top: -10px; }
.finder__hint { color: var(--ink-dim); }
.finder__preview h3 { font-family: var(--font-display); font-size: 26px; color: var(--phos-bright); text-shadow: 0 0 8px var(--phos-glow); margin-bottom: .1rem; }
.finder__preview .sub { color: var(--amber); font-size: 11.5px; margin-bottom: .8rem; }
.finder__preview pre { white-space: pre-wrap; color: var(--ink); line-height: 1.55; }
.finder__preview a { font-size: 12px; display: inline-block; margin-top: .8rem; }
.finder__kv { margin-top: 1rem; border-top: 1px solid var(--edge); padding-top: .7rem; display: grid; grid-template-columns: auto 1fr; gap: .25rem .8rem; font-size: 12px; }
.finder__kv span:nth-child(odd) { color: var(--ink-dim); }
.finder__status { flex-shrink: 0; border-top: 1px solid var(--edge); padding: .3rem .9rem; font-size: 11.5px; color: var(--ink-dim); text-align: center; }

/* ===================== TROPHIES ===================== */
.honors__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.honors__sub { color: var(--ink-dim); font-size: 12.5px; margin-top: -.6rem; }
.honors__ring {
  flex: 0 0 auto; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--phos) calc(var(--p, 0) * 1%), color-mix(in srgb, var(--edge) 80%, transparent) 0);
  transition: background 1.2s var(--ease);
}
.honors__ring::before { content: ""; position: absolute; width: 58px; height: 58px; border-radius: 50%; background: var(--panel); }
.honors__ring span { position: relative; font-family: var(--font-display); font-size: 20px; color: var(--ink-dim); letter-spacing: .04em; }
.honors__ring b { color: var(--phos-bright); font-weight: 400; }

.trophies { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-content: start; max-width: 1100px; }
.trophy {
  position: relative; overflow: hidden; border: 1px solid var(--edge); border-radius: 12px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--tc) 9%, var(--bg-soft)), var(--bg-soft) 60%);
  padding: 1.1rem 1.15rem; display: flex; gap: 1rem; align-items: flex-start;
}
.trophy::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(105deg, transparent, rgba(255,255,255,.16), transparent); transform: skewX(-18deg); }
.screen.is-on .trophy::after { animation: shine 1.1s var(--ease) both; animation-delay: calc(.5s + var(--i,0) * .12s); }
@keyframes shine { to { left: 130%; } }
.trophy__medal {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 27px; color: var(--tc);
  background: radial-gradient(circle at 34% 28%, color-mix(in srgb, var(--tc) 26%, transparent), transparent 62%), var(--panel);
  border: 1px solid color-mix(in srgb, var(--tc) 55%, var(--edge));
  box-shadow: inset 0 0 14px -4px color-mix(in srgb, var(--tc) 60%, transparent), 0 6px 16px -10px color-mix(in srgb, var(--tc) 80%, transparent);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.trophy__tag { display: inline-block; font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--tc); border: 1px solid color-mix(in srgb, var(--tc) 40%, var(--edge)); border-radius: 999px; padding: .1rem .5rem; margin-bottom: .45rem; }
.trophy__body b { display: block; color: var(--phos-bright); font-weight: 500; font-size: 15px; line-height: 1.25; }
.trophy__org { color: var(--amber); font-size: 12px; }
.trophy__note { color: var(--ink-dim); font-size: 12.5px; margin-top: .5rem; line-height: 1.5; }

/* ===================== NET ===================== */
.net__status { white-space: pre-wrap; color: var(--phos); text-shadow: 0 0 6px var(--phos-glow); font-size: 13px; min-height: 5.5em; margin-bottom: 1rem; }
#netLed.ok { background: var(--phos); box-shadow: 0 0 8px var(--phos-glow); }
.ports { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.ports li { display: flex; }
.ports a { flex: 1; display: flex; align-items: center; gap: .7rem; border: 1px solid var(--edge); border-radius: 4px; padding: .55rem .8rem; }
.ports a:hover { background: color-mix(in srgb, var(--phos) 7%, transparent); border-color: var(--phos); }
.ports .jack { width: 10px; height: 10px; border-radius: 50%; background: var(--phos); box-shadow: 0 0 8px var(--phos-glow); flex-shrink: 0; }
.ports .pk { color: var(--amber); width: 5rem; flex-shrink: 0; font-size: 12px; }
.net__ascii { margin-top: 1.1rem; color: var(--edge); font-size: 12px; line-height: 1.3; user-select: none; }

/* ===================== DOCK ===================== */
.dock { position: fixed; left: 0; right: 0; bottom: 8px; z-index: 4200; display: flex; justify-content: center; pointer-events: none; }
.dock__inner {
  pointer-events: auto; display: flex; align-items: flex-end; gap: 6px;
  padding: 7px 10px; border-radius: 20px; max-width: calc(100% - 2rem); overflow: visible;
  background: color-mix(in srgb, var(--panel-bar) 62%, transparent);
  border: 1px solid color-mix(in srgb, #fff 12%, transparent);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  box-shadow: 0 16px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.12);
}
.dock__sep { width: 1px; align-self: stretch; margin: 4px 5px; background: rgba(255,255,255,.16); flex: 0 0 auto; }
.dock__item {
  position: relative; flex: 0 0 auto; width: 52px; height: 52px; border: 0; padding: 0; cursor: pointer;
  background: none; transform-origin: 50% 100%; will-change: transform;
  transition: transform .22s var(--ease);
}
/* while the pointer is over the dock the transform is driven per frame, so the
   easing transition has to get out of the way or the icons lag behind */
.dock__inner.is-magnifying .dock__item, .dock__inner.no-mag .dock__item { transition: none; }
.dock__tile {
  position: relative; width: 100%; height: 100%; border-radius: 23%; display: grid; place-items: center;
  background: var(--bg); overflow: hidden;
  box-shadow: 0 7px 15px -4px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.35), inset 0 0 0 .5px rgba(0,0,0,.35);
}
/* the gloss every macOS icon plate has */
.dock__tile::after {
  content: ""; position: absolute; inset: 0 0 52% 0;
  background: linear-gradient(rgba(255,255,255,.26), rgba(255,255,255,.05));
  pointer-events: none;
}
.dock__tile svg { position: relative; width: 62%; height: 62%; display: block; }
/* running indicator */
.dock__item::after {
  content: ""; position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; border-radius: 50%;
  transform: translateX(-50%); background: var(--ink-dim); opacity: 0; transition: opacity .2s, background .2s;
}
.dock__item.is-open::after { opacity: .75; }
.dock__item.is-active::after { opacity: 1; background: var(--phos); box-shadow: 0 0 7px var(--phos-glow); }
/* label */
.dock__item::before {
  content: attr(data-label); position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%) translateY(4px);
  padding: .28rem .6rem; border-radius: 7px; white-space: nowrap; font-size: 12px; color: var(--ink);
  background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--edge);
  opacity: 0; pointer-events: none; transition: opacity .16s, transform .16s var(--ease);
}
.dock__item:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }
.dock__item:active .dock__tile { filter: brightness(.85); }
@keyframes dockBounce { 0%,100% { translate: 0 0; } 40% { translate: 0 -16px; } }
.dock__item.is-bouncing { animation: dockBounce .55s var(--ease) 2; }

/* ===================== JUICE ===================== *//* ===================== JUICE ===================== */
.squash { transform: scale(.94) !important; transition: transform .07s !important; }

#sfxToggle { background: none; border: 1px solid var(--edge); color: var(--ink-dim); padding: .2rem .55rem; cursor: pointer; transition: color .15s, border-color .15s, box-shadow .15s; }
#sfxToggle.is-on { color: var(--phos-bright); border-color: var(--phos); box-shadow: 0 0 12px -4px var(--phos-glow); }
#sfxToggle:hover { border-color: var(--phos); }

/* file tree rows: sliding underline + glow */
.filetree li { position: relative; }
.filetree li::after {
  content: ""; position: absolute; left: .6rem; right: 100%; bottom: 2px; height: 1px;
  background: var(--phos); box-shadow: 0 0 6px var(--phos-glow);
  transition: right .25s var(--ease);
}
.filetree li:hover::after { right: .6rem; }

/* traffic lights grow on bar hover */
.window__bar:hover .tb-traffic i { transform: scale(1.25); }
.tb-traffic i { transition: transform .15s var(--ease); }

/* folders: icon bounce + wiggle on hover */
@keyframes icobounce { 30% { transform: translateY(-5px) rotate(-4deg) scale(1.12); } 60% { transform: translateY(1px) rotate(3deg); } 100% { transform: none; } }

/* trophies: lift + glow on hover */
.trophy { transition: transform .22s var(--ease), border-color .18s, box-shadow .18s; }
.trophy:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tc) 60%, var(--edge)); box-shadow: 0 16px 30px -14px color-mix(in srgb, var(--tc) 75%, transparent); }
.trophy:hover .trophy__medal { transform: scale(1.08) rotate(-4deg); box-shadow: inset 0 0 18px -3px color-mix(in srgb, var(--tc) 70%, transparent), 0 0 22px -6px color-mix(in srgb, var(--tc) 85%, transparent); }

/* ports: jack blinks + arrow slides in on hover */
.ports a { position: relative; overflow: hidden; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.ports a:hover { transform: translateX(4px); }
.ports a::after { content: "→"; position: absolute; right: .8rem; opacity: 0; transform: translateX(-8px); transition: opacity .18s, transform .18s var(--ease); color: var(--phos-bright); }
.ports a:hover::after { opacity: 1; transform: none; }
.ports a:hover .jack { animation: pulse .5s ease-in-out infinite; }


/* meter tracks shimmer on hover */
.meter:hover .meter__fill { filter: brightness(1.4); }
.meter__fill { transition: inset 1.1s var(--ease), filter .2s; }

/* menubar clock breathes */
.menubar__clock { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { text-shadow: 0 0 14px var(--phos-glow), 0 0 4px var(--phos-glow); } }

/* links get a scanline flash */
a, button { -webkit-tap-highlight-color: transparent; }

/* ===================== CLAUDE CHAT (ask) ===================== */
.window--chat { font-family: -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif; }
.chat { flex: 1; min-height: 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100%; background: #1f1f1f; color: #ececec; }
.chat__chips { max-width: 760px; width: calc(100% - 3rem); margin: 0 auto .5rem; display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }
.chat__chips button { background: #262626; border: 1px solid #3a3a3a; color: #ddd; border-radius: 999px; padding: .38rem .85rem; font: inherit; font-size: 13px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.chat__chips button:hover { background: #333; border-color: var(--phos); color: #fff; }
.chat__side { background: #171717; padding: .8rem .7rem; display: flex; flex-direction: column; overflow-y: auto; font-size: 14px; }
.chat__sidetop { display: flex; align-items: center; justify-content: space-between; margin: .1rem .3rem 1.2rem; }
.chat__sideicons i { font-style: normal; font-size: 18px; margin-left: .9rem; color: #bbb; cursor: pointer; }
.chat__sideicons i:hover { color: #fff; }
.chat__h { font-size: 12px; font-weight: 700; color: #ddd; margin: 1.1rem .6rem .35rem; }
.chat__list { list-style: none; }
.chat__list li { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border-radius: 8px; cursor: pointer; color: #ececec; }
.chat__list li:hover { background: #2a2a2a; }
.chat__list li.cur { background: #2f2f2f; }
.chat__spark { color: var(--phos); font-size: 16px; }
.chat__glyph { color: #aaa; font-family: var(--font-display); font-size: 16px; }
.chat__main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat__top { display: flex; align-items: center; padding: .7rem 1.2rem; }
.chat__top .chat__topright { margin-left: auto; }
.chat__model { font-size: 17px; font-weight: 600; color: #ddd; cursor: pointer; }
.chat__model small { font-weight: 400; color: #999; font-size: 13px; margin-left: .3rem; }
.chat__topright { display: flex; align-items: center; gap: .9rem; }
.chat__share { background: #2a2a2a; border: 1px solid #3a3a3a; color: #fff; border-radius: 999px; padding: .45rem .9rem; font: inherit; font-size: 13.5px; cursor: pointer; }
.chat__share:hover { background: #333; }
.chat__avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--phos), #2a6a3a); display: grid; place-items: center; font-weight: 700; color: #04140a; }
.chat__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: .5rem 1.5rem 1rem; }
.chat__msgs { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 1.4rem; }
.msg { display: flex; gap: .9rem; line-height: 1.6; font-size: 15.5px; }
.msg--user { justify-content: flex-end; }
.msg--user .msg__body { background: #2f2f2f; border-radius: 18px; padding: .6rem 1.1rem; max-width: 70%; }
.msg--ai .msg__ico { width: 28px; height: 28px; border-radius: 50%; border: 1px solid #444; display: grid; place-items: center; color: var(--phos); flex-shrink: 0; font-size: 15px; margin-top: .2rem; }
.msg__body h4 { font-size: 15.5px; margin: .9rem 0 .2rem; color: #fff; }
.msg__body h4:first-child { margin-top: 0; }
.msg__body p { margin: 0 0 .5rem; }
.msg__body ul { margin: .1rem 0 .5rem 1.2rem; }
.msg__body a { color: #4c9dff; border: 0; }
.msg__body b { color: #fff; }
.msg__body code { font-size: 13px; }
.msg--typing .msg__body::after { content: "▍"; color: var(--phos); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.chat__composer { max-width: 760px; width: calc(100% - 3rem); margin: .3rem auto 0; display: flex; align-items: center; background: #2b2b2b; border: 1px solid #3a3a3a; border-radius: 999px; padding: .35rem .45rem .35rem 1.2rem; }
.chat__composer input { flex: 1; background: none; border: 0; outline: 0; color: #fff; font: inherit; font-size: 15.5px; min-width: 0; }
.chat__composer input::placeholder { color: #8a8a8a; }
.chat__composer button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: #fff; color: #000; font-size: 18px; cursor: pointer; }
.chat__composer button:hover { background: var(--phos); }
.chat__disclaimer { text-align: center; font-size: 11.5px; color: #8a8a8a; padding: .5rem 0 .7rem; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 860px) {
  :root { --bar-h: 40px; --tick-h: 26px; --dock-h: 62px; }
  .menubar { padding: 0 .7rem; gap: .5rem; font-size: 12px; }
  .menubar__logo { font-size: 20px; }
  .crumbs span:not(.crumbs__file), .crumbs i { display: none; }
  .crumbs::before { content: "…/"; color: var(--edge); }
  .menubar__links { margin-left: 0; }
  .menubar__links a:not(.menubar__links-all) { display: none; }
  .menubar__links a { padding: .15rem .3rem; }
  .menubar__right { gap: .5rem; }
  .menubar__clock { display: none; }
  #sfxToggle, #themeToggle { padding: .15rem .4rem; font-size: 11px; }

  .layout { grid-template-columns: 1fr; }
  .apps { top: calc(var(--bar-h) + 6px); left: 6px; right: 6px; bottom: calc(var(--dock-h) + 8px); }
  .stage { display: none; }
  .screen--home { left: 0; }
  .window--term { left: 0; right: 0; top: 16%; bottom: 0; }
  .hero__hi { font-size: 20px; }

  /* the dock handles navigation on phones, so the jump strip is redundant */
  .mobilenav { display: none; }
  .mobilenav--unused {
    display: flex; gap: .35rem; position: fixed; top: var(--bar-h); left: 0; right: 0; z-index: 3900;
    padding: .35rem .6rem; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--edge);
  }
  .mobilenav::-webkit-scrollbar { display: none; }
  .mobilenav button {
    flex: 0 0 auto; background: none; border: 1px solid var(--edge); border-radius: 999px;
    color: var(--ink-dim); font: inherit; font-size: 11px; letter-spacing: .04em; padding: .2rem .6rem; cursor: pointer;
    transition: color .15s, border-color .15s, background .15s;
  }
  .mobilenav button.on { color: var(--phos-bright); border-color: var(--phos); background: var(--edge-soft); text-shadow: 0 0 6px var(--phos-glow); }


  .window { width: 100%; border-radius: 6px; }
  .window__body { padding: .9rem .85rem 1rem; }
  .tb-title { font-size: 15px; }
  .tb-menu { display: none; }
  h2.decode { font-size: 21px; }

  .hero__ascii { font-size: clamp(4px, 2.05vw, 10px); margin-bottom: .6rem; }
  .macbar { font-size: 12px; gap: .6rem; padding: 0 .6rem; }
  .macbar span:not(.macbar__right):not(#macClock) { display: none; }
  .macbar__right i { display: none; }
  .widget--rings { left: 12px; top: 40px; width: calc(100% - 24px); height: 96px; }
  .ring__c { width: 44px; height: 44px; } .ring { font-size: 12px; }
  .widget--weather, .deskicons { display: none; }
  .chat { grid-template-columns: 1fr; }
  .chat__side { display: none; }

  .chat__chips { width: calc(100% - 1.4rem); gap: .3rem; }
  .chat__chips button { font-size: 12px; padding: .3rem .65rem; }
  .msg { font-size: 14px; }
  .msg--user .msg__body { max-width: 85%; }
  .chat__scroll { padding: .3rem .8rem; }
  .chat__composer { width: calc(100% - 1.4rem); }
  .hero__sub { font-size: 13px; min-height: 0; }
  .term__live { font-size: 13px; }
  .term__tip { font-size: 11px; }
  .editor__code { font-size: 12.5px; padding: .7rem .7rem; }
  .editor__gutter { padding: .7rem .4rem; font-size: 12px; }
  .editor__statusbar { gap: .7rem; flex-wrap: wrap; }
  .editor__hint { display: none; }

  .meter__label { font-size: 15px; }
  .monitor__graphs { grid-template-columns: 1fr; gap: .5rem; margin-top: .8rem; }
  .graph { padding: .4rem .5rem; }

  .qt__video { min-height: 0; }
  .qt__content { padding: 1.4rem 1.1rem 8.6rem; justify-content: flex-start; }
  .qt__badge { position: static; transform: none; width: 108px; border-radius: 18px; margin: 0 0 .7rem auto; padding: 9%; }
  @keyframes badgeIn { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
  .qt__content .vhs__role, .qt__content .vhs__org, .qt__content .vhs__when, .qt__content .vhs__note, .qt__chapter { max-width: none; }
  .vhs__role { font-size: clamp(22px, 6.4vw, 30px); }
  .vhs__note { font-size: 12.5px; }
  .qt__hud { width: calc(100% - 1.2rem); bottom: .6rem; padding: .55rem .7rem .6rem; border-radius: 10px; }
  .qt__vol { width: 64px; }
  .qt__transport { gap: .5rem; }
  .qt__chapters { right: .6rem; left: .6rem; bottom: 7.2rem; min-width: 0; }

  .finder { grid-template-columns: 1fr; }
  .finder__side { display: none; }
  .finder__toolbar { padding: .45rem .6rem; gap: .5rem; }
  .finder__tools .finder__tool:not(#finderShare), .finder__toolgroup { display: none; }
  .finder__search { width: 110px; }
  .finder__content { grid-template-columns: 1fr; grid-template-rows: max-content minmax(0, 1fr); }
  /* one sideways-scrolling strip of folders, so no vertical space is wasted */
  .finder__grid { display: flex; gap: .55rem; padding: .7rem .5rem; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .finder__grid::-webkit-scrollbar { display: none; }
  .folder { flex: 0 0 86px; }
  .folder__ico { width: 56px; height: 42px; }
  .finder__preview { border-left: 0; border-top: 1px solid var(--edge); padding: .8rem; overflow-y: auto; }
  .finder__preview .finder__bigico { display: none; }
  .finder__preview h3 { font-size: 22px; }
  .finder__preview pre { font-size: 12px; }
  .finder__kv { display: none; }

  .trophies { grid-template-columns: 1fr; gap: .5rem; }
  .trophy { padding: .8rem; }
  .trophy { padding: .7rem; }

  .net__status { font-size: 12px; min-height: 0; }
  .ports { gap: .45rem; }
  .ports a { padding: .5rem .6rem; font-size: 12.5px; min-width: 0; }
  .ports a > :last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ports .pk { width: 4.4rem; }
  .net__ascii { display: none; }

  :root { --dock-h: 62px; }
  .dock__inner { gap: 3px; padding: 5px 7px; border-radius: 16px; overflow-x: auto; scrollbar-width: none; }
  .dock__item { width: 42px; height: 42px; }
  .dock__tile { border-radius: 11px; font-size: 21px; }
  .dock__item::before { display: none; }
  .honors__head { flex-direction: column; gap: .4rem; }
  .honors__ring { width: 58px; height: 58px; }
  .honors__ring::before { width: 44px; height: 44px; }
}
@media (max-width: 420px) {
  .crumbs { display: none; }
  .screen { padding-left: .4rem; padding-right: .4rem; }
}
@media (hover: none) {
  .menubar__links a, .ports a, .folder, .qt__btn, .mobilenav button { -webkit-tap-highlight-color: transparent; }
  .spotlight { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .window { opacity: 1; transform: none; filter: none; }
  .meter, .trophy, .ports li, .folder { opacity: 1; transform: none; }
  .meter__fill { inset: 0 calc(100% - var(--pct)) 0 0; }
  .dotgrid, .crt-flicker, .crt-power, .qt__grain { display: none; }
  .screens { scroll-snap-type: none; }
}
