/* =========================================================
   NAI V5 · Character Archive — v2 visual system
   ink / paper / warn themes · vermilion accent · serif display
   ========================================================= */
@font-face { font-family: "Smiley"; font-weight: 400; font-display: swap; src: url(../fonts/smiley.woff2?v=20261019a) format("woff2"); }
@font-face { font-family: "Round"; font-weight: 400; font-display: swap; src: url(../fonts/round-400.woff2?v=20261019a) format("woff2"); }
@font-face { font-family: "Round"; font-weight: 700; font-display: swap; src: url(../fonts/round-700.woff2?v=20261019a) format("woff2"); }
@font-face { font-family: "JBM"; font-weight: 100 800; font-display: swap; src: url(../fonts/jbm.woff2) format("woff2"); }

:root {
  --ink: #1a1816; --ink2: #24211e; --paper: #faf9f5; --paper2: #efece4;
  --acc: #d97757; --acc2: #e8956f; --ok: #3ccf8e; --mid: #f2b84b; --bad: #ff5a4a;
  --serif: "Smiley", "Round", "PingFang SC", sans-serif;
  --sans: "Round", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, sans-serif;
  --disp: "Smiley", "Round", sans-serif;
  --mono: "JBM", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --rail: 76px; --maxw: 1400px;
  /* theme-dependent (ink default) */
  --bg: #faf6ef; --fg: #3a2f28; --mut: #8a7d72; --dim: #b9aea3; --line: rgba(90, 60, 40, .1); --line2: rgba(90, 60, 40, .2); --card: #ffffff; --card2: #f4ede3;
  --r: 20px; --rs: 12px; --h-sm: 32px; --h-md: 40px; --h-lg: 52px; --shadow: 0 14px 34px -18px rgba(120, 70, 40, .35);
}
body[data-p="A"] { --acc: #5f9470; --acc2: #7aab89; }
body[data-p="B"] { --acc: #d97757; --acc2: #e8956f; }
body[data-p="C"] { --acc: #d9922e; --acc2: #e8ab55; }
body[data-p="D"] { --acc: #c0704f; --acc2: #d58c6c; }
.part.t-sky { --bg: #f2f4ec; --fg: #2f3a30; --mut: #77826f; --dim: #aab3a1; --line: rgba(50, 80, 50, .1); --line2: rgba(50, 80, 50, .2); --card: #ffffff; --card2: #e8eddf; --acc: #5f9470; --acc2: #7aab89; }
.part.t-peach { --bg: #fcf0e4; --fg: #3d2d22; --mut: #8f7a68; --dim: #c2ae9b; --line: rgba(160, 100, 40, .13); --line2: rgba(160, 100, 40, .25); --card: #fffaf4; --card2: #f8e6d4; --acc: #d9922e; --acc2: #e8ab55; }

* { box-sizing: border-box; }
html.lock { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15.5px/1.8 var(--sans); letter-spacing: .01em; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
  transition: background-color .8s var(--ease), color .8s var(--ease); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-feature-settings: "palt"; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
code { font: .9em var(--mono); color: var(--acc); background: color-mix(in srgb, var(--acc) 9%, transparent); padding: 1px 6px; border-radius: 3px; }
.mono { font-family: var(--mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
::selection { background: var(--acc); color: #fff; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 3px; }
html { scrollbar-width: thin; scrollbar-color: #d9c7b6 transparent; }
.checker { background-color: #f3ece2; background-image: conic-gradient(#ebe1d4 25%, transparent 0 50%, #ebe1d4 0 75%, transparent 0); background-size: 20px 20px; }

/* ---------- buttons / pills / chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-sizing: border-box; height: var(--h-md); padding: 0 18px; border: 1.5px solid var(--line2); background: var(--card); color: var(--fg);
  font: 700 13.5px/1 var(--sans); letter-spacing: .02em; border-radius: 99px; transition: background .25s, color .25s, border-color .25s, transform .2s var(--ease), box-shadow .25s; white-space: nowrap; }
.btn:hover { border-color: var(--acc); color: var(--acc); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn.acc { background: var(--acc); border-color: var(--acc); color: #fff; box-shadow: 0 10px 22px -12px var(--acc); }
.btn.acc:hover { background: var(--acc2); border-color: var(--acc2); color: #fff; transform: translateY(-2px); }
.btn.sm { height: var(--h-sm); padding: 0 14px; font-size: 12.5px; }
.btn.lg { height: var(--h-lg); padding: 0 28px; font-size: 15px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--mut); }
.btn.ghost:hover { color: var(--acc); border-color: color-mix(in srgb, var(--acc) 35%, transparent); }
.btn.ghost.on { background: transparent; color: var(--acc); border-color: var(--acc); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg.col { flex-direction: column; align-items: stretch; }
.seg.col .btn { justify-content: flex-start; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; min-height: 26px; font: 12px/1.4 var(--mono); padding: 3px 10px; border: 1px solid var(--line2); border-radius: 99px; color: var(--fg); background: color-mix(in srgb, var(--fg) 4%, transparent); }
.pill .w i, .prompt .w i { font-style: normal; color: var(--acc); margin-right: 2px; }
.pill.more { color: var(--mut); }
.pills.q .pill { color: var(--mut); }
.prompt { font: 12.5px/1.75 var(--mono); color: color-mix(in srgb, var(--fg) 82%, transparent); margin: 0; word-break: break-word; }
.prompt .w { color: var(--fg); background: color-mix(in srgb, var(--acc) 12%, transparent); padding: 0 3px; }
.prompt .w.neg { background: color-mix(in srgb, #5aa0ff 14%, transparent); }
.prompt .w.neg i { color: #5aa0ff; }
.prompt .tx { color: var(--acc); }
.prompt.clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.prompt.clamp3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; font: 600 11.5px var(--sans); border: 1px solid; border-radius: 2px; white-space: nowrap; }
.chip.ok { color: var(--ok); } .chip.mid { color: var(--mid); } .chip.bad { color: var(--bad); } .chip.warn { color: #fff; background: var(--acc); border-color: var(--acc); }
.params { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0; }
.params > div { background: var(--card2); padding: 8px 12px; border-radius: 10px; }
.params dt { font: 10.5px var(--mono); letter-spacing: .12em; color: var(--mut); text-transform: uppercase; }
.params dd { margin: 2px 0 0; font: 600 13px var(--mono); color: var(--fg); }
.params.mini { grid-template-columns: repeat(4, 1fr); }
.params.mini > div { padding: 6px 8px; }
.charl { font: 12px/1.6 var(--mono); margin: 4px 0; color: color-mix(in srgb, var(--fg) 80%, transparent); }
.charl b { color: var(--acc); margin-right: 8px; } .charl i { color: var(--mut); font-style: normal; }
.sc { position: absolute; top: 8px; right: 8px; z-index: 3; width: 22px; height: 22px; display: grid; place-items: center; font: 700 11px var(--mono); color: #111; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.sc.s5 { background: #ffd36e; } .sc.s4 { background: #9fe0bc; } .sc.s3 { background: #ece4d8; } .sc.s2 { background: #ffbe8f; } .sc.s1 { background: #ff9c8f; } .sc.s0 { background: #555; color: #eee; }

/* ---------- intro ---------- */
#intro { position: fixed; inset: 0; z-index: 300; background: #faf6ef; display: grid; place-items: center; clip-path: inset(0); }
.in-w { display: grid; justify-items: center; gap: 6px; }
.in-k { font: 400 clamp(64px, 10vw, 150px)/.9 var(--disp); color: #3a2f28; letter-spacing: .02em; }
.in-p { font: 400 28px var(--disp); color: var(--acc); }
.in-s { font: 11px var(--mono); letter-spacing: .3em; color: #a89a8c; }

/* ---------- top bar ---------- */
#topbar { position: fixed; z-index: 80; top: 0; left: 0; right: 0; height: 56px; display: flex; align-items: center; gap: 24px; padding: 0 20px 0 calc(var(--rail) + 8px);
  background: color-mix(in srgb, var(--bg) 96%, transparent); border-bottom: 1px solid var(--line); transform: translateY(-100%); transition: transform .5s var(--ease), background-color .8s; }
#topbar.on { transform: none; }
.tb-brand { font: 400 22px var(--disp); letter-spacing: .02em; color: var(--acc); }
.tb-brand em { font: 700 12px var(--serif); font-style: normal; margin-left: 10px; color: var(--mut); letter-spacing: .1em; }
.tb-cur { flex: 1; font: 400 18px var(--serif); display: flex; align-items: baseline; gap: 10px; }
.tb-cur .mono { color: var(--acc); }
@media (max-width: 600px) { .tb-cur { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; } .tb-cur .mono { margin-right: 6px; } }
#tb-prog { position: absolute; left: 0; bottom: -1px; height: 2px; width: 100%; background: var(--acc); transform-origin: left; transform: scaleX(0); }
.kbd { font-size: 14px; }

/* ---------- side rail ---------- */
#rail { position: fixed; z-index: 81; left: 0; top: 0; bottom: 0; width: var(--rail); display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 70px 0 20px;
  border-right: 1px solid var(--line); background: var(--bg); transform: translateX(-100%); transition: transform .6s var(--ease), background-color .8s, width .45s var(--ease); overflow: hidden; }
body.in-ch #rail, #topbar.on ~ #rail { transform: none; }
#rail:hover { width: 280px; box-shadow: 24px 0 60px rgba(0, 0, 0, .35); }
.r-p { display: grid; gap: 2px; }
.r-k { font: 400 26px/1 var(--disp); color: var(--dim); padding: 0 0 4px 26px; transition: color .3s; }
.r-p[data-p=A] { --pc: #5f9470; } .r-p[data-p=B] { --pc: #d97757; } .r-p[data-p=C] { --pc: #d9922e; } .r-p[data-p=D] { --pc: #9a8f84; }
.r-p .r-k { color: color-mix(in srgb, var(--pc) 55%, var(--dim)); } .r-p.on .r-k { color: var(--pc); }
.r-c { display: flex; align-items: center; gap: 14px; height: 24px; padding-left: 30px; color: var(--mut); font-size: 13px; white-space: nowrap; }
.r-c i { width: 14px; height: 2px; background: var(--dim); flex: none; transition: width .3s var(--ease), background .3s; }
.r-c span { opacity: 0; transition: opacity .3s; }
#rail:hover .r-c span { opacity: 1; }
.r-c:hover { color: var(--fg); } .r-c:hover i { width: 22px; background: var(--fg); }
.r-c.on { color: var(--acc); } .r-c.on i { width: 26px; background: var(--acc); }

/* ---------- TOC overlay ---------- */
#toc { position: fixed; inset: 0; z-index: 150; background: rgba(250, 246, 239, .98); color: #3a2f28; display: none; overflow: auto; padding: 80px 5vw 60px; }
#toc.on { display: block; }
#toc-x { position: fixed; top: 18px; right: 22px; color: #3a2f28; border-color: rgba(90, 60, 40, .25); background: #fff; }
.toc-in { max-width: 1500px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
@media (max-width: 1100px) { .toc-in { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .toc-in { grid-template-columns: 1fr; } }
.tp-h { display: flex; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--acc); padding-bottom: 10px; margin-bottom: 8px; }
.tp-h b { font: 400 54px/1 var(--disp); color: var(--acc); }
.toc-p:nth-child(1) { --acc: #5f9470; } .toc-p:nth-child(2) { --acc: #d97757; } .toc-p:nth-child(3) { --acc: #d9922e; } .toc-p:nth-child(4) { --acc: #b3a99e; }
.tp-h span { font: 700 22px var(--serif); } .tp-h em { font: 11px var(--mono); letter-spacing: .2em; color: #a89a8c; font-style: normal; }
.toc-c { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 12px 10px; border-radius: 14px; margin: 4px 0; transition: background .2s, transform .3s var(--ease); }
.toc-c:hover { background: #fff; box-shadow: var(--shadow); transform: translateX(4px); }
.toc-c img, .toc-c .ph { width: 64px; height: 80px; object-fit: contain; background: #f1e9de; border-radius: 10px; display: grid; place-items: center; font: 400 22px var(--disp); color: #555; }
.toc-c b { display: block; font: 400 18px var(--serif); margin: 2px 0; } .toc-c p { margin: 0; font-size: 12px; line-height: 1.6; color: #8a7d72; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toc-c .mono { color: var(--acc); }

/* ======================= HOME ======================= */
#hero { position: relative; height: 100vh; height: 100svh; min-height: 680px; overflow: hidden; background: radial-gradient(ellipse 60% 70% at 20% 40%, #fff7ec, transparent 70%), #f7efe4; color: #3a2f28; display: grid; grid-template-columns: minmax(520px, 46%) 1fr; grid-template-rows: minmax(0, 1fr); isolation: isolate; }
.hm-top { position: absolute; z-index: 6; top: 0; left: 0; right: 0; display: flex; align-items: center; padding: 22px 32px; }
.hm-logo b { font: 400 30px/1 var(--disp); color: var(--acc); display: block; }
.hm-logo span { font: 700 12px var(--sans); letter-spacing: .2em; color: #a08f80; }
.hm-nav { margin-left: auto; display: flex; align-items: center; gap: 22px; font-size: 14px; padding: 6px 6px 6px 22px; background: rgba(255, 252, 247, .96); border-radius: 99px; box-shadow: var(--shadow); }
.hm-nav a { color: #6b5a4e; position: relative; padding: 4px 0; font-weight: 700; }
.hm-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--acc); transform: scaleX(0); transform-origin: right; transition: transform .45s var(--ease); }
.hm-nav a:hover { color: var(--acc); } .hm-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.hm-nav .btn { color: #3a2f28; border-color: rgba(90, 60, 40, .25); background: #fff; }
.hm-intro { position: relative; z-index: 4; align-self: center; padding: 90px 3vw 60px 6vw; }
.hm-k { color: var(--acc); }
.hm-intro h1 { margin: 18px 0 24px; font: 400 clamp(52px, 5.8vw, 104px)/1.08 var(--serif); letter-spacing: .01em; color: #3a2f28; }
.hm-intro h1 .ln { display: block; overflow: hidden; padding-bottom: .06em; }
.hm-intro h1 em { font-style: normal; color: var(--acc); }
.hm-lead { font-size: 16.5px; line-height: 1.9; color: #7a6a5e; max-width: 34em; margin: 0 0 34px; }
.hm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 34px; }
.hm-stats div { padding: 16px 18px !important; background: #fff; border-radius: var(--r); box-shadow: var(--shadow); border: 0 !important; }
.hm-stats div + div { padding-left: 16px; } .hm-stats div:last-child { border-right: 0; }
.hm-stats dt { font: 700 12px var(--sans); letter-spacing: .06em; color: #a08f80; }
.hm-stats dd { margin: 4px 0 0; font: 400 16px var(--disp); color: #8a7d72; }
.hm-stats dd b { font: 400 clamp(34px, 3.2vw, 50px)/1 var(--disp); color: var(--acc); margin-right: 2px; }
.hm-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hm-cta { align-items: center; }
/* image wall */
.hm-wall { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; padding: 0 12px; height: 100%; min-height: 0; overflow: hidden; transform: rotate(-4deg) scale(1.16); transform-origin: 40% 50%;
  }
.hm-wall-clip { position: relative; z-index: 1; overflow: hidden; height: 100%; min-height: 0; }
.hm-wall-clip::before { content: ""; position: absolute; z-index: 3; top: 0; bottom: 0; left: 0; width: 120px; background: linear-gradient(90deg, #f7efe4 0%, rgba(247,239,228,.85) 35%, rgba(247,239,228,0) 100%); pointer-events: none; }
.hm-col { position: relative; overflow: hidden; height: 100%; min-height: 0; contain: layout paint; }
.hm-track { display: grid; gap: 12px; animation: col var(--dur) linear infinite; animation-play-state: paused; will-change: transform; transform: translate3d(0,0,0); }
.hm-wall.run .hm-track { animation-play-state: running; }
.hm-col.up .hm-track { animation-direction: reverse; }
.hm-wall.run.pause .hm-track { animation-play-state: paused; }
@keyframes col { from { transform: translateY(0); } to { transform: translateY(calc(-50% - 6px)); } }
.hm-t { position: relative; margin: 0; overflow: hidden; background: #fff; border: 5px solid #fff; border-radius: 16px; box-shadow: 0 10px 20px -14px rgba(120, 70, 40, .45); cursor: zoom-in; transition: transform .45s var(--ease); }
.hm-t img { border-radius: 11px; }
.hm-t:hover { transform: translateY(-4px) rotate(-1deg); }
.hm-t img { width: 100%; height: 100%; object-fit: contain; transition: filter .5s; }
.hm-t figcaption { position: absolute; left: 8px; bottom: 8px; transform: translateY(6px); opacity: 0; transition: all .4s var(--ease); }
.hm-t figcaption span { font: 600 11.5px var(--sans); color: #fff; background: var(--acc); padding: 3px 8px; }
.hm-t:hover figcaption { opacity: 1; transform: none; }
.hm-t::after { content: ""; position: absolute; inset: 0; background: #f8f1e6; opacity: 0; transition: opacity .4s; pointer-events: none; }
.hm-wall:hover .hm-t:not(:hover)::after { opacity: .35; }
.hm-cue { position: absolute; z-index: 5; left: 6vw; bottom: 28px; display: flex; align-items: center; gap: 14px; }
.hm-cue i { width: 1px; height: 40px; background: rgba(90, 60, 40, .2); position: relative; overflow: hidden; }
.hm-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--acc); animation: drop 1.8s var(--ease) infinite; }
@keyframes drop { to { top: 100%; } }
.hm-cue .mono { color: #a89a8c; }
@media (max-width: 1000px) {
  #hero { grid-template-columns: 1fr; height: auto; min-height: 100svh; }
  .hm-intro { padding: 110px 22px 30px; } .hm-nav a { display: none; }
  .hm-wall { transform: rotate(-4deg) scale(1.3); grid-template-columns: repeat(3, 1fr); }
  .hm-stats { grid-template-columns: 1fr 1fr; } .hm-stats div:nth-child(3) { padding-left: 0; }
}

/* ======================= OVERVIEW ======================= */
#overview { position: relative; padding: 140px 5vw 120px calc(var(--rail) + 5vw); max-width: 1680px; margin: 0 auto; }
.ov-h { max-width: 980px; margin-bottom: 56px; }
.ov-h h2 { font: 400 clamp(44px, 5.8vw, 92px)/1.1 var(--serif); margin: 14px 0 18px; letter-spacing: .01em; }
.ov-h h2 em { font-style: normal; color: var(--acc); }
.ov-h p { font-size: 17px; color: var(--mut); max-width: 44em; }
.ov-grid { columns: 3 340px; column-gap: 18px; }
.ov-c { display: block; break-inside: avoid; margin: 0 0 18px; background: var(--card); border: 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); transition: transform .5s var(--ease), border-color .3s, box-shadow .5s var(--ease); }
.ov-c:hover { transform: translateY(-6px); border-color: var(--acc); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); }
.ov-f { position: relative; overflow: hidden; background: var(--card2); }
.ov-f img { width: 100%; height: 100%; object-fit: contain; }
.ov-t { padding: 18px 20px 20px; position: relative; }
.ov-n { display: block; font: 400 clamp(40px, 3.6vw, 60px)/1 var(--disp); color: var(--acc); letter-spacing: .01em; }
.ov-t b { display: block; font: 400 26px var(--serif); margin: 8px 0 4px; }
.ov-t p { margin: 0; font-size: 14px; color: var(--mut); }
.ov-go { display: inline-flex; gap: 6px; margin-top: 12px; font: 12px var(--mono); letter-spacing: .12em; border-bottom: 1px solid var(--acc); padding-bottom: 2px; }
.ov-go i { font-style: normal; transition: transform .35s var(--ease); } .ov-c:hover .ov-go i { transform: translateX(6px); }
.ov-c.bad { --acc: #e0a33e; } .ov-c.bad { background: #fff6ea; }


/* ======================= PARTS & CHAPTERS ======================= */
#chapters { padding-left: var(--rail); }
.part { position: relative; }
.pd { position: relative; min-height: 88vh; display: grid; grid-template-columns: 1.1fr 1fr; align-items: center; gap: 4vw; padding: 120px 6vw; overflow: hidden; border-top: 1px solid var(--line); }
.pd-l { font: 400 clamp(260px, 40vw, 680px)/.8 var(--disp); color: color-mix(in srgb, var(--acc) 22%, var(--bg)); text-align: center; will-change: transform; position: relative; }
.pd-l::after { content: "✺"; position: absolute; top: 4%; right: 12%; font-size: .18em; color: var(--acc); animation: spin 18s linear infinite; }
.pd-r h2 { font: 400 clamp(60px, 7vw, 116px)/1 var(--serif); margin: 14px 0 6px; color: var(--acc); }
.pd-r p { font-size: 18px; color: var(--mut); margin: 0 0 30px; }
.pd-r ol { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line2); }
.pd-r ol { border-top: 0 !important; display: grid; gap: 8px; }
.pd-r li a { display: flex; align-items: center; gap: 18px; padding: 14px 18px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); font: 400 20px var(--serif); transition: transform .35s var(--ease), color .25s; }
.pd-r li a:hover { transform: translateX(8px); color: var(--acc); }
.pd-r li .mono { color: var(--acc); width: 34px; }
.dots { margin-left: auto; font-style: normal; font-size: 10px; letter-spacing: 3px; color: var(--acc); }
.pd::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 22px; background: radial-gradient(circle, color-mix(in srgb, var(--acc) 45%, transparent) 2px, transparent 2.5px) 0 0 / 18px 18px; opacity: .7; }
@media (max-width: 900px) { .pd { grid-template-columns: 1fr; } .pd-l { font-size: 50vw; } }

.chap { position: relative; padding: 110px 5vw 60px; max-width: 1600px; margin: 0 auto; }
.ch-h { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; gap: 40px; align-items: start; padding-bottom: 46px; margin-bottom: 46px; border-bottom: 1px solid var(--line2); }
.ch-no .big { display: inline-block; font: 400 clamp(72px, 8vw, 130px)/1 var(--disp); color: #fff; background: var(--acc); padding: 14px 26px 10px; border-radius: 28px; box-shadow: var(--shadow); }
.ch-no .mono { display: block; margin-top: 14px; }
.ch-t { font: 400 clamp(46px, 5vw, 84px)/1.1 var(--serif); letter-spacing: .01em; overflow: hidden; padding-bottom: .08em; }
.ch-v { font: 700 clamp(18px, 1.6vw, 23px)/1.65 var(--serif); margin: 18px 0 22px; max-width: 34em; color: color-mix(in srgb, var(--fg) 88%, transparent); }
.ch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.meter { display: inline-flex; align-items: center; gap: 3px; margin-right: 10px; }
.meter i { width: 22px; height: 8px; border-radius: 99px; background: var(--line2); }
.meter i.on { background: var(--acc); }
.meter.s1 i.on, .meter.s2 i.on { background: var(--bad); }
.meter b { font: 400 18px var(--disp); margin-left: 8px; letter-spacing: .04em; }
.meter.n { display: inline-flex; align-items: center; height: var(--h-sm); font: 11px var(--mono); letter-spacing: .14em; color: var(--mut); border: 1.5px solid var(--line2); padding: 0 14px; border-radius: 99px; }
.pt { display: inline-flex; align-items: center; height: var(--h-sm); font-size: 13px; font-weight: 700; padding: 0 14px; background: var(--card); border-radius: 99px; color: var(--fg); box-shadow: var(--shadow); }
.pt::before { content: "✺"; color: var(--acc); font-size: 8px; margin-right: 7px; vertical-align: 2px; }
@media (max-width: 760px) { .ch-h { grid-template-columns: 1fr; gap: 10px; } .chap { padding: 80px 18px 40px; } #chapters { padding-left: 0; } #overview { padding: 100px 18px 80px; } }
.blk + .blk { margin-top: 36px; }
.sub { margin-top: 72px !important; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: baseline; }
.sub h3 { font: 400 30px var(--serif); }
.sub h3::before { content: "✺"; color: var(--acc); margin-right: 10px; font-size: .8em; }
.sub p { margin: 0; color: var(--mut); font-size: 14px; }
.note { color: var(--mut); font-size: 14px; line-height: 1.8; margin: 14px 0 0; max-width: 60em; }
.note b, .callout b { color: var(--fg); }
.callout { border-left: 3px solid var(--acc); background: color-mix(in srgb, var(--acc) 6%, transparent); padding: 18px 24px; font-size: 15px; line-height: 1.85; max-width: 72em; }

/* ---------- grids & tiles ---------- */
.grid { display: flex; flex-wrap: wrap; gap: 10px; --rh: 300px; }
.grid::after { content: ""; flex: 1e9 1 0; }
.grid.one::after, .grid.fill::after { display: none; }
.grid.rows { display: block; } .grid.rows::after { display: none; } /* block, not column-flex: nested flex measured rows too short and clipped the tiles */
.grid.rows > .grow + .grow { margin-top: 10px; }
.grid.rows > .grow { display: flex; gap: 10px; }
.grid.rows > .grow > .tile { flex: var(--ar, 1) 1 0; min-width: 0; }
@media (max-width: 760px) { .grid.rows > .grow { flex-direction: column; } .grid.rows > .grow > .tile { flex: none; } }
.grid.one > .tile { flex-basis: 0; }
.grid > .tile, .grid > .adm { flex: var(--ar, 1) 1 calc(var(--ar, 1) * var(--rh) - 12px); min-width: 0; }
.c8 { --rh: 232px; } .c6 { --rh: 300px; } .c5 { --rh: 360px; } .c4 { --rh: 450px; } .c3 { --rh: 560px; } .c2 { --rh: 420px; } .c1 { --rh: 700px; }
.grid.assets { display: grid; grid-template-columns: repeat(3, 1fr); } .grid.assets::after { display: none; }
.c1 { grid-template-columns: 1fr; } .c2 { grid-template-columns: repeat(2, 1fr); } .c3 { grid-template-columns: repeat(3, 1fr); } .c4 { grid-template-columns: repeat(4, 1fr); }
.c5 { grid-template-columns: repeat(5, 1fr); } .c6 { grid-template-columns: repeat(6, 1fr); } .c8 { grid-template-columns: repeat(8, 1fr); }
@media (max-width: 760px) { .grid { --rh: 230px !important; } .grid.one > .tile { flex-basis: calc(var(--ar, 1) * var(--rh) - 12px); } .grid.one::after { display: block; } .grid.assets { grid-template-columns: 1fr; } }
.tile { position: relative; margin: 0; overflow: hidden; background: var(--card); border-radius: 10px; cursor: zoom-in; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.tile { display: flex; flex-direction: column; }
.tile img { width: 100%; height: auto; display: block; }
.tile:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .6); }
.tile figcaption { position: static; padding: 9px 12px 11px; font-size: 12.5px; font-weight: 700; line-height: 1.55; color: var(--fg); background: var(--card); pointer-events: none; flex: 1; }
.grid.small figcaption { font-size: 11.5px; padding: 6px 8px 8px; text-align: center; }
.tile::after { content: ""; position: absolute; inset: 0; border: 1px solid transparent; transition: border-color .3s; pointer-events: none; }
.tile::after { border-radius: inherit; } .tile:hover::after { border-color: var(--acc); }

/* ---------- recipe ---------- */
.recipe { display: grid; grid-template-columns: 1.35fr 1fr; gap: 0; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); align-items: start; }
.rv-img { margin: 0; overflow: hidden; cursor: zoom-in; background: var(--card2); align-self: stretch; display: flex; align-items: center; }
.rv-img img { width: 100%; height: auto; }
.rcard { padding: 28px 30px; display: grid; gap: 14px; align-content: start; }
.rc-k { font: 11px var(--mono); letter-spacing: .16em; color: var(--acc); }
.rcard h4 { font: 400 26px/1.3 var(--serif); }
.rc-n { margin: 0; color: var(--mut); font-size: 14px; }
.rc-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.rc-row > span { font: 11px var(--mono); color: var(--mut); padding-top: 3px; }
.rc-acts { display: flex; gap: 8px; margin-top: 4px; }
@media (max-width: 900px) { .recipe { grid-template-columns: minmax(0, 1fr); } .recipe > * { min-width: 0; } }

/* ---------- horizontal gallery ---------- */
.hgal { overflow: hidden; margin-left: -5vw; margin-right: -5vw; padding: 10px 0 20px; }
.hg-track { display: flex; gap: 22px; padding: 0 5vw; width: max-content; will-change: transform; }
.hg-frame { position: relative; margin: 0; height: 72vh; width: calc((72vh - 46px) * var(--ar)); flex: none; cursor: zoom-in; }
.hg-inner { position: absolute; inset: 0 0 46px; overflow: hidden; background: var(--card2); border-radius: var(--r); box-shadow: var(--shadow); }
.hg-inner img { width: 100%; height: 100%; object-fit: contain; }
.hg-frame figcaption { position: absolute; left: 0; right: 0; bottom: 0; height: 40px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line2); font-size: 13px; }
.hg-frame figcaption b { font: 700 14px var(--serif); } .hg-frame figcaption em { margin-left: auto; font: 11px var(--mono); color: var(--mut); font-style: normal; }
.hg-frame .sc { top: 10px; right: 10px; }

/* ---------- pano / lens ---------- */
.panof { position: relative; margin: 0 0 18px; cursor: zoom-in; }
.panof img { border-radius: var(--r); box-shadow: var(--shadow); }
.panof img { width: 100%; height: auto; }
.panof figcaption { display: flex; gap: 16px; align-items: baseline; flex-wrap: wrap; padding: 12px 0 0; background: var(--bg); }
.panof figcaption b { font: 700 16px var(--serif); } .panof figcaption span { font-size: 13px; color: var(--mut); }
.pano { position: relative; height: 46vh; min-height: 280px; overflow: hidden; background: #000; cursor: grab; }
.pano img { position: absolute; left: 0; top: 0; height: 100%; width: auto; max-width: none; user-select: none; -webkit-user-drag: none; }
.pano-l { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 14px; align-items: center; padding: 6px 12px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 13px; }
.pano-l b { font: 700 14px var(--serif); } .pano-l span { font: 11px var(--mono); color: #aaa; }
.lensb { display: grid; grid-template-columns: auto 240px; gap: 20px; align-items: center; justify-content: center; }
.lens-wrap { position: relative; overflow: hidden; cursor: crosshair; background: #000; width: min(calc(76vh * var(--ar, 1)), calc(100vw - 560px), 1000px); border-radius: var(--r); box-shadow: var(--shadow); }
.lens-wrap > img { width: 100%; }
.lens { position: absolute; left: 0; top: 0; width: 260px; height: 260px; border-radius: 50%; border: 2px solid var(--acc); pointer-events: none; display: none; background-repeat: no-repeat; box-shadow: 0 16px 40px rgba(0, 0, 0, .6); }
.lens-st { display: grid; gap: 8px; }
.lst { text-align: left; padding: 14px 18px; border: 2px solid transparent; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; transition: border-color .25s; }
.lst b { font: 400 22px var(--disp); letter-spacing: .03em; } .lst span { font-size: 12px; color: var(--mut); }
.lst.on { border-color: var(--acc); } .lst.on b { color: var(--acc); }
@media (max-width: 900px) { .lensb { grid-template-columns: 1fr; } .lens-wrap { width: 100%; } }

/* ---------- matrix / findings ---------- */
.mtx { overflow-x: auto; overflow-y: hidden; } /* overflow-x:auto alone turns y to auto too: the cells' entry slide would flash a vertical scrollbar and squeeze the grid */
.mtx-g { display: grid; gap: 6px; min-width: 680px; margin: 0 auto; }
.mtx .mh { font: 11px var(--mono); letter-spacing: .1em; color: var(--mut); padding: 2px 4px; align-self: end; }
.mtx .mr { font: 700 14px/1.4 var(--serif); align-self: center; padding-right: 8px; }
.mtx .mr i { display: block; font: 400 11.5px var(--sans); color: var(--mut); font-style: normal; margin-top: 2px; }
.mtx .tile.mc { min-height: 60px; }
.finding { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 26px; margin-top: 30px !important; }
.finding header { display: grid; grid-template-columns: 90px 1fr auto; gap: 20px; align-items: start; margin-bottom: 18px; }
.fn { font: 400 54px/1 var(--disp); color: var(--acc); }
.finding h4 { font: 400 26px var(--serif); margin-bottom: 6px; }
.finding header p { margin: 0; color: var(--mut); font-size: 14px; max-width: 54em; }
.fstat { font: 700 13px var(--mono); padding: 6px 14px; background: var(--acc); color: #fff; white-space: nowrap; border-radius: 99px; }
@media (max-width: 760px) { .finding header { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- textlab ---------- */
.tlab { columns: 3 340px; column-gap: 16px; }
.tlab .tl { break-inside: avoid; margin-bottom: 16px; display: block !important; }
.tlab .tl-img img { width: 100%; height: auto; }
.tl { display: grid; grid-template-columns: 1.25fr 1fr; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); align-items: start; }
.tl-img { margin: 0; overflow: hidden; cursor: zoom-in; background: var(--card2); align-self: stretch; display: flex; align-items: center; } .tl-img img { width: 100%; height: auto; }
.tl-b { padding: 20px 20px; } .tl-b h4 { font: 400 22px var(--serif); margin-bottom: 10px; }
.tl-b ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-b li { display: grid; grid-template-columns: 20px 1fr; gap: 6px; font-size: 13px; }
.tl-b li em { grid-column: 2; font-style: normal; font-size: 12px; color: var(--mut); }
.tl-b .mk { font-weight: 700; } .tl-b .ok .mk { color: var(--ok); } .tl-b .mid .mk { color: var(--mid); } .tl-b .bad .mk { color: var(--bad); }
.tl-b code { color: var(--fg); background: none; padding: 0; }

/* ---------- multichar ---------- */
.mcs .seg { margin-bottom: 12px; }
.mc-stage { position: relative; overflow: hidden; cursor: zoom-in; background: #000; border-radius: var(--r); box-shadow: var(--shadow); max-width: 1180px; }
.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.off { opacity: 0; }
.mc-stage svg circle { fill: none; stroke: var(--acc); stroke-width: .3; }
.mc-stage svg text { font: 1.4px var(--mono); fill: #fff; paint-order: stroke; stroke: #000; stroke-width: .35; }
.xf-n { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.xf-n.on { opacity: 1; }

/* ---------- studio ---------- */
.studio { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 1000px) { .studio { grid-template-columns: 1fr; } }
.sprite { position: relative; aspect-ratio: 832/1216; overflow: hidden; cursor: zoom-in; border-radius: var(--r); }
.sprite img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sprite .emo { opacity: 0; transition: opacity .35s; } .sprite .emo.on { opacity: 1; }
.st-l .seg { margin-top: 10px; } .st-r { display: grid; gap: 10px; }
.svgd { display: grid; justify-items: center; gap: 16px; text-align: center; }
.svgd .svg-box { width: min(440px, 100%); }
.svgd-c { display: grid; justify-items: center; gap: 10px; }
.svgd-c .note { margin: 0; }
.svg-box { position: relative; background: #fffaf3; overflow: hidden; border-radius: var(--r); box-shadow: var(--shadow); }
.svg-box svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity 1.2s; }
.svg-box svg path { fill: rgba(25, 25, 30, 0); stroke: #19191e; stroke-width: 1px; vector-effect: non-scaling-stroke; transition: fill .8s; }
.svg-box.filled svg path { fill: #19191e; }
.svg-box .color { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity 1.4s; }
.svg-box.colored .color { opacity: 1; } .svg-box.colored svg { opacity: 0; }
@media (max-width: 760px) { .svgd { grid-template-columns: 1fr; } }

/* ---------- visual novel ---------- */
.vnw { max-width: 1280px; }
.vn { position: relative; aspect-ratio: 16/9; overflow: hidden; background: #000; user-select: none; cursor: pointer; border-radius: var(--r); box-shadow: var(--shadow); }
.vn .bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vn .spr { position: absolute; bottom: -24%; height: 120%; aspect-ratio: 832/1216; transition: transform .7s var(--ease), opacity .5s, filter .5s; }
.vn .spr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.vn .spr .emo { opacity: 0; transition: opacity .3s; } .vn .spr .emo.on { opacity: 1; }
.vn .spr.l { left: 7%; } .vn .spr.r { right: 7%; }
.vn .spr.dim { filter: brightness(.45) saturate(.6); transform: scale(.97); }
.vn .spr.hide { opacity: 0; transform: translateY(6%); }
.vn .spr.talk { animation: talk .45s var(--ease); }
@keyframes talk { 40% { translate: 0 -1.2%; } }
.vbox { position: absolute; left: 4%; right: 4%; bottom: 4%; min-height: 25%; padding: 2.4% 3%; background: rgba(255, 250, 244, .93); border: 2px solid var(--acc); border-radius: 22px; color: #3a2f28 !important; font: 400 clamp(13px, 1.5vw, 20px)/1.65 var(--sans); color: #f0ece4; }
.vname { position: absolute; top: -18px; left: 3%; padding: 4px 20px; background: var(--acc); color: #fff; border-radius: 99px; font: 400 clamp(14px, 1.3vw, 18px) var(--serif); letter-spacing: .1em; }
.vnext { position: absolute; right: 18px; bottom: 12px; color: var(--acc); animation: bob 1s infinite; }
@keyframes bob { 50% { translate: 0 4px; } }
.vhud { position: absolute; top: 14px; right: 16px; display: flex; gap: 6px; }
.vhud span { font: 10px var(--mono); letter-spacing: .1em; padding: 3px 8px; background: rgba(0, 0, 0, .5); color: #aaa; }
.vn-hint { font: 11px var(--mono); letter-spacing: .14em; color: var(--mut); margin-top: 10px; }

/* ---------- holo cards ---------- */
.cards { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; perspective: 1400px; padding: 20px 0; }
.holo { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --o: 0; position: relative; width: 320px; aspect-ratio: 63/88; border-radius: 16px; transform: rotateX(var(--rx)) rotateY(var(--ry)); transition: transform .5s var(--ease); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .7); cursor: pointer; }
.holo.act { transition: transform .08s linear; }
.holo .face { position: absolute; inset: 0; border-radius: 16px; overflow: hidden; background: #0c0c18; }
.holo .art { position: absolute; inset: 7% 7% 30% 7%; overflow: hidden; }
.holo .art { background: #090912; } .holo .art img { width: 100%; height: 100%; object-fit: contain; }
.holo .frame { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.holo .info { position: absolute; left: 9%; right: 9%; bottom: 7%; height: 21%; display: grid; gap: 6px; align-content: start; color: #eee; }
.holo h4 { font: 700 19px var(--serif); color: #f6dca4; letter-spacing: .08em; }
.holo .icons { display: flex; gap: 6px; } .holo .icons i { width: 30px; height: 30px; background-size: 300% 300%; border-radius: 6px; }
.holo .info p { margin: 0; font-size: 11px; color: #bbb; }
.holo .shine { position: absolute; inset: 0; border-radius: 16px; pointer-events: none; mix-blend-mode: color-dodge; opacity: var(--o); transition: opacity .3s;
  background: repeating-linear-gradient(110deg, rgba(255, 0, 132, .32) 0%, rgba(252, 164, 0, .32) 6%, rgba(255, 255, 0, .28) 12%, rgba(0, 255, 138, .28) 18%, rgba(0, 207, 255, .32) 24%, rgba(204, 76, 250, .32) 30%, rgba(255, 0, 132, .32) 36%), radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .5), transparent 40%);
  background-size: 300% 300%, 100% 100%; background-position: calc(var(--mx) * 1.2) calc(var(--my) * 1.2), center; }
.holo .glare { position: absolute; inset: 0; border-radius: 16px; pointer-events: none; background: radial-gradient(circle at var(--mx) var(--my), rgba(255, 255, 255, .32), transparent 35%); mix-blend-mode: overlay; opacity: var(--o); }

/* ---------- vfx / assets ---------- */
.vfxw .seg { margin-bottom: 12px; }
.vfx { position: relative; overflow: hidden; background: #000; border-radius: var(--r); max-width: min(1280px, calc(78vh * 4 / 3)); }
.vfx > img:first-child { 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: 56%; width: 44%; height: auto; aspect-ratio: 1; translate: -50% -50%; animation: spin 30s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.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; } }
.assets .adm { aspect-ratio: 1; cursor: default; display: grid; place-items: center; }
.adm .big { font: 700 30px var(--serif); color: #fff; text-shadow: 0 4px 20px #000; letter-spacing: .2em; }
.assets .adm:first-child { background-size: 200px; animation: pan 16s linear infinite; }
@keyframes pan { to { background-position: 200px 200px; } }
.assets .adm:nth-child(2) { grid-template-columns: 1fr 1fr; padding: 16px; }
.float { animation: float 4s ease-in-out infinite; filter: drop-shadow(0 16px 20px rgba(0, 0, 0, .5)); }
@keyframes float { 50% { transform: translateY(-12px) rotate(2deg); } }
.glow { animation: float 4s ease-in-out infinite, glow 3s ease-in-out infinite; }
@keyframes glow { 50% { filter: drop-shadow(0 0 20px rgba(127, 214, 255, .8)); } }
.bounce { width: 76%; animation: bounce 1.6s cubic-bezier(.3, 1.6, .5, 1) infinite; transform-origin: 50% 100%; }
@keyframes bounce { 30% { transform: scale(1.06, .94); } 55% { transform: scale(.96, 1.05) translateY(-12px); } }

/* ---------- lab (steps) / outpaint ---------- */
.lab { display: grid; grid-template-columns: auto 320px; gap: 24px; justify-content: start; align-items: start; }
.lab-v { position: relative; width: min(calc(74vh * 832 / 1216), calc(100vw - 520px)); overflow: hidden; cursor: zoom-in; background: #000; border-radius: var(--r); box-shadow: var(--shadow); }
.lab-v > img { width: 100%; }
.lab-v svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lab-v svg rect { fill: color-mix(in srgb, var(--acc) 15%, transparent); stroke: var(--acc); stroke-width: .4; stroke-dasharray: 1.2 1; animation: dash 3s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -22; } }
.lab-c { border-radius: var(--r); box-shadow: var(--shadow); background: var(--card); padding: 22px; position: sticky; top: 80px; display: grid; gap: 12px; }
.lab-c h5, .bench-c h5 { margin: 0; font: 11px var(--mono); letter-spacing: .16em; color: var(--mut); text-transform: uppercase; }
.lab-c .val, .bench-c .val { font: 700 22px var(--serif); }
.lab-c p { margin: 0; font-size: 14px; color: var(--mut); }
@media (max-width: 900px) { .lab { grid-template-columns: 1fr; } .lab-v { width: 100%; } }
.outp { position: relative; overflow: hidden; cursor: pointer; background: #000; border-radius: var(--r); }
.outp > img { width: 100%; }
.outp .inner { position: absolute; top: 0; height: 100%; border: 2px solid var(--acc); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .62); transition: box-shadow 1.2s var(--ease); }
.outp.open .inner { box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0); }
.outp-l { position: absolute; left: 14px; bottom: 12px; font: 11px var(--mono); letter-spacing: .1em; padding: 4px 10px; background: rgba(0, 0, 0, .65); color: #ddd; }

/* ---------- gate (mature) ---------- */
.gate-t img { filter: blur(26px) saturate(.6); transform: scale(1.1); transition: filter .6s, transform .6s; }
.gate-t.show img { filter: none; transform: none; }
.gate { position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; background: rgba(0, 0, 0, .25); cursor: pointer; color: #eee; font-size: 13px; }
.gate-t.show .gate { display: none; }

/* ---------- bench ---------- */
.bench { display: grid; grid-template-columns: auto 340px; gap: 24px; align-items: center; justify-content: center; }
@media (max-width: 1000px) { .bench { grid-template-columns: 1fr; } }
.bench-v { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; width: min(calc((80vh - 8px) / 2 * 0.6842 * 2 + 8px), calc(100vw - 560px)); }
.bench-v.wide { width: min(calc((80vh - 8px) / 2 * 1.4615 * 2 + 8px), calc(100vw - 560px)); }
.bc { position: relative; overflow: hidden; cursor: zoom-in; background: var(--card2); border-radius: var(--rs); }
.bc img { width: 100%; }
.bench-c { position: relative; border-radius: var(--r); box-shadow: var(--shadow); background: var(--card); padding: 22px; display: grid; gap: 8px; }
.bench-c .seg.wrap .btn { height: 30px; padding: 0 10px; font-size: 12px; }
.meters { display: grid; gap: 7px; margin-top: 4px; }
.mrow { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; gap: 8px; font-size: 12px; color: var(--mut); }
.mrow b { font: 600 12px var(--mono); color: var(--fg); text-align: right; }
.mt { position: relative; height: 8px; background: var(--line); border-radius: 99px; }
.mt::before { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--line2); }
.mt.c::before { display: none; }
.mt i { position: absolute; top: 0; bottom: 0; border-radius: 99px; background: var(--ok); transition: all .45s var(--ease); }
.mt i.neg { background: var(--mid); } .mt.c i { background: var(--acc); }
.mbase { font-size: 13px; color: var(--mut); margin: 0; }
.bench-c p { font-size: 13.5px; line-height: 1.75; margin: 8px 0 0; }

/* ---------- table / stats ---------- */
.tbl { overflow-x: auto; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 6px 10px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font: 11px var(--mono); letter-spacing: .14em; color: var(--mut); text-transform: uppercase; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.tbl td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { font: 400 17px var(--serif); white-space: nowrap; }
.tbl tr:hover td { background: color-mix(in srgb, var(--fg) 3%, transparent); }
@media (max-width: 600px) { .tbl { padding: 4px 6px; } .tbl th, .tbl td { padding: 10px 7px; } .tbl td:first-child { white-space: normal; font-size: 15px; min-width: 4.2em; } }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { padding: 26px 24px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.stat .v { font: 400 64px/1 var(--disp); color: var(--acc); } .stat .v small { font-size: 20px; margin-left: 6px; color: var(--fg); }
.stat .k { margin-top: 10px; font-size: 13.5px; color: var(--mut); }
@media (max-width: 760px) { .stats { grid-template-columns: 1fr 1fr; } .stat .v { font-size: 44px; } }

/* ---------- archive ---------- */
.arch-bar { position: sticky; top: 52px; z-index: 6; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 0; background: var(--bg); transition: background-color .8s; }
.arch-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; }
.achip { display: inline-flex; align-items: center; height: var(--h-sm); font-size: 12.5px; font-weight: 700; padding: 0 14px; border: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 99px; color: var(--fg); transition: border-color .2s, color .2s; }
.achip:hover { border-color: var(--acc); color: var(--acc); }
.achip i, .ag h4 i { font: 11px var(--mono); color: var(--mut); font-style: normal; margin-left: 4px; }
.ag { margin-top: 34px; content-visibility: auto; contain-intrinsic-size: auto 600px; }
.ag h4 { font: 400 22px var(--serif); padding-bottom: 8px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.ag-g { display: flex; flex-wrap: wrap; gap: 8px; } .ag-g::after { content: ""; flex: 1e9 1 0; }
.ag-t { position: relative; margin: 0; flex: 1 1 140px; height: 190px; flex-basis: auto; overflow: hidden; background: var(--card2); border-radius: 10px; cursor: zoom-in; transition: transform .35s var(--ease); }
.ag-t:hover { transform: translateY(-3px); }
.ag-t img { width: auto; height: 100%; max-width: none; object-fit: contain; }
.ag-t figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px; font: 10px var(--mono); color: #ddd; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-t .sc { width: 18px; height: 18px; font-size: 10px; top: 5px; right: 5px; }
.ag-t.low img { filter: blur(14px) grayscale(1); }
.lowg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 10px; font-size: 11px; color: #ffb0a6; background: rgba(20, 0, 0, .4); }
.ag-err { --ec: var(--bad); position: relative; display: flex; flex-direction: column; gap: 6px; width: 210px; height: 190px; padding: 14px 14px 12px; border-radius: 10px; border: 1px dashed color-mix(in srgb, var(--ec) 45%, transparent); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ec) 5%, var(--card2)) 0 10px, var(--card2) 10px 20px); font-size: 12px; line-height: 1.55; color: var(--mut); overflow: hidden; cursor: help; }
.ag-err.skip { --ec: var(--mid); }
.ag-err .ae-tag { align-self: flex-start; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; color: var(--ec); background: color-mix(in srgb, var(--ec) 13%, transparent); }
.ag-err b { font-size: 14px; color: var(--fg); }
.ag-err p { margin: 0; flex: 1; }
.ag-err .ae-f { display: flex; align-items: baseline; gap: 8px; }
.ag-err code { flex: 1; min-width: 0; padding: 0; font-size: 10px; color: var(--dim); background: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-err .ae-go { flex: none; font-size: 11px; color: var(--acc); text-decoration: none; } .ag-err .ae-go:hover { text-decoration: underline; }

/* ======================= DETAIL PANEL ======================= */
#dp { position: fixed; inset: 0; z-index: 200; display: grid; grid-template-columns: 1fr 440px; background: rgba(243, 236, 226, .985); color: #3a2f28; opacity: 0; pointer-events: none; transition: opacity .35s var(--ease);
  --bg: #faf6ef; --fg: #3a2f28; --mut: #8a7d72; --line: rgba(90, 60, 40, .1); --line2: rgba(90, 60, 40, .2); --card: #ffffff; --card2: #f4ede3; }
#dp.on { opacity: 1; pointer-events: auto; }
#dp-stage { position: relative; overflow: hidden; cursor: grab; }
#dp-img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; border-radius: 8px; box-shadow: 0 24px 60px -24px rgba(90, 50, 20, .45); }
#dp-aside { background: #fffdf9; border-radius: 26px 0 0 26px; box-shadow: -20px 0 50px -30px rgba(120, 70, 40, .4); overflow-y: auto; padding: 70px 26px 90px; transform: translateX(30px); transition: transform .5s var(--ease); }
#dp.on #dp-aside { transform: none; }
#dp:not(.on) { visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; } #dp.on { visibility: visible; transition: opacity .35s var(--ease); } #dp { overflow: hidden; }
#dp-aside section, #dp-aside details { padding: 14px 0; border-bottom: 1px dashed rgba(90, 60, 40, .15); }
#dp-aside h5 { margin: 0 0 10px; font: 400 17px var(--serif); color: #3a2f28; }
#dp-aside h5::before { content: "✺ "; color: var(--acc); font-size: .8em; }
#dp-aside h5 em { color: var(--acc); font-style: normal; margin-left: 6px; }
#dp-aside summary { cursor: pointer; font: 400 17px var(--serif); color: #8a7d72; }
#dp-aside .prompt.neg { margin-top: 10px; color: #9a8d82; }
.dp-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 2px solid var(--acc); }
.dp-head .mono { color: #3a2f28; font-size: 12px; text-transform: none; letter-spacing: .04em; flex: 1; word-break: break-all; }
.dp-head .sc { position: static; flex: none; } .dp-sn { font-size: 12px; color: #8a7d72; }
.dp-acts { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; }
.dp-acts .btn { color: #3a2f28; border-color: rgba(90, 60, 40, .2); background: #fff; }
.dp-acts .btn:first-child { background: var(--acc); border-color: var(--acc); color: #fff; }
.dp-nav { position: absolute; top: 14px; right: 18px; display: flex; gap: 8px; align-items: center; z-index: 3; }
.dp-nav .btn { color: #3a2f28; border-color: rgba(90, 60, 40, .18); background: #fff; box-shadow: var(--shadow); }
#dp-count { color: #8a7d72; min-width: 50px; text-align: center; }
.dp-hint { position: absolute; left: 18px; top: 18px; color: #b3a596; }
@media (max-width: 900px) { #dp { grid-template-columns: 1fr; grid-template-rows: 55vh 1fr; } #dp-aside { padding: 18px; border-left: 0; border-top: 1px solid rgba(255, 255, 255, .1); } .dp-hint { display: none; } .dp-nav { top: 8px; right: 8px; } }

#toast { position: fixed; left: 50%; bottom: 50px; z-index: 400; transform: translate(-50%, 16px); opacity: 0; padding: 10px 22px; background: #fff; border: 1.5px solid var(--acc); color: #3a2f28; border-radius: 99px; box-shadow: var(--shadow); font-size: 13px; transition: all .35s var(--ease); pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#foot { padding: 80px 5vw 60px calc(var(--rail) + 5vw); border-top: 1px solid var(--line); color: var(--mut); font-size: 13px; }
.zm { cursor: zoom-in; }
/* hero eyebrow: drop the middle phrase on phones so it stays one line */
.hm-k i { font-style: normal; }
@media (max-width: 760px) { .hm-k i { display: none; } }
.veil { position: fixed; inset: 0; z-index: 120; background: var(--bg, #faf6ef); opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.veil.on { opacity: 1; transition-duration: .16s; }
@media (max-width: 760px) { .ag-t figcaption { font-size: 11.5px; } }
/* annotated images */
.anno-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 22px; align-items: start; max-width: calc(var(--n) * 460px); margin-left: auto; margin-right: auto; }
.anno { position: relative; margin: 0; border-radius: var(--r); overflow: visible; box-shadow: var(--shadow); cursor: zoom-in; }
.anno > img { width: 100%; height: 100%; display: block; border-radius: var(--r); }
.anno svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.anno circle, .anno line { fill: none; stroke: #fff; stroke-width: .55; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 2px rgba(0,0,0,.55)); }
.anno circle { stroke: var(--acc); stroke-width: 2.6; stroke-dasharray: 7 5; }
.anno line { stroke-width: 1.6; }
.anno text { display: none; font: 700 4px var(--sans); fill: #fff; paint-order: stroke; stroke: var(--acc); stroke-width: 1.2; }
.anno-b { position: absolute; transform: translate(0, -50%); width: clamp(150px, 46%, 240px); background: #fffdf9; color: #3a2f28; border: 1.5px solid var(--acc); border-radius: 14px; padding: 7px 11px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 8px 20px -10px rgba(0,0,0,.45); pointer-events: none; }
.anno-b.l { transform: translate(-100%, -50%); }
.anno-b b { display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 11px; vertical-align: 1px; }
.anno-cap { margin: 10px 4px 0; font-size: 13px; color: var(--mut); }
.anno-list { display: none; }
html.mo .anno-row:not(.in) .anno-b { opacity: 0; }
html.mo .anno-row.in .anno-b { animation: annoPop .5s var(--ease) both; animation-delay: var(--d); }
html.mo .anno-row.in .anno g { animation: annoDraw .9s ease both; animation-delay: var(--d); }
.anno circle, .anno line { stroke-dashoffset: 0; }
@keyframes annoPop { from { opacity: 0; transform: translate(var(--tx, 0), -50%) scale(.85); } to { opacity: 1; } }
.anno-b.l { --tx: -100%; }
@keyframes annoDraw { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 900px) {
  .anno-row { grid-template-columns: 1fr; }
  .anno-b { display: none; } .anno text { display: block; }
  .anno-list { display: block; margin: 10px 0 0; padding-left: 22px; font-size: 13.5px; line-height: 1.7; }
}
/* OC design steps */
.ocf { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px; }
.ocs-g .tile { outline: 1px solid var(--line); }
@media (max-width: 1000px) { .ocf { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) { .ocf { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ocf li { min-width: 0; overflow-wrap: anywhere; } }
.ocf li { background: var(--card); border-radius: var(--rs); box-shadow: var(--shadow); padding: 12px 14px; display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; }
.ocf b { font: 400 22px/1 var(--disp); color: var(--acc); white-space: nowrap; flex-shrink: 0; overflow-wrap: normal; }
.ocs { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 26px; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; margin-top: 22px !important; align-items: start; }
.ocs-h { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.ocs-n { font: 400 44px/1 var(--disp); color: #fff; background: var(--acc); border-radius: 14px; padding: 8px 12px 4px; }
.ocs-h .mono { color: var(--acc); font-size: 11px; } .ocs-h h4 { margin: 2px 0 0; font: 400 24px/1.25 var(--serif); }
.ocs-goal { margin: 0 0 12px; font-size: 14.5px; line-height: 1.75; }
.ocs h6 { margin: 14px 0 6px; font: 700 12px var(--sans); color: var(--mut); letter-spacing: .08em; }
.ocs-code { margin: 0; white-space: pre-wrap; word-break: break-word; background: var(--card2); border-radius: var(--rs); padding: 10px 12px; font: 12px/1.6 var(--mono); color: var(--fg); max-height: 220px; overflow: auto; }
.ocs-pit { margin: 0; font-size: 13.5px; line-height: 1.7; color: var(--fg); background: rgba(217, 119, 87, .08); border-left: 3px solid var(--acc); padding: 8px 12px; border-radius: 0 var(--rs) var(--rs) 0; }
.ocs-cost { display: inline-block; margin-top: 12px; font-size: 11px; color: var(--mut); border: 1px solid var(--line2); border-radius: 99px; padding: 3px 10px; }
.ocs-g { align-self: center; }
.ocs-card { align-self: stretch; background: var(--card2); border-radius: var(--rs); padding: 18px 20px; font-size: 14px; line-height: 1.8; }
.ocs-card dl { display: grid; grid-template-columns: 6em 1fr; gap: 6px 14px; margin: 0; } .ocs-card dt { color: var(--mut); font-weight: 700; } .ocs-card dd { margin: 0; }
@media (max-width: 1000px) { .ocs { grid-template-columns: 1fr; padding: 18px; } }
/* reveal start states live in CSS so nothing flashes before JS takes over; html.mo is only set when IO + WAAPI exist */
html.mo .rv:not(.in), html.mo .rvt:not(.in) { opacity: 0; }
html.mo .rvm:not(.in) { clip-path: inset(0 0 100% 0); }
html.mo .chap:not(.ob) :is(.ch-no, .ch-t, .nar, .ch-meta) { opacity: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }

/* ======================= 小克 narrator ======================= */
.nar { display: flex; align-items: flex-end; gap: 14px; margin: 18px 0 22px; max-width: 760px; }
.nar img { width: 92px; height: auto; flex: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.nar .bubble { position: relative; background: var(--card); border: 1.5px solid var(--acc); border-radius: var(--r) var(--r) var(--r) 6px; padding: 16px 20px; font: 400 16px/1.8 var(--sans); color: var(--fg); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5); }
.nar .bubble::before { content: ""; position: absolute; left: -9px; bottom: 10px; width: 14px; height: 14px; background: var(--card); border-left: 1.5px solid var(--acc); border-bottom: 1.5px solid var(--acc); transform: rotate(45deg) skew(10deg, 10deg); }
.nar.sm img { width: 70px; } .nar.sm .bubble { font-size: 15px; }
.hm-say { display: flex; gap: 14px; align-items: flex-start; margin: 0 0 30px; max-width: 36em; }
.hm-say img { width: 84px; flex: none; margin-top: -6px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .4)); }
.hm-say p { margin: 0; font-size: 15.5px; line-height: 1.85; color: #5a4a3f; background: #fff; border: 1.5px solid rgba(217, 119, 87, .55); box-shadow: var(--shadow); border-radius: var(--r) var(--r) var(--r) 6px; padding: 16px 20px; }
.hm-say b { color: var(--acc); font-weight: 700; }
.callout { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: start; border-left: 0; border: 1.5px dashed color-mix(in srgb, var(--acc) 60%, transparent); border-radius: 16px; background: color-mix(in srgb, var(--acc) 6%, transparent); }
.callout img { width: 64px; } .callout .mono { color: var(--acc); } .callout p { margin: 4px 0 0; }
#buddy { position: fixed; z-index: 90; right: 22px; bottom: 18px; width: 96px; padding: 0; border: 0; background: none; transform: translateY(160%); transition: transform .7s var(--ease); }
#buddy.on { transform: none; }
#buddy img { width: 96px; height: auto; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .35)); transition: transform .3s var(--ease); }
#buddy:hover img { transform: translateY(-6px) rotate(-4deg); }
.b-bub { position: absolute; right: 86px; bottom: 58px; white-space: nowrap; padding: 8px 14px; background: var(--card); color: var(--fg); border: 1.5px solid var(--acc); border-radius: 16px 16px 4px 16px; font: 700 13px var(--sans); opacity: 0; transform: translateX(10px) scale(.9); transform-origin: right bottom; transition: all .4s var(--ease); pointer-events: none; }
#buddy.talk .b-bub { opacity: 1; transform: none; }
.b-tip { position: absolute; left: 50%; bottom: -2px; translate: -50% 0; background: var(--acc); color: #fff !important; padding: 1px 8px; border-radius: 99px; font-size: 10px !important; opacity: 0; transition: opacity .3s; }
#buddy:hover .b-tip { opacity: 1; }
@media (max-width: 760px) { #buddy { width: 70px; right: 10px; } #buddy img { width: 70px; } .nar img { width: 64px; } .nar .bubble { font-size: 14.5px; } }

@media (max-width: 900px) {
  #rail { display: none; } #chapters { padding-left: 0; } #topbar { padding-left: 16px; } #foot { padding-left: 18px; }
  .hm-top { padding: 16px 18px; } .hm-logo span { display: none; } .hm-intro { padding-top: 96px; }
  .hm-say img { width: 64px; } .hm-cta .btn.lg { height: 46px; padding: 0 20px; font-size: 14px; }
}
.hm-cta .btn.ghost { border-color: var(--line2); }
.hm-cta .btn.ghost:hover { border-color: var(--acc); }

.part { background: var(--bg); color: var(--fg); }
.part.t-cream { --bg: #faf6ef; }
#part-A { --acc: #d97757; --acc2: #e8956f; }
#part-D { --acc: #c0704f; --acc2: #d58c6c; }

.steps-g .tile { cursor: zoom-in; }
.st-box { position: relative; }
.st-box svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.st-box svg rect { fill: color-mix(in srgb, var(--acc) 14%, transparent); stroke: var(--acc); stroke-width: .5; stroke-dasharray: 1.4 1; }
.steps-g figcaption b { display: block; font-size: 13.5px; }
.steps-g figcaption span { display: block; font-weight: 400; color: var(--mut); font-size: 12px; margin-top: 2px; }
/* archive pager */
.arch-head { display: flex; align-items: baseline; gap: 14px; margin: 18px 0 12px; }
.arch-head b { font: 400 24px var(--serif); } .arch-head span { font-size: 13px; color: var(--mut); }
.achip.on { background: var(--acc); color: #fff; }
.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 26px 0 10px; }
.pager .btn:disabled { opacity: .35; pointer-events: none; }
.pg-gap { color: var(--mut); padding: 0 4px; }
.arch-bar { position: static !important; }
@media (max-width: 1000px) { .bench { grid-template-columns: 1fr; } .bench-v, .bench-v.wide { width: 100%; } }

/* center fixed-width media blocks */
.vnw, .vfxw, .mcs, .outp { margin-left: auto; margin-right: auto; }
.vnw { max-width: 1240px; } .mcs { max-width: 1240px; } .vfxw { max-width: 1240px; }
.vfx { margin: 0 auto; } .mc-stage { margin: 0 auto; }
.vfxw .seg, .mcs .seg { justify-content: center; }
.vfxw .note, .mcs .note, .vn-hint { text-align: center; margin-left: auto; margin-right: auto; }
.outp { max-width: 1240px; }

@media (max-width: 1000px) {
  .hm-wall-clip { position: absolute; inset: 0; opacity: .22; }
  .hm-wall-clip::before { display: none; }
  .hm-cue { display: none; }
  .hm-k { font-size: 10px; letter-spacing: .1em; }
  .hm-intro h1 { font-size: clamp(40px, 12vw, 64px); }
  .sub { grid-template-columns: 1fr; }
  .arch-chips { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .achip { flex: none; }
  .b-bub { display: none; }
  .nar { align-items: flex-start; }
  .ch-no .big { font-size: 56px; padding: 10px 18px 6px; border-radius: 20px; }
  .pd { min-height: auto; padding: 80px 20px; } .pd-l { font-size: 40vw; }
  .stats { grid-template-columns: 1fr 1fr; }
  .hm-wall .hm-col:nth-child(4) { display: none; }
  .hm-wall { grid-template-columns: repeat(3, 1fr); }
}
@media (hover: none) { .tile:hover, .hm-t:hover, .ov-c:hover { transform: none; } }
/* source / credit link cards */
.lks { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.lk { display: flex; flex-direction: column; gap: 6px; background: var(--card); border-radius: var(--rs); box-shadow: var(--shadow); padding: 14px 16px; color: inherit; text-decoration: none; transition: transform .2s, box-shadow .2s; min-width: 0; }
.lk:hover { transform: translateY(-2px); }
.lk b { font: 400 18px/1.3 var(--serif); }
.lk span { font-size: 13.5px; line-height: 1.6; color: var(--mut); }
.lk i { font: 11px var(--mono); font-style: normal; color: var(--acc); margin-top: auto; overflow-wrap: anywhere; }
.sub p a, .callout a, .note a { color: var(--acc); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- codex promo (D2) ---------- */
.codex { position: relative; display: grid; grid-template-columns: minmax(300px, 420px) 1fr; gap: 40px; align-items: center; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 34px 38px 34px 30px; margin-bottom: 26px; overflow: hidden; isolation: isolate; }
.codex::before { content: ""; position: absolute; z-index: -1; left: -120px; top: -140px; width: 460px; height: 460px; border-radius: 50%; border: 1.5px dashed rgba(236, 138, 60, .35); animation: cxspin 120s linear infinite; }
@keyframes cxspin { to { rotate: 360deg; } }
.cx-art { position: relative; display: block; height: 290px; }
.cx-frame { position: absolute; right: 0; top: 6px; width: 92%; padding: 9px 9px 30px; background: #fffdf9; border-radius: 8px; box-shadow: 0 24px 46px -24px rgba(90, 50, 30, .6), 0 0 0 1px rgba(90, 60, 40, .06); rotate: 3deg; transition: rotate .7s var(--ease), transform .7s var(--ease); }
.cx-frame img { width: 100%; aspect-ratio: 1216 / 832; object-fit: cover; border-radius: 3px; }
.cx-frame em { position: absolute; left: 12px; bottom: 7px; font: 600 10.5px var(--mono); letter-spacing: .14em; color: #b58a63; font-style: normal; }
.cx-tape { position: absolute; left: 50%; top: -12px; width: 96px; height: 24px; translate: -50% 0; rotate: -5deg; background: repeating-linear-gradient(45deg, rgba(236, 138, 60, .55) 0 7px, rgba(245, 173, 98, .55) 7px 14px); border-radius: 3px; }
.cx-xk { position: absolute; left: -6px; bottom: -14px; width: 46%; filter: drop-shadow(0 14px 18px rgba(90, 50, 30, .35)); transition: transform .7s cubic-bezier(.34, 1.56, .64, 1); }
.cx-art:hover .cx-frame { rotate: 0deg; transform: translateY(-4px); }
.cx-art:hover .cx-xk { transform: translateY(-10px) rotate(-4deg) scale(1.04); }
.cx-body h3 { font: 400 32px/1.2 var(--disp); margin: 8px 0 10px; }
.cx-body p { margin: 0; max-width: 46em; color: color-mix(in srgb, var(--fg) 82%, transparent); }
.cx-body dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; }
.cx-body dl > div { padding: 9px 14px; border-radius: 14px; background: var(--card2); }
.cx-body dt { font: 10.5px var(--mono); letter-spacing: .12em; color: var(--mut); }
.cx-body dd { margin: 2px 0 0; font: 400 22px/1 var(--disp); color: var(--fg); }
.cx-cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
@media (max-width: 760px) { .codex { grid-template-columns: 1fr; padding: 22px 18px; gap: 16px; } .cx-art { height: 230px; } }

/* ---------- themed tooltip ---------- */
.tip { position: fixed; z-index: 400; left: 0; top: 0; max-width: 280px; padding: 7px 11px; border-radius: 10px; background: #3a2f28; color: #faf6ef; font: 600 12px/1.5 var(--sans); box-shadow: 0 10px 24px -10px rgba(60, 35, 20, .55); pointer-events: none; opacity: 0; transform: translateY(4px) scale(.96); transition: opacity .18s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.tip.on { opacity: 1; transform: none; }
.tip::after { content: ""; position: absolute; left: var(--ax, 50%); width: 9px; height: 9px; background: inherit; translate: -50% 0; rotate: 45deg; border-radius: 2px; }
.tip.above::after { bottom: -4px; } .tip.below::after { top: -4px; }

