:root {
  color-scheme: dark;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: #f8f4e9;
  background: #060d1c;
  --ink: #f8f4e9;
  --muted: #afc0cf;
  --aqua: #b5eeec;
  --gutter: max(clamp(20px, 5vw, 90px), calc((100vw - 1580px) / 2));
}
*, *::before, *::after { box-sizing: border-box; }
html { overflow-anchor: none; }
body, h1, h2, h3, p, ol { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--aqua); outline-offset: 4px; }
.frame { padding-inline: var(--gutter); }
.hero { position: relative; overflow: clip; background: #050a14; min-height: 100svh; }
.hero::before, .stage::before { content: ""; position: absolute; pointer-events: none; }
.hero::before {
  z-index: 0; inset: 0;
  background: radial-gradient(ellipse at 65% 40%, #1a2f44 0%, #0a172a 34%, #060d1c 72%);
}
.masthead, footer { display: flex; justify-content: space-between; align-items: center; }
.masthead { height: clamp(64px, 7vw, 102px); position: relative; display: grid; grid-template-columns: 1fr auto; }
.brand { font-size: clamp(24px, 2vw, 32px); font-weight: 740; letter-spacing: -.065em; }
.masthead .brand { opacity: 0; }
.masthead .brand.returning { opacity: 1; animation: return-name 420ms cubic-bezier(.2,.65,.3,1) both; }
@keyframes return-name { from { opacity: 0; } to { opacity: 1; } }
.masthead .brand { justify-self: start; }
#skip, #project-links { grid-area: 1 / 2; justify-self: end; }
#skip { position: relative; z-index: 5; }
#skip:not([hidden]) ~ #project-links { visibility: hidden; }
#room-shade { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 3; pointer-events: none; }
body:has(.how :focus-visible, footer :focus-visible) #room-shade { opacity: 0; }
#room-shade:not(.painted) { background: #030711; }
.masthead a:not(.brand), #back { color: #d0dbe2; font-size: .91rem; }
.theater {
  display: grid; position: relative; align-items: center; column-gap: 2%;
  grid-template-columns: minmax(0, 40fr) minmax(0, 33fr) minmax(0, 23fr);
  min-height: clamp(540px, 70svh, 850px); padding: 18px var(--gutter);
}
.stage { position: absolute; inset: 0; isolation: isolate; pointer-events: none; }
.stage::before {
  inset: 0 0 0 15%; opacity: .16;
  background: url("./art/backdrop.webp") center / 100% 100% no-repeat;
  mask-image: radial-gradient(ellipse closest-side, black 40%, transparent 97%);
}
.glass {
  position: absolute; left: 59%; top: 50%; width: min(36vw, 590px); aspect-ratio: 1;
  transform: translate(-50%, -50%); mix-blend-mode: screen;
  --aura: .13; --reflection: .09;
}
#key { display: block; width: 100%; height: 100%; opacity: .94; }
.glass::before, .glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  transition: opacity 240ms ease-out;
}
.glass::before {
  /* Give the halo room to fade beyond the square artwork. */
  inset: -25%;
  opacity: var(--aura);
  background: radial-gradient(ellipse 26.67% 26.67% at 43.2% 38%, #63e0f445 41%, #64e9ff8a 60%, #4595c82b 80%, transparent 100%),
              radial-gradient(ellipse 12.67% 16% at 60% 64.67%, #74cbe165, transparent 100%);
}
.glass::after {
  opacity: var(--reflection); mix-blend-mode: screen;
  mask: url("./art/glass-key.webp") center / contain no-repeat;
  background: radial-gradient(ellipse 27% 27% at 39.8% 32%, #daffff80, #68daef3b 52%, #a6f7ff94 86%, transparent),
              linear-gradient(125deg, transparent 24%, #92dcff55 43%, transparent 54%, #78dbda7a 70%, transparent 87%);
}
.glass[data-light="contact"] { --aura: .37; --reflection: .31; }
.glass[data-light="active"] { --aura: 1; --reflection: 1; }
.stage canvas { position: absolute; width: 100%; height: 100%; inset: 0; }
.bay { grid-column: 1; display: grid; align-items: center; position: relative; min-width: 0; }
.bay > * { grid-area: 1 / 1; }
.request[inert] { visibility: hidden; }
.hero > .request[inert] { visibility: visible; }
.intro { max-width: 550px; }
h1 { font-size: clamp(42px, 4.35vw, 80px); font-weight: 470; line-height: 1.015; letter-spacing: -.066em; }
h1 span { display: block; color: #bdd9e2; }
.intro > p:first-of-type { max-width: 31ch; margin-block: 18px 24px; color: #cfdae1; line-height: 1.48; font-size: clamp(1rem, 1.3vw, 1.32rem); }
.primary, .secondary { border: 1px solid transparent; border-radius: 99px; min-height: 44px; padding: .65em 1.35em; font-weight: 650; }
.primary { color: #0d1d28; background: #e5f4ef; }
.secondary { color: var(--ink); background: #09162455; border-color: #667d93; }
.text-button, .lease-action { color: #cbdae3; border: 0; background: transparent; text-decoration: underline; text-underline-offset: .25em; min-height: 44px; }
.details { font-size: .83rem; color: var(--muted); }

.request {
  position: relative; z-index: 4; width: min(100%, 368px); padding: clamp(20px,2.1vw,32px); border-radius: 27px;
}
.source { color: #cce8ef; font-size: .82rem; font-weight: 650; }

.request h2 { margin: 13px 0 7px; font-size: clamp(1.4rem, 2.2vw, 2rem); letter-spacing: -.045em; }
.request p { line-height: 1.45; }
.request .details { margin-block: 8px 16px; }
.details b { letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.decisions { display: flex; gap: 9px; }
.decisions button { flex: 1; }

#leases { grid-column: 3; width: 100%; max-width: 280px; justify-self: end; display: grid; z-index: 1; }
.lease-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.lease-host { letter-spacing: -.025em; }
.remaining { font-size: .76rem; font-variant-numeric: tabular-nums; }
.lease-agent, .lease-status { font-size: .79rem; color: #d7ecf7; margin-top: 3px; }
#project-links { display: flex; align-items: center; gap: 18px; }
#project-links a, #how-link { display: inline-flex; align-items: center; min-height: 44px; gap: 7px; }
#stars { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
#how-link { position: relative; width: fit-content; margin: 0 auto; display: flex; font-size: .9rem; color: #cfdae1; }
.hero:not([data-revealed="true"]) :is(#how-link, #project-links) { visibility: hidden; }
.hero .theater, .hero .masthead, #how-link {
  transition: opacity 360ms cubic-bezier(.2,.7,.2,1), transform 420ms cubic-bezier(.2,.7,.2,1);
}
.hero[data-departed="true"] .theater { opacity: 0; transform: translate3d(0, -34px, 0); }
.hero[data-departed="true"] :is(.masthead, #how-link) { opacity: 0; transform: translate3d(0, -16px, 0); }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.stores { display: flex; flex-wrap: wrap; gap: 8px; }
.stores a {
  display: grid; align-content: center; gap: 2px; min-height: 44px; padding: 6px 15px;
  border-radius: 15px; font-size: .84rem; font-weight: 650; color: #e3eeef;
  background: linear-gradient(155deg, #c7e1e520, #a6cbdd0b);
  box-shadow: inset 0 1px 2px #effaff40, inset 0 -1px 2px #99bec827;
}
.stores small { color: #b3c6d1; font-weight: 400; font-size: .71rem; }
.how, footer { border-top: 1px solid #293745; }
footer { position: relative; z-index: 4; min-height: 74px; background: #060d1c; }
footer span { color: var(--muted); line-height: 1.46; font-size: .85rem; }
@media (hover: hover) { .primary:hover { background: white; } .secondary:hover { border-color: #bbebee; } .lease-action:hover { background-color: #ffffff38; } .text-button:hover { color: white; } }
@media (max-width: 920px) {
  .theater { display: flex; flex-direction: column; align-items: stretch; min-height: 0; padding: 0 0 12px; gap: 12px; }
  .stage { position: relative; inset: auto; width: 100%; height: clamp(196px, 48vw, 300px); flex: none; }
  .glass { width: auto; height: 100%; left: 52%; }
  .bay, #leases { width: min(calc(100% - 2 * var(--gutter)), 480px); margin-inline: auto; }
  .bay { min-height: 255px; }
  .request { width: 100%; }
  #leases { max-width: none; }
  .lease-action { min-height: 44px; }
  h1 { font-size: clamp(36px, 7.7vw, 52px); }
  .intro > p:first-of-type { margin: 10px 0 15px; }
  .hero { min-height: 100svh; }
}
@media (prefers-reduced-motion: reduce) {
  .glass::before, .glass::after, .hero .theater, .hero .masthead, #how-link { transition: none; }
  .hero[data-departed="true"] :is(.theater, .masthead, #how-link) { opacity: 1; transform: none; }
  .masthead .brand.returning { opacity: 1; animation: none; }
}

.outgoing, #notice { position: absolute; left: var(--lens-x); top: var(--lens-y); pointer-events: none; }
#incoming-data { position: absolute; left: var(--lens-x); top: var(--lens-y); pointer-events: none; }
#incoming-data i {
  position: absolute; bottom: 3px; right: 1px; color: #fff1ca; text-shadow: 0 0 5px #ffcf819c;
  font: 600 11px/1 ui-monospace, monospace; animation: incoming-byte 1800ms linear infinite;
}
#incoming-data i:nth-child(2) { animation-delay: -600ms; }
#incoming-data i:nth-child(3) { animation-delay: -1200ms; }
@keyframes incoming-byte {
  0% { transform: translate(var(--in-x), var(--in-y)); opacity: 0; }
  12%, 86% { opacity: 1; }
  100% { transform: translate(0,0); opacity: 0; }
}
.outgoing i {
  position: absolute; width: 4px; height: 2px; top: -1px; border-radius: 50%;
  background: var(--color); box-shadow: 0 0 4px 1px var(--color);
  --dy: calc(var(--dx) * (var(--out-slope) + var(--lane) * var(--out-spread)));
}
#flow { --dx: var(--flow-length); }
#flow i { animation: flow 1350ms linear infinite; }
#flow i:nth-child(2) { animation-delay: -290ms; }
#flow i:nth-child(3) { animation-delay: -820ms; }
#flow i:nth-child(4) { animation-delay: -530ms; }
#flow i:nth-child(5) { animation-delay: -1070ms; }
@keyframes flow {
  0% { transform: translate(0,0); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translate(var(--dx),var(--dy)); opacity: 0; }
}
#scatter { --dx: calc(var(--progress) * var(--out-length)); }
#scatter i { transform: translate(var(--dx),var(--dy)); opacity: calc(1 - var(--progress) * .65); }
#notice {
  z-index: 4; margin: 19px 0 0 17px; font-size: .84rem; font-weight: 600; letter-spacing: .01em;
  color: #fff1e6; background: #263342e8; border-radius: 99px; padding: 8px 15px;
  box-shadow: inset 0 1px 2px #e4f2fd62, 0 4px 18px #05111f55;
  backdrop-filter: blur(10px); opacity: 1; transition: opacity 100ms;
}
#notice:empty { opacity: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.request.leaving[inert] { visibility: visible; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .outgoing, #incoming-data { display: none; }
  #flow i { animation: none; }
}

/* Light reflected by the scene stays behind active lease cards only. */
#leases { position: relative; isolation: isolate; gap: 10px; }
#leases:has(.lease[data-status="active"], .lease[data-status="ending"])::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -42px -30px;
  border-radius: 40%; mask-image: radial-gradient(ellipse closest-side, #000 58%, transparent);
  background: radial-gradient(ellipse 98% 132% at 3% 136%, transparent 56%, #3986c751 62%, #8bcee466 65%, transparent 71%),
              radial-gradient(ellipse at 22% 23%, #367ebe66, transparent 54%),
              radial-gradient(ellipse at 87% 73%, #2b868373, transparent 52%);
}
.request, .lease {
  --tint: #145d9b7a; --reflex: #67bbf53d; --rim: #9edcf2;
  isolation: isolate; color: #f4fbff;
  background:
    radial-gradient(ellipse 77% 80% at 8% -55%, transparent 62%, var(--reflex) 77%, transparent 94%),
    radial-gradient(ellipse 91% 49% at 18% -13%, var(--reflex), transparent 96%),
    radial-gradient(ellipse 63% 25% at 84% 107%, var(--reflex), transparent),
    linear-gradient(144deg, var(--tint), #05244759 52%, var(--tint));
  -webkit-backdrop-filter: blur(2px) saturate(1.35) brightness(var(--transmission, .82));
  backdrop-filter: blur(2px) saturate(1.35) brightness(var(--transmission, .82));
  box-shadow: inset 1px 2px 5px -3px #e6ffffc4, inset -2px -3px 7px -4px var(--rim),
              0 3px 6px -3px #010815a6, 0 17px 25px -10px #010610e8,
              0 22px 40px -18px var(--reflex);
}
.request::before, .lease::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1.5px;
  background: conic-gradient(from 0deg, #81b8da42, #42759529 13%, var(--rim) 29%, #719ab242 39%,
              #abcdd240 50%, var(--rim) 62%, #45698540 73%, #f1ffffed 86%, #81b8da42 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.lease { --transmission: .64; position: relative; padding: 11px 20px 9px; border-radius: 23px; }
.lease[data-status="active"] { --tint: #08636394; --reflex: #5be4d83b; --rim: #a6f6e7; }
@media (min-width: 921px) {
  .hero[data-state="pending"] .intro { opacity: .035; }
}
.request .source, .request .details { color: #d7ecf7; }
.request .primary { color: #fff; border: 0; background: linear-gradient(#2b65bd, #144488); box-shadow: inset 0 1px 1px #a4d2ff9c, 0 3px 9px #0107145c; }
.request .secondary { color: #ecf8ff; border-color: #7caed65c; background: #071a3380; }
.lease-action {
  display: inline-block; min-height: 30px; margin-top: 5px; padding: 2px 12px; border-radius: 99px;
  color: #ecf8ff; font-size: .79rem; font-weight: 600; text-decoration: none;
  border: 0; background: linear-gradient(#4578a75c, #071e356b);
  box-shadow: inset 0 1px 1px #c8edff8a, inset 0 -1px 1px #84b7ce42, 0 2px 5px #0109144d;
}
.bay, .theater > .request { grid-row: 1; grid-column: 1; }
#leases { grid-row: 1; }
#menu-toggle, #mobile-stores { display: none; }
#menu-links { display: flex; gap: 18px; align-items: center; }

@media (max-width: 920px) {
  .theater {
    --scene-height: clamp(260px, min(35svh, 58vw), 332px);
    display: grid; grid-template-columns: 100%; grid-template-rows: var(--scene-height) auto auto;
    gap: 0; align-content: start; align-items: start; padding-bottom: 0;
  }
  .stage { grid-area: 1 / 1; height: var(--scene-height); }
  .glass { height: 95%; top: 48%; }
  .bay, #leases { width: min(calc(100% - 32px), 560px); }
  .bay { grid-area: 2 / 1; min-height: 0; padding: 12px 3px; }
  .intro { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .intro h1 { grid-area: 1 / 1; font-size: clamp(24px, 4.6vw, 35px); }
  .intro .actions { grid-area: 1 / 2; }
  .intro > p:first-of-type { grid-area: 2 / 1 / 3 / 3; margin: 0; max-width: 48ch; }
  .bay #next { min-height: 46px; padding-inline: 17px; font-size: .88rem; }
  .intro { max-width: none; }
  #leases { grid-area: 3 / 1; gap: 8px; }
  #leases:not(:empty) { margin-top: 6px; }
  .lease {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px;
    padding: 12px 16px; border-radius: 21px;
  }
  .lease-top { grid-column: 1 / -1; }
  .lease-agent, .lease-status { grid-column: 1; }
  .lease-action { grid-column: 2; grid-row: 2 / 4; margin: 0; min-height: 44px; }
  .theater > .request {
    grid-area: auto; position: absolute; top: calc(var(--scene-height) - 45px);
    left: 0; right: 0; margin: 0 auto; width: min(calc(100% - 20px), 560px);
    padding: 25px clamp(20px, 5vw, 30px) 20px; border-radius: 28px;
  }
  .request::after { content: ""; position: absolute; top: 9px; left: calc(50% - 16px); width: 32px; height: 4px; border-radius: 4px; background: #b6d8ec78; pointer-events: none; }
  .request h2 { margin-top: 8px; }
  .request .primary, .request .secondary { min-height: 50px; }
  .hero[data-state="pending"] .theater { min-height: calc(var(--scene-height) + 206px); }
  .hero[data-state="pending"] .bay, .hero[data-state="pending"] #leases { visibility: hidden; }
  #mobile-stores { display: block; width: min(calc(100% - 40px), 552px); margin: 16px auto; position: relative; }
  .hero:not([data-revealed="true"]) #mobile-stores, .hero[data-state="pending"] #mobile-stores { visibility: hidden; }
  #menu-toggle { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; gap: 8px; border: 0; border-radius: 22px; background: #b9d8ea28; box-shadow: inset 0 1px 2px #f3ffff65; color: var(--ink); }
  #menu-toggle::before { content: ""; width: 13px; height: 5px; border-block: 1.5px solid currentColor; }
  #project-links { position: relative; z-index: 5; }
  #menu-links { display: none; position: absolute; right: 0; top: calc(100% + 5px); min-width: 142px; padding: 5px 10px; border-radius: 17px; background: #142b40f2; box-shadow: inset 0 1px #d3efff55, 0 9px 20px #02081270; }
  #menu-toggle[aria-expanded="true"] + #menu-links { display: grid; gap: 0; }
  #menu-links a { padding-inline: 8px; }
  #notice { margin-top: 12px; }
}
.request .match::before { content: " · "; }
@media (max-width: 920px) {
  .request .match { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; padding: 11px 15px; border-radius: 13px; background: #03132b52; box-shadow: inset 0 1px 2px #00091240, 0 1px #a1d8ff38; }
  .request .match::before { content: none; }
  .request .match b { font: 600 1.24rem ui-monospace, monospace; letter-spacing: .18em; color: #e9f8ff; }
}
@media (max-width: 920px) and (min-height: 590px) {
  .theater > .request {
    position: fixed; top: auto; bottom: max(12px, env(safe-area-inset-bottom)); max-height: 75svh;
    overflow: auto; overscroll-behavior: contain; padding-block: 29px 20px;
  }
  .request .decisions { margin-top: 17px; }
}

/* ── How it works: scroll-driven optical story ── */
.how {
  position: relative; z-index: 4;
  overflow-x: clip;
  background: radial-gradient(ellipse 76% 42% at 72% 14%, #11243b5c 0%, #071122 52%, #060d1c 100%), #060d1c;
  padding-block: 0 clamp(48px, 6vw, 96px);
}
.how dl, .how dd, .how ul { margin: 0; }
.how-intro {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 40px 0;
  opacity: .34;
  transition: opacity 280ms ease-out;
}
.how-intro[data-active="true"], .how-intro:focus-within { opacity: 1; }
.how-kicker {
  font-size: .82rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase;
  color: var(--aqua); margin-bottom: 12px;
}
.how-intro h2 {
  max-width: 16ch;
  font-size: clamp(32px, 3.8vw, 58px); font-weight: 470; line-height: 1.04; letter-spacing: -.06em;
  color: var(--ink);
}
.how-points {
  list-style: none; padding: 0; margin-top: 22px;
  display: grid; gap: 12px; max-width: 44ch;
}
.how-points li {
  position: relative; padding-left: 18px;
  color: #c7d5e2; font-size: clamp(.96rem, 1.12vw, 1.08rem); line-height: 1.5;
}
.how-points li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--aqua); box-shadow: 0 0 8px #8be8e688;
}

.how-story {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  column-gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.story-chapters { grid-column: 1; grid-row: 1; min-width: 0; }
.story-stage-wrap {
  grid-column: 2; grid-row: 1;
  position: sticky; top: 0;
  height: 100svh;
  display: flex; align-items: center; justify-content: center;
  min-width: 0;
}

.story-list { list-style: none; padding: 0; display: grid; }
.story-step {
  min-height: 82svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 36px 0;
  position: relative;
  scroll-margin-top: 0;
  opacity: .34;
  transition: opacity 280ms ease-out;
}
.story-step:last-child { min-height: 100svh; }
.story-step[data-active="true"], .story-step:focus-within { opacity: 1; }

.story-step h3 {
  font-size: clamp(26px, 2.7vw, 42px); font-weight: 480; line-height: 1.08;
  letter-spacing: -.05em; color: var(--ink); max-width: 18ch;
}
.story-step p {
  margin-top: 14px; max-width: 40ch;
  color: #c7d5e2; font-size: clamp(.98rem, 1.18vw, 1.14rem); line-height: 1.54;
}

.story-finale { padding-block: 48px; }
.how-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.how-actions a { display: inline-flex; align-items: center; justify-content: center; }
.how-stores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.how-stores a {
  display: grid; align-content: center; gap: 2px; min-height: 44px; padding: 6px 15px;
  border-radius: 15px; font-size: .84rem; font-weight: 650; color: #e3eeef;
  background: linear-gradient(155deg, #c7e1e520, #a6cbdd0b);
  box-shadow: inset 0 1px 2px #effaff40, inset 0 -1px 2px #99bec827;
}
.how-stores small { color: #b3c6d1; font-weight: 400; font-size: .71rem; }
.story-finale #back {
  display: inline-flex; align-items: center; min-height: 44px; margin-top: 18px;
  width: fit-content; color: #c7d6e3; font-size: .9rem;
}
@media (hover: hover) {
  .story-finale #back:hover { color: #ffffff; }
}

/* ── Frameless Sticky Optical Stage (floats directly on page background) ── */
.story-stage {
  position: relative;
  width: 100%;
  height: clamp(460px, 74svh, 600px);
  overflow: visible;
  isolation: isolate;
  background: transparent;
}
#story-canvas {
  position: absolute; inset: -48px -64px; width: calc(100% + 128px); height: calc(100% + 96px);
  z-index: 1; pointer-events: none;
}

.story-glass {
  position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none;
  mix-blend-mode: screen;
  will-change: transform, opacity;
  --aura: .18; --reflection: .14;
}
.story-key-img { display: block; width: 100%; height: 100%; opacity: .94; }
.story-glass::before, .story-glass::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  transition: opacity 260ms ease-out;
}
.story-glass::before {
  inset: -25%; opacity: var(--aura);
  background:
    radial-gradient(ellipse 26.67% 26.67% at 43.2% 38%, #63e0f448 41%, #64e9ff8f 60%, #4595c82e 80%, transparent 100%),
    radial-gradient(ellipse 12.67% 16% at 60% 64.67%, #74cbe166, transparent 100%);
}
.story-glass::after {
  opacity: var(--reflection); mix-blend-mode: screen;
  mask: url("./art/glass-key.webp") center / contain no-repeat;
  background:
    radial-gradient(ellipse 27% 27% at 39.8% 32%, #daffff80, #68daef3b 52%, #a6f7ff94 86%, transparent),
    linear-gradient(125deg, transparent 24%, #92dcff55 43%, transparent 54%, #78dbda7a 70%, transparent 87%);
}
.story-glass[data-light="contact"] { --aura: .44; --reflection: .38; }
.story-glass[data-light="active"] { --aura: .95; --reflection: .92; }

/* ── Glass "Water Drop" Cards (clear, bright refractive rim, deep clear blue) ── */
.glass-drop {
  --tint: #145d9b7a; --reflex: #67bbf53d; --rim: #9edcf2;
  position: relative; isolation: isolate; color: #f4fbff;
  border-radius: 22px; padding: 16px 18px;
  background:
    radial-gradient(ellipse 77% 80% at 8% -55%, transparent 62%, var(--reflex) 77%, transparent 94%),
    radial-gradient(ellipse 91% 49% at 18% -13%, var(--reflex), transparent 96%),
    radial-gradient(ellipse 63% 25% at 84% 107%, var(--reflex), transparent),
    linear-gradient(144deg, var(--tint), #05244762 52%, var(--tint));
  -webkit-backdrop-filter: blur(2.5px) saturate(1.38) brightness(.84);
  backdrop-filter: blur(2.5px) saturate(1.38) brightness(.84);
  box-shadow:
    inset 1px 2px 5px -3px #e6ffffc4,
    inset -2px -3px 7px -4px var(--rim),
    0 3px 6px -3px #010815a6,
    0 17px 25px -10px #010610e8,
    0 22px 40px -18px var(--reflex);
}
.glass-drop::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1.5px;
  background: conic-gradient(from 0deg, #81b8da42, #42759529 13%, var(--rim) 29%, #719ab242 39%,
              #abcdd240 50%, var(--rim) 62%, #45698540 73%, #f1ffffed 86%, #81b8da42 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.aqua-drop { --tint: #0966698f; --reflex: #5be4d83e; --rim: #a6f6e7; }
.warn-drop { --tint: #6c2f3b70; --reflex: #ff9c7a33; --rim: #ffc4ad; }
.terminal-drop { --tint: #0f3a6670; --reflex: #6eb5e830; --rim: #9acbe8; }

.opt-icon { width: 17px; height: 17px; flex: none; color: #cceeff; }
.drop-head { display: flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 600; color: #dff2fc; }
.drop-kicker { font-size: .74rem; font-weight: 600; color: #bfe2f6; letter-spacing: .01em; }
.drop-title { display: block; font-size: 1.08rem; font-weight: 600; letter-spacing: -.03em; margin-top: 4px; color: #f6fbff; }
.drop-mono {
  display: block; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .85rem; color: #eaf7ff; font-variant-numeric: tabular-nums;
}
.drop-mono-sm {
  margin-left: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .72rem; color: #b7dcf2; font-variant-numeric: tabular-nums;
}
.drop-meta { display: block; margin-top: 5px; font-size: .79rem; color: #c7e0ef; line-height: 1.4; }
.drop-badge {
  margin-left: auto; padding: 2px 9px; border-radius: 99px;
  font-size: .71rem; font-weight: 650; letter-spacing: .02em;
}
.warn-badge { color: #ffe0d2; background: #5a2229b0; border: 1px solid #ff9e8266; }
.aqua-badge { color: #d9fff8; background: #0d5857b0; border: 1px solid #89eee266; }
.drop-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.warn-dot { background: #ff9b7d; box-shadow: 0 0 8px #ff9b7d; }
.aqua-dot { background: #7df2df; box-shadow: 0 0 8px #7df2df; }

/* ── Scene Layer Crossfades (composite-only: transform + opacity) ── */
.stage-scene {
  position: absolute; inset: 12px; z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(.975);
  transition: opacity 320ms ease-out, transform 380ms cubic-bezier(.18,.72,.2,1);
}
.stage-scene[data-state="past"] { transform: translate3d(0, -16px, 0) scale(.98); }
.stage-scene[data-active="true"] { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }

/* Scene 0: Problem — centered composition */
.stage-scene[data-scene="0"] {
  display: grid; align-content: center; justify-items: center; gap: 16px;
}
.scene-problem-key { width: min(100%, 340px); transform: translateX(-24px); }
.scene-problem-key .drop-mono { margin-top: 8px; color: #ffd9c7; }
.scene-problem-prompt { width: min(100%, 340px); transform: translateX(24px); }
.scene-problem-prompt .drop-mono { margin-top: 8px; color: #fff1cc; }

/* Scene 1: Idea — balanced across the glass key center */
.stage-scene[data-scene="1"] {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; justify-items: center; gap: 20px;
}
.scene-idea-req {
  width: min(100%, 215px);
  display: grid; gap: 3px; align-self: end; margin-bottom: 16%;
}
.scene-idea-req strong { font-size: .96rem; letter-spacing: -.02em; }
.scene-idea-cert { width: min(100%, 275px); align-self: center; }

/* Scene 2: How a request travels — centered pair (key left-of-center, phone right-of-center) */
.stage-scene[data-scene="2"] {
  display: grid; grid-template-rows: auto 1fr; align-items: center; justify-items: center; gap: 16px;
}
.route-strip {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px;
}
.route-node {
  padding: 5px 11px; border-radius: 99px; font-size: .74rem; font-weight: 600;
  color: #cde3f3; background: #0c2442a6; border: 1px solid #6ba6cf4a;
}
.route-hot { color: #f4fbff; border-color: #9de1f599; background: #144d82a8; }
.route-sep { color: #7bb0d4; font-size: .78rem; }

.phone-drop {
  width: min(100%, 336px); border-radius: 26px; padding: 18px 20px;
  margin-left: 24%;
}
.phone-title {
  display: block; margin-top: 8px; font-size: 1.15rem; font-weight: 560;
  letter-spacing: -.04em; color: #f6fbff;
}
.phone-facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 12px;
}
.phone-facts div { min-width: 0; }
.phone-facts dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: #9fc6e2; }
.phone-facts dd { font-size: .82rem; font-weight: 550; color: #eef8ff; margin-top: 2px; }
.phone-match {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px; padding: 9px 13px; border-radius: 13px;
  background: #03152c6e; box-shadow: inset 0 1px 2px #000a1460, 0 1px #a1d8ff38;
  font-size: .76rem; color: #bad9ee;
}
.phone-match b { font-size: 1.12rem; letter-spacing: .2em; color: #f2fbff; }
.phone-approve {
  position: relative; margin-top: 12px; min-height: 42px; border-radius: 99px;
  display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(#2f6ad6, #163f98);
  box-shadow: inset 0 1px 1px #b6daffad, 0 6px 16px #030d208c;
  font-size: .84rem; font-weight: 650; color: #ffffff;
  transition: background-color 260ms ease-out;
}
.phone-approve > span {
  grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 7px;
  transition: opacity 240ms ease-out, transform 260ms ease-out;
}
.approve-done { opacity: 0; transform: translate3d(0, 8px, 0); }
.stage-scene[data-scene="2"][data-signed="true"] .phone-approve {
  background: linear-gradient(#127b73, #0b5152);
  box-shadow: inset 0 1px 1px #b2fff499, 0 6px 18px #0212168c;
}
.stage-scene[data-scene="2"][data-signed="true"] .approve-idle { opacity: 0; transform: translate3d(0, -8px, 0); }
.stage-scene[data-scene="2"][data-signed="true"] .approve-done { opacity: 1; transform: translate3d(0, 0, 0); }

/* Scene 3: Lease & expiry — centered ensemble */
.stage-scene[data-scene="3"] {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; justify-items: center; gap: 16px;
}
.lens-lock {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; border-radius: 99px; font-size: .8rem; font-weight: 650;
  --tint: #662d3899; --reflex: #ff9c7a40; --rim: #ffc4ad;
  opacity: 0; transform: scale(.88);
  transition: opacity 280ms ease-out, transform 320ms cubic-bezier(.2,.75,.2,1);
}
.stage-scene[data-scene="3"][data-expired="true"] .lens-lock { opacity: 1; transform: scale(1); }

.lease-card-drop { width: min(100%, 336px); border-radius: 26px; padding: 18px 20px; margin-left: 10%; }
.lease-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.countdown-ring {
  position: relative; width: 58px; height: 58px; flex: none;
  display: grid; place-items: center;
}
.countdown-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: #8dd9ec2e; stroke-width: 3; }
.ring-fill {
  fill: none; stroke: #9cf5e7; stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 113.1; stroke-dashoffset: 0;
  transition: stroke-dashoffset 140ms linear, stroke 240ms ease-out;
}
.stage-scene[data-scene="3"][data-expired="true"] .ring-fill { stroke: #ffaa8c; }
#story-countdown { font-size: .74rem; font-weight: 650; color: #f4fbff; }

.lease-rows { display: grid; gap: 8px; margin-top: 14px; }
.lease-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 13px; font-size: .8rem;
  background: #04192e6e; border: 1px solid #88d6ec2b;
}
.lease-row span { color: #b7d7ea; }
.lease-row strong { color: #d2fff7; font-weight: 650; }
.stage-scene[data-scene="3"][data-expired="true"] .login-row {
  background: #3d182285; border-color: #ff9c7a66;
}
.stage-scene[data-scene="3"][data-expired="true"] .login-row strong { color: #ffd4c4; }
.lease-controls { display: flex; gap: 8px; margin-top: 14px; }
.glass-pill {
  padding: 6px 13px; border-radius: 99px; font-size: .76rem; font-weight: 600; color: #edf9ff;
  background: linear-gradient(#4578a768, #071e357d);
  box-shadow: inset 0 1px 1px #c8edff8a, 0 2px 6px #0109144d;
}
.subtle-pill { background: transparent; border: 1px solid #96c4e054; box-shadow: none; color: #cfe6f6; }

/* Scene 4: Why it is safe */
.stage-scene[data-scene="4"] { display: grid; place-items: center; }
.trust-grid {
  width: min(100%, 520px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.trust-plate {
  display: flex; align-items: center; gap: 11px; padding: 13px 15px; border-radius: 19px;
  opacity: 0; transform: translate3d(0, 14px, 0);
  transition: opacity 320ms ease-out, transform 360ms cubic-bezier(.18,.72,.2,1);
  transition-delay: calc(var(--i, 0) * 55ms);
}
.stage-scene[data-scene="4"][data-active="true"] .trust-plate {
  opacity: 1; transform: translate3d(0, 0, 0);
}
.trust-wide { grid-column: 1 / -1; }
.trust-plate strong { display: block; font-size: .84rem; font-weight: 650; color: #f4fbff; }
.trust-plate > div > span { display: block; font-size: .74rem; color: #bdd8ea; margin-top: 2px; line-height: 1.3; }
.risk-box {
  width: 19px; height: 19px; flex: none; border-radius: 5px;
  border: 1.5px solid #e6f6ff; display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 800; line-height: 1; color: #f6fbff;
}

/* Scene 5: Goal — centered pair */
.stage-scene[data-scene="5"] {
  display: grid; align-content: center; justify-items: center;
}
.goal-stack { width: min(100%, 316px); display: grid; gap: 11px; margin-left: 26%; }
.goal-card {
  padding: 13px 16px; border-radius: 20px;
  opacity: 0; transform: translate3d(16px, 0, 0);
  transition: opacity 320ms ease-out, transform 380ms cubic-bezier(.18,.72,.2,1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.stage-scene[data-scene="5"][data-active="true"] .goal-card {
  opacity: 1; transform: translate3d(0, 0, 0);
}
.goal-tap {
  display: flex; align-items: center; gap: 9px; font-size: .8rem; font-weight: 600; color: #eef8ff;
}

/* Scene 6: Get it — centered pair */
.stage-scene[data-scene="6"] {
  display: grid; align-content: center; justify-items: center;
}
.cli-drop { width: min(100%, 408px); border-radius: 24px; padding: 18px 20px; margin-left: 20%; }
.cli-cmd { margin-top: 12px; color: #fff2ce; font-size: .79rem; line-height: 1.45; }
.nowrap { white-space: nowrap; }
.cli-out { margin-top: 8px; color: #9cece3; font-size: .78rem; }

/* ── Tablet & Phone (<= 960px): Deliberate stacked layout, frameless stage, zero sideways scroll ── */
@media (max-width: 960px) {
  .how { padding-top: 0; }
  .how-intro {
    min-height: 46svh;
    padding: 18px 0 32px;
    scroll-margin-top: 416px;
  }
  .how-intro h2 { font-size: clamp(26px, 6.2vw, 40px); max-width: none; }
  .how-points { margin-top: 16px; gap: 10px; max-width: 52ch; }
  .how-points li { font-size: .95rem; }

  .how-story { display: block; }
  .story-stage-wrap {
    position: sticky; top: 0; z-index: 3;
    height: auto; display: block;
    margin-inline: calc(var(--gutter) * -1);
    padding: 10px var(--gutter) 18px;
    background: linear-gradient(180deg, #060d1c 0%, #060d1cf6 84%, #060d1c00 100%);
  }
  .story-stage { height: clamp(320px, 40svh, 400px); }
  #story-canvas { inset: -16px -24px; width: calc(100% + 48px); height: calc(100% + 32px); }

  .story-chapters { margin-top: 6px; }
  .story-step, .story-step:first-child, .story-step:last-child {
    min-height: 46svh;
    padding: 24px 0 32px;
    scroll-margin-top: 416px;
  }
  .story-finale { min-height: 50svh; padding-bottom: 48px; }
  .story-step h3 { font-size: clamp(24px, 5.8vw, 34px); max-width: none; }
  .story-step p { font-size: .98rem; max-width: 52ch; }

  .stage-scene { inset: 8px 6px; }
  .scene-problem-key, .scene-problem-prompt { transform: none; }
  .phone-drop { width: min(100%, 340px); padding: 14px 16px; margin-left: 16%; }
  .lease-card-drop { width: min(100%, 340px); padding: 14px 16px; margin-left: 0; }
  .goal-stack { margin-left: 16%; }
  .cli-drop { margin-left: 14%; }
}

@media (max-width: 560px) {
  .story-stage { height: clamp(288px, 38svh, 336px); }
  .how-intro { min-height: 44svh; scroll-margin-top: 348px; }
  .story-step, .story-step:last-child { min-height: 44svh; scroll-margin-top: 348px; }
  .stage-scene { inset: 6px 0; }
  .glass-drop { padding: 11px 13px; border-radius: 18px; }
  .scene-problem-key, .scene-problem-prompt { width: 100%; }
  .stage-scene[data-scene="1"] { grid-template-columns: 1fr; align-content: center; gap: 10px; }
  .scene-idea-req { margin-bottom: 0; width: 100%; align-self: auto; }
  .scene-idea-cert { width: 100%; }
  .route-strip { flex-wrap: nowrap; gap: 3px; }
  .route-node { padding: 3px 6px; font-size: .61rem; white-space: nowrap; }
  .route-sep { font-size: .64rem; }
  .phone-drop { width: 100%; padding: 11px 13px; border-radius: 20px; margin-left: 0; }
  .phone-title { font-size: .96rem; margin-top: 4px; }
  .phone-facts { gap: 4px 10px; margin-top: 7px; }
  .phone-facts dt { font-size: .62rem; }
  .phone-facts dd { font-size: .74rem; }
  .phone-match { margin-top: 7px; padding: 6px 10px; font-size: .7rem; }
  .phone-match b { font-size: .96rem; }
  .phone-approve { margin-top: 7px; min-height: 36px; font-size: .78rem; }

  .stage-scene[data-scene="3"] { grid-template-columns: 1fr; align-content: center; gap: 8px; }
  .lens-lock { justify-self: start; padding: 5px 11px; font-size: .72rem; }
  .lease-card-drop { width: 100%; padding: 12px 14px; border-radius: 20px; }
  .countdown-ring { width: 48px; height: 48px; }
  .lease-rows { gap: 6px; margin-top: 8px; }
  .lease-row { padding: 6px 10px; font-size: .74rem; }
  .lease-controls { margin-top: 8px; }

  .trust-grid { gap: 7px; }
  .trust-plate { padding: 8px 10px; gap: 8px; border-radius: 15px; }
  .trust-plate strong { font-size: .75rem; }
  .trust-plate > div > span { font-size: .66rem; }
  .goal-stack { width: 100%; gap: 8px; margin-left: 0; }
  .goal-card { padding: 10px 13px; }
  .cli-drop { width: 100%; padding: 13px 14px; margin-left: 0; }
  .cli-cmd { font-size: .74rem; }
  .cli-out { font-size: .72rem; }
  .how-actions a { flex: 1 1 auto; white-space: nowrap; font-size: .92rem; padding: .65em 1.15em; }
}

/* ── Reduced motion: static steps with simple opacity fades ── */
@media (prefers-reduced-motion: reduce) {
  .how-intro, .story-step, .stage-scene, .trust-plate, .goal-card,
  .lens-lock, .phone-approve > span, .ring-fill, .story-glass::before, .story-glass::after {
    transition-duration: 180ms;
    transition-property: opacity;
    transition-delay: 0ms;
  }
  .stage-scene,
  .stage-scene[data-state="past"],
  .stage-scene[data-active="true"],
  .trust-plate,
  .stage-scene[data-scene="4"][data-active="true"] .trust-plate,
  .goal-card,
  .stage-scene[data-scene="5"][data-active="true"] .goal-card,
  .lens-lock,
  .stage-scene[data-scene="3"][data-expired="true"] .lens-lock,
  .approve-done,
  .stage-scene[data-scene="2"][data-signed="true"] .approve-idle,
  .stage-scene[data-scene="2"][data-signed="true"] .approve-done {
    transform: none;
  }
  .how-intro, .story-step { opacity: .68; }
  .how-intro[data-active="true"], .story-step[data-active="true"] { opacity: 1; }
}
