:root {
  --bg: #08080a;
  --ink: #f2f2ef;
  --ink-2: rgba(242, 242, 239, 0.62);
  --ink-3: rgba(242, 242, 239, 0.38);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --glass: rgba(14, 14, 17, 0.62);
  --accent: #ff7a26;
  --accent-2: #ffa366;
  --steel: #c9ccd2;
  --blue: #9bbcff;
  --sans: "Inter Tight", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); }
body { font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
code, .mono { font-family: var(--mono); font-variant-ligatures: none; }
::selection { background: var(--accent); color: #000; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.veil {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    linear-gradient(to top, rgba(8, 8, 10, 0.85), transparent 34%),
    linear-gradient(to bottom, rgba(8, 8, 10, 0.55), transparent 18%);
}

/* header */
.hd { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 26px 40px; z-index: 10; }
.mark { display: flex; align-items: center; gap: 14px; }
.mark-o { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); position: relative; }
.mark-o::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 18px var(--accent); }
.mark b { display: block; font-weight: 600; font-size: 13px; letter-spacing: 0.16em; }
.mark i { display: block; font-style: normal; font-size: 10px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.hd-r { display: flex; align-items: center; gap: 10px; }
.now { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); padding: 9px 14px; border: 1px solid var(--line); border-radius: 99px; background: var(--glass); backdrop-filter: blur(14px); transition: border-color 0.3s; }
.now:hover { border-color: var(--line-2); color: var(--ink); }
.now::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(255, 122, 38, 0.6); animation: ping 2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(255, 122, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 122, 38, 0); } }
.ghost { font-size: 12.5px; padding: 9px 16px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink-2); background: var(--glass); backdrop-filter: blur(14px); }
.ghost:hover { color: var(--ink); border-color: var(--line-2); }

/* caption */
.cap { position: fixed; left: 40px; bottom: 112px; width: min(520px, calc(100vw - 80px)); z-index: 5; pointer-events: none; }
.cap > * { transition: opacity 0.7s var(--ease), transform 0.9s var(--ease); }
.cap.out > * { opacity: 0; transform: translateY(14px); }
.cap.out .cap-title { transition-delay: 0s; }
.cap-no { font: 400 11px var(--mono); color: var(--accent); letter-spacing: 0.2em; margin-bottom: 14px; }
.cap-title { font: 200 clamp(44px, 6.4vw, 88px)/0.98 var(--sans); letter-spacing: -0.045em; margin: 0 0 18px; }
.cap-line { font-size: 16px; line-height: 1.55; color: var(--ink-2); margin: 0; max-width: 42ch; transition-delay: 0.08s; }
.cap-extra { margin-top: 22px; pointer-events: auto; transition-delay: 0.14s; }

.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 99px; padding: 3px; background: var(--glass); backdrop-filter: blur(14px); }
.seg button { font-size: 12.5px; padding: 7px 14px; border-radius: 99px; color: var(--ink-2); transition: all 0.3s; }
.seg button.on { background: var(--ink); color: #0a0a0b; }

/* rail */
.rail { position: fixed; left: 40px; right: 40px; bottom: 34px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; z-index: 6; }
.rail button { text-align: left; padding-top: 14px; position: relative; color: var(--ink-3); transition: color 0.4s; }
.rail button::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--line-2); }
.rail button::after { content: ""; position: absolute; left: 0; top: 0; height: 1px; width: 0; background: var(--ink); transition: width 0.9s var(--ease); }
.rail button.on { color: var(--ink); }
.rail button.on::after { width: 100%; }
.rail button:hover { color: var(--ink-2); }
.rail .n { font: 400 10.5px var(--mono); letter-spacing: 0.12em; margin-right: 10px; }
.rail .t { font-size: 13px; letter-spacing: 0.02em; }

/* hotspots */
#hot { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.hs { position: absolute; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 9px; opacity: 0; transition: opacity 0.6s var(--ease); white-space: nowrap; }
.hs.show { opacity: 1; }
.hs i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12); flex: none; }
.hs.warn i { background: var(--accent); box-shadow: 0 0 0 4px rgba(255, 122, 38, 0.22); }
.hs span { font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-2); text-shadow: 0 1px 8px #000; }
.hs.warn span { color: var(--accent-2); }
.hs.chip span { font: 500 10px var(--mono); letter-spacing: 0.1em; color: #0a0a0b; background: var(--steel); padding: 2px 6px; border-radius: 2px; text-shadow: none; }
.hs.chip.red span { background: var(--accent); }
.hs.chip i { display: none; }
.hs.lbl span { font: 500 10px var(--mono); color: var(--ink); background: rgba(10, 10, 12, 0.72); border: 1px solid var(--line-2); padding: 2px 6px; border-radius: 2px; text-shadow: none; }
.hs.lbl i { display: none; }
.hs.lbl.dim { opacity: 0.35; }

/* sim HUD */
#hud { position: fixed; z-index: 6; }
.simhud { position: fixed; left: 50%; bottom: 112px; transform: translateX(-50%); width: min(560px, calc(100vw - 80px)); display: none; }
.simhud.on { display: block; }
.task { display: flex; align-items: center; gap: 12px; justify-content: center; font: 400 12.5px var(--mono); color: var(--ink-2); margin-bottom: 14px; flex-wrap: wrap; }
.task b { font-weight: 400; color: var(--ink); padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 99px; background: var(--glass); backdrop-filter: blur(12px); transition: all 0.3s; }
.task b.p2 { border-color: rgba(255, 122, 38, 0.6); color: var(--accent-2); }
.task em { font-style: normal; color: var(--ink-3); }
.tl { display: grid; gap: 4px; cursor: pointer; }
.tl-seg { height: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.tl-seg span { position: absolute; inset: 0; width: 0; background: var(--ink); }
.tl-lbl { display: grid; gap: 4px; margin-top: 8px; font: 400 10px var(--mono); color: var(--ink-3); letter-spacing: 0.04em; }
.tl-lbl span.on { color: var(--ink); }
.tl-lbl span b { font-weight: 400; color: var(--accent-2); }
.tl-lbl span b.ok { color: var(--steel); }

#pip { position: fixed; inset: 0; pointer-events: none; z-index: 4; }
.pipf { position: absolute; border: 1px solid var(--line-2); border-radius: 4px; opacity: 0; transition: opacity 0.6s var(--ease); }
.pipf.on { opacity: 1; }
.pipf span { position: absolute; left: 10px; top: 8px; font: 400 10px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 6px #000; }
.pipf span::before { content: "● "; color: #ff4d4d; }

/* operator panel */
.op { position: fixed; right: 40px; top: 50%; transform: translateY(-50%); width: 380px; padding: 26px; border: 1px solid var(--line); border-radius: 6px; background: var(--glass); backdrop-filter: blur(22px) saturate(140%); display: none; }
.op.on { display: block; animation: rise 0.8s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(calc(-50% + 16px)); } }
.op-top { display: flex; justify-content: space-between; align-items: center; font: 400 10.5px var(--mono); letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase; }
.op-top select { font: inherit; letter-spacing: inherit; color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 99px; padding: 4px 8px; text-transform: none; }
.op-big { font: 200 58px/1 var(--sans); letter-spacing: -0.04em; margin: 26px 0 14px; }
.op-big .arr { color: var(--ink-3); font-weight: 200; margin: 0 4px; }
.op-big .red { color: var(--accent); font-weight: 400; }
.op-big .ok { color: var(--steel); font-weight: 400; }
.op-sub { font-size: 13.5px; color: var(--ink-2); margin: 0 0 6px; }
.op-sub code { color: var(--ink); font-size: 12.5px; }
.op-note { font-size: 13px; color: var(--blue); margin-top: 14px; padding-left: 12px; border-left: 1px solid var(--blue); }
.op-nav { display: flex; gap: 8px; margin-top: 26px; }
.btn { flex: none; font-size: 13.5px; font-weight: 500; padding: 13px 18px; border-radius: 99px; border: 1px solid var(--line-2); color: var(--ink); transition: all 0.25s; }
.btn:hover { border-color: var(--ink-3); }
.btn.main { flex: 1; background: var(--ink); color: #0a0a0b; border-color: var(--ink); }
.btn.main:hover { background: #fff; }
.btn:disabled { opacity: 0.3; }
.op-prog { display: flex; gap: 2px; margin-top: 22px; }
.op-prog span { flex: 1; height: 2px; background: var(--line-2); }
.op-prog span.d { background: var(--ink-2); }
.op-prog span.c { background: var(--accent); }
.op-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.cmd { display: flex; align-items: center; gap: 10px; font: 400 12px var(--mono); background: rgba(0, 0, 0, 0.45); border: 1px solid var(--line); border-radius: 4px; padding: 10px 10px 10px 14px; }
.cmd code { flex: 1; overflow-x: auto; white-space: nowrap; color: var(--ink); }
.cmd code::before { content: "$ "; color: var(--ink-3); }
.copy { font: 500 10.5px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); border: 1px solid var(--line-2); border-radius: 99px; padding: 5px 10px; flex: none; }
.copy:hover { color: var(--ink); }
.copy.ok { color: #6fd39e; border-color: #6fd39e; }
.link { font-size: 12.5px; color: var(--ink-2); margin-top: 12px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { color: var(--ink); }

/* loop stats */
.stats { display: flex; gap: 44px; }
.stat b { display: block; font: 200 44px/1 var(--sans); letter-spacing: -0.03em; }
.stat b small { font-size: 18px; color: var(--ink-3); }
.stat span { font: 400 10.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
.drawer::before { content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.5s var(--ease); }
.drawer.open { pointer-events: auto; }
.drawer.open::before { opacity: 1; }
.drawer-in { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: #0d0d10; border-left: 1px solid var(--line); transform: translateX(100%); transition: transform 0.7s var(--ease); overflow-y: auto; padding: 28px 32px 60px; }
.drawer.open .drawer-in { transform: none; }
.drawer-hd { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; font: 400 11px var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink-3); }
.x { font-size: 26px; line-height: 1; color: var(--ink-2); width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); }
.x:hover { color: var(--ink); }
.dsec { margin-bottom: 34px; }
.dsec h3 { font: 300 24px var(--sans); letter-spacing: -0.02em; margin: 0 0 14px; }
.dsec p { color: var(--ink-2); font-size: 13.5px; margin: -6px 0 14px; }
.blk { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 10px; overflow: hidden; }
.blk-h { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink-2); padding: 9px 10px 9px 14px; border-bottom: 1px solid var(--line); }
.blk pre { margin: 0; padding: 12px 14px; font: 400 12px/1.7 var(--mono); color: var(--ink); overflow-x: auto; background: rgba(0, 0, 0, 0.35); }
.blk pre .c { color: var(--ink-3); }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.plist div { font: 400 12px var(--mono); padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.2s; }
.plist div i { width: 8px; height: 8px; border-radius: 50%; background: #ecebe6; }
.plist div i.t { background: var(--accent); }
.plist div.got { opacity: 0.35; text-decoration: line-through; }
.ptype { font: 400 10.5px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin: 16px 0 8px; }
.kv { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.kv td { padding: 7px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.kv td:last-child { text-align: right; font-family: var(--mono); color: var(--ink); }

/* loader */
.loader { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--bg); transition: opacity 1s var(--ease), visibility 1s; }
.loader.done { opacity: 0; visibility: hidden; }
.loader-in { width: 220px; display: grid; grid-template-columns: 1fr auto; gap: 14px 0; }
.loader-in b { font-weight: 600; font-size: 12px; letter-spacing: 0.2em; }
.loader-in span { font: 400 11px var(--mono); color: var(--ink-3); }
.loader-in span::after { content: "%"; }
.loader-in i { grid-column: 1 / -1; height: 1px; background: var(--line-2); position: relative; }
.loader-in em { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--ink); transition: width 0.3s; }

@media (max-width: 900px) {
  .hd { padding: 18px 18px; }
  .now { display: none; }
  .cap { left: 20px; bottom: 96px; }
  .cap-title { font-size: 46px; margin-bottom: 12px; }
  .cap-line { font-size: 14px; }
  .rail { left: 20px; right: 20px; bottom: 22px; gap: 8px; }
  .rail .t { display: none; }
  .op { right: 12px; left: 12px; width: auto; top: auto; bottom: 74px; transform: none; padding: 18px; }
  .op.on { animation: none; }
  .op-big { font-size: 40px; margin: 14px 0 8px; }
  .op-foot { display: none; }
  .simhud { bottom: 72px; }
  .tl-lbl { display: none; }
  .cap.withhud .cap-title, .cap.compact .cap-title { font-size: 30px; }
  .cap.withhud .cap-line { display: none; }
  .cap.withhud { bottom: auto; top: 76px; width: calc(100vw - 200px); }
  .stats { gap: 22px; }
  .stat b { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.cap.compact .cap-title { font-size: 40px; margin-bottom: 0; }
.cap.compact .cap-line { display: none; }
