
:root {
  color-scheme: dark;
  --ink: #ece8f4;
  --muted: #b3aecb;
  --gold: #f0cf8a;
  --gold-deep: #c9964a;
  --navy: #070b1a;
  --violet: #7a63e0;
  --teal: #35c2c7;
}
* { box-sizing: border-box; }
html { background: var(--navy); }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  background: var(--navy);
  overflow-x: clip;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }


.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30; height: 72px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 4vw;
  background: linear-gradient(#070b1ae6, #070b1a00);
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { height: 42px; display: block; }   
.logo span { font-size: 14px; letter-spacing: .12em; color: #d8cfb8; }
.top nav { display: flex; align-items: center; gap: 22px; font-size: 15px; }
.top nav a { text-decoration: none; color: #e9dfc6; }
.top nav a:hover { color: #fff; }
.top nav button { background: none; border: 1px solid #e8c77f55; border-radius: 999px; padding: 6px 14px; font-size: 13px; color: #e9dfc6; }


#story { position: relative; }
#viewport {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  perspective-origin: 50% 50%;
  background: radial-gradient(120% 90% at 50% 45%, #141a3e 0%, #0a0f26 55%, #05070f 100%);
}

#bg {
  position: absolute; inset: 0; overflow: hidden; opacity: .5;
  background:
    radial-gradient(60% 50% at 70% 30%, #3b2a8a55, transparent 70%),
    radial-gradient(55% 45% at 25% 70%, #1c6f7a33, transparent 70%),
    #0b1026;
}
#bg .bgl { position: absolute; inset: -8%; background: center / cover no-repeat; will-change: transform, opacity; }

#bg .bgs { position: absolute; inset: 0; }
#bg .bgs + .bgs { opacity: 0; visibility: hidden; }
#bg [data-s="A"] .far { background-image: url("assets/bg/A-far.webp"); }
#bg [data-s="A"] .mid { background-image: url("assets/bg/A-mid.webp"); }
#bg [data-s="A"] .near { background-image: url("assets/bg/A-near.webp"); }
#bg [data-s="B"].ld .far { background-image: url("assets/bg/B-far.webp"); }
#bg [data-s="B"].ld .mid { background-image: url("assets/bg/B-mid.webp"); }
#bg [data-s="B"].ld .near { background-image: url("assets/bg/B-near.webp"); }
#bg [data-s="C"].ld .far { background-image: url("assets/bg/C-far.webp"); }
#bg [data-s="C"].ld .mid { background-image: url("assets/bg/C-mid.webp"); }
#bg [data-s="C"].ld .near { background-image: url("assets/bg/C-near.webp"); }
#bg [data-s="D"].ld .far { background-image: url("assets/bg/D-far.webp"); }
#bg [data-s="D"].ld .mid { background-image: url("assets/bg/D-mid.webp"); }
#bg [data-s="D"].ld .near { background-image: url("assets/bg/D-near.webp"); }

#veil { position: absolute; inset: -20%; background: url("assets/bg/veil.webp") center / cover no-repeat; opacity: 0; pointer-events: none; will-change: transform, opacity; }
#world {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0;
  transform-style: preserve-3d; will-change: transform;
}
#vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(110% 85% at 50% 50%, transparent 55%, #03050ccc 100%);
}
#dim { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(70% 55% at 50% 42%, #05081ae6, #05081a99 60%, #05081a55); }
#world > * { position: absolute; left: 0; top: 0; backface-visibility: hidden; visibility: hidden; }

.poster { width: 1600px; pointer-events: none; filter: drop-shadow(0 40px 80px #000a); }
.layer { pointer-events: none; filter: drop-shadow(0 18px 28px #0009); }


.panel {
  border: 1px solid #e8c77f80;
  border-radius: 6px;
  
  background: url(assets/d/panel-grid.webp) 0 0 / 100% 100% no-repeat;
  box-shadow: inset 0 0 0 1px #ffffff0d;
}
[data-mode="port"] .panel { background-image: url(assets/m/panel-grid.webp); }
.panel .num {
  position: absolute; left: 34px; top: 22px;
  font: 700 64px/1 Georgia, "Times New Roman", serif; color: #e8c77f44; letter-spacing: -.02em;
}
.panel small { display: none; }
.panel .reg { position: absolute; width: 26px; height: 26px; }
.panel .reg::before, .panel .reg::after { content: ""; position: absolute; background: #e8c77f66; }
.panel .reg::before { left: 12px; top: 0; width: 1px; height: 26px; }
.panel .reg::after { left: 0; top: 12px; width: 26px; height: 1px; }
.panel .tl { left: 14px; top: 14px; } .panel .tr { right: 14px; top: 14px; }
.panel .bl { left: 14px; bottom: 14px; } .panel .br { right: 14px; bottom: 14px; }
.panel .tab {
  position: absolute; bottom: 100%; left: calc(36px + var(--i) * 176px);
  padding: 10px 20px 8px; border: 1px solid #e8c77f99; border-bottom: 0; border-radius: 12px 12px 0 0;
  background: linear-gradient(180deg, #232c6af2, #141b4af2); color: #f3e6c8; font-size: 24px; white-space: nowrap;
  box-shadow: 0 -6px 30px #0006;
}
.panel .tab b { color: var(--gold); font-family: Georgia, "Times New Roman", serif; margin-right: 6px; }
[data-mode="port"] .panel .tab { left: calc(8px + var(--i) * 45px); padding: 4px 7px 3px; font-size: 0; border-radius: 6px 6px 0 0; }
[data-mode="port"] .panel .tab b { font-size: 12px; margin: 0; }
[data-mode="port"] .panel .num { font-size: 28px; left: 16px; top: 12px; }
[data-mode="port"] .panel small { font-size: 10px; left: 18px; top: 46px; }


.it { visibility: hidden; border-radius: 10px; }
.it .media { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; border-radius: inherit; background: #0b1024; }
.it .shade { position: absolute; inset: 0; border-radius: inherit; background: #060914; opacity: 0; pointer-events: none; }
.k-card { border: 1px solid #e8c77f55; box-shadow: 0 22px 56px #000b, 0 0 0 1px #0006; background: #0b1024; }
.k-web { border: 1px solid #e8c77f4d; box-shadow: 0 22px 56px #000b; background: #10152e; border-radius: 12px; overflow: hidden; }
.k-web .bar { display: flex; gap: 6px; align-items: center; height: 22px; padding: 0 10px; background: #161c3a; border-bottom: 1px solid #ffffff10; }
.k-web .bar span { width: 8px; height: 8px; border-radius: 50%; background: #e8c77f66; }
.k-web .bar span:nth-child(2) { background: #7a63e088; } .k-web .bar span:nth-child(3) { background: #35c2c788; }
.k-web .media { height: calc(100% - 22px); border-radius: 0; }

.k-laptop { box-sizing: border-box; padding: 2.2% 2.2% 6.2%; border-radius: 14px 14px 4px 4px; background: linear-gradient(180deg, #1d2238, #0c0f1f);
  box-shadow: 0 0 0 1px #3a4262, 0 26px 60px #000b; }
.k-laptop .media { height: 100%; border-radius: 3px; }
.k-laptop::before { content: ""; position: absolute; top: .75%; left: 50%; width: .8%; aspect-ratio: 1; border-radius: 50%; background: #2e3556; transform: translateX(-50%); }
.k-laptop .deck { position: absolute; left: -6%; bottom: 0; width: 112%; aspect-ratio: 35 / 1; border-radius: 3px 3px 48% 48% / 3px 3px 100% 100%;
  background: linear-gradient(180deg, #e3e6ef, #a3a8bf 40%, #5d6279); }
.k-laptop .deck::before { content: ""; position: absolute; left: 43%; width: 14%; top: 0; height: 38%; border-radius: 0 0 6px 6px; background: #7c8199; }
.k-laptop .shade { border-radius: 14px 14px 4px 4px; }
.k-phone { border: 6px solid #0a0d1c; border-radius: 22px; box-shadow: 0 0 0 1.5px #5d6485, 0 20px 48px #000c; overflow: hidden; background: #0a0d1c; }
.k-phone::before { content: ""; position: absolute; z-index: 1; top: 1.6%; left: 50%; width: 28%; aspect-ratio: 4.2; transform: translateX(-50%); border-radius: 99px; background: #05060d; }

.k-gold { --fw: 10px; border-radius: 8px; background: none; box-shadow: 0 22px 56px #000b; }
.k-gold::before { content: ""; position: absolute; z-index: -1; inset: calc(-1 * var(--fw)); border-radius: calc(8px + var(--fw));
  background: linear-gradient(135deg, #fff0bf, #d6a449 24%, #7f5218 50%, #e7c267 76%, #fff0bf); box-shadow: inset 0 0 0 1px #fff4d0aa, inset 0 0 0 3px #5a3a0e55; }
.k-gold .media { border-radius: 8px; }
.k-gold .shade { inset: calc(-1 * var(--fw)); border-radius: calc(8px + var(--fw)); }
[data-mode="port"] .k-gold { --fw: 4px; }
.k-phone .media { border-radius: 14px; }
.k-cut { border-radius: 0; background: none; }
.k-cut .media { object-fit: contain; background: none; border-radius: 0; filter: drop-shadow(0 18px 30px #000a); }

.it.deco { box-shadow: none; } .it.deco .media { filter: none; }

.slots, .resize { --a: 0; --b: 0; font-size: 31px; color: #f3e6c8; border-radius: 16px;
  background: linear-gradient(160deg, #1b2360, #0e1336); border: 1px solid #e8c77f55; box-shadow: 0 22px 56px #000b; }
.slots-h { position: absolute; top: 3%; margin: 0; font-size: .9em; font-weight: 700; letter-spacing: .12em; color: var(--gold); }
.slots-h.a { left: 2%; opacity: var(--a); } .slots-h.b { left: 54%; opacity: var(--b); }
.slot { position: absolute; display: block; border: 2px dashed #e8c77fcc; border-radius: 6px; background: #0c1130cc; overflow: hidden; }
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .38; filter: saturate(.6); }
.slot em { position: absolute; left: 6px; top: 4px; font: 700 .72em/1.1 ui-monospace, Consolas, monospace; font-style: normal; color: #fff3d6; text-shadow: 0 1px 4px #000; white-space: nowrap; }
.slot small { position: absolute; left: 6px; bottom: 4px; font-size: .6em; color: #d8cfe8; text-shadow: 0 1px 4px #000; }
.slot.a { opacity: var(--a); transform: scale(calc(.85 + var(--a) * .15)); }
.slot.b { opacity: var(--b); transform: scale(calc(.85 + var(--b) * .15)); }
[data-mode="port"] .slots { font-size: 11px; }
.slots .demo, .resize .demo { position: absolute; right: 2.4%; top: 3%; font-size: .62em; letter-spacing: .1em; color: #a99fc8; }
.resize .credit { position: absolute; left: 2%; top: 80%; width: 30%; margin: 0; font-size: .56em; line-height: 1.5; letter-spacing: .04em; color: #cfc6e8; opacity: var(--src); }
[data-mode="port"] .resize .credit { left: 27%; top: 43%; width: 46%; text-align: center; font-size: .66em; }
.resize { --src: 0; --fixed: 0; --stitch: 0; --out: 0; --crop: 0; --any: 0; }
.rs { position: absolute; margin: 0; }
.rs img { display: block; width: 100%; height: 100%; border-radius: 6px; box-shadow: 0 16px 40px #000a; }
.rs figcaption { position: absolute; left: 0; bottom: calc(100% + 8px); white-space: nowrap; font-size: .72em; font-weight: 700; letter-spacing: .06em; color: #f3e6c8; }
.rs.src { left: 2%; top: 16%; width: 30%; aspect-ratio: 1; opacity: var(--src); }
.rs.src figcaption { color: color-mix(in srgb, #f3e6c8 calc(100% - var(--fixed) * 100%), #9fe3e6); }
.rs.out1 { left: 40%; top: 10%; width: 56%; aspect-ratio: 900 / 405; clip-path: inset(0 calc((1 - var(--stitch)) * 27.5%) round 6px); opacity: calc(var(--stitch) * 4); }
.rs.out2 { left: 40%; top: 66%; width: 57%; aspect-ratio: 1400 / 153; clip-path: inset(0 calc((1 - var(--out)) * 44%) round 6px); opacity: calc(var(--out) * 4); }
.rs.out1 figcaption { opacity: var(--stitch); } .rs.out2 figcaption { opacity: var(--out); }
.rs .crop { position: absolute; left: 10%; top: 16.7%; width: 80%; height: 66.6%; border: 3px dashed #9fe3e6; border-radius: 4px;
  box-shadow: 0 0 0 999px #0a0f26aa; opacity: var(--crop); transform: scale(calc(1.25 - var(--crop) * .25)); }
.rs .crop em { position: absolute; left: 0; top: calc(100% + 6px); font-style: normal; font-size: .62em; font-weight: 700; color: #9fe3e6; white-space: nowrap; }
.anysize { position: absolute; left: 40%; top: 86%; margin: 0; display: flex; align-items: center; gap: .6em; font-size: .78em;
  opacity: var(--any); transform: translateY(calc((1 - var(--any)) * 14px)); }
.anysize span { color: var(--gold); font-weight: 700; letter-spacing: .08em; }
.anysize b { padding: .3em .7em; border: 1.5px solid #e8c77f99; border-radius: 6px; background: #0c1130; font: 600 1em ui-monospace, Consolas, monospace; color: #fff3d6; }
.anysize i { font-style: normal; color: #9fe3e6; }
[data-mode="port"] .resize { font-size: 12px; }
[data-mode="port"] .rs.src { left: 27%; top: 7%; width: 46%; }
[data-mode="port"] .rs.out1 { left: 10%; top: 50%; width: 80%; }
[data-mode="port"] .rs.out2 { left: 3%; top: 84%; width: 94%; }
[data-mode="port"] .anysize { left: 3%; top: 94%; }

.spend, .steady, .tests, .cpa { --teal: #35c2c7; --tealx: #9fe3e6; --red: #ff6b6b; font-size: 30px; color: #f3e6c8; border-radius: .6em;
  background: linear-gradient(160deg, #1b2360, #0e1336); border: 1px solid #e8c77f55; box-shadow: 0 22px 56px #000b, 0 0 60px #e8c77f1a; }
.steady header, .tests header, .cpa header { position: absolute; left: 4%; right: 4%; top: 6%; display: flex; align-items: baseline; gap: .6em; font-size: .8em; letter-spacing: .08em; color: #cfc6e8; }
.steady header b, .tests header b, .cpa header b { color: var(--gold); font-size: 1.15em; letter-spacing: .1em; }
.steady header span, .tests header span, .cpa header span { margin-left: auto; color: #a99fc8; }
.spend { --roll: 0; --plus: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35em; text-align: center; }
.spend p { margin: 0; }
.sp-h { font-size: .8em; font-weight: 700; letter-spacing: .16em; color: var(--gold); }
.sp-num { display: flex; align-items: flex-start; font: 800 3.3em/1 "Segoe UI", system-ui, -apple-system, sans-serif; font-variant-numeric: tabular-nums lining-nums; letter-spacing: .01em;
  color: #fff3d6; filter: drop-shadow(0 0 .22em #e8c77f66); }   
.sp-num .cur { font-size: .42em; margin: .18em .35em 0 0; color: var(--gold); letter-spacing: .04em; }
.sp-num .dg { display: inline-block; height: 1em; overflow: hidden; opacity: calc(.4 + var(--roll) * .6); }
.sp-num .dg b { display: block; font-weight: inherit; transform: translateY(calc(var(--roll) * var(--n) * -1em)); }
.sp-num .dg i { display: block; height: 1em; font-style: normal; }
.sp-num .sep { opacity: calc(.4 + var(--roll) * .6); }
.sp-num .approx { font-size: .42em; margin: .18em .3em 0 0; color: var(--gold); font-weight: 700; }   
.sp-sub { font-size: .66em; letter-spacing: .1em; color: #d8cfe8; opacity: var(--plus); transform: translateY(calc((1 - var(--plus)) * 10px)); }
.steady { --band: 0; --draw: 0; --ok: 0; }
.steady .plot { position: absolute; left: 4%; top: 22%; width: 92%; height: 62%; overflow: visible; }
.steady .band { fill: #ff6b6b; opacity: calc(var(--band) * .14); }
.steady .grid { stroke: #ffffff14; stroke-width: 1; vector-effect: non-scaling-stroke; fill: none; }
.steady .area { fill: #e8c77f; opacity: .14; clip-path: inset(0 calc((1 - var(--draw)) * 100%) 0 0); }
.steady .line { fill: none; stroke: var(--gold); stroke-width: 5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--draw)); filter: drop-shadow(0 0 6px #e8c77f88); }
.steady .band-t { position: absolute; left: 48%; width: 27.6%; top: 23.5%; margin: 0; text-align: center; font-size: .66em; font-weight: 700; letter-spacing: .12em;
  color: #ffb3b3; opacity: var(--band); }
.steady .ok { position: absolute; right: 4%; top: 30%; margin: 0; display: flex; align-items: center; gap: .4em; padding: .3em .8em; border-radius: 99px;
  font-size: .9em; font-weight: 800; letter-spacing: .08em; color: #1a1430; background: linear-gradient(180deg, #fff3d6, #e8c77f); box-shadow: 0 0 1.2em #e8c77f88;
  opacity: var(--ok); transform: scale(calc(.8 + var(--ok) * .2)); }
.steady .ok i { font-style: normal; }
.steady .axis { position: absolute; right: 4%; bottom: 4%; margin: 0; font-size: .56em; letter-spacing: .1em; color: #a99fc8; }
.tests { --run: 0; --win: 0; --warn: 0; --stop: 0; --boost: 0; }
.tests .cells { position: absolute; left: 4%; right: 4%; top: 17%; bottom: 5%; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 3.5%; row-gap: 6%; align-content: start; }
.tests .cell { position: relative; margin: 0; opacity: calc(1 - var(--win) * .45); }
.tests .cell.win, .tests .cell.bad { opacity: 1; }
.tests .pic { position: relative; display: block; aspect-ratio: 7 / 4; border-radius: 6px; }
.tests .pic img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 6px; box-shadow: 0 10px 26px #0009; }
.tests .win .pic img { box-shadow: 0 0 0 calc(var(--win) * 4px) var(--gold), 0 0 calc(var(--win) * 34px) #e8c77f88; }
.tests .bad .pic img { filter: grayscale(var(--stop)) brightness(calc(1 - var(--stop) * .45)); box-shadow: 0 0 0 calc(var(--warn) * 3px) var(--red); }
.tests .boost { transform: scale(calc(1 + var(--boost) * .06)); z-index: 1; }
.tests .boost .pic img { box-shadow: 0 0 0 calc(var(--win) * 4px) var(--gold), 0 0 calc(var(--win) * 34px + var(--boost) * 30px) #9fe3e6aa; }
.tests figcaption { margin-top: .35em; font-size: .56em; letter-spacing: .08em; color: #d8cfe8; }
.tests .bar { display: block; height: .3em; margin-top: .3em; border-radius: 99px; background: #ffffff1a; overflow: hidden; }
.tests .bar b { display: block; height: 100%; border-radius: inherit; width: calc(var(--run) * var(--p) * 100%); background: linear-gradient(90deg, var(--teal), var(--gold)); }
.tests .bad .bar b { width: calc(var(--run) * (var(--p) - var(--warn) * .48) * 100%); background: color-mix(in srgb, var(--gold) calc(100% - var(--warn) * 100%), var(--red)); }
.tests .boost .bar b { width: calc(var(--run) * (var(--p) + var(--boost) * (1 - var(--p))) * 100%); }
.tests .tag { position: absolute; top: .45em; padding: .16em .55em; border-radius: 5px; font-size: .52em; font-weight: 800; font-style: normal; letter-spacing: .06em; white-space: nowrap; }
.tests .tag.win { left: .45em; color: #1a1430; background: var(--gold); opacity: var(--win); }
.tests .tag.warn { right: .45em; color: #fff; background: var(--red); opacity: calc(var(--warn) * (1 - var(--stop))); }
.tests .tag.up { right: .45em; color: #0b2b2c; background: var(--tealx); opacity: var(--boost); }
.tests .stamp { position: absolute; left: 50%; top: 50%; padding: .2em .6em; border: .12em solid var(--red); border-radius: 6px; font-size: .7em; font-weight: 900; font-style: normal;
  letter-spacing: .12em; white-space: nowrap; color: var(--red); background: #1a0b16cc; opacity: var(--stop);
  transform: translate(-50%, -50%) rotate(-8deg) scale(calc(1.5 - var(--stop) * .5)); }
.cpa { --outs: 0; --me: 0; --low: 0; }
.cpa .row { position: absolute; left: 4%; right: 4%; display: grid; grid-template-columns: 6.4em 1fr 7.6em; align-items: center; gap: .8em; }
.cpa .row.o { top: 34%; } .cpa .row.me { top: 62%; }
.cpa .row p { margin: 0; font-size: .8em; font-weight: 700; letter-spacing: .06em; text-align: right; }
.cpa .row.me p { color: var(--gold); font-size: .95em; }
.cpa .track { position: relative; display: block; height: 1.1em; border-radius: 6px; background: #ffffff10; }
.cpa .track b { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; }
.cpa .o b { width: calc(var(--outs) * 100%); background: #8f89b8; }
.cpa .me b { width: calc(var(--me) * 100%);    background: linear-gradient(90deg, var(--gold-deep), var(--gold)); box-shadow: 0 0 1em #e8c77f55; }
.cpa .me s { position: absolute; left: 92%; width: 8%; top: 0; bottom: 0; border-radius: 0 6px 6px 0; opacity: var(--low);
  background: repeating-linear-gradient(-45deg, #e8c77f66 0 6px, transparent 6px 12px); outline: 1px dashed #e8c77f99; outline-offset: -1px; }
.cpa .row em { font-style: normal; font-size: .66em; letter-spacing: .06em; color: #cfc6e8; white-space: nowrap; }
.cpa .o em { opacity: var(--outs); }
.cpa .me em { font-size: .74em; font-weight: 800; color: var(--gold); }
.cpa .me .eq { opacity: var(--me); } .cpa .me .lo { opacity: var(--low); }
.cpa .formula { position: absolute; left: 4%; right: 4%; bottom: 7%; margin: 0; font-size: .56em; letter-spacing: .06em; color: #a99fc8; text-align: right; opacity: var(--outs); }
.sp-solo { font-size: .66em; font-weight: 700; letter-spacing: .1em; color: var(--gold); opacity: var(--solo, 0); transform: translateY(calc((1 - var(--solo, 0)) * 10px)); }
[data-mode="port"] .spend { font-size: 13px; }
[data-mode="port"] .sp-num { font-size: 2.6em; }
[data-mode="port"] .steady, [data-mode="port"] .tests, [data-mode="port"] .cpa { font-size: 13.5px; border-radius: 12px; }
[data-mode="port"] .steady .plot { top: 26%; height: 52%; }
[data-mode="port"] .steady .band-t { top: 18%; font-size: .74em; }
[data-mode="port"] .steady .ok { top: auto; bottom: 5%; right: auto; left: 4%; }
[data-mode="port"] .tests .cells { grid-template-columns: repeat(2, 1fr); top: 12%; row-gap: 3.2%; }
[data-mode="port"] .tests header { top: 4%; }
[data-mode="port"] .tests .tag { font-size: .66em; }
[data-mode="port"] .tests figcaption { font-size: .7em; }
[data-mode="port"] .cpa header { flex-wrap: wrap; row-gap: .2em; }
[data-mode="port"] .cpa .row { grid-template-columns: 1fr; gap: .35em; left: 6%; right: 6%; }
[data-mode="port"] .cpa .row p { text-align: left; }
[data-mode="port"] .cpa .row.o { top: 28%; } [data-mode="port"] .cpa .row.me { top: 56%; }
[data-mode="port"] .cpa .formula { bottom: 5%; text-align: left; left: 6%; font-size: .7em; }

.xpl { transform-style: preserve-3d; border-radius: 0; --gapz: 105px; --x: calc(var(--open, 0) * (1 - var(--shut, 0))); }
.xpl .xl { position: absolute; transform: translateZ(calc(var(--x) * var(--k) * var(--gapz)));
  
  filter: brightness(calc(1 - var(--x) * max(0, -1 * var(--k)) * .09)) blur(calc(var(--x) * max(0px, -1px * var(--k)) * .55)); }
.xpl .xl img { display: block; width: 100%; height: 100%; }
.xpl .xpl-flat { position: absolute; left: 0; top: 0; width: 100%; height: 100%; transform: translateZ(1px); opacity: calc(1 - var(--x) * 8); box-shadow: 0 22px 56px #000b; }
.xpl .xl-tag { position: absolute; left: calc(100% + 26px); white-space: nowrap; font-size: 21px; font-weight: 700; letter-spacing: .06em; color: #f3e6c8;
  padding: 6px 12px; border: 1px solid #e8c77f99; border-radius: 6px; background: #0c1130d9; opacity: var(--x);
  transform: translateZ(calc(var(--x) * var(--k) * var(--gapz))); }
.xpl .xg { position: absolute; width: calc(var(--x) * (var(--n) - 1) * var(--gapz)); height: 0; border-top: 1.5px dashed #e8c77fcc; transform-origin: 0 0;
  transform: translateZ(calc(var(--x) * (var(--n) - 1) / -2 * var(--gapz))) rotateY(-90deg); opacity: var(--x); }
.xpl .xg.tl { left: 0; top: 0; } .xpl .xg.tr { left: 100%; top: 0; } .xpl .xg.bl { left: 0; top: 100%; } .xpl .xg.br { left: 100%; top: 100%; }
.xpl .xpl-cap { position: absolute; left: 0; bottom: calc(100% + 16px); margin: 0; white-space: nowrap; font-size: 22px; letter-spacing: .06em; color: #d8cfe8; }

.xpl .xl.turn { transform: translateZ(calc(var(--x) * var(--k) * var(--gapz))) rotate(calc(var(--spin, 0) * 765deg)); }
[data-mode="port"] .xpl { --gapz: 38px; }
[data-mode="port"] .xpl .xl-tag { display: none; }
[data-mode="port"] .xpl .xpl-cap { font-size: 10.5px; bottom: calc(100% + 8px); }
.k-cut .shade { display: none; }
[data-mode="port"] .k-web .bar { height: 12px; padding: 0 6px; gap: 4px; }
[data-mode="port"] .k-web .bar span { width: 5px; height: 5px; }
[data-mode="port"] .k-web .media { height: calc(100% - 12px); }
[data-mode="port"] .k-phone { border-width: 3px; border-radius: 12px; }


.chip {
  white-space: nowrap; transform-origin: 50% 50%;
  padding: 18px 34px; border-radius: 999px; font-size: 40px; font-weight: 600; letter-spacing: .04em;
  color: #fff3d6; background: #0c1130d9; border: 2px solid #e8c77f99; box-shadow: 0 0 60px #e8c77f33, 0 24px 60px #000a;
  translate: -50% -50%;
}
[data-mode="port"] .chip { font-size: 17px; padding: 8px 16px; border-width: 1px; }


.sheet { border-radius: 14px; background: #f4f6f4; color: #1e3a2a; box-shadow: 0 22px 56px #000b; overflow: hidden; }
.sheet header { height: 17%; display: flex; align-items: center; gap: 12px; padding: 0 5%; background: #1e8e4e; color: #fff; font-size: 26px; font-weight: 700; }
.sheet header em { font-style: normal; font-size: 30px; }
.sheet .grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; padding: 4%; height: 64%; }
.sheet .grid span { background: #e3e9e4; border-radius: 3px; }
.sheet .grid span.on { background: #f0cf8a; box-shadow: inset 0 0 0 3px #c9964a; }
.sheet footer { height: 19%; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 700; color: #1e8e4e; background: #e6f3ea; }
[data-mode="port"] .sheet header { font-size: 12px; gap: 5px; } [data-mode="port"] .sheet header em { font-size: 14px; }
[data-mode="port"] .sheet footer { font-size: 11px; }


.flow, .guard { --teal: #35c2c7; --tealx: #9fe3e6; font-size: 30px; color: #f3e6c8; border-radius: .6em;
  background: linear-gradient(160deg, #1b2360, #0e1336); border: 1px solid #e8c77f55; box-shadow: 0 22px 56px #000b, 0 0 60px #35c2c71f; }
.flow svg, .guard svg { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flow header, .guard header { position: absolute; left: 4%; right: 4%; top: 6%; display: flex; align-items: center; gap: .6em; font-size: .72em; letter-spacing: .08em; color: #cfc6e8; }
.flow { --auto: 0; --gate: 0; --cut: 0; }
.flow .pills { display: grid; margin-left: auto; }
.flow .pill { grid-area: 1 / 1; justify-self: end; display: inline-flex; align-items: center; gap: .45em; padding: .28em .8em; border-radius: 99px; font-weight: 700; letter-spacing: .1em; }
.flow .pill.auto { color: var(--tealx); border: 1px solid var(--teal); background: #35c2c722; opacity: calc(1 - var(--cut)); }
.flow .pill.auto i { width: .5em; height: .5em; border-radius: 50%; background: var(--tealx); box-shadow: 0 0 .6em var(--tealx); animation: pill-blink 1s steps(2) infinite; }
@keyframes pill-blink { 50% { opacity: .25; } }
.flow .pill.split { color: #1a1430; background: linear-gradient(180deg, #fff3d6, #e8c77f); opacity: var(--cut); }

.flow .node, .flow .gate { position: absolute; top: 55%; transform: translate(-50%, -50%); }
.flow .n0 { left: 14%; } .flow .n1 { left: 36%; } .flow .n2 { left: 64%; } .flow .n3 { left: 86%; }
.flow .node { --lit: clamp(0, calc(var(--auto) * 4 - var(--k)), 1); display: flex; align-items: center; gap: .4em; padding: .55em .8em; border-radius: .45em;
  font-weight: 700; background: #1c2a5c; border: 2px solid var(--teal); color: #eafcfd;
  box-shadow: 0 0 calc(var(--lit) * 1.4em) #35c2c788; opacity: calc(.45 + var(--lit) * .55); }
.flow .node em { font-style: normal; }
.flow .node, .guard .bubble, .guard .dest { white-space: nowrap; width: max-content; }
.flow .n2, .flow .n3 { border-color: color-mix(in srgb, var(--teal) calc(100% - var(--cut) * 100%), #e8c77f); color: color-mix(in srgb, #eafcfd calc(100% - var(--cut) * 100%), #ffe7b0);
  background: color-mix(in srgb, #1c2a5c calc(100% - var(--cut) * 100%), #3a2f1e); box-shadow: 0 0 calc(var(--lit) * 1.4em) color-mix(in srgb, #35c2c788 calc(100% - var(--cut) * 100%), #e8c77f66); }
.flow .link { position: absolute; top: 55%; height: 3px; margin-top: -1.5px; background: var(--teal); opacity: calc(.35 + var(--auto) * .65); }
.flow .l0 { left: 14%; width: 22%; } .flow .l1 { left: 36%; width: 14%; } .flow .l2 { left: 50%; width: 14%; } .flow .l3 { left: 64%; width: 22%; }
.flow .l2, .flow .l3 { background: color-mix(in srgb, var(--teal) calc(100% - var(--cut) * 100%), #e8c77f); }

.flow .link::after { content: ""; position: absolute; top: -.35em; left: 0; width: 100%; height: .75em;
  background: radial-gradient(circle .38em at .38em 50%, #fff 0 .2em, #9fe3e6aa .26em, transparent .38em) no-repeat;
  animation: flow-run 1.1s linear infinite; }
@keyframes flow-run { from { transform: translateX(-.38em); } to { transform: translateX(calc(100% - .38em)); } }

body:not([data-chapter="judgment"]) .flow .link::after, body:not([data-chapter="judgment"]) .flow .pill.auto i { animation-play-state: paused; }
.flow .l2::after, .flow .l3::after { opacity: calc(1 - var(--cut)); }   
.flow .gate { left: 50%; display: flex; flex-direction: column; align-items: center; gap: .25em; z-index: 2;
  opacity: var(--gate); transform: translate(-50%, calc(-50% - (1 - var(--gate)) * 1.6em)) scale(calc(.5 + var(--gate) * .5)); }
.flow .gate svg { box-sizing: content-box; width: 1.1em; height: 1.1em; padding: .4em; border-radius: 50%; color: #1a1430;
  background: radial-gradient(circle at 35% 30%, #fff3d6, #e8c77f); box-shadow: 0 0 0 .18em #0e1336, 0 0 1.6em #e8c77fcc; }
.flow .gate em { position: absolute; top: calc(100% + .2em); white-space: nowrap; font-style: normal; font-weight: 700; font-size: .8em; color: #ffe7b0; }
.flow .scope { position: absolute; left: 5%; top: 33%; height: 44%; width: calc(90% - var(--cut) * 50%); border: 2px dashed var(--teal); border-radius: .5em; background: #35c2c70d; }
.flow .scope b { position: absolute; left: .6em; bottom: 100%; margin-bottom: .25em; font-size: .62em; letter-spacing: .12em; color: var(--tealx); white-space: nowrap; }
.flow .legend { position: absolute; left: 0; right: 0; bottom: 5%; margin: 0; display: flex; justify-content: center; gap: 2em; font-size: .62em; color: #cfc6e8; opacity: var(--gate); }
.flow .legend span::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .45em; border-radius: 50%; vertical-align: -.05em; }
.flow .legend .sys::before { background: var(--teal); } .flow .legend .hum::before { background: #e8c77f; }

[data-mode="port"] .flow { font-size: 14px; border-radius: 12px; }
[data-mode="port"] .guard { font-size: 14.5px; border-radius: 12px; }
[data-mode="port"] .flow header { font-size: .82em; }
[data-mode="port"] .flow .scope b { font-size: .74em; }
[data-mode="port"] .guard .bubble small { font-size: .7em; }
[data-mode="port"] .flow header { top: 3.5%; left: 6%; right: 6%; }
[data-mode="port"] .flow .node, [data-mode="port"] .flow .gate { left: 50%; }
[data-mode="port"] .flow .node { min-width: 7.6em; justify-content: center; padding: .6em .9em; border-width: 1.5px; }
[data-mode="port"] .flow .n0 { top: 21%; } [data-mode="port"] .flow .n1 { top: 37%; } [data-mode="port"] .flow .n2 { top: 67%; } [data-mode="port"] .flow .n3 { top: 83%; }
[data-mode="port"] .flow .gate { top: 52%; flex-direction: row; }
[data-mode="port"] .flow .gate em { position: absolute; top: auto; left: calc(100% + .5em); }
[data-mode="port"] .flow .link { left: 50%; width: 2px; height: auto; margin: 0 0 0 -1px; }
[data-mode="port"] .flow .l0 { top: 21%; height: 16%; } [data-mode="port"] .flow .l1 { top: 37%; height: 15%; }
[data-mode="port"] .flow .l2 { top: 52%; height: 15%; } [data-mode="port"] .flow .l3 { top: 67%; height: 16%; }
[data-mode="port"] .flow .link::after { top: 0; left: -.35em; width: .75em; height: 100%; animation-name: flow-run-v;
  background: radial-gradient(circle .38em at 50% .38em, #fff 0 .2em, #9fe3e6aa .26em, transparent .38em) no-repeat; }
@keyframes flow-run-v { from { transform: translateY(-.38em); } to { transform: translateY(calc(100% - .38em)); } }
[data-mode="port"] .flow .scope { left: 17%; width: 66%; top: 12%; height: calc(78% - var(--cut) * 46%); }
[data-mode="port"] .flow .legend { bottom: 2.6%; gap: 1.4em; font-size: .8em; }
.guard { --q0: 0; --r0: 0; --q1: 0; --r1: 0; }
.guard header b { color: var(--tealx); letter-spacing: .1em; }
.guard header span { margin-left: auto; color: #a99fc8; }
.guard .row { position: absolute; left: 4%; right: 4%; display: flex; align-items: center; }
.guard .r0 { top: 30%; } .guard .r1 { top: 63%; }
.guard .bubble { position: relative; margin: 0; padding: .5em .8em .55em; border-radius: .2em 1em 1em 1em; background: #f2f4ff; color: #1b2040; font-weight: 700; white-space: nowrap; }
.guard .bubble small { display: block; margin-bottom: .2em; font-size: .56em; font-weight: 700; letter-spacing: .12em; color: #6b6f94; }
.guard .wire { position: relative; flex: 1; height: 3px; margin: 0 .7em; background: #ffffff1f; }
.guard .wire::before { content: ""; position: absolute; inset: 0; transform-origin: left; }
.guard .wire::after { content: ""; position: absolute; right: -.1em; top: 50%; width: .5em; height: .5em; border: solid; border-width: 3px 3px 0 0; transform: translate(0, -50%) rotate(45deg); }
.guard .dest { display: flex; align-items: center; gap: .45em; margin: 0; padding: .6em .9em; border-radius: .5em; font-weight: 700; white-space: nowrap; }
.guard .r0 .bubble { opacity: var(--q0); transform: translateX(calc((1 - var(--q0)) * -1.4em)); }
.guard .r1 .bubble { opacity: var(--q1); transform: translateX(calc((1 - var(--q1)) * -1.4em)); }
.guard .r0 .wire::before { background: var(--teal); transform: scaleX(var(--r0)); box-shadow: 0 0 .8em var(--teal); }
.guard .r1 .wire::before { background: #e8c77f; transform: scaleX(var(--r1)); box-shadow: 0 0 .8em #e8c77f; }
.guard .r0 .wire::after { color: var(--teal); opacity: var(--r0); } .guard .r1 .wire::after { color: #e8c77f; opacity: var(--r1); }
.guard .r0 .dest { color: #eafcfd; border: 2px solid var(--teal); background: #35c2c724; opacity: calc(.3 + var(--r0) * .7); box-shadow: 0 0 calc(var(--r0) * 1.6em) #35c2c788; }
.guard .r1 .dest { color: #ffe7b0; border: 2px solid #e8c77f; background: #e8c77f24; opacity: calc(.3 + var(--r1) * .7); box-shadow: 0 0 calc(var(--r1) * 1.6em) #e8c77f88; }
[data-mode="port"] .guard header { top: 7%; left: 5%; right: 5%; font-size: .85em; }
[data-mode="port"] .guard .row { left: 5%; right: 5%; }
[data-mode="port"] .guard .r0 { top: 27%; } [data-mode="port"] .guard .r1 { top: 60%; }
[data-mode="port"] .guard .wire { margin: 0 .4em; }
[data-mode="port"] .guard .dest { padding: .6em .6em; border-width: 1.5px; }


.dust { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: radial-gradient(circle, #fff6dc, #f0cf8a88 45%, transparent 70%); opacity: 0; }
.dust.big { width: 10px; height: 10px; margin: -5px 0 0 -5px; }

.glow { border-radius: 50%; opacity: 0; pointer-events: none; }
.glow.g-land { background: radial-gradient(circle, #fff3d6cc 0%, #e8c77f88 22%, #e8c77f22 48%, transparent 66%); }

.regframe { pointer-events: none; }
.regframe .c { position: absolute; width: 64px; height: 64px; border: 2px solid #e8c77fd9; }
.regframe .tl { left: 0; top: 0; border-right: 0; border-bottom: 0; } .regframe .tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.regframe .bl { left: 0; bottom: 0; border-right: 0; border-top: 0; } .regframe .br { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.regframe .x { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px;
  background: linear-gradient(#e8c77fd9, #e8c77fd9) center / 2px 100% no-repeat, linear-gradient(#e8c77fd9, #e8c77fd9) center / 100% 2px no-repeat; }
.regframe .scan { position: absolute; top: -3%; bottom: -3%; left: calc(var(--scan, 0) * 100%); width: 2px; margin-left: -1px;
  background: linear-gradient(transparent, #fff3d6 18%, #fff3d6 82%, transparent); box-shadow: 0 0 22px 4px #e8c77f99; opacity: calc(1 - var(--scan, 0) * .35); }
[data-mode="port"] .regframe .c { width: 26px; height: 26px; border-width: 1.5px; }
[data-mode="port"] .regframe .x { width: 20px; height: 20px; margin: -10px 0 0 -10px; }
.glow.g0 { background: radial-gradient(circle, #7a63e055, transparent 62%); }
.glow.g1 { background: radial-gradient(circle, #35c2c744, transparent 62%); }
.glow.g2 { background: radial-gradient(circle, #e8c77f44, transparent 62%); }
.glow.g3 { background: radial-gradient(circle, #d4508844, transparent 62%); }


#chapter-card {
  
  --s: 1;
  position: fixed; z-index: 20; pointer-events: none; text-shadow: 0 2px 24px #000d;
  left: calc(5vw + 45vw * var(--s)); top: calc(80px + (40vh - 80px) * var(--s));
  translate: calc(-50% * var(--s)) calc(-50% * var(--s));
  width: max-content; max-width: min(820px, 88vw); opacity: 0;
}
#chapter-card.slate { text-align: center; }
#chapter-meta { margin: 0 0 calc(4px + var(--s) * 10px); font-size: calc(12px + var(--s) * 3px); letter-spacing: .16em; color: var(--gold); }
#chapter-title {
  margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -.01em;
  font-size: calc(18px + var(--s) * clamp(16px, 2.6vw, 36px));
  opacity: calc(.55 + var(--s) * .45);
  background: linear-gradient(180deg, #fff7e2, #e8c77f); -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: keep-all; text-wrap: balance;
}
#caption {
  position: fixed; z-index: 20; left: 50%; bottom: 72px; translate: -50% 0; margin: 0;
  max-width: min(900px, 88vw); padding: 12px 22px; border-radius: 12px;
  font-size: clamp(17px, 1.55vw, 23px); line-height: 1.5; text-align: center; color: #fbf5e6;
  background: #060a1ccc; box-shadow: 0 10px 40px #0008; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .35s; pointer-events: none; word-break: keep-all; text-wrap: balance;
}
#caption.on { opacity: 1; }
#toast {
  position: fixed; z-index: 21; right: 4vw; top: 92px; display: grid; gap: 4px;
  padding: 14px 20px 14px 58px; border-radius: 14px; min-width: 240px;
  background: linear-gradient(135deg, #2a1f5ef2, #111633f2); border: 1px solid #e8c77f99; box-shadow: 0 16px 50px #000a, 0 0 40px #e8c77f33;
  transform: translateX(130%); transition: transform .5s cubic-bezier(.2, 1.3, .4, 1); pointer-events: none;
}
#toast::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 28px; height: 28px; translate: 0 -50%;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23f0cf8a' d='M7 3h10v2h4v3a4 4 0 0 1-4 4h-.3A5 5 0 0 1 13 14.9V18h3v3H8v-3h3v-3.1A5 5 0 0 1 7.3 12H7a4 4 0 0 1-4-4V5h4V3zm10 4v3a2 2 0 0 0 2-2V7h-2zM5 7v1a2 2 0 0 0 2 2V7H5z'/%3E%3C/svg%3E");
}
#toast.on { transform: none; }
#toast b { font-size: 12px; letter-spacing: .2em; color: var(--gold); }
#toast span { font-size: 18px; font-weight: 700; color: #fff; }
#rail { position: fixed; z-index: 20; right: 16px; top: 50%; translate: 0 -50%; display: grid; gap: 10px; }
#rail button { display: flex; align-items: center; justify-content: flex-end; gap: 10px; background: none; border: 0; padding: 2px; }
#rail i { order: 2; width: 9px; height: 9px; border-radius: 50%; border: 1px solid #e8c77faa; transition: transform .3s, background .3s; }
#rail span { order: 1; font-size: 12px; color: #d8cfb8; opacity: 0; transition: opacity .25s; white-space: nowrap; }
#rail button:hover span, #rail button[aria-current="true"] span { opacity: 1; }
#rail button[aria-current="true"] i { background: var(--gold); transform: scale(1.35); box-shadow: 0 0 12px #e8c77faa; }
#controls { position: fixed; z-index: 20; left: 4vw; bottom: 22px; display: flex; align-items: center; gap: 16px; font-size: 13px; color: #b3aecb; }
#play { padding: 9px 18px; border-radius: 999px; border: 1px solid #e8c77f99; background: #0c1130cc; color: #fff3d6; font-size: 14px; }
#progress { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: 3px; background: #ffffff10; }
#progress-bar { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--gold)); transform-origin: 0 50%; transform: scaleX(0); }

#hero {
  position: fixed; z-index: 25; left: 50%; top: 13vh; translate: -50% 0; width: min(900px, 90vw); text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .5s; text-shadow: 0 2px 30px #000c;
}
#hero.on { opacity: 1; }
#hero h1 {
  margin: 0; font-size: clamp(34px, 4.4vw, 64px); font-weight: 600; letter-spacing: -.01em; line-height: 1.2;
  background: linear-gradient(180deg, #fff7e2, #e8c77f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 24px #000b);
}
#hero p { margin: 14px 0 0; font-size: clamp(14px, 1.3vw, 18px); letter-spacing: .08em; color: #e9dfc6; }
#start {
  position: fixed; z-index: 25; left: 50%; bottom: 17vh; translate: -50% 0; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .4s;
}
#start.on { opacity: 1; pointer-events: auto; }
#start button {
  padding: 16px 34px; border-radius: 999px; border: 0; font-size: 20px; font-weight: 700; color: #1a1430;
  background: linear-gradient(180deg, #fff3d6, #e8c77f); box-shadow: 0 10px 40px #e8c77f55;
}
#start button small { font-size: 14px; font-weight: 400; margin-left: 6px; }
#start p { margin: 12px 0 0; font-size: 14px; color: #d8cfb8; }

#end {
  position: fixed; z-index: 24; left: 50%; bottom: 9vh; translate: -50% 0; width: min(1080px, 92vw);
  display: grid; gap: 18px; justify-items: center; text-align: center;
  opacity: 0; pointer-events: none; transform: translateY(20px); transition: opacity .6s, transform .6s;
}
#end.on { opacity: 1; pointer-events: auto; transform: none; }
#end h2 {
  margin: 0; font-size: clamp(24px, 3vw, 42px); font-weight: 600;
  background: linear-gradient(180deg, #fff7e2, #e8c77f); -webkit-background-clip: text; background-clip: text; color: transparent;
  word-break: keep-all; text-wrap: balance;
}
#end .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 100%; }
#end .cards a { display: block; padding: 16px 18px; border-radius: 14px; text-align: left; text-decoration: none; background: #0c1130e6; border: 1px solid #e8c77f55; transition: border-color .2s, transform .2s; }
#end .cards a:hover, #end .cards a:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
#end .cards i { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: #9fe3e6; }
#end .cards b { display: block; font-size: 18px; color: var(--gold); margin-bottom: 4px; }
#end .cards span { font-size: 14px; color: #d8cfe8; }
#end .cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
#end .cta a, #end .cta button { padding: 12px 22px; border-radius: 999px; font-size: 15px; text-decoration: none; border: 1px solid #e8c77f99; background: #0c1130cc; color: #fff3d6; }
#end .cta .primary { background: linear-gradient(180deg, #fff3d6, #e8c77f); color: #1a1430; border: 0; font-weight: 700; }
body.in-closing #caption { bottom: calc(9vh + 250px); }

#after { position: relative; z-index: 1; padding: 90px 5vw 120px; text-align: center; background: linear-gradient(#05070f, #0a0f26); }
#after p { color: var(--muted); }
#after a { display: inline-block; margin: 8px; padding: 12px 24px; border-radius: 999px; border: 1px solid #e8c77f88; text-decoration: none; }


@media (max-width: 900px) and (orientation: portrait) {
  .top { height: 58px; padding: 0 16px; }
  .logo img { height: 34px; } .logo span { display: none; }
  .top nav { gap: 14px; font-size: 14px; }
  #chapter-card { left: calc(16px + (50vw - 16px) * var(--s)); top: calc(66px + (36vh - 66px) * var(--s)); max-width: 90vw; }
  #chapter-meta { font-size: calc(10px + var(--s) * 2px); letter-spacing: .1em; }
  #chapter-title { font-size: calc(15px + var(--s) * 11px); }
  #caption { bottom: 64px; font-size: 16px; padding: 10px 14px; max-width: 92vw; }
  #toast { top: auto; bottom: 128px; right: 16px; padding: 10px 14px 10px 46px; min-width: 0; }
  #toast::before { left: 12px; width: 22px; height: 22px; }
  #toast span { font-size: 15px; }
  #rail { right: 6px; gap: 8px; } #rail span { display: none; }
  #controls { left: 16px; bottom: 16px; } #hint { display: none; }
  #start { bottom: 22vh; width: 90vw; }
  #hero { top: 11vh; }
  #hero p { letter-spacing: .02em; line-height: 1.7; }
  #start button { font-size: 17px; padding: 14px 24px; }
  
  #end { bottom: 64px; gap: 10px; }   
  #end h2 { font-size: 20px; line-height: 1.4; }
  #end .cards { grid-template-columns: 1fr; gap: 6px; }
  #end .cards a { padding: 8px 12px; }
  #end .cards i { display: inline; margin: 0 0 0 8px; font-size: 12px; }
  #end .cards b { font-size: 14.5px; margin-bottom: 2px; } #end .cards span { font-size: 12.5px; }
  #end .cta { gap: 8px; flex-wrap: nowrap; }
  #end .cta a, #end .cta button { padding: 10px 14px; font-size: 14px; white-space: nowrap; }
  #hero p .dot { display: none; } #hero p .skills { display: block; }
  body.in-closing #caption { bottom: calc(6vh + 330px); }
}
@media (prefers-reduced-motion: reduce) {
  #toast, #caption, #end, #start { transition: none; }
  .flow .link::after, .flow .pill.auto i { animation: none; }  
}


.it.has-credit { container-type: inline-size; overflow: visible; }
.it .credit { position: absolute; left: 0; right: 0; top: calc(100% + 1.6cqw); margin: 0; text-align: center; white-space: nowrap;
  font-size: 2.5cqw; letter-spacing: .06em; color: #f0e2bd; text-shadow: 0 1px 6px #05070fcc; }
[data-mode="port"] .it .credit { font-size: 3.4cqw; white-space: normal; }
.cpa .me s { display: none; }


#start button.alt { margin-left: 12px; padding: 15px 26px; font-size: 17px; color: #f3ecdc; background: #0b1026cc; border: 1px solid #e8c77f99; box-shadow: none; }
#after .more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; margin-top: 10px; }
#after button { margin: 8px; padding: 12px 24px; border-radius: 999px; border: 1px solid #e8c77f88; background: none; color: #e9dfc6; font: inherit; }
#after .resumes { margin-top: 18px; font-size: 15px; color: #d8cfb8; }
#after .resumes a { margin: 6px 4px; padding: 6px 14px; border-color: #e8c77f55; font-size: 15px; }
#after .resumes span { color: #8f88a8; }
#teaser { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 92svh; overflow: visible; }
#teaser::backdrop { background: #03050cdd; }
#teaser video { display: block; width: min(1100px, 94vw); max-height: 86svh; border-radius: 14px; background: #000; box-shadow: 0 30px 80px #000c; }
#teaser.portrait video { width: auto; height: min(86svh, 1560px); }
#teaser .close { position: absolute; top: -48px; right: 0; min-height: 40px; padding: 6px 16px; border-radius: 999px; border: 1px solid #e8c77f77; background: #0b1026; color: #f3ecdc; font: inherit; cursor: pointer; }
@media (max-width: 900px) and (orientation: portrait) {
  #start button.alt { margin: 12px 0 0; display: block; width: 100%; }
}


body.past-story #end, body.past-story #caption, body.past-story #toast, body.past-story #rail, body.past-story #controls,
body.past-story #chapter-card, body.past-story #progress { opacity: 0 !important; pointer-events: none !important; transition: opacity .3s; }
#after h2 { margin: 0 0 6px; font-size: clamp(22px, 2.6vw, 30px); }
#after .cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; max-width: 1080px; margin: 24px auto 18px; }
#after .cards a { display: block; margin: 0; padding: 16px 18px; border-radius: 14px; text-align: left; background: #0c1130e6; border: 1px solid #e8c77f55; transition: border-color .2s, transform .2s; }
#after .cards a:hover, #after .cards a:focus-visible { border-color: var(--gold); transform: translateY(-2px); }
#after .cards b { display: block; font-size: 18px; color: var(--gold); margin-bottom: 4px; }
#after .cards span { font-size: 14px; color: #d8cfe8; }
#after .cards i { display: block; margin-top: 8px; font-style: normal; font-size: 13px; color: #9fe3e6; }
@media (max-width: 900px) { #after .cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { #after .cards { grid-template-columns: 1fr; } #after { padding: 64px 16px 90px; } }

.ph { display: inline-block; }
#after br.narrow { display: none; }
@media (max-width: 520px) { #after br.narrow { display: inline; } }


#end .contact-line { margin: 2px 0 0; font-size: 14px; color: #d8cfb8; }
#end .contact-line a { color: #fff3d6; text-decoration: none; border-bottom: 1px solid #e8c77f66; }
#end .contact-line span { color: #8f88a8; margin: 0 6px; }
#after .contact { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; margin: 26px auto 0; }
#after .contact h3 { width: 100%; margin: 0 0 4px; font-size: 13px; letter-spacing: .24em; color: var(--gold); font-weight: 700; }
@media (max-width: 900px) and (orientation: portrait) { #end .contact-line { font-size: 12px; } }


@media (orientation: landscape) and (max-height: 820px) {
  #end { bottom: 5vh; gap: 12px; }
  #end h2 { font-size: clamp(22px, 2.4vw, 32px); }
  #end .cards a { padding: 11px 14px; }
  #end .cards b { font-size: 16px; margin-bottom: 2px; }
  #end .cards span { font-size: 13px; }
  #end .cards i { margin-top: 4px; font-size: 12px; }
  #end .cta a, #end .cta button { padding: 9px 18px; font-size: 14px; }
}

@media (orientation: landscape) and (max-height: 520px) {
  #hero { top: 9vh; } #hero h1 { font-size: clamp(22px, 3.4vw, 34px); } #hero p { margin-top: 6px; font-size: 12px; }
  #start { bottom: 7vh; } #start button { padding: 10px 22px; font-size: 16px; } #start button.alt { padding: 9px 18px; font-size: 14px; } #start p { display: none; }
  #end { bottom: 3vh; gap: 8px; width: 94vw; }
  #end h2 { font-size: 18px; }
  #end .cards { gap: 8px; }
  #end .cards a { padding: 8px 10px; }
  #end .cards span { display: none; }
  #end .cards b { font-size: 14px; } #end .cards i { display: inline; margin: 0 0 0 6px; font-size: 11px; }
  #end .cta a, #end .cta button { padding: 7px 14px; font-size: 13px; }
  #end .contact-line { font-size: 11.5px; }
}


#hint { transition: opacity .4s; }
body.in-closing #hint { opacity: 0; }
