@font-face { font-family: "NaiSerif"; font-weight: 700; font-display: swap; src: url(../fonts/serif-700.woff2) format("woff2"); }
@font-face { font-family: "NaiSans"; font-weight: 400; font-display: swap; src: url(../fonts/sans-400.woff2) format("woff2"); }
@font-face { font-family: "NaiSans"; font-weight: 700; font-display: swap; src: url(../fonts/sans-700.woff2) format("woff2"); }
:root {
  --bg: #07070b;
  --bg2: #0d0d14;
  --surface: #12121b;
  --surface2: #1a1a26;
  --line: rgba(255, 255, 255, .08);
  --line2: rgba(255, 255, 255, .16);
  --text: #ece8df;
  --muted: #9b978e;
  --dim: #6a675f;
  --gold: #e3b96b;
  --gold2: #f6dca4;
  --cyan: #7fd6ff;
  --ok: #7be0a4;
  --mid: #ffd06b;
  --bad: #ff7f7f;
  --serif: "NaiSerif", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
  --sans: "NaiSans", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
  --r-sm: 8px; --r: 12px; --r-lg: 16px;
  --t-fast: .18s; --t: .35s; --t-slow: .8s;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --w: 1320px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15.5px/1.8 var(--sans);
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern";
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-feature-settings: "palt"; text-wrap: balance; }
p, .lead, .note { text-wrap: pretty; }
code { font: .92em var(--mono); color: var(--gold2); background: rgba(227, 185, 107, .08); padding: 1px 6px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }
html { scrollbar-color: #3a3326 #0b0b10; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0b0b10; }
::-webkit-scrollbar-thumb { background: #3a3326; border-radius: 10px; border: 2px solid #0b0b10; }
::-webkit-scrollbar-thumb:hover { background: #5a4c33; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--gold); text-decoration: none; }
button { font: inherit; color: inherit; }
::selection { background: rgba(227, 185, 107, .9); color: #111; }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 28px;
  padding: 14px 32px;
  background: linear-gradient(to bottom, rgba(7, 7, 11, .85), rgba(7, 7, 11, 0));
  backdrop-filter: blur(6px);
  transition: background .3s;
}
.nav.solid { background: rgba(7, 7, 11, .92); border-bottom: 1px solid var(--line); }
.nav .brand { font: 600 15px var(--serif); letter-spacing: .2em; color: var(--gold2); white-space: nowrap; }
.nav .links { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.nav .links a { color: var(--muted); font-size: 13px; white-space: nowrap; transition: color .2s; }
.nav .links a:hover, .nav .links a.on { color: var(--text); }
.nav .meter { margin-left: auto; font: 12px var(--mono); color: var(--dim); white-space: nowrap; }

/* ---------- hero ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; overflow: hidden; background: #000; }
.hero .layer { position: absolute; inset: -6%; background-size: cover; background-position: center; will-change: transform; }
.hero .layer.screen { mix-blend-mode: screen; }
.hero .layer img { width: 100%; height: 100%; object-fit: cover; }
.hero .layer.frame-mask { -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 52%, transparent 45%, #000 80%); mask-image: radial-gradient(ellipse 62% 58% at 50% 52%, transparent 45%, #000 80%); }
.hero .circle {
  position: absolute; left: 50%; top: 44%; width: min(70vh, 720px); aspect-ratio: 1;
  translate: -50% -50%; mix-blend-mode: screen; opacity: .55;
  animation: spin 80s linear infinite; pointer-events: none;
}
.hero .circle img { width: 100%; height: 100%; border-radius: 50%; }
@keyframes spin { to { rotate: 360deg; } }
.hero canvas.petals { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero .title {
  position: absolute; left: 50%; top: 44%; translate: -50% -50%;
  width: min(62vw, 760px); pointer-events: none;
  filter: drop-shadow(0 6px 30px rgba(0, 0, 0, .6));
}
.hero .copy {
  position: absolute; left: 0; right: 0; bottom: 9vh; text-align: center; padding: 0 24px;
}
.hero .copy h1 { margin: 0; font: 700 clamp(28px, 4.2vw, 58px)/1.15 var(--serif); letter-spacing: .06em; text-shadow: 0 4px 40px #000; }
.hero .copy p { margin: 14px auto 0; max-width: 760px; color: #d8d3c8; text-shadow: 0 2px 20px #000; }
.hero .scroll { position: absolute; left: 50%; bottom: 22px; translate: -50% 0; font: 11px var(--mono); color: var(--muted); letter-spacing: .3em; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(6px); } }
.hero .vignette { position: absolute; inset: 0; background: radial-gradient(120% 80% at 50% 40%, transparent 40%, rgba(0, 0, 0, .75)); pointer-events: none; }
.hero .fx-toggle { position: absolute; right: 24px; bottom: 22px; }

/* ---------- sections ---------- */
section.sec { position: relative; padding: 120px 32px 40px; }
.wrap { max-width: var(--w); margin: 0 auto; }
.sec-head { display: grid; grid-template-columns: 120px 1fr; gap: 24px; align-items: end; margin-bottom: 40px; }
.sec-head .no { font: 600 64px/1 var(--serif); color: transparent; -webkit-text-stroke: 1px var(--gold); opacity: .8; }
.sec-head h2 { margin: 0; font: 700 clamp(26px, 3vw, 40px)/1.2 var(--serif); letter-spacing: .04em; }
.sec-head h2 small { display: block; margin-top: 6px; font: 500 12px var(--mono); letter-spacing: .25em; color: var(--gold); text-transform: uppercase; }
.lead { color: #cfcac0; max-width: 860px; margin: -16px 0 32px 144px; }
.lead b { color: var(--gold2); font-weight: 600; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; } .sec-head .no { font-size: 40px; } .lead { margin-left: 0; } }

.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- chips / verdicts ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 99px; font: 500 12px var(--sans); border: 1px solid var(--line2); color: var(--muted); white-space: nowrap; }
.chip.ok { color: var(--ok); border-color: rgba(123, 224, 164, .35); background: rgba(123, 224, 164, .06); }
.chip.mid { color: var(--mid); border-color: rgba(255, 208, 107, .35); background: rgba(255, 208, 107, .06); }
.chip.bad { color: var(--bad); border-color: rgba(255, 127, 127, .35); background: rgba(255, 127, 127, .06); }
.chip.info { color: var(--cyan); border-color: rgba(127, 214, 255, .3); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 99px;
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line2); cursor: pointer;
  font-size: 13px; transition: all .2s;
}
.btn:hover { border-color: var(--gold); color: var(--gold2); }
.btn.on { background: var(--gold); color: #111; border-color: var(--gold); }

/* ---------- stats band ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stat { background: var(--bg2); padding: 26px 22px; }
.stat .v { font: 700 38px/1 var(--serif); color: var(--gold2); font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 16px; color: var(--gold); margin-left: 4px; }
.stat .k { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* ---------- gallery ---------- */
.masonry { columns: 3 380px; column-gap: 16px; }
.card {
  break-inside: avoid; margin: 0 0 16px; position: relative; border-radius: 12px; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); cursor: zoom-in;
  transition: transform .5s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(-3px); border-color: var(--line2); }
.card img { width: 100%; height: auto; transition: transform 1.2s var(--ease); }
.card:hover img { transform: scale(1.03); }
.card .cap {
  position: absolute; inset: auto 0 0 0; padding: 40px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .85));
  font-size: 13px; opacity: 0; transform: translateY(8px); transition: all .35s var(--ease);
}
.card:hover .cap, .card:focus-within .cap { opacity: 1; transform: none; }
.card .cap b { display: block; font: 600 15px var(--serif); color: #fff; }
.card .cap .meta { color: var(--muted); font: 11px var(--mono); margin-top: 4px; }
.card .tag { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.card .tag .chip { background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); }

/* ---------- panorama ---------- */
.pano { position: relative; height: 46vh; min-height: 300px; overflow: hidden; border-radius: 14px; border: 1px solid var(--line); background: #000; cursor: grab; margin-bottom: 18px; }
.pano img { height: 100%; width: auto; max-width: none; position: absolute; left: 0; top: 0; user-select: none; -webkit-user-drag: none; }
.pano .label { position: absolute; left: 16px; bottom: 14px; font: 12px var(--mono); background: rgba(0, 0, 0, .6); padding: 4px 10px; border-radius: 6px; color: var(--muted); }
.pano .label b { color: var(--text); }

/* ---------- compare ---------- */
.compare { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; user-select: none; touch-action: none; }
.compare img { width: 100%; height: auto; }
.compare .top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x, 50%)); }
.compare .top img { width: 100%; height: 100%; object-fit: cover; }
.compare .bar { position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; background: var(--gold); cursor: ew-resize; }
.compare .bar::after { content: "⟺"; position: absolute; top: 50%; left: 50%; translate: -50% -50%; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #111; display: grid; place-items: center; font-size: 16px; }
.compare .lbl { position: absolute; top: 12px; font: 12px var(--mono); padding: 3px 9px; border-radius: 6px; background: rgba(0, 0, 0, .65); }
.compare .lbl.l { left: 12px; } .compare .lbl.r { right: 12px; }

/* ---------- lens ---------- */
.lens-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); cursor: crosshair; }
.lens-wrap img { width: 100%; }
.lens { position: absolute; width: 260px; height: 260px; border-radius: 50%; border: 2px solid var(--gold); pointer-events: none; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); background-repeat: no-repeat; display: none; }
.stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.stage { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; transition: border-color .2s; }
.stage.on { border-color: var(--gold); }
.stage b { font: 600 22px var(--serif); color: var(--gold2); display: block; }
.stage span { font-size: 12px; color: var(--muted); }

/* ---------- grids ---------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
@media (max-width: 900px) { .g3, .g4, .g6 { grid-template-columns: repeat(2, 1fr); } .g2 { grid-template-columns: 1fr; } }
.tile { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); cursor: zoom-in; }
.tile img { width: 100%; aspect-ratio: var(--ar, 1); object-fit: cover; transition: transform .6s var(--ease), filter .4s; }
.tile:hover img { transform: scale(1.05); }
.tile .t { position: absolute; left: 8px; bottom: 8px; font: 12px var(--sans); background: rgba(0, 0, 0, .6); padding: 2px 9px; border-radius: 6px; backdrop-filter: blur(4px); }
.checker { background-color: #2a2a33; background-image: conic-gradient(#3a3a45 25%, transparent 0 50%, #3a3a45 0 75%, transparent 0); background-size: 22px 22px; }

/* ---------- text lab ---------- */
.tl { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.tl .img { cursor: zoom-in; background: #000; }
.tl .img img { width: 100%; height: 100%; object-fit: contain; max-height: 640px; }
.tl .body { padding: 24px 26px; }
.tl h3 { margin: 0 0 4px; font: 600 20px var(--serif); }
.tl .want { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 8px; }
.tl .want li { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.tl .want code { font: 13px var(--mono); color: var(--gold2); }
.tl .note { color: var(--muted); font-size: 13px; }
@media (max-width: 900px) { .tl { grid-template-columns: 1fr; } }

/* ---------- multi-char ---------- */
.mc-stage { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.mc-stage img { width: 100%; }
.mc-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .3s; }
.mc-stage svg circle { fill: none; stroke: var(--gold); stroke-width: .25; }
.mc-stage svg text { font: 1.3px var(--sans); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: .3; }
.mc-bar { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.mc-bar .sp { flex: 1; }

/* ---------- character studio ---------- */
.studio { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.sprite-box { position: relative; aspect-ratio: 832/1216; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.sprite-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .45s; }
.emo-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.svg-draw { position: relative; aspect-ratio: 832/1216; background: #f7f3ea; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.svg-draw svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.svg-draw svg path { fill: rgba(27,27,34,0); stroke: #1b1b22; stroke-width: 1px; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; transition: fill .8s; }
.svg-draw.filled svg path { fill: rgba(27,27,34,1); }
.svg-draw svg { transition: opacity 1.4s; }
.svg-draw.colored svg { opacity: .0; }
.svg-draw .color { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.6s; }
.svg-draw.colored .color { opacity: 1; }

/* ---------- visual novel ---------- */
.vn { position: relative; aspect-ratio: 16/9; border-radius: 16px; overflow: hidden; border: 1px solid var(--line2); background: #000; user-select: none; cursor: pointer; }
.vn .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: filter 1s; }
.vn .spr { position: absolute; bottom: -22%; height: 118%; aspect-ratio: 832/1216; transition: transform .7s var(--ease), opacity .6s, filter .5s; }
.vn .spr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .35s; }
.vn .spr.l { left: 6%; } .vn .spr.r { right: 6%; }
.vn .spr.dim { filter: brightness(.45) saturate(.6); transform: scale(.98); }
.vn .spr.hide { opacity: 0; transform: translateY(6%); }
.vn .spr.talk { animation: talk .45s var(--ease); }
@keyframes talk { 40% { transform: translateY(-1.2%); } }
.vn .box {
  position: absolute; left: 4%; right: 4%; bottom: 4%; min-height: 24%; padding: 2.2% 3%;
  background: linear-gradient(180deg, rgba(14, 14, 24, .78), rgba(8, 8, 14, .9));
  border: 1px solid rgba(227, 185, 107, .45); border-radius: 14px; backdrop-filter: blur(8px);
  font-size: clamp(13px, 1.6vw, 20px); line-height: 1.6;
}
.vn .name { position: absolute; top: -18px; left: 22px; padding: 3px 18px; background: var(--gold); color: #111; font: 700 clamp(12px, 1.3vw, 16px) var(--serif); border-radius: 8px; letter-spacing: .1em; }
.vn .next { position: absolute; right: 16px; bottom: 10px; color: var(--gold); animation: bob 1s infinite; }
.vn .hud { position: absolute; top: 14px; right: 16px; display: flex; gap: 8px; }
.vn .hud span { font: 11px var(--mono); padding: 3px 8px; background: rgba(0, 0, 0, .5); border-radius: 6px; color: var(--muted); }
.vn .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.vn .flash.go { animation: flash .6s; }
@keyframes flash { 10% { opacity: .8; } 100% { opacity: 0; } }

/* ---------- holo card ---------- */
.cards-row { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; perspective: 1400px; padding: 20px 0 40px; }
.holo {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --o: 0;
  position: relative; width: 340px; aspect-ratio: 63/88; border-radius: 18px; transform-style: preserve-3d;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease), box-shadow .5s;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 255, 255, .08);
  cursor: pointer;
}
.holo.active { transition: transform .08s linear; }
.holo .face { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: #0c0c18; }
.holo .art { position: absolute; inset: 7% 7% 30% 7%; border-radius: 8px; overflow: hidden; }
.holo .art img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; }
.holo .frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.holo .info { position: absolute; left: 8%; right: 8%; bottom: 6%; height: 22%; display: flex; flex-direction: column; gap: 6px; }
.holo .info h4 { margin: 0; font: 700 20px var(--serif); color: var(--gold2); letter-spacing: .08em; }
.holo .info .row { display: flex; gap: 8px; }
.holo .info .ic { width: 34px; height: 34px; border-radius: 8px; background-size: 300% 300%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.holo .info p { margin: 0; font-size: 11px; color: #bbb6aa; line-height: 1.5; }
.holo .shine {
  position: absolute; inset: 0; border-radius: 18px; pointer-events: none; mix-blend-mode: color-dodge; opacity: var(--o);
  background:
    repeating-linear-gradient(110deg, rgba(255, 0, 132, .35) 0%, rgba(252, 164, 0, .35) 6%, rgba(255, 255, 0, .3) 12%, rgba(0, 255, 138, .3) 18%, rgba(0, 207, 255, .35) 24%, rgba(204, 76, 250, .35) 30%, rgba(255, 0, 132, .35) 36%),
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .55), transparent 40%);
  background-size: 300% 300%, 100% 100%;
  background-position: calc(var(--mx) * 1.2) calc(var(--my) * 1.2), center;
  filter: brightness(.9) contrast(1.3);
  transition: opacity .3s;
}
.holo .glare { position: absolute; inset: 0; border-radius: 18px; pointer-events: none; background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .35), transparent 35%); mix-blend-mode: overlay; opacity: var(--o); }

/* ---------- param lab ---------- */
.lab { display: grid; grid-template-columns: auto 340px; justify-content: center; gap: 28px; margin-bottom: 56px; align-items: start; }
.lab .view { width: min(var(--vw, 800px), calc(100vw - 480px), 940px); }
@media (max-width: 1000px) { .lab { grid-template-columns: 1fr; } .lab .view { width: 100%; } }
.lab .view { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.lab .view img { width: 100%; transition: opacity .2s; }
.lab .ctrl { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; position: sticky; top: 96px; }
.lab .ctrl h3 { margin: 0 0 6px; font: 600 18px var(--serif); }
.lab .ctrl .val { font: 700 30px var(--serif); color: var(--gold2); }
.lab .ctrl input[type=range] { width: 100%; accent-color: var(--gold); }
.lab .ctrl .opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lab .ctrl p { font-size: 13px; color: #cfcac0; margin: 10px 0 0; }
.lab .ctrl .ticks { display: flex; justify-content: space-between; font: 11px var(--mono); color: var(--dim); }

/* ---------- vfx lab ---------- */
.vfx { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; aspect-ratio: 16/9; }
.vfx > img { width: 100%; height: 100%; object-fit: cover; }
.vfx .ov { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; transition: opacity .6s; }
.vfx .ov.circle { inset: auto; left: 50%; top: 55%; width: 46%; height: auto; aspect-ratio: 1; translate: -50% -50%; animation: spin 30s linear infinite; }
.vfx .ov.embers { animation: rise 9s linear infinite; }
@keyframes rise { from { transform: translateY(4%) scale(1.08); } to { transform: translateY(-4%) scale(1.08); } }
.vfx .ov.bolt { opacity: 0; }
.vfx .ov.bolt.strike { animation: strike .5s steps(4) 1; }
@keyframes strike { 0%, 40% { opacity: 1; } 20%, 60%, 100% { opacity: 0; } }
.vfx-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.tile-demo { height: 260px; border-radius: 14px; border: 1px solid var(--line); background-size: 220px; animation: pan 18s linear infinite; position: relative; }
@keyframes pan { to { background-position: 220px 220px; } }
.tile-demo .over { position: absolute; inset: 0; display: grid; place-items: center; font: 700 34px var(--serif); color: #fff; text-shadow: 0 4px 24px #000; letter-spacing: .2em; }
.float { animation: float 4s ease-in-out infinite; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55)); }
@keyframes float { 50% { transform: translateY(-14px) rotate(2deg); } }
.glow { animation: glow 3s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 22px rgba(127, 214, 255, .8)); } }
.bounce { animation: bounce 1.6s cubic-bezier(.3, 1.6, .5, 1) infinite; transform-origin: 50% 100%; }
@keyframes bounce { 0%, 100% { transform: scale(1, 1); } 30% { transform: scale(1.06, .94); } 55% { transform: scale(.96, 1.05) translateY(-12px); } }
.sprite-player { image-rendering: pixelated; background-repeat: no-repeat; border-radius: 10px; border: 1px solid var(--line); background-color: #fff; }

/* ---------- step timeline ---------- */
.steps { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.step-view { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.step-view img { width: 100%; }
.step-view svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.step-view svg rect { fill: rgba(227, 185, 107, .18); stroke: var(--gold); stroke-width: .4; stroke-dasharray: 1.2 1; animation: dash 3s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.outp { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.outp img { width: 100%; }
.outp .inner { position: absolute; top: 0; height: 100%; border: 2px solid var(--gold); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); transition: box-shadow 1.2s var(--ease); }
.outp.open .inner { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); }

/* ---------- blur reveal ---------- */
.nsfw img { filter: blur(28px) saturate(.6); }
.nsfw.show img { filter: none; }
.nsfw .gate { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; background: rgba(0, 0, 0, .35); cursor: pointer; z-index: 2; padding: 20px; }
.nsfw.show .gate { display: none; }
.nsfw .gate span { font-size: 13px; color: #ddd; }

/* ---------- verdict table ---------- */
table.vt { width: 100%; border-collapse: collapse; font-size: 14px; }
table.vt th, table.vt td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.vt th { font: 600 12px var(--mono); letter-spacing: .15em; color: var(--gold); text-transform: uppercase; }
table.vt td:first-child { font-weight: 600; white-space: nowrap; }
.callout { padding: 18px 22px; border-left: 3px solid var(--gold); background: rgba(227, 185, 107, .06); border-radius: 0 12px 12px 0; color: #ddd7cb; margin: 20px 0; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(4, 4, 7, .96); display: none; }
.lb.on { display: block; }
.lb .stage { position: absolute; inset: 0 0 92px 0; overflow: hidden; cursor: grab; background: none; border: 0; border-radius: 0; padding: 0; }
.lb .stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; image-rendering: auto; }
.lb .info { position: absolute; left: 0; right: 0; bottom: 0; height: 92px; padding: 14px 24px; border-top: 1px solid var(--line); display: flex; gap: 22px; align-items: center; background: var(--bg2); }
.lb .info .p { flex: 1; font: 12px/1.5 var(--mono); color: var(--muted); max-height: 64px; overflow: auto; }
.lb .info .m { font: 12px var(--mono); color: var(--gold2); white-space: nowrap; text-align: right; }
.lb .x { position: absolute; top: 14px; right: 18px; z-index: 2; }
.lb .hint { position: absolute; top: 18px; left: 22px; font: 11px var(--mono); color: var(--dim); z-index: 2; }

footer { padding: 80px 32px 60px; color: var(--dim); font-size: 12px; text-align: center; }
.hero #L-castle { object-fit: contain; transform: scale(.6) translateY(30%); }

/* ---------- score badge ---------- */
.score { position: absolute; top: 8px; right: 8px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--mono); color: #111; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.score.s5 { background: linear-gradient(135deg, #ffe8a8, #e3b96b); }
.score.s4 { background: #7be0a4; }
.score.s3 { background: #cfd6e0; }
.score.s2 { background: #ffb36b; }
.score.s1 { background: #ff7f7f; }
.score.s0 { background: #555; color: #eee; }
/* ---------- matrix ---------- */
.matrix { display: grid; gap: 8px; min-width: 900px; }
.matrix .mh { font-size: 12px; color: var(--muted); padding: 4px; }
.matrix .mh b { display: block; color: var(--gold2); font: 600 14px var(--serif); }
.matrix .mh span { display: block; font-size: 11px; line-height: 1.4; margin-top: 2px; }
.matrix .mr { display: flex; align-items: center; font: 600 14px var(--serif); color: var(--text); }
.matrix .tile img { aspect-ratio: auto; }
/* ---------- archive ---------- */
.arch-h { font: 600 18px var(--serif); margin: 40px 0 12px; color: var(--gold2); }
.arch-h span { font: 12px var(--mono); color: var(--dim); margin-left: 10px; }
.arch { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; align-items: start; }
.arch-t img { aspect-ratio: 1; background: #0b0b12; }
.arch-t .t { font-size: 11px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arch-err { padding: 14px; border: 1px dashed var(--line2); border-radius: 10px; font-size: 12px; color: var(--muted); }
.arch-err b { color: var(--text); display: block; margin-bottom: 6px; font-family: var(--mono); }
.arch-err p { margin: 6px 0 0; }

/* ================= polish layer ================= */
.note { color: var(--muted); font-size: 13.5px; line-height: 1.75; margin: 12px 0 0; }
.note b, .lead b { color: var(--gold2); font-weight: 700; }
.lead { font-size: 16px; line-height: 1.85; }

/* nav v2: progress + current section + TOC button */
.nav { gap: 18px; }
.nav .links { display: none; }
.nav .cur { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; opacity: 0; transform: translateY(-4px); transition: all var(--t) var(--ease); white-space: nowrap; overflow: hidden; }
.nav.solid .cur { opacity: 1; transform: none; }
.nav .cur .n { font: 700 13px var(--mono); color: var(--gold); }
.nav .cur .ttl { font: 700 15px var(--serif); color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.nav .toc-btn { margin-left: auto; }
.nav .bar { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--p, 0%); background: linear-gradient(90deg, var(--gold), var(--gold2)); transition: width .1s linear; }
.toc { position: fixed; inset: 0; z-index: 90; background: rgba(6, 6, 10, .86); backdrop-filter: blur(14px); display: grid; place-items: center; opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease); }
.toc.on { opacity: 1; pointer-events: auto; }
.toc .in { width: min(1100px, 92vw); max-height: 86vh; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 8px; }
.toc a { display: block; padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--line); background: rgba(255, 255, 255, .02); color: var(--text); transform: translateY(12px); opacity: 0; transition: transform var(--t) var(--ease), opacity var(--t) var(--ease), border-color var(--t-fast), background var(--t-fast); transition-delay: calc(var(--i) * 18ms); }
.toc.on a { transform: none; opacity: 1; }
.toc a:hover, .toc a.on { border-color: rgba(227, 185, 107, .55); background: rgba(227, 185, 107, .06); }
.toc a .n { font: 700 12px var(--mono); color: var(--gold); }
.toc a .t { display: block; font: 700 17px var(--serif); margin-top: 4px; }
.toc a .e { display: block; font: 11px var(--mono); color: var(--dim); letter-spacing: .08em; margin-top: 4px; text-transform: uppercase; }
.toc .x { position: fixed; top: 18px; right: 22px; }

/* buttons, chips, select — one family */
.btn { height: 34px; padding: 0 16px; font: 500 13px var(--sans); letter-spacing: .02em; color: #d9d4c9; background: rgba(255, 255, 255, .035); border: 1px solid var(--line2); transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast); }
.btn:hover { color: var(--gold2); border-color: rgba(227, 185, 107, .6); background: rgba(227, 185, 107, .06); }
.btn:active { transform: scale(.97); }
.btn.on { color: #17130a; background: linear-gradient(180deg, #f0cd85, var(--gold)); border-color: transparent; font-weight: 700; }
.chip { height: 22px; font-size: 12px; letter-spacing: .02em; }
.sel { position: relative; display: inline-block; }
.sel select { appearance: none; -webkit-appearance: none; height: 34px; padding: 0 38px 0 16px; border-radius: 99px; font: 500 13px var(--sans); color: #d9d4c9; background: rgba(255, 255, 255, .035); border: 1px solid var(--line2); cursor: pointer; transition: border-color var(--t-fast), color var(--t-fast); }
.sel select:hover, .sel select:focus { border-color: rgba(227, 185, 107, .6); color: var(--gold2); outline: none; }
.sel select option { background: #14141c; color: var(--text); }
.sel::after { content: ""; position: absolute; right: 15px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--gold); border-bottom: 1.5px solid var(--gold); transform: translateY(-70%) rotate(45deg); pointer-events: none; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 120px; z-index: 200; transform: translate(-50%, 16px); opacity: 0; padding: 10px 20px; border-radius: 99px; background: #1b1a22; border: 1px solid rgba(227, 185, 107, .5); color: var(--gold2); font: 500 13px var(--sans); box-shadow: 0 12px 40px rgba(0, 0, 0, .5); transition: all var(--t) var(--ease); pointer-events: none; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* crossfade container */
.xf { position: relative; overflow: hidden; }
.xf > img { display: block; width: 100%; }
.xf > img.xf-new { position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0; transition: opacity .38s var(--ease); }
.xf > img.xf-new.show { opacity: 1; }

/* image placeholders: thumbnail as background until the display image arrives */
.tile img, .card img, .tl .img img { background-size: cover; background-position: center; background-color: #101018; }

/* reveal stagger inside grids */
.grid > .reveal, .masonry > .reveal, .arch > * { transition-delay: calc(min(var(--i, 0), 12) * 45ms); }

/* lightbox v2 */
.lb { display: block; opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease); }
.lb.on { opacity: 1; pointer-events: auto; }
.lb .stage img { transition: opacity .25s; }
.lb.on .stage { animation: lbin .45s var(--ease); }
@keyframes lbin { from { transform: scale(.97); } }
.lb .info { gap: 18px; }
.lb .acts { display: flex; flex-direction: column; gap: 8px; }
.lb .nav-a { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 44px; height: 44px; border-radius: 50%; padding: 0; justify-content: center; font-size: 18px; }
.lb .prev { left: 18px; } .lb .next { right: 18px; }

/* section rhythm */
section.sec + section.sec::before { content: ""; position: absolute; top: 40px; left: 50%; width: min(var(--w), 92vw); translate: -50% 0; height: 1px; background: linear-gradient(90deg, transparent, var(--line2), transparent); }
.sec-head h2 { letter-spacing: .03em; }
.sub-h { font: 700 21px var(--serif); color: var(--gold2); margin: 64px 0 18px; display: flex; align-items: center; gap: 14px; }
.sub-h::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(227, 185, 107, .35), transparent); }
.arch-bar { position: sticky; top: 64px; z-index: 5; padding: 10px 0; background: linear-gradient(var(--bg) 70%, transparent); }
@media (max-width: 760px) { section.sec { padding: 96px 18px 32px; } .nav { padding: 12px 16px; } .nav .brand { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }

.lab .view { align-self: start; }
.steps { justify-content: center; }

.opts.vertical { flex-direction: column; align-items: stretch; }
.opts.vertical .btn { justify-content: flex-start; }
.lab .ctrl .val { line-height: 1.3; margin-bottom: 6px; }

/* ---------- parameter bench ---------- */
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
@media (max-width: 1000px) { .bench { grid-template-columns: 1fr; } }
.bench-view { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
.bench-view.wide { grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .bench-view { grid-template-columns: 1fr 1fr; } }
.bench-cell { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: #0b0b12; cursor: zoom-in; }
.bench-cell img { width: 100%; }
.bench .ctrl { position: sticky; top: 96px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; }
.bench .ctrl .lbl { font: 600 11px var(--mono); letter-spacing: .18em; color: var(--dim); margin: 12px 0 6px; text-transform: uppercase; }
.bench .ctrl .lbl:first-child { margin-top: 0; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts.seg .btn { height: 30px; padding: 0 12px; font-size: 12.5px; }
.bench .ctrl .val { font: 700 20px var(--serif); color: var(--gold2); margin: 18px 0 10px; }
.meters { display: grid; gap: 7px; }
.mrow { display: grid; grid-template-columns: 56px 1fr 54px; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.mrow.base { display: block; line-height: 1.6; }
.mt { position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.mt::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(255, 255, 255, .25); }
.mt.comp::before { display: none; }
.mt i { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, #8fd9b0, var(--ok)); border-radius: 4px; transition: all .4s var(--ease); }
.mt i.neg { background: linear-gradient(90deg, #ff9a8a, #ffb36b); }
.mt.comp i { background: linear-gradient(90deg, #7fd6ff, #b9a6ff); }
.mv { font: 12px var(--mono); color: var(--text); text-align: right; }
.bench .ctrl p { font-size: 13px; line-height: 1.75; color: #d4cfc4; margin: 14px 0 0; }
