:root {
  --navy: #0b2545;
  --blue: #0b5fa5;
  --sky: #2f9be0;
  --ink: #0b2545;
  --dim: #47607d;
  --green: #17b26a;
  --paper: rgba(255, 255, 255, .92);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: #bfe6f7; }
body { font-family: var(--sans); color: var(--ink); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

#track { height: 1300vh; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
canvas#stage { opacity: 0; transition: opacity 1s ease; }
#stage text { font-family: var(--sans); }

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 18px clamp(18px, 4vw, 48px);
}
.logo { display: inline-flex; align-items: center; font-weight: 700; font-size: 21px; letter-spacing: .07em; color: var(--navy); }
.logo svg { height: 1.02em; margin: 0 .03em 0 .05em; transform: translateY(.06em); }
.tagline { font: 500 11px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--blue); padding-left: 16px; border-left: 1px solid rgba(11, 37, 69, .25); }
.nav .btn { margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; padding: 14px 24px; border-radius: 999px;
  background: var(--navy); color: #fff; font-weight: 600; font-size: 15px;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(11, 37, 69, .6); }
.btn.small { padding: 10px 18px; font-size: 13.5px; }
.btn.ghost { background: #fff; color: var(--navy); box-shadow: inset 0 0 0 1.5px rgba(11, 37, 69, .2); }

.eyebrow { font: 500 11.5px var(--mono); letter-spacing: .26em; text-transform: uppercase; color: var(--blue); }

/* ---------- hero ---------- */
#hero {
  position: fixed; z-index: 10; left: clamp(18px, 6vw, 96px); top: 15vh; max-width: 640px;
  transition: opacity .5s, transform .6s cubic-bezier(.16, 1, .3, 1);
}
#hero::before { content: ""; position: absolute; inset: -70px -90px -50px -120px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(255, 255, 255, .82), rgba(255, 255, 255, .5) 55%, rgba(255, 255, 255, 0)); }
#hero h1 { margin-top: 18px; font-size: clamp(38px, 5.4vw, 76px); line-height: .98; letter-spacing: -.035em; font-weight: 600; text-wrap: balance; }
#hero .lede { margin-top: 20px; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; color: #2b4563; max-width: 40ch; }
#hero.off { opacity: 0; transform: translateY(-24px); pointer-events: none; }
.hint { margin-top: 26px; display: flex; align-items: center; gap: 12px; font: 500 10.5px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--blue); }
.hint i { width: 1.5px; height: 34px; background: linear-gradient(var(--blue), transparent); transform-origin: top; animation: drip 2s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* ---------- caption ---------- */
#caption {
  position: fixed; z-index: 10; left: clamp(18px, 5vw, 72px); top: 13vh; width: min(400px, calc(100vw - 36px));
  padding: 22px 24px 24px; border-radius: 22px; background: var(--paper);
  box-shadow: 0 24px 60px -24px rgba(11, 37, 69, .45), inset 0 0 0 1px rgba(255, 255, 255, .8);
  backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(18px); transition: opacity .35s, transform .5s cubic-bezier(.16, 1, .3, 1);
}
#caption.on { opacity: 1; transform: none; }
#caption .num { font: 500 11px var(--mono); letter-spacing: .24em; color: var(--blue); }
#caption h2 { margin-top: 10px; font-size: clamp(26px, 2.6vw, 36px); letter-spacing: -.03em; line-height: 1.02; font-weight: 600; }
#caption p { margin-top: 10px; font-size: 15.5px; line-height: 1.5; color: var(--dim); }

/* ---------- marina office toast ---------- */
#office {
  position: fixed; z-index: 10; left: clamp(18px, 5vw, 72px); bottom: 110px; width: min(360px, calc(100vw - 36px));
  padding: 16px 18px; border-radius: 18px; background: var(--navy); color: #fff;
  box-shadow: 0 24px 50px -20px rgba(11, 37, 69, .7);
  opacity: 0; transform: translateX(-30px); transition: opacity .4s, transform .6s cubic-bezier(.16, 1, .3, 1);
}
#office.on { opacity: 1; transform: none; }
#office .k { font: 500 9.5px var(--mono); letter-spacing: .24em; text-transform: uppercase; color: #8fd0ff; }
#office b { display: block; margin-top: 8px; font-size: 15px; }
#office p { margin-top: 6px; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .78); }
#office .ok { display: inline-block; margin-top: 10px; padding: 5px 10px; border-radius: 999px; background: rgba(23, 178, 106, .2); color: #6ff0b2; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity .4s .1s; }
#office.approved .ok { opacity: 1; }

/* ---------- phone ---------- */
#phone {
  position: fixed; z-index: 12; right: clamp(18px, 8vw, 130px); top: 50%; width: 280px; height: 570px;
  border-radius: 44px; background: #0d1522; padding: 10px;
  box-shadow: 0 40px 90px -30px rgba(11, 37, 69, .75), inset 0 0 0 2px #2a3a52;
  transform: translate(0, -46%) translateY(var(--py, 120vh)) rotate(var(--pr, 8deg));
}
#phone .island { position: absolute; z-index: 3; top: 20px; left: 50%; width: 84px; height: 24px; margin-left: -42px; border-radius: 14px; background: #0d1522; }
.scr { position: absolute; inset: 10px; border-radius: 35px; overflow: hidden; background: #fff; opacity: 0; transition: opacity .35s; display: flex; flex-direction: column; }
#phone[data-state=cam] .cam, #phone[data-state=form] .form, #phone[data-state=wait] .wait, #phone[data-state=ok] .ok { opacity: 1; }

.scr.cam { background: linear-gradient(160deg, #3c5876, #1b2c44); align-items: center; justify-content: center; gap: 22px; }
.vf { position: relative; width: 168px; height: 168px; padding: 16px; background: #fff; border-radius: 6px; transform: rotate(-3deg); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.vf svg { width: 100%; height: 100%; display: block; }
.vf i { position: absolute; width: 26px; height: 26px; border: 3px solid #ffd23d; }
.vf .c1 { left: -10px; top: -10px; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.vf .c2 { right: -10px; top: -10px; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.vf .c3 { left: -10px; bottom: -10px; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.vf .c4 { right: -10px; bottom: -10px; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.pill { padding: 10px 18px; border-radius: 16px; background: rgba(255, 210, 61, .96); color: #1b2c44; text-align: center; opacity: 0; transform: translateY(10px) scale(.94); transition: opacity .3s, transform .4s cubic-bezier(.2, 1.4, .4, 1); }
.pill small { display: block; font: 500 10px var(--mono); opacity: .7; }
.pill b { font-size: 15px; }
#phone.found .pill { opacity: 1; transform: none; }

.scr.form { padding: 54px 18px 18px; }
.app-top { display: flex; justify-content: space-between; align-items: center; }
.mini-logo { font-weight: 700; letter-spacing: .12em; font-size: 13px; color: var(--navy); }
.gate { font: 500 9.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; padding: 4px 8px; border-radius: 999px; background: #e6f2fc; color: var(--blue); }
.scr h3 { font-size: 24px; letter-spacing: -.02em; }
.scr.form h3 { margin: 18px 0 10px; }
.field { padding: 9px 0; border-bottom: 1px solid #e3eaf2; opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .4s; }
.field label { display: block; font: 500 9px var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #7d91a8; }
.field span { display: block; margin-top: 3px; font-size: 14.5px; font-weight: 500; }
.field em { font-style: normal; font-size: 11px; color: var(--green); font-weight: 600; margin-left: 4px; }
#phone[data-fill="1"] .field:nth-of-type(-n+2), #phone[data-fill="2"] .field:nth-of-type(-n+3),
#phone[data-fill="3"] .field:nth-of-type(-n+4), #phone[data-fill="4"] .field:nth-of-type(-n+5) { opacity: 1; transform: none; }
.note { margin-top: 10px; font-size: 11.5px; color: #7d91a8; opacity: 0; transition: opacity .3s; }
#phone[data-fill="4"] .note { opacity: 1; }
.cta-btn { margin-top: auto; padding: 15px; border-radius: 16px; text-align: center; font-weight: 600; color: #fff; background: var(--blue); transition: transform .2s, background .2s, box-shadow .2s; box-shadow: 0 10px 24px -10px var(--blue); }
#phone.pressed .cta-btn { transform: scale(.94); background: #084a82; box-shadow: none; }

.scr.wait, .scr.ok { align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 24px; }
.scr.wait p, .scr.ok p { color: var(--dim); font-size: 14.5px; }
.spinner { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #dbe7f3; border-top-color: var(--blue); animation: spin .9s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.scr.ok { background: linear-gradient(180deg, #eafbf2, #fff 60%); }
.tick { width: 92px; height: 92px; border-radius: 50%; background: var(--green); color: #fff; font-size: 46px; font-weight: 700; display: grid; place-items: center; margin-bottom: 14px; transform: scale(.3); transition: transform .5s cubic-bezier(.2, 1.6, .4, 1); box-shadow: 0 0 0 12px rgba(23, 178, 106, .15), 0 0 0 26px rgba(23, 178, 106, .07); }
#phone[data-state=ok] .tick { transform: none; }
.scr.ok small { margin-top: 8px; font: 500 10.5px var(--mono); letter-spacing: .12em; color: #7d91a8; }

/* ---------- final CTA ---------- */
#cta {
  position: fixed; z-index: 11; left: 50%; top: 13vh; width: min(620px, calc(100vw - 36px)); text-align: center;
  padding: 34px 32px; border-radius: 28px; background: var(--paper); backdrop-filter: blur(12px);
  box-shadow: 0 30px 80px -30px rgba(11, 37, 69, .55);
  opacity: 0; transform: translate(-50%, 30px); pointer-events: none;
  transition: opacity .45s, transform .7s cubic-bezier(.16, 1, .3, 1);
}
#cta.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#cta h2 { margin-top: 14px; font-size: clamp(30px, 3.6vw, 48px); letter-spacing: -.035em; line-height: 1; font-weight: 600; text-wrap: balance; }
#cta .lede { margin-top: 14px; color: var(--dim); font-size: 16.5px; line-height: 1.5; }
#cta ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
#cta li { padding: 7px 13px; border-radius: 999px; background: #e7f7ee; color: #0e7a48; font-size: 13.5px; font-weight: 600; }
#cta .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 24px; }

/* ---------- step rail ---------- */
#rail {
  position: fixed; z-index: 15; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; gap: 4px; padding: 7px; border-radius: 999px; background: rgba(255, 255, 255, .86); backdrop-filter: blur(10px);
  box-shadow: 0 14px 40px -18px rgba(11, 37, 69, .5);
}
#rail button {
  all: unset; cursor: pointer; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  font: 500 10.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #7d91a8; transition: background .3s, color .3s;
}
#rail button.done { color: var(--blue); }
#rail button.on { background: var(--navy); color: #fff; }

/* ---------- scene ambience ---------- */
.shim { animation: shim 3.4s ease-in-out infinite; }
@keyframes shim { 0%, 100% { opacity: .08; } 50% { opacity: .7; } }

@media (max-width: 860px) {
  .tagline { display: none; }
  #hero { top: 11vh; }
  #caption { top: 78px; padding: 16px 18px 18px; }
  #caption p { font-size: 14px; }
  #office { display: none; }
  #phone { right: 50%; margin-right: -140px; top: auto; bottom: 74px; transform: translateY(var(--py, 120vh)) scale(.78) rotate(var(--pr, 8deg)); transform-origin: bottom center; }
  #rail button { padding: 7px 8px; font-size: 0; }
  #rail button::before { content: attr(data-n); font-size: 10px; }
  #cta { top: 78px; padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { .shim, .hint i { animation: none; } }
