/* Scroll story of the start page: stage, chapters, approval card, mail card. */
.progress { position: fixed; z-index: 31; inset: 0 0 auto 0; height: 2px; }
.progress i { display: block; height: 100%; background: var(--signal); transform-origin: 0 50%; transform: scaleX(0); }

#story { position: relative; height: 940vh; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden;
  background: radial-gradient(120% 90% at 72% 42%, #0C2F63 0%, #06142E 45%, #020712 100%); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.copy { position: absolute; left: var(--gutter); top: 50%; width: min(34vw, 470px); transform: translateY(-50%); opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s linear .45s; }
.copy.on { opacity: 1; visibility: visible; transition: opacity .45s ease, visibility 0s; }
.copy h1, .copy h2 { font-family: var(--display); font-weight: 500; letter-spacing: -0.015em; margin: 0 0 20px; text-wrap: balance; }
.copy h1 { font-size: clamp(34px, 3.5vw, 58px); line-height: 1.04; }
.copy h2 { font-size: clamp(30px, 2.9vw, 46px); line-height: 1.08; }
.copy p { font-size: clamp(16px, 1.2vw, 19px); line-height: 1.55; color: var(--on-dark-muted); margin: 0 0 14px; max-width: 30em; }
.copy .cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.copy .step { font-size: 14px; color: var(--on-dark-muted); margin: 0 0 14px; }
.stats { display: flex; gap: 36px; margin: 26px 0 6px; }
.stats b { display: block; font: 500 44px/1 var(--display); letter-spacing: -0.02em; color: var(--on-dark); }
.stats span { font-size: 14px; color: var(--on-dark-muted); }
.hint { position: absolute; left: var(--gutter); bottom: 28px; font-size: 14px; color: var(--on-dark-muted); display: flex; align-items: center; gap: 12px; transition: opacity .4s; }
.hint i { display: block; width: 1px; height: 34px; background: linear-gradient(var(--ice), transparent); transform-origin: 50% 0; }

.rail { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.rail button { display: block; width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 1px solid rgba(169, 190, 221, .7); background: transparent; cursor: pointer; }
.rail button[aria-current="step"] { background: var(--on-dark); border-color: var(--on-dark); }

/* approval card: the product, in its own light layer */
.card { position: absolute; left: 0; top: 0; width: 372px; background: var(--surface); color: var(--ink); border-radius: 14px; font-size: 14px; line-height: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); opacity: 0; pointer-events: none; will-change: transform, opacity; }
.card section { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.card section:last-child { border-bottom: 0; }
.card h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.card p { margin: 0; }
.card .sum { font: 500 22px/30px var(--num); font-variant-numeric: tabular-nums; }
.card .sum { white-space: nowrap; }
.card .sum small { font-size: 13px; color: var(--muted); }
.card .who { color: var(--muted); font-size: 13px; }
.card .badge { position: absolute; right: 16px; top: 13px; display: inline-flex; gap: 7px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 11px 2px 9px; font-size: 13px; }
.card .badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--waiting); }
.card .why { display: grid; grid-template-columns: 16px 1fr auto; gap: 3px 8px; align-items: center; }
.card .why .ok { color: var(--done); font-weight: 600; } .card .why .warn { color: var(--alert); font-weight: 600; }
.card .why em { font-style: normal; font-size: 13px; color: var(--action); border: 1px solid var(--line); border-radius: 6px; padding: 0 7px; }
.card .acts { display: flex; gap: 8px; align-items: center; }
.card .btn { font: 500 14px/20px var(--text); padding: 8px 15px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.card .btn.go { background: var(--action); border-color: var(--action); color: #fff; transition: transform .15s, background .15s; }
.card.press .btn.go { transform: scale(.94); background: #123AA6; }
.card .result { display: none; color: var(--done); font-weight: 500; }
.card.done .acts .btn { display: none; }
.card.done .result { display: block; }
.card.done .badge::before { background: var(--done); }
.card .subj { font-weight: 600; font-size: 15px; }
.card.mail { width: 404px; }
.card .btn { white-space: nowrap; }
.card.mail .body p { margin: 0 0 8px; }
.card.mail .body p:last-child { margin-bottom: 0; }
.card .cursor { position: absolute; left: 0; top: 0; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: rgba(14, 23, 38, .28); box-shadow: 0 0 0 2px #fff; opacity: 0; }

@media (max-width: 900px) {
  .copy { top: auto; bottom: 56px; width: auto; right: var(--gutter); transform: none; }
  .copy h1 { font-size: 32px; } .copy h2 { font-size: 27px; margin-bottom: 12px; }
  .copy p { font-size: 15px; } .copy .cta { margin-top: 16px; }
  .stats { margin: 14px 0 4px; } .stats b { font-size: 32px; }
  .hint { display: none; }
  .rail { right: 10px; top: 30%; }
  .card { width: min(340px, 88vw); font-size: 13px; }
  .card section { padding: 9px 14px; }
  .card .sum { font-size: 19px; line-height: 26px; }
  .card.mail { width: min(340px, 88vw); }
  .card.mail .basis, .card.mail .opt, .card.mail .acts .btn:nth-child(3) { display: none; }
}
.frozen .copy, .frozen .copy.on, .frozen .hint { transition: none; }
@media (prefers-reduced-motion: reduce) { .copy, .copy.on, .card .btn.go { transition: none; } }

/* movement without a library: the lines of a chapter rise in, the scroll hint breathes */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes breathe { from { transform: scaleY(0); opacity: 1; } to { transform: scaleY(1); opacity: .2; } }
.copy.on > * { animation: rise .7s cubic-bezier(.33, 1, .68, 1) both; }
.copy.on > :nth-child(2) { animation-delay: 70ms; }
.copy.on > :nth-child(3) { animation-delay: 140ms; }
.copy.on > :nth-child(4) { animation-delay: 210ms; }
.copy.on > :nth-child(5) { animation-delay: 280ms; }
.hint i { animation: breathe 1.6s ease-in-out infinite alternate; }
.copy .note { font-size: 14px; }
.copy.first > *, .frozen .copy.on > *, .frozen .hint i { animation: none; }
@media (prefers-reduced-motion: reduce) { .copy.on > *, .hint i { animation: none; } }

.copy.first { transition: none; }
@media (max-width: 900px) { .copy .cta { gap: 10px; } .copy .cta .pill { padding: 11px 16px; font-size: 14px; } }
