/* ---------- Hero ---------- */
.sky { position: absolute; inset: 0; z-index: -1; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 100%, #243C66 0%, #14243D 42%, var(--night) 72%); }
.stars { position: absolute; inset: -10% 0 0; opacity: .7;
  background-image:
    radial-gradient(1px 1px at 12% 18%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 28% 42%, #D4E5FF 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 12%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 62% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 16%, #D4E5FF 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 38%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 6% 52%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 54% 48%, #D4E5FF 50%, transparent 51%),
    radial-gradient(1px 1px at 94% 6%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 36% 6%, #fff 50%, transparent 51%);
  background-size: 640px 520px;
  transform: translateY(calc(var(--hp) * 60px));
  animation: twinkle 7s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .45; } to { opacity: .8; } }

.horizon { position: absolute; left: 50%; top: calc(56% + 48px); width: max(2400px, 240vw); aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(closest-side, #0E1B2E 97%, #1B2E4F);
  box-shadow: 0 -1px 0 rgba(255,236,214,.85), 0 -14px 40px rgba(243,185,126,.25);
  transform: translate(-50%, calc(14vh - var(--load, 0) * 14vh - var(--hp) * 12vh));
  opacity: var(--load, 0);
  transition: transform 1.8s var(--ease-out), opacity 1.4s var(--ease-out); }
.horizon::before { content: ""; position: absolute; left: 50%; top: -420px; width: min(2400px, 160vw); height: 840px; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(50% 50% at 50% 50%, rgba(108,137,183,.38), rgba(108,137,183,.12) 45%, transparent 70%); }
.horizon-rim { position: absolute; left: 50%; top: -90px; width: 70vw; max-width: 1100px; height: 180px; transform: translateX(-50%);
  background: radial-gradient(50% 50% at 50% 50%, rgba(255,210,160,.42), rgba(243,185,126,.08) 55%, transparent 72%);
  filter: blur(8px); opacity: calc(.7 + var(--hp) * .3); }
.is-loaded .hero .horizon, .close .horizon { --load: 1; }
.hero .horizon { transition: opacity 1.4s var(--ease-out); }

/* Pinned hero: the copy lifts away while the portal tilts up from the horizon into focus */
.hero { --hp: 0; --a: clamp(0, calc(var(--hp) / .4), 1); --b: clamp(0, calc(var(--hp) / .8), 1); height: 220vh; }
.hero-pin { position: sticky; top: 0; height: 100vh; overflow: hidden; isolation: isolate; }
.hero-copy { position: absolute; left: 0; right: 0; top: clamp(96px, 14vh, 150px); text-align: center; display: grid; justify-items: center;
  opacity: calc(1 - var(--a) * 1.15); transform: translateY(calc(var(--a) * -110px)) scale(calc(1 - var(--a) * .05)); filter: blur(calc(var(--a) * 8px)); }
.hero-title { font-size: clamp(38px, 5.2vw, 72px); line-height: 1.02; letter-spacing: -.04em; font-weight: 300; max-width: 16ch; text-wrap: balance; }
/* The Frontier logo stands in for the word "frontier" in the headline. */
.title-logo { display: inline-block; height: .8em; width: auto; vertical-align: -.02em; margin: 0 .04em; }
.hero-sub { margin-top: 20px; max-width: 58ch; font-size: clamp(16px, 1.25vw, 18px); color: var(--fg-muted); }
.hero-sub, .hero-signup { opacity: 0; translate: 0 16px; transition: opacity .9s var(--ease-out), translate 1s var(--ease-out); }
.is-loaded .hero-sub { opacity: 1; translate: 0 0; transition-delay: .6s; }
.is-loaded .hero-signup { opacity: 1; translate: 0 0; transition-delay: .75s; }

/* Email sign-up: one pill holding the field and the button */
.hero-signup { margin-top: 28px; width: min(100%, 480px); display: grid; justify-items: center; gap: 6px; }
.signup-field { width: 100%; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); transition: border-color .2s, background-color .2s, box-shadow .2s; }
.signup-field:focus-within { border-color: rgba(194,218,255,.7); background: rgba(255,255,255,.11); box-shadow: 0 0 0 4px rgba(108,137,183,.2); }
.signup-field input { flex: 1; min-width: 0; height: 44px; padding: 0 16px; border: 0; background: transparent; color: #fff; font: 400 16px var(--font); outline: none; }
.signup-field input::placeholder { color: #8FA3C2; }
.signup-field .btn { min-height: 44px; flex: none; }
.hero-signup.is-invalid .signup-field { border-color: #F2A38F; box-shadow: 0 0 0 4px rgba(242,163,143,.18); }
.signup-note { font-size: 13px; color: var(--fg-muted); margin-top: 4px; }
.signup-msg { min-height: 20px; font-size: 14px; color: #F7C2B4; }
.signup-msg:empty { min-height: 0; } /* stays in the layout (it is a live region), but takes no space until it speaks */
.hero-explore { font-size: 15px; color: #CFDCF0; text-decoration: none; text-underline-offset: 4px; transition: color .2s; }
.hero-explore:hover { color: #fff; text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.hero-stage { position: absolute; left: 0; right: 0; top: 50%; display: flex; justify-content: center; perspective: 1500px; perspective-origin: 50% 0%;
  opacity: 0; translate: 0 120px; transition: opacity 1.2s var(--ease-out) .9s, translate 1.6s var(--ease-out) .9s; }
.is-loaded .hero-stage { opacity: 1; translate: 0 0; }
/* The stage box spans the hero from mid-screen down; only the portal itself takes clicks, so the copy above stays clickable */
.hero-stage { pointer-events: none; }
.hero-frame { pointer-events: auto; }
.hero-frame { --ratio: 1.568; width: min(1080px, calc(100vw - 2 * var(--gutter)), calc((100vh - 130px) * var(--ratio))); transform-origin: 50% 100%;
  transform: translateY(calc(-50% + 34px + (1 - var(--b)) * var(--start, 44vh))) rotateX(calc((1 - var(--b)) * 56deg)) scale(calc(.8 + var(--b) * .2)); }
.hero-frame .demo-view { box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 50px 100px -30px rgba(3,10,24,.8), 0 0 calc(40px + var(--b) * 80px) -10px rgba(108,137,183,calc(.25 + var(--b) * .3)); }
.hero .horizon { transform: translate(-50%, calc(14vh - var(--load, 0) * 14vh + var(--hp) * 26vh)); }
.hero .sky { -webkit-mask-image: linear-gradient(to bottom, #000 80%, transparent); mask-image: linear-gradient(to bottom, #000 80%, transparent); }

/* Real portal demo, laid out at its native width and scaled to the frame */
.demo-view { position: relative; width: 100%; height: 755px; border-radius: var(--r-lg); overflow: hidden; background: #fff;
  box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 40px 80px -30px rgba(3,10,24,.7), 0 0 80px -10px rgba(108,137,183,.35); }
.demo-scale { position: absolute; left: 0; top: 0; width: 1184px; transform-origin: 0 0; }
.demo-scale.is-mobile { width: 622px; } /* natural width of the demo's mobile layout */
.demo-scale frontier-demo { display: block; width: 100%; }
.demo-missing { display: none; position: absolute; inset: 0; place-items: center; color: var(--slate); font-size: 15px; }
.demo-view.is-missing .demo-scale { display: none; }
.demo-view.is-missing { height: 320px; }
.demo-view.is-missing .demo-missing { display: grid; }

/* ---------- Statement: words light up as the pinned text scrolls ---------- */
.statement { height: 220vh; }
.statement .wrap { position: sticky; top: 0; height: 100vh; display: grid; align-items: center; }
.statement-text { font-size: clamp(30px, 4.2vw, 60px); line-height: 1.12; letter-spacing: -.03em; font-weight: 400; max-width: 26ch; text-wrap: pretty; }
.statement-text .lw { --o: 0; color: var(--fg); opacity: calc(.14 + var(--o) * .86); transition: opacity .15s linear; }

/* ---------- Curtain reveal for product visuals ---------- */
[data-curtain] { clip-path: inset(40px 6% 0 6% round 32px); transform: translateY(40px) scale(.96); opacity: .35;
  transition: clip-path .9s var(--ease-out), transform .9s var(--ease-out), opacity .6s var(--ease-out); }
[data-curtain].is-in { clip-path: inset(-15% -15% -15% -15% round 0px); transform: none; opacity: 1; }

/* ---------- Parallax on section heads ---------- */
[data-depth] { --sp: .5; transform: translateY(calc((.5 - var(--sp)) * 90px)); }

/* ---------- Section rhythm ---------- */
.platform, .relationship, .security { padding: clamp(96px, 14vh, 160px) 0; }
.section-head { margin-bottom: clamp(48px, 8vh, 88px); }

/* ---------- Platform tour (pinned) ---------- */
.tour { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: clamp(32px, 6vw, 96px); }
.tour-steps { list-style: none; margin: 0; padding: 0; }
.tour-step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; }
.tour-copy { display: grid; gap: 12px; padding-left: 22px; border-left: 2px solid var(--line); transition: border-color .5s; }
.tour-step.is-active .tour-copy { border-left-color: var(--signal); }
.tour-step h3 { font-size: clamp(24px, 2.2vw, 32px); font-weight: 400; letter-spacing: -.025em; }
.tour-step p { color: var(--fg-muted); max-width: 40ch; }
.tour-step h3, .tour-step p { transition: color .5s; }
.tour-step:not(.is-active) h3, .tour-step:not(.is-active) p { color: #5F6E82; }
.tour-stage { position: relative; }
.tour-sticky { position: sticky; top: calc(50vh - 260px); }
.tour-frame { height: 520px; border-color: var(--line); box-shadow: 0 30px 70px -30px rgba(20,36,61,.28), 0 6px 20px -10px rgba(20,36,61,.12); }

/* ---------- Relationship sequence ---------- */
.seq { --p: 0; position: relative; }
.seq-track { position: absolute; left: 20px; right: 20px; top: 20px; height: 2px; background: var(--line); }
.seq-fill { position: absolute; inset: 0; background: linear-gradient(90deg, var(--primary-800), var(--primary-500)); transform: scaleX(var(--p)); transform-origin: left; }
.seq-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; position: relative; }
.seq-steps li { display: grid; gap: 12px; align-content: start; }
.seq-steps p { color: var(--fg-muted); font-size: 16px; }
.seq-n { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 500; margin-bottom: 14px;
  background: var(--bg); border: 1px solid var(--line); color: var(--fg-muted); transition: background-color .5s, color .5s, border-color .5s, box-shadow .5s; }
.seq-steps li.is-on .seq-n { background: var(--ink); color: #fff; border-color: var(--ink); box-shadow: 0 0 0 6px rgba(108,137,183,.14); }
.seq-steps li h3, .seq-steps li p { color: #5F6E82; transform: translateY(8px); transition: color .6s var(--ease-out), transform .6s var(--ease-out); }
.seq-steps li.is-on h3 { color: var(--ink); transform: none; }
.seq-steps li.is-on p { color: var(--fg-muted); transform: none; }
.seq-cta { margin-top: 56px; align-items: center; gap: 16px; }
.seq-cta-note { font-size: 14px; color: var(--fg-muted); }

/* ---------- Security ---------- */
.sec-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.sec-grid li { padding: 28px; border-radius: var(--r-lg); background: #fff; border: 1px solid var(--line); display: grid; gap: 10px; align-content: start;
  transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.sec-grid li:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -24px rgba(20,36,61,.3); }
.sec-grid li:nth-child(2) { --d: .1s; } .sec-grid li:nth-child(3) { --d: .2s; }
.sec-grid svg { width: 28px; height: 28px; fill: none; stroke: var(--signal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 8px; }
.sec-grid p { color: var(--fg-muted); font-size: 16px; }

/* ---------- Close ---------- */
.close { min-height: 92vh; display: grid; align-items: center; overflow: hidden; isolation: isolate; padding: 140px 0 220px; --hp: .6; background: var(--night);
  /* Always dark: its text must read before the page scene switches over */
  --fg: #EEF3FB; --fg-muted: #9FB1CB; --line: rgba(255,255,255,.1); color: var(--fg); }
.sky-close { background: radial-gradient(110% 70% at 50% 100%, #243C66 0%, #14243D 45%, var(--night) 75%); }
.close { --sp: .5; }
.sky-close .horizon { top: 74%; transform: translate(-50%, calc((.6 - min(var(--sp), .6)) * 60vh)); transition: none; }
.close-inner { transform: scale(calc(.9 + min(var(--sp), .55) * .18)); }
.close-inner { text-align: center; display: grid; justify-items: center; }
.close-inner h2 { max-width: 16ch; font-size: clamp(38px, 5.6vw, 76px); font-weight: 300; }
.close-signup { margin-top: 36px; }
.close-inner .cta-row { margin-top: 14px; justify-content: center; align-items: center; gap: 20px; }
.close-inner .lede { --d: .15s; } .close-signup { --d: .3s; } .close-inner .cta-row { --d: .4s; }
.link-email { font-size: 15px; color: var(--fg-muted); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(159,177,203,.4); transition: color .2s; }
.link-email:hover { color: var(--fg); }

/* ---------- Footer ---------- */
.footer { background: var(--night); color: #9FB1CB; padding: 64px 0 48px; border-top: 1px solid rgba(255,255,255,.08); }
.foot-inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-items: start; }
.foot-brand img { width: 140px; height: auto; }
.foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.foot-cols > div { display: grid; gap: 12px; align-content: start; }
.foot-h { font-size: 14px; font-weight: 600; letter-spacing: 0; color: #fff; max-width: none; margin-bottom: 4px; }
.foot-cols a { font-size: 15px; width: fit-content; transition: color .2s; }
.foot-cols a:hover { color: #fff; }
.foot-legal { margin-top: 48px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.08); display: grid; gap: 8px; font-size: 13px; line-height: 1.55; color: #7F92AE; }
.foot-legal p { max-width: 110ch; }
.foot-id { color: #9FB1CB; }
.foot-id a, .pause-toggle { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(159,177,203,.4); }
.foot-id a:hover, .pause-toggle:hover { color: #fff; }
.pause-toggle { padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .seq-steps { grid-template-columns: 1fr 1fr; row-gap: 48px; }
  .seq-track { display: none; }
}
@media (max-width: 900px) {
  .tour { grid-template-columns: 1fr; }
  .tour-stage { order: -1; position: sticky; top: 68px; z-index: 2; }
  .tour-sticky { position: static; }
  .tour-frame { height: min(400px, 50svh); }
  .tour-frame .alert-row span { display: none; }
  .mix-share { display: none; }
  .tour-steps { padding-bottom: 30svh; }
  .tour-step { min-height: 42svh; justify-content: flex-start; padding-top: 24px; }
}
@media (max-width: 760px) {
  .hero { height: 180vh; }
  .statement { height: 170vh; }
  .hero .horizon { top: calc(56% + 32px); }
  .signup-field { flex-direction: column; border-radius: 18px; align-items: stretch; }
  .signup-field .btn { width: 100%; }
  .hero-frame { --ratio: .645; }
  .close-inner .cta-row { flex-direction: column; width: 100%; }
  .close-inner .cta-row .btn { width: 100%; }
  .seq-steps { grid-template-columns: 1fr; }
  .sec-grid { grid-template-columns: 1fr; }
  .seq-cta { flex-direction: column; align-items: stretch; text-align: center; }
  .foot-inner { grid-template-columns: 1fr; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}
