/* 灯文 — 見た目 */
:root {
  --ink: #f3ecdf;
  --ink-dim: #b9b0c9;
  --ink-faint: #7d7594;
  --night: #070914;
  --night-2: #0d1024;
  --line: rgba(255, 228, 190, .14);
  --glass: rgba(16, 15, 34, .55);
  --ember: #ffb347;
  --ember-2: #ff7a3d;
  --ember-hot: #fff1c9;
  --vermilion: #e2541b;
  --plum: #a989ff;
  --jade: #8ff0d0;
  --mincho: "Shippori Mincho B1", "Hiragino Mincho ProN", serif;
  --gothic: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, sans-serif;
  --hand: "Zen Kurenaido", "Klee One", var(--gothic);
  --latin: "Cormorant Garamond", serif;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.77, 0, .18, 1);
  --r: 22px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; background: var(--night); color: var(--ink);
  font-family: var(--gothic); font-size: 16px; line-height: 1.85; letter-spacing: .02em;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
@media (hover: hover) and (pointer: fine) { body, a, button { cursor: none; } }
::selection { background: rgba(255, 179, 71, .35); }
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; }

#sky { position: fixed; inset: 0; z-index: -2; display: block; }
#grain {
  position: fixed; inset: -50%; z-index: 50; pointer-events: none; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-4%)} 60%{transform:translate(-4%,-1%)} 80%{transform:translate(3%,3%)} 100%{transform:translate(0,0)} }

/* カーソル（火の粉） */
#cursor { position: fixed; left: 0; top: 0; z-index: 100; pointer-events: none; width: 0; height: 0; display: none; }
@media (hover: hover) and (pointer: fine) { #cursor { display: block; } }
#cursor span {
  position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  background: radial-gradient(circle, #fffbe8 0 25%, rgba(255, 179, 71, .85) 45%, rgba(255, 120, 40, 0) 72%);
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background .3s;
  mix-blend-mode: screen;
}
#cursor.hot span { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: radial-gradient(circle, rgba(255, 245, 210, .5) 0 12%, rgba(255, 179, 71, .25) 40%, rgba(255, 120, 40, 0) 70%); }
#cursor.text span { width: 4px; height: 26px; margin: -13px 0 0 -2px; border-radius: 3px; background: var(--ember); }

/* ナビ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 40; display: flex; align-items: center; gap: 28px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: linear-gradient(to bottom, rgba(7, 9, 20, .82), rgba(7, 9, 20, 0));
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; filter: drop-shadow(0 0 10px rgba(255, 160, 70, .7)); animation: sway 5s ease-in-out infinite; transform-origin: 50% 0; }
@keyframes sway { 50% { transform: rotate(4deg) translateY(1px); } }
.brand-ja { font-family: var(--mincho); font-weight: 800; font-size: 22px; letter-spacing: .12em; }
.brand-en { font-family: var(--latin); font-style: italic; font-size: 13px; letter-spacing: .28em; color: var(--ink-faint); }
.nav-links { display: flex; gap: 6px; margin-left: auto; }
.nav-links a {
  position: relative; text-decoration: none; font-size: 14px; padding: 8px 14px; border-radius: 999px; color: var(--ink-dim);
  transition: color .3s, background .3s;
}
.nav-links a:hover { color: var(--ink); background: rgba(255, 255, 255, .05); }
.nav-links a.on { color: var(--ink-hot, #fff); }
.nav-links a.on::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.sound-toggle { background: none; border: 1px solid var(--line); border-radius: 999px; width: 40px; height: 32px; display: grid; place-items: center; }
.sound-toggle .bars { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.sound-toggle i { width: 2px; height: 3px; background: var(--ink-dim); border-radius: 1px; transition: height .3s; }
.sound-toggle[aria-pressed="true"] i { background: var(--ember); animation: eq 1s ease-in-out infinite; }
.sound-toggle[aria-pressed="true"] i:nth-child(2) { animation-delay: -.3s; }
.sound-toggle[aria-pressed="true"] i:nth-child(3) { animation-delay: -.6s; }
.sound-toggle[aria-pressed="true"] i:nth-child(4) { animation-delay: -.15s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }

.mode-badge {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 45;
  font-size: 12px; padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255, 179, 71, .4);
  background: rgba(30, 18, 10, .7); color: var(--ember-hot); backdrop-filter: blur(8px); white-space: nowrap;
}

main { position: relative; z-index: 1; outline: none; }
.view-enter > * { animation: rise .9s var(--ease-out) both; }
.view-enter > *:nth-child(2) { animation-delay: .08s; }
.view-enter > *:nth-child(3) { animation-delay: .16s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } }
@keyframes riseInV { from { opacity: 0; } to { opacity: 1; } }
@keyframes riseIn { from { opacity: 0; transform: translateY(26px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }

/* 画面切り替えの墨流し */
#wipe { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
#wipe svg { width: 100%; height: 100%; display: block; }
#wipe svg { filter: drop-shadow(0 0 14px rgba(255, 140, 60, .55)); }
#wipe #wipePath { fill: #05060d; }
#wipe #wipeEdgeLine { filter: drop-shadow(0 0 6px #ffb347); }
.wipe-title {
  position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--mincho); font-weight: 800; font-size: clamp(26px, 4vw, 46px); letter-spacing: .3em; color: var(--ember-hot);
  text-shadow: 0 0 24px rgba(255, 150, 60, .8), 0 0 70px rgba(255, 110, 40, .5);
  opacity: 0; transform: translateY(10px); filter: blur(6px); transition: opacity .35s, transform .6s var(--ease-out), filter .35s;
}
.wipe-title.on { opacity: 1; transform: none; filter: none; }
#progress { position: fixed; left: 0; right: 0; top: 0; height: 2px; z-index: 60; pointer-events: none; }
#progress b { display: block; height: 100%; transform-origin: left; transform: scaleX(0); background: linear-gradient(90deg, rgba(255, 122, 61, 0), #ff7a3d 60%, #fff1c9); box-shadow: 0 0 12px #ffb347, 0 0 2px #fff; }

.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.section { padding: clamp(80px, 12vh, 140px) 0; position: relative; }
.eyebrow { font-family: var(--latin); font-style: italic; letter-spacing: .35em; text-transform: uppercase; font-size: 13px; color: var(--ember); }
.h2 { font-family: var(--mincho); font-weight: 800; font-size: clamp(30px, 4.6vw, 58px); line-height: 1.3; letter-spacing: .06em; margin: 10px 0 18px; }
.lead { color: var(--ink-dim); max-width: 36em; }
.glass { background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(16px) saturate(1.2); -webkit-backdrop-filter: blur(16px) saturate(1.2); }

/* ボタン */
.btn {
  --bx: 50%; --by: 50%;
  position: relative; display: inline-flex; align-items: center; gap: 10px; justify-content: center;
  padding: 15px 30px; border-radius: 999px; border: 0; text-decoration: none; font-weight: 700; letter-spacing: .1em;
  color: #2a1406; isolation: isolate; overflow: hidden;
  background: linear-gradient(120deg, #ffe7a8, #ffb347 45%, #ff7a3d);
  box-shadow: 0 0 0 1px rgba(255, 220, 160, .5) inset, 0 10px 40px -8px rgba(255, 130, 50, .65), 0 0 80px -10px rgba(255, 150, 60, .5);
  transform: translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform .5s var(--ease-out), box-shadow .4s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(160px circle at var(--bx) var(--by), rgba(255, 255, 255, .75), transparent 60%); opacity: 0; transition: opacity .3s; }
.btn:hover::before { opacity: 1; }
.btn:hover { transform: translate(var(--tx, 0px), calc(var(--ty, 0px) - 2px)); box-shadow: 0 0 0 1px rgba(255, 230, 180, .7) inset, 0 16px 50px -8px rgba(255, 130, 50, .85), 0 0 120px -10px rgba(255, 150, 60, .7); }
.btn:active { transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(.97); }
.btn[disabled] { filter: grayscale(.8) brightness(.6); pointer-events: none; }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: 0 0 0 1px var(--line) inset; }
.btn.ghost:hover { box-shadow: 0 0 0 1px rgba(255, 200, 140, .5) inset, 0 0 40px -10px rgba(255, 150, 60, .5); }
.btn.small { padding: 10px 20px; font-size: 14px; }

/* ================= トップ ================= */
.hero { min-height: 100svh; display: grid; place-items: center; text-align: center; position: relative; padding: 120px 16px 80px; }
.hero-title { font-family: var(--mincho); font-weight: 800; font-size: clamp(54px, 11vw, 168px); line-height: 1.05; letter-spacing: .08em; margin: 0; }
.hero-title .ch { display: inline-block; opacity: 0; transform: translateY(.4em) scale(.9); filter: blur(12px); animation: chIn 1.4s var(--ease-out) forwards; text-shadow: 0 0 0 transparent; }
.hero-title .ch.lit { color: var(--ember-hot); text-shadow: 0 0 18px rgba(255, 179, 71, .9), 0 0 60px rgba(255, 120, 40, .6), 0 0 140px rgba(255, 90, 30, .4); animation: chIn 1.4s var(--ease-out) forwards, flicker 4s 1.6s infinite; }
@keyframes chIn { to { opacity: 1; transform: none; filter: none; } }
@keyframes flicker { 0%,100% { opacity: 1; } 47% { opacity: 1; } 48% { opacity: .82; } 50% { opacity: 1; } 72% { opacity: .93; } }
.hero-sub { margin: 26px auto 40px; max-width: 30em; color: var(--ink-dim); font-size: clamp(15px, 1.6vw, 18px); opacity: 0; animation: riseIn 1.2s 1.1s var(--ease-out) forwards; }
.hero-cta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; opacity: 0; animation: riseIn 1.2s 1.35s var(--ease-out) forwards; }
.hero-tate {
  position: absolute; right: clamp(16px, 5vw, 70px); top: 50%; transform: translateY(-50%);
  writing-mode: vertical-rl; font-family: var(--mincho); font-size: 15px; letter-spacing: .5em; color: var(--ink-faint);
  opacity: 0; animation: riseInV 1.6s 1.8s var(--ease-out) forwards;
}
.hero-tate b { color: var(--ember); font-weight: 600; }
.hero-left {
  position: absolute; left: clamp(16px, 5vw, 70px); bottom: 40px; text-align: left; font-size: 12px; color: var(--ink-faint);
  font-family: var(--latin); letter-spacing: .25em; opacity: 0; animation: riseIn 1.4s 2s var(--ease-out) forwards;
}
.hero-left strong { display: block; font-family: var(--mincho); font-size: 30px; letter-spacing: .05em; color: var(--ink); font-variant-numeric: tabular-nums; }
.scroll-cue { position: absolute; bottom: 30px; left: 50%; width: 1px; height: 70px; background: linear-gradient(var(--ember), transparent); transform-origin: top; animation: cue 2.4s var(--ease-io) infinite; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* 物語（スクロールで手紙→灯籠） */
.story { height: 420vh; position: relative; }
.story-stage { position: sticky; top: 0; height: 100vh; display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 4vw; width: min(1180px, 100% - 32px); margin-inline: auto; }
.story-steps { position: relative; height: 260px; }
.story-step { position: absolute; inset: 0; opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.story-step.on { opacity: 1; transform: none; }
.story-step .num { font-family: var(--latin); font-size: 90px; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255, 179, 71, .55); }
.story-step h3 { font-family: var(--mincho); font-size: clamp(26px, 3.4vw, 42px); margin: 6px 0 12px; letter-spacing: .06em; }
.story-step p { color: var(--ink-dim); margin: 0; max-width: 26em; text-shadow: 0 1px 12px rgba(4, 5, 13, .95), 0 0 2px rgba(4, 5, 13, .9); }
.story-art { position: relative; height: min(70vh, 560px); display: grid; place-items: center; perspective: 1200px; }
.story-art > svg { width: min(420px, 90%); height: auto; overflow: visible; }
.story-progress { position: absolute; left: 0; bottom: 12vh; display: flex; gap: 8px; }
.story-progress i { width: 34px; height: 2px; background: rgba(255, 255, 255, .15); border-radius: 2px; overflow: hidden; position: relative; }
.story-progress i b { position: absolute; inset: 0; background: var(--ember); transform-origin: left; transform: scaleX(0); }

/* 文字を灯す計算機 */
.calc { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; margin-top: 40px; }
.calc-in { padding: 26px; position: relative; }
.calc-in textarea {
  width: 100%; min-height: 220px; resize: vertical; background: transparent; border: 0; outline: 0; color: var(--ink);
  font-family: var(--hand); font-size: 22px; line-height: 1.9;
  background-image: linear-gradient(transparent calc(1.9em - 1px), rgba(255, 220, 170, .12) 1px); background-size: 100% 1.9em;
}
.calc-out { padding: 26px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; overflow: hidden; position: relative; }
.calc-out::before { content: ""; position: absolute; inset: -40%; background: radial-gradient(circle at 50% 60%, rgba(255, 150, 60, var(--heat, .05)), transparent 55%); transition: background .4s; pointer-events: none; }
.odo { font-family: var(--mincho); font-weight: 800; font-size: clamp(46px, 6vw, 80px); line-height: 1; display: flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.odo .yen { font-size: .45em; color: var(--ember); }
.odo-digits { display: inline-flex; overflow: hidden; height: 1em; }
.odo-digit { display: inline-flex; flex-direction: column; transition: transform .7s var(--ease-out); }
.odo-digit span { height: 1em; line-height: 1; }
.odo-comma { width: .3em; text-align: center; }
.meter { height: 8px; border-radius: 8px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ff7a3d, #ffe7a8); box-shadow: 0 0 20px #ffb347; transition: width .5s var(--ease-out); }
.calc-rows { display: grid; gap: 6px; font-size: 14px; color: var(--ink-dim); }
.calc-rows div { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding-bottom: 6px; }
.calc-rows b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mini-lantern { width: 70px; height: 100px; margin: 0 auto; position: relative; transition: transform .5s var(--ease-out); }

/* 数字の帯 */
.ticker { overflow: hidden; border-block: 1px solid var(--line); padding: 18px 0; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: tick 60s linear infinite; }
.ticker-track span { font-family: var(--mincho); font-size: 18px; color: var(--ink-dim); white-space: nowrap; }
.ticker-track span b { color: var(--ember-hot); font-weight: 600; }
@keyframes tick { to { transform: translateX(-50%); } }

/* 3つの約束 */
.vows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.vow { padding: 30px 26px; position: relative; overflow: hidden; }
.vow .k { font-family: var(--mincho); font-size: 64px; line-height: 1; color: var(--ember); text-shadow: 0 0 30px rgba(255, 150, 60, .6); }
.vow h3 { font-family: var(--mincho); font-size: 22px; margin: 16px 0 8px; }
.vow p { color: var(--ink-dim); font-size: 14.5px; margin: 0; }

/* 料金の円 */
.split { display: grid; grid-template-columns: 340px 1fr; gap: 50px; align-items: center; margin-top: 30px; }
.donut { width: 100%; aspect-ratio: 1; position: relative; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.donut .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-family: var(--mincho); }
.donut .center b { font-size: 54px; display: block; line-height: 1; color: var(--ember-hot); }
.legend { display: grid; gap: 14px; }
.legend div { display: grid; grid-template-columns: 14px 1fr auto; gap: 14px; align-items: center; padding: 14px 18px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; }

/* ================= 相手を選ぶ ================= */
.page-head { padding: 140px 0 30px; }
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; padding-bottom: 120px; }
.ccard {
  --mx: 50%; --my: 50%; --rx: 0deg; --ry: 0deg;
  position: relative; display: block; text-decoration: none; border-radius: var(--r); overflow: hidden; padding: 0;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .5s var(--ease-out), box-shadow .5s;
}
.ccard:hover { box-shadow: 0 30px 80px -30px rgba(255, 130, 50, .6); }
.ccard::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: radial-gradient(400px circle at var(--mx) var(--my), rgba(255, 200, 140, .18), transparent 45%); opacity: 0; transition: opacity .4s; }
.ccard:hover::after { opacity: 1; }
.ccard .cover { height: 150px; position: relative; overflow: hidden; }
.ccard .cover canvas { width: 100%; height: 100%; display: block; }
.ccard .avatar { width: 74px; height: 74px; border-radius: 50%; margin: -40px 0 0 22px; position: relative; border: 3px solid var(--night-2); display: grid; place-items: center; font-family: var(--mincho); font-size: 30px; font-weight: 800; transform: translateZ(40px); }
.ccard .body { padding: 10px 22px 22px; transform: translateZ(20px); }
.ccard h3 { margin: 6px 0 0; font-family: var(--mincho); font-size: 22px; }
.ccard .role { font-size: 13px; color: var(--ember); letter-spacing: .1em; }
.ccard p { font-size: 14px; color: var(--ink-dim); margin: 8px 0 14px; min-height: 3.6em; }
.ccard .stats { display: flex; gap: 18px; font-size: 13px; color: var(--ink-faint); }
.ccard .stats b { color: var(--ink); font-size: 16px; font-family: var(--mincho); }

/* ================= 手紙を書く ================= */
.profile { padding-top: 110px; }
.banner { height: 300px; border-radius: 0 0 40px 40px; overflow: hidden; position: relative; }
.banner canvas { width: 100%; height: 100%; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 30%, var(--night) 100%); }
.pmeta { display: flex; gap: 26px; align-items: flex-end; margin-top: -80px; position: relative; z-index: 2; flex-wrap: wrap; }
.pmeta .avatar { width: 136px; height: 136px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mincho); font-weight: 800; font-size: 56px; border: 4px solid var(--night); box-shadow: 0 0 60px -10px var(--glow, rgba(255, 150, 60, .6)); }
.pmeta h1 { font-family: var(--mincho); font-size: clamp(30px, 4vw, 48px); margin: 0; letter-spacing: .06em; }
.pmeta .role { color: var(--ember); letter-spacing: .15em; font-size: 14px; }
.pmeta .stats { margin-left: auto; display: flex; gap: 30px; }
.pmeta .stats div { text-align: center; }
.pmeta .stats b { display: block; font-family: var(--mincho); font-size: 28px; }
.pmeta .stats span { font-size: 12px; color: var(--ink-faint); }
.bio { margin: 26px 0 0; color: var(--ink-dim); max-width: 46em; }

.compose { display: grid; grid-template-columns: 1fr 1.05fr; gap: 28px; margin: 50px 0 140px; align-items: start; }
.panel { padding: 28px; }
.field { margin-bottom: 22px; }
.field > label, .field > .lbl { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: .12em; color: var(--ink-dim); margin-bottom: 10px; }
.field input[type=text], .field textarea {
  width: 100%; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; color: var(--ink); outline: 0;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.field textarea { min-height: 200px; resize: vertical; font-family: var(--hand); font-size: 18px; line-height: 1.9; }
.field input:focus, .field textarea:focus { border-color: rgba(255, 179, 71, .6); box-shadow: 0 0 0 4px rgba(255, 179, 71, .1), 0 0 40px -10px rgba(255, 150, 60, .5); background: rgba(255, 255, 255, .05); }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: flex; align-items: center; gap: 8px; padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; transition: all .3s var(--ease-out); }
.chip input:checked + span { border-color: var(--ember); background: rgba(255, 179, 71, .12); box-shadow: 0 0 24px -6px rgba(255, 150, 60, .7); }
.chip input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }
.chip .sw { width: 16px; height: 16px; border-radius: 50%; }
.amount-row { display: flex; align-items: center; gap: 16px; }
.amount-row output { font-family: var(--mincho); font-weight: 800; font-size: 34px; min-width: 6.5ch; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, #ff7a3d, #ffe7a8 var(--p, 10%), rgba(255, 255, 255, .08) var(--p, 10%)); outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #ffb347 55%, #e2541b); box-shadow: 0 0 20px #ffb347; border: 0; }
input[type=range]::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle, #fff 0 25%, #ffb347 55%, #e2541b); box-shadow: 0 0 20px #ffb347; border: 0; }
.hint { font-size: 12.5px; color: var(--ink-faint); margin-top: 8px; }
.hint.warn { color: #ffb4a2; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-dim); }
.toggle input { accent-color: var(--ember); width: 18px; height: 18px; }

/* 便箋プレビュー */
.preview-wrap { position: sticky; top: 100px; perspective: 1600px; }
.paper {
  --paper: #f6efe2; --paper-ink: #2b2230; --rule: rgba(90, 60, 40, .14);
  position: relative; min-height: 560px; padding: 54px 48px 44px; border-radius: 6px; color: var(--paper-ink);
  background: var(--paper); box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .2), 0 0 120px -40px rgba(255, 150, 60, .5);
  transform: rotateX(4deg) rotateY(-6deg); transform-style: preserve-3d; transition: transform .8s var(--ease-out), background .6s, color .6s;
  font-family: var(--hand); overflow: hidden;
}
.preview-wrap:hover .paper { transform: rotateX(0) rotateY(0); }
.paper::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.04 .9' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E"); mix-blend-mode: multiply; }
.paper .lines { position: absolute; inset: 54px 48px 44px; background-image: linear-gradient(transparent calc(2em - 1px), var(--rule) 1px); background-size: 100% 2em; font-size: 19px; pointer-events: none; }
.paper .to { font-size: 19px; line-height: 2em; margin: 0 0 2em; position: relative; }
.paper .text { font-size: 19px; line-height: 2em; white-space: pre-wrap; word-break: break-all; min-height: 12em; position: relative; }
.paper .text .ph { opacity: .35; }
.paper .text .nc { display: inline; animation: inkIn .6s var(--ease-out); }
@keyframes inkIn { from { opacity: 0; filter: blur(3px); } }
.paper .from { text-align: right; padding-right: 76px; margin-top: 2em; font-size: 19px; line-height: 2em; position: relative; }
.paper .seal { position: absolute; right: 38px; bottom: 34px; width: 64px; height: 64px; opacity: .92; transform: rotate(-8deg); mix-blend-mode: multiply; }
.paper .stamp-amt { position: absolute; left: 40px; bottom: 34px; font-family: var(--mincho); font-size: 13px; letter-spacing: .1em; opacity: .7; }
.paper.washi { --paper: #f6efe2; --paper-ink: #2b2230; }
.paper.tsukishiro { --paper: #e9eef7; --paper-ink: #1d2540; --rule: rgba(40, 60, 120, .14); }
.paper.yozakura { --paper: #f8e4e8; --paper-ink: #4a1f33; --rule: rgba(160, 60, 90, .16); }
.paper.sumi { --paper: #1b1a22; --paper-ink: #efe4cf; --rule: rgba(255, 230, 190, .1); }
.paper.sumi .seal { mix-blend-mode: screen; }
.paper.yozakura::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 92% 8%, rgba(230, 120, 150, .35) 0 6%, transparent 7%), radial-gradient(circle at 85% 16%, rgba(230, 120, 150, .25) 0 3%, transparent 4%), radial-gradient(circle at 96% 22%, rgba(230, 120, 150, .2) 0 2%, transparent 3%); }
.paper.tsukishiro::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .9), rgba(200, 215, 240, .3) 60%, transparent 70%); pointer-events: none; }
.ink-sumi { --paper-ink-override: #2b2230; }
.paper[data-ink=ai] .text, .paper[data-ink=ai] .to, .paper[data-ink=ai] .from { color: #1f3a7a; }
.paper[data-ink=beni] .text, .paper[data-ink=beni] .to, .paper[data-ink=beni] .from { color: #b3243b; }
.paper[data-ink=kin] .text, .paper[data-ink=kin] .to, .paper[data-ink=kin] .from { color: #a8761a; }
.paper.sumi[data-ink=kin] .text, .paper.sumi[data-ink=kin] .to, .paper.sumi[data-ink=kin] .from { color: #f1c36a; }
.paper.sumi[data-ink=ai] .text, .paper.sumi[data-ink=ai] .to, .paper.sumi[data-ink=ai] .from { color: #9bb8ff; }
.paper.sumi[data-ink=beni] .text, .paper.sumi[data-ink=beni] .to, .paper.sumi[data-ink=beni] .from { color: #ff8fa0; }
.preview-lantern { display: flex; align-items: center; gap: 16px; margin-top: 18px; padding: 14px 18px; }
.preview-lantern canvas { width: 64px; height: 90px; }
.preview-lantern p { margin: 0; font-size: 13.5px; color: var(--ink-dim); }
.preview-lantern b { color: var(--ember-hot); }

/* ================= 決済の窓 ================= */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 10, .7); backdrop-filter: blur(10px); animation: fade .4s both; }
@keyframes fade { from { opacity: 0; } }
.modal-card { width: min(460px, 100%); padding: 30px; animation: pop .6s var(--ease-out) both; position: relative; }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } }
.modal-card h3 { font-family: var(--mincho); font-size: 24px; margin: 0 0 4px; }
.modal-card .sum { display: grid; gap: 8px; margin: 20px 0; font-size: 14px; }
.modal-card .sum div { display: flex; justify-content: space-between; color: var(--ink-dim); }
.modal-card .sum .total { border-top: 1px solid var(--line); padding-top: 10px; color: var(--ink); font-size: 18px; font-weight: 700; }
.card-sim { border-radius: 16px; padding: 18px; background: linear-gradient(135deg, #2a2140, #171327); border: 1px solid var(--line); margin-bottom: 18px; position: relative; overflow: hidden; }
.card-sim::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .08) 45%, transparent 60%); transform: translateX(-100%); animation: sheen 3s infinite; }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.card-sim .row { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-faint); }
.card-sim .num { font-family: ui-monospace, Menlo, monospace; font-size: 18px; letter-spacing: .12em; margin: 14px 0 8px; }
.demo-note { font-size: 12.5px; color: #ffcf9e; background: rgba(255, 150, 60, .08); border: 1px dashed rgba(255, 179, 71, .4); padding: 10px 12px; border-radius: 12px; margin-bottom: 16px; }
.x { position: absolute; right: 16px; top: 14px; background: none; border: 0; font-size: 22px; color: var(--ink-faint); }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(42, 20, 6, .3); border-top-color: #2a1406; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 送ったあとの演出 ================= */
.ceremony { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; pointer-events: none; perspective: 1400px; }
.fold { position: relative; width: 300px; height: 400px; transform-style: preserve-3d; }
.fold .leaf { position: absolute; left: 0; width: 100%; height: 33.34%; background: var(--fold-paper, #f6efe2); transform-style: preserve-3d; backface-visibility: visible; box-shadow: inset 0 0 30px rgba(0, 0, 0, .12); }
.fold .leaf:nth-child(1) { top: 0; transform-origin: bottom; }
.fold .leaf:nth-child(2) { top: 33.33%; }
.fold .leaf:nth-child(3) { top: 66.66%; transform-origin: top; }
.fold .leaf .scrib { position: absolute; inset: 16px 20px; background-image: repeating-linear-gradient(transparent 0 14px, rgba(60, 40, 40, .35) 14px 15px); mask-image: linear-gradient(90deg, #000 70%, transparent); }
.ceremony-msg { position: fixed; left: 0; right: 0; bottom: 14vh; text-align: center; font-family: var(--mincho); font-size: clamp(22px, 3vw, 34px); letter-spacing: .14em; opacity: 0; transition: opacity 1s; text-shadow: 0 0 30px rgba(255, 150, 60, .8); z-index: 71; pointer-events: none; }
.ceremony-msg.on { opacity: 1; }

.sent-page { min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 140px 16px 80px; }
.sent-page h1 { font-family: var(--mincho); font-size: clamp(34px, 5vw, 64px); letter-spacing: .1em; margin: 0 0 12px; }
.sent-page p { color: var(--ink-dim); }
.receipt { margin: 30px auto; padding: 22px 26px; width: min(420px, 100%); text-align: left; font-size: 14px; }
.receipt div { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.receipt div:last-child { border: 0; }

/* ================= 夜空 ================= */
.sky-page { min-height: 100vh; padding: 130px 0 60px; pointer-events: none; }
.sky-page .wrap > * { pointer-events: auto; }
.sky-legend { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 24px; font-size: 13px; color: var(--ink-dim); }
.sky-legend span { display: flex; align-items: center; gap: 8px; }
.sky-legend i { width: 10px; height: 10px; border-radius: 50%; }
.sky-count { position: fixed; right: clamp(16px, 4vw, 48px); bottom: 70px; text-align: right; font-family: var(--mincho); }
.sky-count b { font-size: clamp(40px, 6vw, 80px); display: block; line-height: 1; color: var(--ember-hot); text-shadow: 0 0 40px rgba(255, 150, 60, .7); font-variant-numeric: tabular-nums; }
.sky-count span { color: var(--ink-faint); font-size: 13px; letter-spacing: .2em; }

/* ================= 受け取り箱 ================= */
.inbox { display: grid; grid-template-columns: 1fr 1.2fr; gap: 26px; padding: 30px 0 140px; align-items: start; }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 30px 0 0; }
.kpi { padding: 20px 22px; }
.kpi span { font-size: 12px; letter-spacing: .15em; color: var(--ink-faint); }
.kpi b { display: block; font-family: var(--mincho); font-size: 30px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--jade); font-size: 12px; }
.chart { padding: 22px; margin-top: 14px; }
.chart canvas { width: 100%; height: 220px; display: block; }
.letters { display: grid; gap: 10px; max-height: 640px; overflow-y: auto; overflow-x: hidden; padding: 10px; scrollbar-width: thin; background: rgba(10, 10, 26, .6); border: 1px solid var(--line); border-radius: var(--r); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.lt { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; text-align: left; background: rgba(255, 255, 255, .025); border: 1px solid var(--line); border-radius: 16px; transition: all .35s var(--ease-out); width: 100%; }
.lt:hover, .lt.on { background: rgba(255, 179, 71, .08); border-color: rgba(255, 179, 71, .4); transform: translateX(3px); }
.lt .lamp { width: 30px; height: 42px; margin: auto; border-radius: 40% 40% 30% 30%; background: radial-gradient(circle at 50% 65%, #fff6d6, #ffb347 50%, #e2541b); box-shadow: 0 0 calc(var(--g, 1) * 14px) rgba(255, 150, 60, .8); animation: sway 4s ease-in-out infinite; }
.lt.unread .lamp { animation: sway 4s ease-in-out infinite, pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 34px rgba(255, 170, 70, 1); } }
.lt .who { font-weight: 700; }
.lt .snip { display: block; font-size: 13px; color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lt .amt { font-family: var(--mincho); font-weight: 800; color: var(--ember-hot); }
.reader { position: sticky; top: 100px; }
.reader .paper { min-height: 460px; transform: none; animation: unfold 1s var(--ease-out) both; transform-origin: top; }
@keyframes unfold { from { transform: rotateX(-80deg); opacity: 0; } }
.reply { margin-top: 14px; padding: 18px; display: flex; gap: 10px; }
.reply input { flex: 1; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: 999px; padding: 10px 16px; color: var(--ink); outline: 0; }
.reply-shown { margin-top: 12px; font-size: 14px; color: var(--jade); }
.connect { padding: 24px; margin-top: 14px; display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.connect p { margin: 0; font-size: 14px; color: var(--ink-dim); max-width: 32em; }
.empty { padding: 50px 20px; text-align: center; color: var(--ink-faint); }

.foot { border-top: 1px solid var(--line); padding: 40px 0 70px; color: var(--ink-faint); font-size: 13px; position: relative; z-index: 1; background: linear-gradient(transparent, rgba(3, 4, 10, .9)); }
.foot .wrap { display: flex; gap: 20px; justify-content: space-between; flex-wrap: wrap; }
.foot a { color: var(--ink-dim); text-decoration: none; margin-right: 18px; }

#toast { position: fixed; top: 84px; left: 50%; transform: translate(-50%, -20px); z-index: 95; padding: 12px 20px; border-radius: 14px; background: rgba(20, 16, 34, .92); border: 1px solid var(--line); opacity: 0; pointer-events: none; transition: all .5s var(--ease-out); font-size: 14px; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 文章ページ（規約など） */
.doc { padding: 140px 0 120px; max-width: 760px; }
.doc h1 { font-family: var(--mincho); }
.doc h2 { font-family: var(--mincho); font-size: 20px; margin-top: 2em; color: var(--ember-hot); }
.doc p, .doc li { color: var(--ink-dim); font-size: 15px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; }
.doc td, .doc th { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.doc th { width: 34%; color: var(--ink); font-weight: 500; }

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

/* スマホ */
@media (max-width: 860px) {
  .nav { gap: 10px; padding: 12px 16px; }
  .brand-en { display: none; }
  .nav-links { position: fixed; left: 12px; right: 12px; bottom: 12px; justify-content: space-around; background: rgba(12, 12, 28, .85); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 999px; padding: 6px; margin: 0; }
  .nav-links a { padding: 8px 10px; font-size: 13px; }
  .sound-toggle { margin-left: auto; }
  .mode-badge { bottom: 76px; }
  .hero-tate, .hero-left { display: none; }
  .hero-title { font-size: 12.4vw; letter-spacing: .02em; white-space: nowrap; }
  .story { height: 360vh; }
  .story-stage { grid-template-columns: 1fr; grid-template-rows: auto 1fr; padding-top: 90px; gap: 0; }
  .story-steps { height: 200px; }
  .story-step .num { font-size: 60px; }
  .story-art { height: 46vh; }
  .story-progress { bottom: 100px; }
  .calc, .vows, .split, .compose, .inbox { grid-template-columns: 1fr; }
  .split .donut { max-width: 300px; margin: 0 auto; }
  .preview-wrap, .reader { position: relative; top: 0; }
  .paper { padding: 40px 26px 36px; min-height: 440px; }
  .paper .lines { inset: 40px 26px 36px; }
  .pmeta .stats { margin-left: 0; }
  .kpis { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .kpi { padding: 14px; } .kpi b { font-size: 20px; }
  .sky-count { bottom: 90px; }
  .foot { padding-bottom: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ===== 見出しを1文字ずつ ===== */
.h2.chars.reveal { opacity: 1; transform: none; }
.h2.chars .c { display: inline-block; opacity: 0; transform: translateY(.55em) rotate(6deg); filter: blur(10px);
  transition: opacity .9s var(--ease-out) calc(var(--i) * 38ms), transform 1.2s var(--ease-out) calc(var(--i) * 38ms), filter 1s var(--ease-out) calc(var(--i) * 38ms); }
.h2.chars.in .c { opacity: 1; transform: none; filter: none; }
.h2 .c.lit { color: var(--ember-hot); text-shadow: 0 0 16px rgba(255, 179, 71, .9), 0 0 50px rgba(255, 120, 40, .55); }
.h2.chars.in .c.lit { animation: flicker 4s 1.5s infinite; }

/* ===== トップの読みやすさと案内 ===== */
.hero::before { content: ""; position: absolute; inset: 14% 8% 18%; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(4, 5, 13, .62), rgba(4, 5, 13, .25) 45%, transparent 70%); filter: blur(10px); }
.hero-hint { position: absolute; left: 50%; bottom: 112px; transform: translateX(-50%); font-size: 12px; letter-spacing: .25em; color: var(--ink-faint);
  opacity: 0; animation: riseInV 1.4s 2.6s var(--ease-out) forwards; white-space: nowrap; }
.hero { cursor: inherit; }

/* ===== 夜空の札 ===== */
.sky-tip { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: center;
  padding: 12px 16px; border-radius: 16px; background: rgba(14, 12, 28, .82); border: 1px solid rgba(255, 200, 140, .3); backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8), 0 0 40px -12px rgba(255, 150, 60, .6); font-size: 13px; white-space: nowrap;
  opacity: 0; transition: opacity .3s, transform .25s var(--ease-out); }
.sky-tip.on { opacity: 1; }
.sky-tip i { grid-row: span 3; width: 10px; height: 10px; border-radius: 50%; }
.sky-tip b { font-family: var(--mincho); font-size: 16px; }
.sky-tip span { color: var(--ink-dim); }
.sky-tip em { font-style: normal; color: var(--ember-hot); font-variant-numeric: tabular-nums; }

/* ===== 幕開け ===== */
#intro { position: fixed; inset: 0; z-index: 99; background: rgb(3, 4, 10); display: grid; place-items: center; }
.intro-stage { position: relative; display: grid; justify-items: center; gap: 26px; }
.intro-lantern { width: 110px; height: auto; overflow: visible; will-change: transform; }
.intro-lantern .i-lit, .intro-lantern .i-flame, .intro-lantern .i-halo { opacity: 0; transform-box: fill-box; transform-origin: center; }
.intro-spark { position: absolute; top: 74px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, #fff 0 30%, #ffb347 60%, transparent 72%); box-shadow: 0 0 16px #ffb347, 0 0 40px #ff7a3d; }
.intro-words { margin: 0; font-family: var(--mincho); font-size: clamp(20px, 3vw, 28px); letter-spacing: .35em; height: 1.5em; }
.intro-words span { display: inline-block; opacity: 0; transform: translateY(8px); filter: blur(6px); }
.intro-words span.lit { color: var(--ember-hot); text-shadow: 0 0 18px rgba(255, 179, 71, .9); }
#intro.words .intro-words span { transition: opacity .8s var(--ease-out) calc(var(--i) * 70ms), transform .9s var(--ease-out) calc(var(--i) * 70ms), filter .8s calc(var(--i) * 70ms); opacity: 1; transform: none; filter: none; }
#intro.leaving .intro-words span { transition: opacity .5s, filter .5s; transition-delay: 0s; opacity: 0; filter: blur(8px); }
#intro.leaving .intro-skip { opacity: 0; }
.intro-skip { position: absolute; right: 22px; bottom: 22px; background: none; border: 1px solid rgba(255, 228, 190, .2); color: var(--ink-faint);
  border-radius: 999px; padding: 6px 16px; font-size: 12px; letter-spacing: .2em; transition: opacity .4s; }
.intro-running #view *, .intro-running #view *::before, .intro-running #view *::after { animation-play-state: paused !important; }
.intro-running .mode-badge { opacity: 0; }
@media (max-width: 860px) { .hero-hint { display: none; } .sky-tip { white-space: normal; max-width: 70vw; } }

/* 夜空のページ：見出しの裏に薄い影 */
.sky-page .wrap { position: relative; }
.sky-page .wrap::before { content: ""; position: absolute; left: -8%; top: -30px; width: min(760px, 110%); height: calc(100% + 60px); z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at 30% 50%, rgba(4, 5, 13, .7), rgba(4, 5, 13, .3) 50%, transparent 72%); filter: blur(12px); }
.sky-page h1, .sky-page .lead, .sky-legend { text-shadow: 0 1px 14px rgba(4, 5, 13, .95); }

/* ===== 物語の場面（三つ折りの便箋） ===== */
.s3 { --pw: min(290px, 64vw, 40vh); --ph: calc(var(--pw) * 1.32); --fs: calc(var(--pw) * .074);
  position: relative; width: 100%; height: 100%; display: grid; place-items: center; perspective: 1400px; perspective-origin: 50% 35%; }
.s3-scene { position: relative; width: var(--pw); height: var(--ph); transform-style: preserve-3d; will-change: transform, opacity; }
.s3-paper { position: absolute; inset: 0; transform-style: preserve-3d; }
.s3-panel { position: absolute; left: 0; width: 100%; height: calc(var(--ph) / 3 + .5px); transform-style: preserve-3d; will-change: transform; }
.s3-top { top: 0; transform-origin: 50% 100%; z-index: 2; }
.s3-mid { top: calc(var(--ph) / 3); }
.s3-bot { top: calc(var(--ph) * 2 / 3); transform-origin: 50% 0; z-index: 1; }
.s3-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden;
  background: #f6efe2; padding: calc(var(--pw) * .07) calc(var(--pw) * .09) 0; color: #3a2a2e; font-family: var(--hand); font-size: var(--fs); line-height: 2;
  background-image: linear-gradient(transparent calc(2em - 1px), rgba(90, 60, 40, .13) 1px), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.05 .8' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 .4 0 0 0 0 .3 0 0 0 0 .2 0 0 0 .08 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  background-size: 100% 2em, auto; background-position: 0 calc(var(--pw) * .07), 0 0; }
.s3-top .s3-face { border-radius: 4px 4px 0 0; }
.s3-bot .s3-face.s3-front { border-radius: 0 0 4px 4px; padding-top: 0; }
.s3-mid .s3-face { padding-top: 0; box-shadow: inset 0 1px 0 rgba(90, 60, 40, .12), inset 0 -1px 0 rgba(90, 60, 40, .12); }
.s3-back { transform: rotateX(180deg); background: #e9dfcb; box-shadow: inset 0 0 40px rgba(90, 60, 40, .18); }
.s3-back i { position: absolute; inset: 18% 22%; border: 1px solid rgba(160, 60, 50, .25); border-radius: 3px; }
.s3-line { height: 2em; white-space: nowrap; }
.s3-line span { display: inline-block; }
.s3-line { clip-path: inset(-20% 100% -20% 0); }
.s3-line.to { font-size: 1.05em; }
.s3-line.from { text-align: right; padding-right: 2.6em; }
.s3-seal { position: absolute; right: calc(var(--pw) * .08); bottom: calc(var(--pw) * .07); width: 2.1em; height: 2.1em; border-radius: 6px; background: #c62f2f; color: #fff6ee;
  display: grid; place-items: center; font-family: var(--mincho); font-weight: 800; font-size: var(--fs); transform: rotate(-6deg); box-shadow: inset 0 0 0 2px rgba(255, 246, 238, .55); }
.s3-amt { position: absolute; left: calc(var(--pw) * .08); bottom: calc(var(--pw) * .06); width: 3.4em; height: 3.4em; border-radius: 50%; border: 2px solid rgba(198, 47, 47, .75);
  color: #b3243b; font-family: var(--mincho); font-weight: 800; font-size: calc(var(--fs) * .62); line-height: 1.25; display: grid; place-items: center; text-align: center; opacity: 0; }
.s3-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: var(--heat, 0);
  background: radial-gradient(ellipse at 50% 120%, rgba(255, 150, 50, .42), rgba(255, 170, 80, .12) 60%, transparent 85%); }
.s3-top .s3-face::after { background: radial-gradient(ellipse at 50% 320%, rgba(255, 150, 50, .35), rgba(255, 170, 80, .08) 60%, transparent 85%); }
.s3-back::after { display: none; }
.s3-cord { position: absolute; left: -6%; right: -6%; top: 50%; height: calc(var(--pw) * .05); margin-top: calc(var(--pw) * -.025); transform-origin: 50% 50%; opacity: 0;
  background: linear-gradient(#e94b4b, #b31d2a 45%, #f2f2ee 46%, #fff 55%, #d9c27a 56%, #b8932e); border-radius: 3px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
.s3-cord i { position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * .16); height: calc(var(--pw) * .16); margin: calc(var(--pw) * -.08) 0 0 calc(var(--pw) * -.08);
  border-radius: 50%; border: calc(var(--pw) * .022) solid #c62f2f; box-shadow: inset 0 0 0 calc(var(--pw) * .012) #f2e3b0, 0 2px 6px rgba(0, 0, 0, .3); }
.s3-embers { position: absolute; inset: 0; pointer-events: none; opacity: 0; transform: translateZ(10px); }
.s3-embers b { position: absolute; left: var(--x); bottom: 10%; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #fffbe8, #ffb347 50%, transparent 70%);
  box-shadow: 0 0 10px #ffb347; animation: s3ember 2.4s var(--d) linear infinite; transform: scale(var(--s)); }
@keyframes s3ember { 0% { transform: translateY(0) scale(var(--s)); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(10px, calc(var(--ph) * -.9)) scale(0); opacity: 0; } }
.s3-glow { position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * 2.2); height: calc(var(--pw) * 2.2); margin: calc(var(--pw) * -1.1) 0 0 calc(var(--pw) * -1.1);
  border-radius: 50%; background: radial-gradient(circle, rgba(255, 170, 80, .55), rgba(255, 120, 40, .15) 45%, transparent 68%); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.s3-lantern-wrap { position: absolute; left: 50%; top: 50%; width: calc(var(--pw) * .62); margin-left: calc(var(--pw) * -.31); margin-top: calc(var(--pw) * -.44); opacity: 0; will-change: transform, opacity; }
.s3-lantern { width: 100%; height: auto; display: block; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite; filter: drop-shadow(0 0 24px rgba(255, 160, 70, .8)); }
.s3-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: s3flame .18s ease-in-out infinite alternate; }
@keyframes s3flame { to { transform: scale(.94, 1.05); } }
@media (max-width: 860px) { .s3 { --pw: min(210px, 56vw, 24vh); } .story-stage { align-items: start; } }
