/* ==========================================================
   Landing page - built on the same --theme-* variables as the
   app (see includes/settings.php -> theme_css_vars()), plus a
   fixed --down color for bearish candles (not admin-themeable,
   matches the in-app red used for losses/rejections everywhere).
   ========================================================== */

:root {
    --down: #ef4444;
    --ink: #e7ebf1;
    --muted: #8b94a1;
    --faint: #5b6472;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.landing {
    margin: 0;
    background: var(--theme-bg);
    color: var(--ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.landing a { color: inherit; text-decoration: none; }

.eyebrow {
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--theme-primary);
    display: inline-flex;
    align-items: center;
    gap: 9px;
}
.eyebrow::before {
    content: '';
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--theme-primary);
    box-shadow: 0 0 10px var(--theme-primary);
}

.display {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.04;
}

.lede { font-size: 17px; line-height: 1.65; color: var(--muted); max-width: 46ch; }

/* ---------- Nav ---------- */
.l-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px clamp(20px, 5vw, 56px);
    background: linear-gradient(to bottom, rgba(10,14,20,.85), transparent);
    backdrop-filter: blur(6px);
}
.l-nav .brand { display: flex; align-items: center; gap: 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 16px; }
.l-nav .brand .badge {
    width: 32px; height: 32px; border-radius: 9px;
    background: linear-gradient(135deg, var(--theme-primary), var(--theme-accent));
    display: flex; align-items: center; justify-content: center; color: #06110d; font-weight: 800;
}
.l-nav .links { display: flex; align-items: center; gap: 28px; font-size: 14px; color: var(--muted); }
.l-nav .links a:hover { color: var(--ink); }
.l-nav .cta-group { display: flex; align-items: center; gap: 14px; }
@media (max-width: 760px) { .l-nav .links { display: none; } }

/* ---------- Buttons ---------- */
.btn-l {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 26px; border-radius: 11px; font-weight: 700; font-size: 14.5px;
    border: 1px solid transparent; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
    white-space: nowrap;
}
.btn-l-primary { background: var(--theme-primary); color: #06110d; box-shadow: 0 6px 24px color-mix(in srgb, var(--theme-primary) 45%, transparent); }
.btn-l-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 30px color-mix(in srgb, var(--theme-primary) 55%, transparent); }
.btn-l-ghost { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.14); color: var(--ink); }
.btn-l-ghost:hover { background: rgba(255,255,255,.09); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center;
    padding: 140px 20px 80px;
    overflow: hidden;
}
#heroCanvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.hero-fallback-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        radial-gradient(ellipse at 50% 20%, color-mix(in srgb, var(--theme-primary) 18%, transparent), transparent 60%),
        radial-gradient(ellipse at 80% 80%, color-mix(in srgb, var(--theme-accent) 14%, transparent), transparent 55%),
        var(--theme-bg);
}
.hero-scrim {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(180deg, rgba(10,14,20,.35) 0%, rgba(10,14,20,.15) 40%, var(--theme-bg) 92%);
}
.hero-content { position: relative; z-index: 2; max-width: 780px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.hero-content .eyebrow { margin-bottom: 2px; }
.hero h1 { font-size: clamp(38px, 6.4vw, 74px); margin: 0; }
.hero h1 .accent-word { color: var(--theme-primary); }
.hero .lede { font-size: 18px; max-width: 52ch; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.hero-stats {
    margin-top: 46px; display: flex; gap: clamp(24px, 6vw, 64px); flex-wrap: wrap; justify-content: center;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-family: 'DM Mono', monospace; font-size: 30px; font-weight: 500; color: var(--ink); }
.hero-stat .num span { color: var(--theme-primary); }
.hero-stat .lbl { font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-top: 4px; }

.scroll-cue {
    position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    font-family: 'DM Mono', monospace; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint);
    animation: float-y 2.4s ease-in-out infinite;
}
.scroll-cue .line { width: 1px; height: 26px; background: linear-gradient(var(--theme-primary), transparent); }
@keyframes float-y { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* ---------- Sections ---------- */
.l-section { padding: 120px clamp(20px, 6vw, 64px); max-width: 1180px; margin: 0 auto; }
.l-section-head { max-width: 640px; margin-bottom: 56px; }
.l-section-head h2 { font-size: clamp(28px, 4vw, 42px); margin: 14px 0 0; }
.l-section-head .lede { margin-top: 14px; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- How it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; counter-reset: step; }
.step { position: relative; padding: 30px 26px; border-radius: 18px; background: var(--theme-surface); border: 1px solid rgba(255,255,255,.06); }
.step .step-num { font-family: 'Space Grotesk', sans-serif; font-size: 46px; font-weight: 700; color: color-mix(in srgb, var(--theme-primary) 30%, transparent); line-height: 1; }
.step h3 { font-size: 18px; margin: 16px 0 8px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.step-arrow { display: flex; align-items: center; justify-content: center; color: var(--faint); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } .step-arrow { display: none; } }

/* ---------- Live signal demo ---------- */
.demo-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.demo-panel {
    background: var(--theme-surface); border: 1px solid rgba(255,255,255,.08); border-radius: 20px;
    padding: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.demo-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.demo-panel-head .live-dot { display: inline-flex; align-items: center; gap: 7px; font-family: 'DM Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--theme-primary); }
.demo-panel-head .live-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--theme-primary); animation: pulse-dot 1.6s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.demo-result { margin-top: 14px; text-align: center; font-family: 'DM Mono', monospace; font-size: 13px; color: var(--faint); min-height: 20px; }
.demo-result.won { color: var(--theme-primary); font-weight: 700; }
.demo-note { font-size: 12px; color: var(--faint); margin-top: 10px; text-align: center; }
.demo-copy .lede { margin-bottom: 22px; }
.demo-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.demo-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink); }
.demo-list li .ico { color: var(--theme-primary); flex-shrink: 0; margin-top: 2px; }
@media (max-width: 900px) { .demo-wrap { grid-template-columns: 1fr; } }

/* ---------- Trust grid ---------- */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust-card { padding: 26px 22px; border-radius: 16px; background: var(--theme-surface); border: 1px solid rgba(255,255,255,.06); }
.trust-card .ico-box {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--theme-primary) 14%, transparent); color: var(--theme-primary); margin-bottom: 16px;
}
.trust-card h3 { font-size: 15.5px; margin: 0 0 6px; }
.trust-card p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }
@media (max-width: 980px) { .trust-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .trust-grid { grid-template-columns: 1fr; } }

/* ---------- Referral network ---------- */
.network-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.network-visual { position: relative; aspect-ratio: 1 / 1; max-width: 420px; margin: 0 auto; }
.network-visual svg { width: 100%; height: 100%; }
.network-copy .lede { margin-bottom: 20px; }
.network-pct { display: flex; gap: 22px; margin-top: 24px; flex-wrap: wrap; }
.network-pct .p { font-family: 'DM Mono', monospace; }
.network-pct .p b { color: var(--theme-secondary); font-size: 20px; display: block; }
.network-pct .p span { font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 900px) { .network-wrap { grid-template-columns: 1fr; } .network-copy { order: 2; } }

/* ---------- Final CTA ---------- */
.final-cta {
    margin: 40px clamp(20px, 6vw, 64px) 0; padding: 70px clamp(24px, 6vw, 64px);
    border-radius: 28px; text-align: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--theme-primary) 18%, var(--theme-surface)), var(--theme-surface));
    border: 1px solid rgba(255,255,255,.08);
    display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.final-cta h2 { font-size: clamp(26px, 4vw, 40px); margin: 0; max-width: 20ch; }

/* ---------- Footer ---------- */
.l-footer { padding: 50px clamp(20px, 6vw, 64px) 40px; border-top: 1px solid rgba(255,255,255,.06); margin-top: 60px; }
.l-footer-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 24px; margin-bottom: 28px; }
.l-footer .brand { display: flex; align-items: center; gap: 9px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; }
.l-footer-links { display: flex; gap: 24px; font-size: 13.5px; color: var(--muted); }
.l-footer-disclaimer { font-size: 12px; color: var(--faint); line-height: 1.7; max-width: 900px; }
.l-footer-bottom { margin-top: 22px; font-size: 12px; color: var(--faint); }
.l-dev-credit {
    background: none; border: none; padding: 0; color: var(--faint); font-size: 12px;
    font-family: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.l-dev-credit:hover { color: var(--theme-primary); }

/* ---------- Flux contact modal ---------- */
.l-modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 60;
    background: rgba(5,8,14,.75); backdrop-filter: blur(2px);
    align-items: center; justify-content: center; padding: 20px;
}
.l-modal-overlay.open { display: flex; }
.l-modal-box {
    width: 100%; max-width: 440px; max-height: calc(100vh - 40px); overflow-y: auto;
    background: var(--theme-surface); border: 1px solid rgba(255,255,255,.1); border-radius: 18px;
    padding: 28px; position: relative; box-shadow: 0 24px 70px rgba(0,0,0,.55);
    animation: l-modal-pop .15s ease;
}
@keyframes l-modal-pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.l-modal-close {
    position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
    color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.l-modal-close:hover { background: rgba(255,255,255,.14); }
.l-modal-title { font-family: 'Space Grotesk', sans-serif; font-size: 21px; margin: 10px 0 4px; }
.l-modal-sub { font-size: 13.5px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; max-width: none; }

.l-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.l-form-group { margin-bottom: 14px; }
.l-form-group label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.l-form-group input, .l-form-group textarea {
    width: 100%; padding: 10px 13px; border-radius: 10px; font-family: inherit; font-size: 14px;
    background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.12); color: var(--ink); resize: vertical;
}
.l-form-group input:focus, .l-form-group textarea:focus { outline: none; border-color: var(--theme-primary); }
.l-form-error { font-size: 12.5px; color: #ef4444; background: rgba(239,68,68,.1); border-radius: 8px; padding: 9px 12px; margin-bottom: 14px; }

.l-success-tick {
    width: 62px; height: 62px; border-radius: 50%; margin: 0 auto;
    background: color-mix(in srgb, var(--theme-primary) 18%, transparent);
    color: var(--theme-primary); display: flex; align-items: center; justify-content: center;
}
.l-success-tick svg { width: 30px; height: 30px; }

@media (max-width: 480px) { .l-form-row { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
    .reveal { transition: none; }
    .scroll-cue { animation: none; }
    .demo-panel-head .live-dot::before { animation: none; }
}
