/* hkshare — Lai See
   crimson satin · white foil · certificate paper · stitched seams · square corners */
:root {
  --lacquer: #120203;
  --lacquer-2: #1d0405;
  --oxblood: #2c0507;
  --crimson: #8f0d12;
  --crimson-2: #b0141a;
  --vermilion: #e0372c;
  --foil: #ffffff;
  --foil-dim: rgba(255, 255, 255, 0.7);
  --foil-faint: rgba(255, 255, 255, 0.44);
  --rule: rgba(255, 255, 255, 0.14);
  --paper: #f5ede1;
  --paper-2: #ebdfcd;
  --ink: #7d0a0f;
  --ink-2: rgba(125, 10, 15, 0.68);
  --ink-rule: rgba(125, 10, 15, 0.22);
  --ok: #2f9e5b;
  --ok-dark: #7fe0a6;
  --f-display: 'Noto Serif TC', 'Songti TC', 'PMingLiU', serif;
  --f-ui: 'Noto Sans TC', 'PingFang HK', 'Microsoft JhengHei', system-ui, sans-serif;
  --f-num: 'Big Shoulders Display', 'Arial Narrow', 'Noto Sans TC', sans-serif;
  --f-body: 'Schibsted Grotesk', 'Noto Sans TC', 'PingFang HK', 'Microsoft JhengHei', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --f-cjk: 'Noto Serif TC', 'Songti TC', 'PMingLiU', 'SimSun', serif;
  --max: 1220px;
  --ease: cubic-bezier(0.2, 0.9, 0.1, 1);
  --fold: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--lacquer); color: var(--foil);
  font: 400 17px/1.6 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.inner {
  background:
    linear-gradient(180deg, rgba(18, 2, 3, 0.8), rgba(18, 2, 3, 0.93) 60%),
    url('/assets/satin.jpg') center / cover fixed, var(--lacquer);
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img, svg, canvas { display: block; max-width: 100%; }
::selection { background: var(--vermilion); color: #fff; }
:focus-visible { outline: 2px dashed var(--foil); outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── type ─────────────────────────────────────────────── */
.display { font-family: var(--f-display); font-weight: 900; line-height: 1.14; letter-spacing: 0.02em; margin: 0; }
.d1 { font-size: clamp(44px, 6.2vw, 96px); }
.d2 { font-size: clamp(34px, 4.4vw, 68px); }
.d3 { font-size: clamp(24px, 2.4vw, 34px); line-height: 1.2; }
.cjk { font-family: var(--f-cjk); font-weight: 700; }
.mono { font-family: var(--f-mono); }
.dim { color: var(--foil-dim); }
.faint { color: var(--foil-faint); }
.small { font-size: 14px; }
.lede { font-size: clamp(17px, 1.35vw, 19px); color: var(--foil-dim); max-width: 34em; line-height: 1.6; }
.wrap { width: min(var(--max), 100% - 2 * clamp(20px, 4vw, 44px)); margin-inline: auto; }

/* ── buttons: foil stamp with a stitched seam ─────────── */
.btn {
  --bg: var(--foil); --fg: var(--crimson); --seam: rgba(143, 13, 18, 0.45);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 26px; border: 0; border-radius: 2px; cursor: pointer; text-decoration: none;
  background: var(--bg); color: var(--fg);
  font: 700 17px/1 var(--f-ui); letter-spacing: 0.08em;
  outline: 1px dashed var(--seam); outline-offset: -6px;
  transition: transform 0.35s var(--ease), background-color 0.3s, color 0.3s, box-shadow 0.35s;
  overflow: hidden; white-space: nowrap; isolation: isolate;
}
.btn::after { /* foil glint */
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 220, 210, 0.9) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 0.8s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }
.btn:hover { box-shadow: 0 14px 34px -14px rgba(224, 55, 44, 0.9); transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }
.btn[disabled] { opacity: 0.42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-line { --bg: transparent; --fg: var(--foil); --seam: rgba(255, 255, 255, 0.32); box-shadow: inset 0 0 0 1.5px var(--foil); }
.btn-line:hover { --bg: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1.5px var(--foil), 0 14px 34px -18px rgba(255, 255, 255, 0.3); }
.btn-red { --bg: var(--crimson); --fg: var(--foil); --seam: rgba(255, 255, 255, 0.4); }
.btn-ink { --bg: var(--ink); --fg: var(--paper); --seam: rgba(245, 237, 225, 0.4); }
.btn-paper-line { --bg: transparent; --fg: var(--ink); --seam: var(--ink-rule); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 16px; outline-offset: -5px; }
.btn-block { width: 100%; }
.btn .arr { display: inline-block; transition: transform 0.4s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.textlink { color: var(--foil); text-decoration: underline; text-decoration-style: dashed; text-underline-offset: 4px; text-decoration-color: var(--foil-faint); }
.textlink:hover { text-decoration-color: var(--foil); }

/* ── header ───────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  display: flex; align-items: center; gap: 28px; height: 68px; padding: 0 clamp(18px, 3vw, 36px);
  background: linear-gradient(180deg, rgba(18, 2, 3, 0.86), rgba(18, 2, 3, 0));
}
.site-header::after { content: ''; position: absolute; left: clamp(18px, 3vw, 36px); right: clamp(18px, 3vw, 36px); bottom: 0; border-bottom: 1px dashed var(--rule); }
body.inner main { padding-top: 68px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 26px; height: 26px; }
.brand b { font: 800 24px/1 var(--f-num); text-transform: uppercase; letter-spacing: 0.06em; }
.nav { display: flex; gap: 4px; }
.nav a {
  position: relative; padding: 8px 12px; text-decoration: none;
  font: 500 15px/1 var(--f-ui); letter-spacing: 0.1em; color: var(--foil-dim);
  transition: color 0.25s;
}
.nav a:hover { color: var(--foil); }
.nav a.on { color: var(--foil); }
.nav a.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; background: var(--vermilion); }
.head-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.menu-btn { display: none; }

/* CA stamp */
.ca {
  display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px 0 14px; cursor: pointer;
  background: transparent; border: 1.5px solid var(--foil); border-radius: 2px; outline: 1px dashed rgba(255, 255, 255, 0.3); outline-offset: -5px;
  font: 500 14px/1 var(--f-mono); color: var(--foil); white-space: nowrap; transition: background-color 0.25s;
}
.ca b { font-weight: 600; color: var(--foil); }
.ca svg { width: 14px; height: 14px; opacity: 0.8; }
.ca:hover { background: rgba(255, 255, 255, 0.07); }
.ca.done { border-color: var(--ok-dark); }
.ca[hidden] { display: none; }
.ca-lg { min-height: 52px; padding: 0 16px 0 18px; font-size: 16px; }

.wallet { min-height: 40px; }
.wallet .live { width: 8px; height: 8px; background: var(--ok); border-radius: 50%; }
.wallet .live.off { background: #f0b429; }

/* ── loader + page transitions: the page opens through the hkshare mark ── */
#veil { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
#veil .v-body {
  position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 30% 20%, #a3141a 0%, #6d0709 55%, #320203 100%);
  -webkit-mask-image: url('/assets/mark-solid.svg'), linear-gradient(#000, #000);
  -webkit-mask-repeat: no-repeat; -webkit-mask-position: center;
  -webkit-mask-size: 0 0, 100% 100%; -webkit-mask-composite: xor;
  mask-image: url('/assets/mark-solid.svg'), linear-gradient(#000, #000);
  mask-repeat: no-repeat; mask-position: center;
  mask-size: 0 0, 100% 100%; mask-composite: exclude;
  transition: mask-size 1s var(--fold), -webkit-mask-size 1s var(--fold);
}
#veil .v-mark { position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; transition: transform 0.7s var(--ease), opacity 0.35s; }
#veil.open .v-body { -webkit-mask-size: 250vmax 250vmax, 100% 100%; mask-size: 250vmax 250vmax, 100% 100%; }
#veil.open .v-mark { transform: scale(2.6) rotate(45deg); opacity: 0; }
#veil.gone { display: none; }
#veil.closing { pointer-events: all; }
#veil.closing .v-body { transition-duration: 0.72s; transition-timing-function: cubic-bezier(0.5, 0, 0.2, 1); }
#veil.closing .v-mark { transition-delay: 0.45s; }
.stamp #veil .v-mark { animation: stamp 0.55s var(--ease) both; }
@keyframes stamp { 0% { transform: scale(1.7); opacity: 0; } 60% { transform: scale(0.93); opacity: 1; } 100% { transform: scale(1); } }

/* ── HOME: the story ──────────────────────────────────── */
.story { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage canvas, .stage .poster { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .poster { object-fit: cover; object-position: 66% 50%; transition: opacity 1.2s; }
.stage canvas { opacity: 0; transition: opacity 1.2s; }
.stage.ready canvas { opacity: 1; }
.stage.ready .poster { opacity: 0; }
.stage::after { /* text scrim — a lacquer gradient, not glass */
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(18, 2, 3, 0.9) 0%, rgba(18, 2, 3, 0.55) 34%, rgba(18, 2, 3, 0) 58%);
}
.seal-cta {
  position: absolute; z-index: 3; left: 0; top: 0; transform: translate(-50%, -50%) scale(0.92);
  opacity: 0; pointer-events: none; transition: opacity 0.5s, transform 0.5s var(--ease);
}
.seal-cta.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.column { position: relative; z-index: 2; margin-top: -100vh; margin-top: -100svh; }
.beat { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; }
.beat .copy { width: min(560px, 44vw); margin-left: clamp(22px, 6vw, 96px); padding: 90px 0 60px; }
.beat .mark-cjk { display: block; font-size: 40px; line-height: 1; color: var(--vermilion); margin-bottom: 22px; }
.beat h1, .beat h2 { margin-bottom: 26px; }
.beat .lede { margin: 0; }
.beat .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.beat .ca-slot { margin-top: 22px; }
.beat .note { margin-top: 18px; font: 500 13px/1.5 var(--f-mono); color: var(--foil-faint); }
.progress-seam { position: fixed; z-index: 5; right: clamp(14px, 2vw, 26px); top: 50%; transform: translateY(-50%); display: grid; gap: 14px; }
.progress-seam span { width: 2px; height: 26px; background: var(--rule); transition: background 0.3s, height 0.3s; }
.progress-seam span.on { background: var(--vermilion); height: 44px; }
.progress-seam.hide { opacity: 0; }

/* ── below the scene ──────────────────────────────────── */
.below { position: relative; z-index: 2; background: var(--lacquer); padding: clamp(90px, 12vw, 150px) 0 0; }
.below-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: end; margin-bottom: 44px; }
.below-head p { margin: 0; }

/* ── tables (on lacquer) ──────────────────────────────── */
.ledger { width: 100%; border-collapse: collapse; }
.ledger th { text-align: left; font: 600 12px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--foil-faint); padding: 0 14px 14px; border-bottom: 1.5px solid var(--foil); }
.ledger td { padding: 18px 14px; border-bottom: 1px dashed var(--rule); vertical-align: middle; }
.ledger .sym { font: 800 24px/1 var(--f-num); letter-spacing: 0.02em; }
.ledger .co { color: var(--foil-dim); font-size: 15px; }
.ledger .co .cjk { color: var(--foil-faint); margin-left: 6px; font-size: 14px; }
.ledger .addr { font: 500 13px/1 var(--f-mono); color: var(--foil-dim); text-decoration: none; }
.ledger .addr:hover { color: var(--foil); text-decoration: underline dashed; }
.ledger .num { font: 600 15px/1 var(--f-mono); text-align: right; white-space: nowrap; }
.ledger td.go { text-align: right; }
.scroll-x { overflow-x: auto; }
.tag { display: inline-block; padding: 4px 8px; border: 1px solid var(--rule); font: 500 12px/1 var(--f-mono); color: var(--foil-dim); white-space: nowrap; }
.tag.red { border-color: var(--vermilion); color: #ff8b80; }
.tag.ok { border-color: rgba(127, 224, 166, 0.5); color: var(--ok-dark); }

/* questions (on lacquer) */
.qa { border-top: 1.5px solid var(--foil); }
.qa details { border-bottom: 1px dashed var(--rule); }
.qa summary { list-style: none; cursor: pointer; padding: 22px 0; display: flex; justify-content: space-between; gap: 24px; font: 900 clamp(19px, 1.8vw, 24px)/1.35 var(--f-display); letter-spacing: 0.02em; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: '+'; font-family: var(--f-mono); font-weight: 500; color: var(--vermilion); transition: transform 0.3s var(--ease); }
.qa details[open] summary::after { transform: rotate(45deg); }
.qa details p { margin: 0 0 24px; color: var(--foil-dim); max-width: 760px; }

/* ── footer: the packet's flap ─────────────────────────── */
.site-footer { position: relative; z-index: 2; margin-top: 140px; background: var(--crimson); color: var(--foil); }
.site-footer::before {
  content: ''; position: absolute; left: 0; right: 0; top: -1px; height: clamp(60px, 9vw, 120px);
  background: var(--lacquer); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
body.inner .site-footer::before { background: #160304; }
.foot-seal { position: relative; z-index: 1; display: grid; place-items: center; padding-top: clamp(34px, 5vw, 64px); }
.foot-seal span { width: 74px; height: 74px; border-radius: 50%; background: var(--foil); display: grid; place-items: center; box-shadow: 0 10px 30px -8px rgba(0, 0, 0, 0.6); }
.foot-seal img { width: 38px; height: 38px; filter: invert(12%) sepia(80%) saturate(5000%) hue-rotate(350deg) brightness(70%); }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding: 56px 0 44px; }
.foot-grid h4 { margin: 0 0 14px; font: 700 14px/1 var(--f-ui); letter-spacing: 0.16em; color: rgba(255, 255, 255, 0.62); }
.foot-grid a { display: block; padding: 5px 0; text-decoration: none; color: var(--foil); font-size: 15px; }
.foot-grid a:hover { text-decoration: underline dashed; text-underline-offset: 4px; }
.foot-big { font: 900 clamp(38px, 5vw, 66px)/1.08 var(--f-display); margin: 0 0 18px; }
.foot-fine { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; padding: 22px 0 30px; border-top: 1px dashed rgba(255, 255, 255, 0.3); font-size: 13px; color: rgba(255, 255, 255, 0.72); }

/* ── inner pages ──────────────────────────────────────── */
.page-head { padding: clamp(64px, 9vw, 120px) 0 40px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0 26px; align-items: start; }
.page-head .cjk { grid-row: span 2; writing-mode: vertical-rl; font-size: clamp(34px, 4vw, 52px); color: var(--vermilion); line-height: 1; letter-spacing: 0.12em; padding-top: 6px; }
.page-head h1 { margin: 0 0 16px; }
.page-head .lede { margin: 0; }

/* paper sheet — every form is a certificate you fill in */
.sheet {
  position: relative; background: var(--paper); color: var(--ink); border-radius: 2px;
  padding: clamp(24px, 3.4vw, 40px);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.85), 0 2px 0 rgba(0, 0, 0, 0.25);
  background-image:
    radial-gradient(rgba(125, 10, 15, 0.04) 1px, transparent 1.2px),
    linear-gradient(var(--paper), var(--paper));
  background-size: 7px 7px, auto;
}
.sheet::before { content: ''; position: absolute; inset: 10px; border: 1px solid var(--ink-rule); pointer-events: none; }
.sheet::after { content: ''; position: absolute; inset: 15px; border: 1px dashed var(--ink-rule); pointer-events: none; }
.sheet > * { position: relative; z-index: 1; }
.sheet h2, .sheet h3 { color: var(--ink); }
.sheet .muted { color: var(--ink-2); }
.sheet a:not(.btn) { color: var(--ink); }

.switch { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--ink); margin-bottom: 30px; }
.switch button {
  border: 0; background: transparent; padding: 14px 10px; cursor: pointer; color: var(--ink);
  font: 700 16px/1 var(--f-ui); letter-spacing: 0.1em; transition: background-color 0.3s, color 0.3s;
}
.switch button + button { border-left: 1.5px solid var(--ink); }
.switch button.on { background: var(--ink); color: var(--paper); }

.f { margin-bottom: 22px; }
.f > label, .f .lab { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font: 600 12px/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.f .lab button { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; color: var(--ink); text-decoration: underline dashed; text-underline-offset: 3px; }
.line { display: flex; align-items: flex-end; gap: 12px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.line:focus-within { border-bottom-color: var(--crimson-2); }
.line input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 6px 0; font: 500 18px/1.2 var(--f-mono); }
.line input.amt { font: 800 46px/1 var(--f-num); letter-spacing: 0.01em; }
.line input::placeholder { color: rgba(125, 10, 15, 0.32); }
.pick {
  display: inline-flex; align-items: center; gap: 10px; border: 1.5px solid var(--ink); background: transparent; color: var(--ink); cursor: pointer;
  padding: 8px 12px; margin-bottom: 4px; font: 800 18px/1 var(--f-num); text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap;
}
.pick:hover { background: rgba(125, 10, 15, 0.07); }
.pick small { font: 500 11px/1 var(--f-mono); letter-spacing: 0.04em; opacity: 0.7; }
.max { border: 0; background: transparent; cursor: pointer; padding: 4px 0 10px; font: 600 12px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--ink); text-decoration: underline dashed; text-underline-offset: 3px; }
.say { min-height: 24px; margin-top: 8px; font-size: 14px; color: var(--ink-2); word-break: break-word; }
.say.ok { color: var(--ok); } .say.err { color: #b3121a; font-weight: 600; } .say.warn { color: #8a5a00; }
.say a { color: inherit; }
.terms { margin: 26px 0; border-top: 1.5px solid var(--ink); }
.terms div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px dashed var(--ink-rule); font-size: 15px; }
.terms span { color: var(--ink-2); }
.terms b { text-align: right; word-break: break-all; font-weight: 600; }
.steps { display: grid; gap: 0; margin-top: 22px; border-top: 1px dashed var(--ink-rule); }
.stp { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px dashed var(--ink-rule); font-size: 15px; color: var(--ink-2); }
.stp i { width: 16px; height: 16px; border: 1.5px solid var(--ink-2); flex: none; transform: rotate(45deg); }
.stp.run { color: var(--ink); } .stp.run i { border-color: var(--crimson-2); animation: turn 1s linear infinite; }
.stp.done { color: var(--ink); } .stp.done i { background: var(--ink); border-color: var(--ink); }
.stp.fail i { background: #b3121a; border-color: #b3121a; }
.stp a { margin-left: auto; font: 500 12px/1 var(--f-mono); color: var(--ink); }
@keyframes turn { to { transform: rotate(405deg); } }
.receipt { margin-top: 24px; padding-top: 22px; border-top: 1.5px solid var(--ink); }
.receipt h3 { margin: 0 0 8px; }
.receipt .linkline { display: flex; gap: 10px; margin: 16px 0; }
.receipt .linkline input { flex: 1; min-width: 0; border: 1.5px solid var(--ink); background: rgba(255, 255, 255, 0.5); padding: 12px; font: 500 12px/1.3 var(--f-mono); color: var(--ink); outline: 0; }
.receipt .acts { display: flex; flex-wrap: wrap; gap: 10px; }
.qr { width: 172px; height: 172px; margin-top: 18px; padding: 10px; background: #fff; border: 1.5px solid var(--ink); }
.qr img { width: 100%; height: 100%; image-rendering: pixelated; }

.app { display: grid; grid-template-columns: minmax(0, 600px) minmax(0, 1fr); gap: clamp(30px, 5vw, 70px); align-items: start; padding-bottom: 40px; }
.side { position: sticky; top: 100px; display: grid; gap: 34px; }
.side h3 { margin: 0 0 10px; }
.side p, .side li { color: var(--foil-dim); font-size: 15px; margin: 0; }
.side ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 8px; }
.side section { padding-top: 22px; border-top: 1.5px solid var(--foil); }

/* claim */
.claim { min-height: calc(100vh - 68px); display: grid; place-items: center; padding: 50px 0 80px; }
.claim .sheet { width: min(560px, 100%); }
.claim .big { font: 900 clamp(64px, 12vw, 120px)/0.85 var(--f-num); margin: 18px 0 6px; color: var(--ink); }
.claim .sym { font: 600 15px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--ink-2); }
.chopmark { position: absolute; right: 26px; top: 26px; width: 76px; height: 76px; background: #c4231c; color: var(--paper); display: grid; grid-template-columns: 1fr 1fr; place-items: center; transform: rotate(-5deg); font: 700 22px/1 var(--f-cjk); padding: 6px; box-shadow: inset 0 0 0 3px #c4231c, inset 0 0 0 5px var(--paper); opacity: 0.92; }

/* links list */
.packets { display: grid; gap: 18px; }
.packet { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 30px; align-items: center; }
.packet .amt { font: 900 40px/0.9 var(--f-num); text-transform: uppercase; color: var(--ink); }
.packet .meta { font: 500 13px/1.6 var(--f-mono); color: var(--ink-2); margin-top: 8px; word-break: break-all; }
.packet .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.state { display: inline-block; margin-left: 10px; padding: 4px 8px; font: 600 11px/1 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; border: 1.5px solid currentColor; vertical-align: middle; }
.state.wait { color: var(--crimson-2); } .state.done { color: var(--ok); } .state.empty { color: var(--ink-2); }
.empty-note { text-align: center; padding: 30px 10px; }

/* search on lacquer */
.search { display: flex; align-items: center; gap: 12px; border-bottom: 2px solid var(--foil); padding: 6px 0; margin-bottom: 30px; max-width: 520px; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: 500 18px/1.3 var(--f-mono); padding: 8px 0; }
.search input::placeholder { color: var(--foil-faint); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin: -12px 0 26px; }
.filters button { border: 1.5px solid var(--rule); background: transparent; padding: 8px 12px; cursor: pointer; font: 500 14px/1 var(--f-ui); letter-spacing: 0.08em; color: var(--foil-dim); }
.filters button.on { border-color: var(--foil); color: var(--foil); }

/* docs */
.docs { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(30px, 5vw, 70px); padding-bottom: 40px; }
.toc { position: sticky; top: 100px; align-self: start; display: grid; gap: 2px; border-top: 1.5px solid var(--foil); padding-top: 14px; }
.toc a { padding: 7px 0; text-decoration: none; font: 500 15px/1.3 var(--f-ui); letter-spacing: 0.08em; color: var(--foil-faint); }
.toc a:hover, .toc a.on { color: var(--foil); }
.toc a.on::before { content: '— '; color: var(--vermilion); }
.prose h2 { font: 900 clamp(28px, 3.2vw, 42px)/1.18 var(--f-display); margin: 90px 0 20px; scroll-margin-top: 96px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font: 900 21px/1.3 var(--f-display); letter-spacing: 0.02em; margin: 40px 0 12px; scroll-margin-top: 96px; }
.prose p, .prose li { color: var(--foil-dim); max-width: 46em; }
.prose strong { color: var(--foil); font-weight: 600; }
.prose a { color: var(--foil); text-decoration: underline dashed; text-underline-offset: 4px; }
.prose code { font: 500 0.86em var(--f-mono); color: var(--foil); background: rgba(255, 255, 255, 0.07); padding: 2px 6px; word-break: break-all; }
.prose pre { background: rgba(0, 0, 0, 0.35); border-left: 2px solid var(--vermilion); padding: 18px 20px; overflow-x: auto; font: 500 13px/1.7 var(--f-mono); }
.prose pre code { background: none; padding: 0; }
.prose ol, .prose ul { padding-left: 22px; }
.prose li { margin: 6px 0; }
.prose .ledger td, .prose .ledger th { font-size: 14px; }
.aside-note { border-left: 2px solid var(--vermilion); padding: 4px 0 4px 18px; margin: 24px 0; }
.aside-note p { margin: 0; }

/* CA panel */
.panel { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; }
.panel .sheet { width: min(560px, 100%); }
.preview { display: flex; justify-content: center; padding: 26px; margin: 18px 0 8px; background: var(--lacquer); }

/* ── modal ────────────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 90; display: none; place-items: center; padding: 20px; background: rgba(10, 1, 2, 0.72); }
.modal.open { display: grid; animation: mfade 0.25s ease; }
@keyframes mfade { from { opacity: 0; } }
.modal .sheet { width: min(480px, 100%); max-height: min(660px, 92vh); display: flex; flex-direction: column; animation: mslide 0.45s var(--ease); }
@keyframes mslide { from { transform: translateY(24px); } }
.modal header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 18px; }
.modal header h3 { margin: 0; }
.x { border: 1.5px solid var(--ink); background: transparent; width: 36px; height: 36px; cursor: pointer; font: 500 20px/1 var(--f-mono); color: var(--ink); }
.x:hover { background: var(--ink); color: var(--paper); }
.mlist { overflow-y: auto; display: grid; margin: 0 -4px; padding: 0 4px; border-top: 1.5px solid var(--ink); }
.mrow { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 4px; border: 0; border-bottom: 1px dashed var(--ink-rule); background: transparent; cursor: pointer; text-align: left; color: var(--ink); text-decoration: none; }
.mrow:hover { background: rgba(125, 10, 15, 0.06); }
.mrow .ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; background: var(--ink); color: var(--paper); font: 800 13px/1 var(--f-num); }
.mrow img.ic { background: transparent; object-fit: contain; }
.mrow .t { flex: 1; min-width: 0; }
.mrow .t b { display: block; font: 800 19px/1.05 var(--f-num); text-transform: uppercase; letter-spacing: 0.02em; }
.mrow .t span { font-size: 13px; color: var(--ink-2); }
.mrow .r { font: 600 13px/1 var(--f-mono); color: var(--ink); }
.msearch { margin-bottom: 12px; }

/* toasts — a strip of paper tape */
.toasts { position: fixed; z-index: 95; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { background: var(--paper); color: var(--ink); padding: 13px 16px; font-size: 15px; border-left: 4px solid var(--ink); box-shadow: 0 18px 40px -16px #000; animation: tin 0.45s var(--ease); }
.toast.err { border-left-color: #c4231c; }
.toast.ok { border-left-color: var(--ok); }
@keyframes tin { from { transform: translateY(14px); opacity: 0; } }

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

/* ── responsive ───────────────────────────────────────── */
@media (max-width: 1100px) {
  .nav { display: none; }
  .menu-btn { display: inline-flex; }
  .nav.open {
    display: grid; position: fixed; inset: 68px 0 auto 0; padding: 18px clamp(18px, 3vw, 36px) 28px; gap: 2px;
    background: var(--crimson); border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
  }
  .nav.open a { padding: 14px 0; font-size: 28px; color: var(--foil); }
  .nav.open a.on::after { left: 0; right: auto; width: 40px; }
  .app, .docs { grid-template-columns: minmax(0, 1fr); }
  .side, .toc { position: static; }
  .toc { display: flex; flex-wrap: wrap; gap: 4px 18px; }
}
@media (max-width: 820px) {
  .site-header { gap: 14px; }
  .head-right .ca { display: none; }
  .stage::after { background: linear-gradient(0deg, rgba(18, 2, 3, 0.96) 0%, rgba(18, 2, 3, 0.82) 34%, rgba(18, 2, 3, 0) 58%); }
  .beat { align-items: flex-end; }
  .beat .copy { width: auto; margin: 0 22px; padding: 0 0 7vh; }
  .beat .mark-cjk { font-size: 30px; margin-bottom: 14px; }
  .beat h1, .beat h2 { margin-bottom: 16px; }
  .d1 { font-size: clamp(46px, 13vw, 64px); }
  .d2 { font-size: clamp(38px, 11vw, 54px); }
  .beat .lede { font-size: 16px; }
  .beat .row { margin-top: 22px; }
  .progress-seam { display: none; }
  .below-head { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
  .packet { grid-template-columns: 1fr; }
  .packet .acts { justify-content: flex-start; }
  .page-head { grid-template-columns: 1fr; }
  .page-head .cjk { writing-mode: horizontal-tb; grid-row: auto; margin-bottom: 12px; }
  .ledger .hide-sm { display: none; }
}
@media (max-width: 480px) {
  .brand b { display: none; }
  .wallet .wl { display: none; }
  .btn { padding: 0 20px; }
  .line input.amt { font-size: 38px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .reveal { opacity: 1; transform: none; }
}

/* additions */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 5vw, 60px); }
.claim-sym { font: 600 15px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--ink-2); text-transform: uppercase; }
@media (max-width: 820px) { .two { grid-template-columns: 1fr; } }

/* chapter captions over the scene (fade with scroll) */
.captions { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.captions .copy {
  position: absolute; left: clamp(22px, 6vw, 96px); top: 50%; width: min(560px, 44vw);
  transform: translateY(calc(-50% + var(--y, 0px))); opacity: 0; will-change: opacity, transform;
}
.captions .copy.live { pointer-events: auto; }
.captions .mark-cjk { display: block; font-size: 40px; line-height: 1; color: var(--vermilion); margin-bottom: 22px; }
.captions h1, .captions h2 { margin-bottom: 26px; }
.captions .lede { margin: 0; }
.captions .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.captions .ca-slot { margin-top: 22px; }
.captions .note { margin-top: 18px; font: 500 13px/1.5 var(--f-mono); color: var(--foil-faint); }
.beat.spacer { min-height: 100vh; min-height: 100svh; }
@media (max-width: 820px) {
  .captions .copy { left: 22px; right: 22px; width: auto; top: auto; bottom: 6vh; transform: translateY(var(--y, 0px)); }
  .captions .mark-cjk { font-size: 30px; margin-bottom: 14px; }
  .captions h1, .captions h2 { margin-bottom: 14px; }
  .captions .lede { font-size: 16px; }
  .captions .row { margin-top: 20px; }
}
.wallet .wl-s { display: none; }
@media (max-width: 480px) { .wallet .wl-s { display: inline; } }
.line input { width: 100%; }
.sheet { min-width: 0; }

/* Traditional Chinese typesetting */
body { line-height: 1.75; letter-spacing: 0.02em; }
.lede { line-height: 1.8; }
.captions .mark-cjk, .page-head .cjk { font-family: var(--f-display); font-weight: 900; }
.f > label, .f .lab, .ledger th, .terms span, .claim-sym, .state { letter-spacing: 0.14em; }
.f > label, .f .lab, .ledger th { font-family: var(--f-ui); font-weight: 500; font-size: 13px; }
@media (max-width: 820px) {
  .d1 { font-size: clamp(34px, 9.4vw, 46px); }
  .d2 { font-size: clamp(28px, 7.6vw, 38px); }
}
/* CJK headlines break at punctuation, not mid-word */
.display, .foot-big, .prose h2, .prose h3, .qa summary { word-break: keep-all; overflow-wrap: break-word; line-break: strict; text-wrap: pretty; }
.lede, p { line-break: strict; }
.terms span { white-space: nowrap; flex: none; }
.d1 { font-size: clamp(40px, 5.1vw, 78px); }
.captions .copy { width: min(640px, 46vw); }
@media (max-width: 820px) { .d1 { font-size: clamp(32px, 9vw, 44px); } .captions .copy { width: auto; } }
/* keep text clear of the seal stamp on paper sheets */
.chopmark ~ div > p:first-of-type, .chopmark ~ div > p.muted { padding-right: 84px; }
@media (max-width: 520px) {
  .chopmark { width: 54px; height: 54px; right: 18px; top: 18px; font-size: 15px; padding: 4px; }
  .chopmark ~ div > p:first-of-type, .chopmark ~ div > p.muted { padding-right: 62px; }
  .chopmark ~ div h1 { padding-right: 62px !important; }
}
