/* X-WOW: a dark private workshop with holographic instruments. Original design; system fonts only. */
:root {
  --bg: #05080d;
  --bg2: #08111a;
  --panel: rgba(10, 26, 38, .72);
  --line: rgba(79, 216, 255, .22);
  --cyan: #4fd8ff;
  --cyan-dim: #2a7f99;
  --gold: #ffb547;
  --red: #ff5a4f;
  --ok: #5cf2b5;
  --text: #d8eef6;
  --muted: #86a7b5;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Segoe UI Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --r: 4px;
  --wrap: 1120px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden; overflow-x: clip;
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 216, 255, .10), transparent 70%),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(255, 181, 71, .05), transparent 70%),
    linear-gradient(rgba(79, 216, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 216, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
  color: var(--text); font: 17px/1.65 var(--sans);
}
html[data-lang="zh"] .en, html:not([data-lang="zh"]) .zh { display: none !important; }
:lang(zh-Hans) { line-height: 1.8; letter-spacing: .01em; }
a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
img, svg, canvas, video { max-width: 100%; }
img { height: auto; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 7vw, 4.6rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li { margin: .25em 0; }
code, kbd, .mono { font-family: var(--mono); font-size: .9em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.skip { position: absolute; left: -999px; top: 0; z-index: 50; background: var(--gold); color: #000; padding: .5rem 1rem; }
.skip:focus { left: 1rem; }

/* header */
.top {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1rem;
  padding: .55rem 16px; background: rgba(5, 8, 13, .82); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: center; gap: .5rem; color: var(--cyan); text-decoration: none; font: 700 1.05rem/1 var(--mono); letter-spacing: .12em; }
.brand-mark { width: 28px; height: 28px; }
.nav { margin-left: auto; display: flex; align-items: center; }
.nav-links { display: flex; gap: .2rem; }
.nav a { color: var(--muted); text-decoration: none; font: .78rem/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: .55rem .6rem; border: 1px solid transparent; border-radius: var(--r); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--cyan); border-color: var(--line); }
.menu { display: none; position: relative; }
.menu summary { list-style: none; cursor: pointer; font: .78rem/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--cyan); padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--r); }
.menu summary::-webkit-details-marker { display: none; }
.menu-links { position: absolute; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; min-width: 210px; padding: .4rem; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.menu-links a { padding: .8rem .7rem; }
.lang { font: 600 .8rem/1 var(--sans); color: var(--gold); background: transparent; border: 1px solid rgba(255, 181, 71, .45); border-radius: var(--r); padding: .5rem .7rem; cursor: pointer; min-width: 52px; }
.lang:hover { background: rgba(255, 181, 71, .1); }
@media (max-width: 820px) {
  .nav-links { display: none; }
  .menu { display: block; }
}

/* blocks */
.block { max-width: var(--wrap); margin: 0 auto; padding: clamp(48px, 8vw, 96px) 16px; position: relative; }
.block + .block { border-top: 1px solid rgba(79, 216, 255, .08); }
.kicker { font: .76rem/1.3 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); margin: 0 0 .8rem; }
.kicker::before { content: "◇ "; color: var(--gold); }
.lead { font-size: clamp(1.08rem, 2.2vw, 1.3rem); color: #eaf7fc; max-width: 46em; }
.muted { color: var(--muted); }
.grid-2, .grid-3 { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* holographic panel with corner brackets */
.panel {
  --c: var(--cyan);
  position: relative; padding: 22px 20px; border: 1px solid var(--line); border-radius: var(--r);
  background:
    linear-gradient(var(--c), var(--c)) top left / 16px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top left / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 16px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 16px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 1.5px 16px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 16px 1.5px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 1.5px 16px no-repeat,
    var(--panel);
  box-shadow: inset 0 0 40px rgba(79, 216, 255, .05), 0 10px 40px rgba(0, 0, 0, .35);
}
.panel > :last-child { margin-bottom: 0; }
.panel.gold { --c: var(--gold); border-color: rgba(255, 181, 71, .3); }
.panel.red { --c: var(--red); border-color: rgba(255, 90, 79, .35); }
.panel h3 { color: #fff; }

/* numbers and tags */
.stat { display: flex; flex-direction: column; gap: .2rem; }
.stat b { font: 600 clamp(1.7rem, 4.6vw, 2.6rem)/1.1 var(--mono); color: var(--cyan); text-shadow: 0 0 18px rgba(79, 216, 255, .45); letter-spacing: -.02em; }
.stat > span { color: var(--muted); font-size: .92rem; }
.num { border-bottom: 1px dotted rgba(79, 216, 255, .5); cursor: help; }
.stat .num { border-bottom: 0; }
.tag { display: inline-block; font: 600 .7rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: .38em .6em; border-radius: 3px; border: 1px solid currentColor; vertical-align: .15em; white-space: nowrap; margin: 0 .2em .2em 0; color: var(--muted); }
.tag.verified { color: var(--ok); }
.tag.sim { color: var(--cyan); }
.tag.predicted { color: var(--gold); }
.tag.untested { color: var(--red); }

/* narrator */
.loupe { position: relative; margin: 1.6rem 0; padding: 14px 16px 14px 18px; max-width: 46em; border-left: 2px solid var(--cyan); background: linear-gradient(90deg, rgba(79, 216, 255, .09), transparent 85%); font: .95rem/1.6 var(--mono); color: #c9f3ff; }
.loupe::before { content: "LOUPE ›"; display: block; font: 700 .7rem/1 var(--mono); letter-spacing: .22em; color: var(--gold); margin-bottom: .45rem; }
.loupe p { margin: 0; }
.loupe p + p { margin-top: .4em; }

/* buttons */
.btn { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; padding: .65em 1.15em; margin: .3em .4em .3em 0; border: 1px solid var(--cyan); border-radius: var(--r); color: var(--cyan); background: rgba(79, 216, 255, .06); text-decoration: none; font: 600 .86rem/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; transition: background .2s, box-shadow .2s, color .2s; cursor: pointer; }
.btn:hover { background: rgba(79, 216, 255, .16); box-shadow: 0 0 22px rgba(79, 216, 255, .3); color: #fff; }
.btn.gold { border-color: var(--gold); color: #120b00; background: var(--gold); }
.btn.gold:hover { background: #ffc871; box-shadow: 0 0 26px rgba(255, 181, 71, .45); color: #000; }
.btn.ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* figures, tables, details */
.fig { margin: 1.5rem 0; }
.fig img { display: block; border: 1px solid var(--line); border-radius: var(--r); background: #000; }
.fig figcaption { margin-top: .6rem; font-size: .88rem; color: var(--muted); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.2rem 0; border: 1px solid var(--line); border-radius: var(--r); }
table.data { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .9rem; }
table.data th, table.data td { padding: .6rem .75rem; border-bottom: 1px solid rgba(79, 216, 255, .12); text-align: left; vertical-align: top; }
table.data th { font: 600 .72rem/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); background: rgba(79, 216, 255, .06); }
table.data tr:last-child td { border-bottom: 0; }
details.more { margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--r); background: rgba(8, 17, 26, .6); }
details.more > summary { cursor: pointer; padding: .8rem 1rem; font: 600 .82rem/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
details.more > summary:hover { color: #fff; }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
details.more > :not(summary) { margin-left: 1rem; margin-right: 1rem; }
details.more > :last-child { margin-bottom: 1rem; }
.warn { margin: 1.4rem 0; padding: 18px 18px 16px; border: 1px solid rgba(255, 90, 79, .5); border-radius: var(--r); background: repeating-linear-gradient(135deg, rgba(255, 90, 79, .07) 0 12px, transparent 12px 24px), rgba(20, 8, 8, .6); }
.warn > :last-child { margin-bottom: 0; }
.warn strong, .warn h3 { color: #ffb1aa; }
ol.steps { list-style: none; counter-reset: s; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: .2rem 0 .9rem 3rem; margin: 0; }
ol.steps > li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: .1rem; font: 700 .85rem/1 var(--mono); color: var(--gold); border: 1px solid rgba(255, 181, 71, .5); border-radius: 3px; padding: .35rem .4rem; }

/* home hero */
.hero { min-height: min(92vh, 860px); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.hero h1 { max-width: 13em; text-shadow: 0 0 40px rgba(79, 216, 255, .25); }
.hero h1 em { font-style: normal; color: var(--gold); text-shadow: 0 0 30px rgba(255, 181, 71, .35); }
.reticle { position: absolute; right: -60px; top: 50%; width: min(560px, 70vw); transform: translateY(-50%); opacity: .55; pointer-events: none; z-index: -1; }
.reticle .spin { transform-origin: 50% 50%; animation: spin 60s linear infinite; }
.reticle .spin2 { transform-origin: 50% 50%; animation: spin 90s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 720px) { .reticle { right: -40%; top: 30%; opacity: .3; } }

/* gallery cards */
.card { display: flex; flex-direction: column; gap: .6rem; height: 100%; }
.card .idx { font: 700 .8rem/1 var(--mono); color: var(--gold); letter-spacing: .2em; }
.card h3 { margin: 0; font-size: 1.5rem; }
.card .grow { flex: 1; }
.card.soon { opacity: .62; border-style: dashed; }

/* builders wall */
.wall { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-top: 1.4rem; }
.wall .empty { grid-column: 1 / -1; padding: 28px; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); font-family: var(--mono); }
.wall .entry h3 { font-size: 1rem; margin-bottom: .3rem; }
.wall .entry p { margin: 0; color: var(--muted); font-size: .85rem; }

/* footer */
.foot { border-top: 1px solid var(--line); background: rgba(3, 6, 10, .8); margin-top: 40px; }
.foot-grid { max-width: var(--wrap); margin: 0 auto; padding: 40px 16px; display: grid; gap: 24px; grid-template-columns: 1fr; font-size: .9rem; color: var(--muted); }
@media (min-width: 760px) { .foot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.foot p { margin: 0 0 .5rem; }

/* reveal on scroll (JS adds .reveal only when motion is allowed) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* boot sequence */
.boot { animation: bootout .4s linear 3.2s forwards; position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: var(--bg); cursor: pointer; transition: opacity .45s ease; }
.boot.out { opacity: 0; pointer-events: none; }
.boot-inner { width: min(560px, calc(100vw - 32px)); font: .9rem/1.9 var(--mono); color: var(--cyan); }
.boot-line { opacity: 0; transform: translateX(-6px); transition: opacity .18s, transform .18s; white-space: pre-wrap; }
.boot-line.on { opacity: 1; transform: none; }
.boot-line b { color: var(--gold); font-weight: 600; }
.boot-bar { height: 2px; margin-top: 1rem; background: rgba(79, 216, 255, .15); overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--gold)); transition: width 1.5s linear; }
.boot-skip { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; font: .75rem var(--mono); color: var(--muted); letter-spacing: .12em; }
.boot-scan { position: absolute; left: 0; right: 0; height: 120px; top: -120px; background: linear-gradient(transparent, rgba(79, 216, 255, .08), transparent); animation: scan 1.6s linear infinite; }
@keyframes scan { to { top: 100%; } }

html.boot-pending .top, html.boot-pending main, html.boot-pending .foot { visibility: hidden; animation: bootfail 0s linear 2.5s forwards; }
@keyframes bootfail { to { visibility: visible; } }
@keyframes bootout { to { opacity: 0; visibility: hidden; pointer-events: none; } }

/* LOUPE voice button */
.voice { position: fixed; right: 14px; bottom: 14px; z-index: 25; display: none; align-items: center; gap: .45rem; padding: .55rem .75rem; font: 700 .7rem/1 var(--mono); letter-spacing: .16em; color: var(--gold); background: rgba(5, 8, 13, .9); border: 1px solid rgba(255, 181, 71, .45); border-radius: 99px; cursor: pointer; }
.voice.ready { display: inline-flex; }
@media (max-width: 720px) { .voice { position: static; margin: 0 16px 24px; } }
.voice[aria-pressed="true"] { background: var(--gold); color: #000; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
@media print {
  body { background: #fff; color: #000; }
  .top, .foot, .boot, .voice, .reticle { display: none !important; }
}
