/* ── VRP Terminal public landing page ─────────────────────────────────────────────────────────
   Loaded after app.css (which provides the --vrp-* palette). Everything here is scoped to the
   landing page markup (lp-*). Motion is scroll-driven from js/landing.js; this file owns the
   static design + reveal transitions. */

:root {
    --lp-max: 1120px;
    --lp-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
}

/* overflow-x MUST be `clip`, not `hidden`. `overflow-x: hidden` forces the other axis to compute
   to `overflow-y: auto`, which makes <html>/<body> a scroll container and silently breaks every
   `position: sticky` descendant — including the scrollytelling vol-surface, which would then scroll
   away and leave 4+ blank viewports on the way down. `clip` hides horizontal overflow the same way
   without creating a scroll container, so sticky keeps working. */
html { scroll-behavior: smooth; overflow-x: clip; }
body.lp {
    margin: 0;
    font-family: Inter, "Segoe UI", sans-serif;
    background: var(--vrp-bg);
    color: var(--vrp-text);
    line-height: 1.6;
    overflow-x: clip;
}
.lp a { color: inherit; }
.lp-wrap { max-width: var(--lp-max); margin: 0 auto; padding: 0 28px; }

/* ── Header ── */
.lp-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
    background: rgba(14,17,24,.55);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: background .3s ease, border-color .3s ease;
}
.lp-header.scrolled { background: rgba(14,17,24,.82); border-bottom-color: var(--vrp-border); }
.lp-nav { display: flex; align-items: center; height: 64px; gap: 28px; }
.lp-brand { font-weight: 700; letter-spacing: .05em; font-size: 17px; text-decoration: none; }
.lp-brand span { color: var(--vrp-primary); }
.lp-nav-links { display: flex; gap: 24px; margin-left: 12px; }
.lp-nav-links a {
    font-size: 13.5px; color: var(--vrp-muted); text-decoration: none; font-weight: 500;
    transition: color .15s ease;
}
.lp-nav-links a:hover { color: var(--vrp-text); }
.lp-nav-cta { margin-left: auto; display: flex; gap: 10px; align-items: center; }

/* ── Buttons ── */
.lp-btn {
    display: inline-block; padding: 10px 20px; border-radius: 8px;
    font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer;
    border: 1px solid transparent; letter-spacing: .01em; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .2s ease;
}
.lp-btn-primary {
    background: var(--vrp-primary); color: #0c1030;
    box-shadow: 0 0 0 0 rgba(123,134,255,0);
}
.lp-btn-primary:hover { background: var(--vrp-primary-hover); box-shadow: 0 4px 24px rgba(123,134,255,.35); }
.lp-btn-ghost { border-color: var(--vrp-border); color: var(--vrp-text-bright); }
.lp-btn-ghost:hover { border-color: var(--vrp-primary); color: #fff; }

/* ── Hero: the universe of stocks ── */
.lp-hero {
    position: relative; min-height: 100vh; min-height: 100svh;
    display: flex; align-items: center; justify-content: center;
    text-align: center; overflow: hidden;
}
#lp-stars { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.lp-hero::after {
    /* Grounds the hero into the page below. */
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px;
    background: linear-gradient(180deg, transparent, var(--vrp-bg));
    pointer-events: none;
}
.lp-hero-inner { position: relative; z-index: 2; padding: 110px 24px 90px; max-width: 860px; }
.lp-eyebrow {
    color: var(--vrp-primary); font-weight: 600; font-size: 12.5px;
    letter-spacing: .18em; text-transform: uppercase;
}
.lp-hero h1 {
    font-size: clamp(38px, 6vw, 62px); line-height: 1.06; font-weight: 700;
    letter-spacing: -.022em; margin: 18px 0 20px;
}
.lp-grad {
    background: linear-gradient(92deg, #9aa2ff 0%, #7b86ff 40%, #34d399 100%);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lp-lede { font-size: 18px; color: var(--vrp-muted); max-width: 640px; margin: 0 auto 34px; }
.lp-lede b { color: var(--vrp-text-bright); font-weight: 600; }

.lp-try { display: flex; gap: 10px; max-width: 470px; margin: 0 auto 10px; flex-wrap: wrap; justify-content: center; }
.lp-try input {
    flex: 1; min-width: 220px; padding: 14px 18px; border-radius: 9px;
    border: 1px solid var(--vrp-border); background: rgba(20,26,38,.8);
    color: var(--vrp-text); font-size: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    backdrop-filter: blur(6px);
}
.lp-try input:focus { outline: none; border-color: var(--vrp-primary); box-shadow: 0 0 0 3px rgba(123,134,255,.22); }
.lp-try input::placeholder { color: var(--vrp-dim); font-weight: 500; letter-spacing: normal; text-transform: none; }
.lp-try button {
    padding: 14px 24px; border-radius: 9px; border: none; background: var(--vrp-primary); color: #0c1030;
    font-weight: 700; font-size: 15px; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, box-shadow .2s ease;
}
.lp-try button:hover { background: var(--vrp-primary-hover); box-shadow: 0 4px 24px rgba(123,134,255,.35); }
.lp-try-note { color: var(--vrp-dim); font-size: 13px; margin: 0 0 30px; }
.lp-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.lp-scroll-cue {
    position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2;
    color: var(--vrp-dim); font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none;
}
.lp-scroll-cue svg { animation: lp-bob 2.2s ease-in-out infinite; }
@keyframes lp-bob { 0%,100% { transform: translateY(0); opacity: .55; } 50% { transform: translateY(7px); opacity: 1; } }

/* ── Scrollytelling: the volatility surface ── */
.lp-scrolly { position: relative; height: 440vh; }
.lp-scrolly-sticky {
    position: sticky; top: 0; height: 100vh; overflow: hidden;
    display: flex; align-items: stretch;
}
#lp-surface { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD readouts — quiet monospace instrument panel. */
.lp-hud {
    position: absolute; top: 84px; right: 36px; z-index: 3;
    font-family: var(--lp-mono); font-size: 12.5px; color: var(--vrp-muted);
    background: rgba(14,17,24,.55); border: 1px solid var(--vrp-border); border-radius: 9px;
    padding: 14px 18px; min-width: 205px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    font-variant-numeric: tabular-nums;
}
.lp-hud-row { display: flex; justify-content: space-between; gap: 22px; padding: 2.5px 0; }
.lp-hud-row b { color: var(--vrp-text); font-weight: 600; }
.lp-hud-row b.warn { color: var(--vrp-error); }
.lp-hud-tag {
    margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--vrp-border);
    font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--vrp-dim);
}

/* Chapter narration cards (cross-faded by JS as scroll progresses). */
.lp-chapters { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 3; display: flex; align-items: center; pointer-events: none; }
.lp-chapter {
    position: absolute; left: max(28px, calc((100vw - var(--lp-max)) / 2 + 28px));
    width: min(390px, 84vw);
    opacity: 0; transform: translateY(26px); pointer-events: none;
    transition: opacity .45s ease, transform .45s ease;
}
.lp-chapter.active { opacity: 1; transform: translateY(0); pointer-events: auto; }
.lp-chapter .lp-ch-num {
    font-family: var(--lp-mono); font-size: 12px; color: var(--vrp-primary); letter-spacing: .2em;
    margin-bottom: 10px;
}
.lp-chapter h3 { font-size: 27px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 10px; line-height: 1.2; }
.lp-chapter p { font-size: 15px; color: var(--vrp-muted); margin: 0; }
.lp-chapter p b { color: var(--vrp-text-bright); font-weight: 600; }

/* Progress rail. */
.lp-progress {
    position: absolute; left: 30px; top: 50%; transform: translateY(-50%); z-index: 4;
    display: flex; flex-direction: column; gap: 14px;
}
.lp-progress i {
    width: 7px; height: 7px; border-radius: 50%; background: var(--vrp-border);
    transition: background .3s ease, transform .3s ease;
}
.lp-progress i.on { background: var(--vrp-primary); transform: scale(1.35); }
.lp-illus-tag {
    position: absolute; bottom: 22px; right: 36px; z-index: 3;
    font-size: 11px; color: var(--vrp-dim); border: 1px solid var(--vrp-border);
    border-radius: 20px; padding: 3px 12px; background: rgba(14,17,24,.5);
}

/* ── Content sections ── */
.lp section.lp-section { padding: 96px 0 24px; }
.lp-section h2 { font-size: clamp(26px, 3.4vw, 34px); font-weight: 700; letter-spacing: -.018em; margin: 0 0 12px; }
.lp-section-sub { color: var(--vrp-muted); max-width: 700px; margin: 0 0 28px; font-size: 16px; }
.lp-kicker {
    color: var(--vrp-primary); font-weight: 600; font-size: 12px;
    letter-spacing: .18em; text-transform: uppercase; margin-bottom: 12px;
}

.lp-card {
    background: linear-gradient(180deg, rgba(255,255,255,.016), rgba(255,255,255,0) 52px), var(--vrp-surface);
    border: 1px solid var(--vrp-border); border-radius: 12px; padding: 24px 26px;
    box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.lp-chart-title { font-weight: 600; font-size: 15px; margin-bottom: 2px; }
.lp-chart-note { color: var(--vrp-dim); font-size: 13px; margin: 8px 0 0; }
.lp-legend { display: flex; gap: 18px; margin: 8px 0 6px; font-size: 12.5px; color: var(--vrp-muted); flex-wrap: wrap; }
.lp-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.lp svg { display: block; width: 100%; height: auto; }
.lp .axis { fill: var(--vrp-dim); font-size: 10px; }

.lp-points { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 22px; }
.lp-pt {
    border: 1px solid var(--vrp-border); border-radius: 12px; padding: 20px 22px;
    background: var(--vrp-elevated);
}
.lp-pt h3 { font-size: 15px; margin: 0 0 6px; font-weight: 650; }
.lp-pt h3 em { font-style: normal; color: var(--vrp-primary); }
.lp-pt p { font-size: 13.5px; color: var(--vrp-muted); margin: 0; }

/* Feature grid. */
.lp-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.lp-feature {
    background: linear-gradient(180deg, rgba(255,255,255,.016), rgba(255,255,255,0) 52px), var(--vrp-surface);
    border: 1px solid var(--vrp-border); border-radius: 12px; padding: 22px 24px;
    transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.lp-feature:hover {
    border-color: rgba(123,134,255,.4); transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.lp-feature .lp-f-icon {
    width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
    background: var(--vrp-primary-bg); color: var(--vrp-primary); margin-bottom: 14px;
}
.lp-feature h3 { font-size: 15.5px; font-weight: 650; margin: 0 0 6px; }
.lp-feature p { font-size: 13.5px; color: var(--vrp-muted); margin: 0; }

/* Final CTA panel. */
.lp-final {
    margin: 90px 0 70px; text-align: center; border-radius: 16px; padding: 74px 30px;
    border: 1px solid var(--vrp-border); position: relative; overflow: hidden;
    background:
        radial-gradient(720px 300px at 50% -80px, rgba(123,134,255,.16), transparent 65%),
        radial-gradient(2px 2px at 22% 38%, rgba(255,255,255,.32), transparent 55%),
        radial-gradient(2px 2px at 57% 24%, rgba(154,162,255,.38), transparent 55%),
        radial-gradient(2px 2px at 84% 56%, rgba(52,211,153,.32), transparent 55%),
        var(--vrp-elevated);
}
.lp-final h2 { font-size: clamp(26px, 3.6vw, 36px); margin: 0 0 12px; letter-spacing: -.02em; }
.lp-final p { color: var(--vrp-muted); margin: 0 auto 28px; max-width: 540px; }

.lp-footer {
    border-top: 1px solid var(--vrp-border); padding: 30px 0 36px;
    color: var(--vrp-dim); font-size: 13px; text-align: center;
}

/* ── Scroll reveal ── */
.rv { opacity: 0; transform: translateY(26px); transition: opacity .7s cubic-bezier(.2,.6,.2,1), transform .7s cubic-bezier(.2,.6,.2,1); }
.rv.in { opacity: 1; transform: none; }
.rv-d1 { transition-delay: .08s; } .rv-d2 { transition-delay: .16s; } .rv-d3 { transition-delay: .24s; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .rv { opacity: 1; transform: none; transition: none; }
    .lp-chapter { transition: none; }
    .lp-scroll-cue svg { animation: none; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .lp-nav-links { display: none; }
    /* On narrow screens the hero text column fills the viewport, so the starfield's ticker labels
       (AMD +1.6%, MSFT…) collide with the paragraph and read as clutter. A radial scrim behind the
       copy darkens the immediate area so the text stays legible while stars still show at the edges.
       Sits above the canvas (hero-inner is its own z-index:2 context) but behind the text (z-index:-1). */
    .lp-hero-inner::before {
        content: ""; position: absolute; z-index: -1; inset: -8% -6%; pointer-events: none;
        background: radial-gradient(115% 78% at 50% 44%,
            var(--vrp-bg) 34%, rgba(14, 17, 24, .68) 58%, transparent 80%);
    }
    .lp-points, .lp-features { grid-template-columns: 1fr; }
    .lp-hud { top: auto; bottom: 86px; right: 16px; min-width: 178px; font-size: 11.5px; padding: 10px 14px; }
    .lp-chapter {
        left: 16px; right: 16px; width: auto; top: 76px;
        background: rgba(14,17,24,.72); border: 1px solid var(--vrp-border); border-radius: 12px;
        padding: 16px 18px; backdrop-filter: blur(8px);
    }
    .lp-chapter h3 { font-size: 21px; }
    .lp-progress { left: auto; right: 16px; top: 20px; transform: none; flex-direction: row; }
    .lp-illus-tag { display: none; }
    .lp section.lp-section { padding: 64px 0 16px; }
}

/* Phones: the two-button header is too wide — the "Create free account" primary already leads to
   login, so drop the redundant ghost "Sign in" and tighten spacing so nothing crowds the edge. */
@media (max-width: 560px) {
    .lp-nav { gap: 12px; height: 58px; }
    .lp-wrap { padding: 0 16px; }
    .lp-nav-cta .lp-btn-ghost { display: none; }
    .lp-nav-cta .lp-btn { padding: 9px 15px; font-size: 13px; }
    .lp-brand { font-size: 15px; }
}
