/* ─── Public landing page ──────────────────────────────────────────────────
   Standalone stylesheet: the app's style.css pins html/body to a fixed
   header + self-scrolling panes, and a marketing page needs to scroll. The
   tokens mirror the shared Rapid Fusion palette (style.css / Apollo
   tokens.css) so the page is on brand without inheriting app layout. */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0a0f;
    --bg-panel: #16161b;
    --bg-card: #1e1e24;
    --primary: #A74E9E;
    --primary-light: #BB6DB3;
    --primary-dark: #933C85;
    --text: #ffffff;
    --text-2: #a0a0a8;
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --radius: 12px;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(1100px 500px at 85% -5%, rgba(167, 78, 158, 0.14), transparent 60%),
        radial-gradient(900px 500px at -10% 40%, rgba(167, 78, 158, 0.07), transparent 60%),
        var(--bg);
    color: var(--text);
    font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p {
    text-wrap: pretty;
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-weight: 700;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(167, 78, 158, 0.35);
}

.btn-ghost {
    border-color: var(--border-light);
    background: transparent;
    color: var(--text-2);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: rgba(167, 78, 158, 0.6);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 17px;
}

.btn-block {
    width: 100%;
}

/* ── Nav ── */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 48px);
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}

.nav-logo {
    height: 34px;
    width: auto;
    flex: 0 0 auto;
}

.nav-name {
    font-weight: 800;
    font-size: 17px;
    white-space: nowrap;
}

.nav-product {
    color: var(--text-2);
    font-size: 13px;
    border-left: 1px solid var(--border-light);
    padding-left: 10px;
    white-space: nowrap;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(10px, 2vw, 24px);
}

.nav-links > a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.nav-links > a:hover {
    color: var(--text);
}

@media (max-width: 820px) {
    .nav-links > a:not(.nav-signin) { display: none; }
    .nav-product { display: none; }
}

@media (max-width: 720px) {
    /* Logo + CTA carry the phone nav; sign-in lives in the footer too. */
    .nav-links > a.nav-signin { display: none; }
}

/* ── Hero ── */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 64px);
    align-items: center;
    padding: clamp(40px, 8vh, 96px) clamp(16px, 4vw, 48px) clamp(32px, 6vh, 72px);
    max-width: 1280px;
    margin: 0 auto;
}

.hero-eyebrow {
    color: var(--primary-light);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 14px;
}

.hero h1 {
    font-size: clamp(40px, 6vw, 68px);
    font-weight: 800;
}

.grad-text {
    background: linear-gradient(120deg, var(--primary-light), var(--primary) 60%, #7a4275);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    margin-top: 20px;
    font-size: clamp(16px, 1.6vw, 19px);
    color: var(--text-2);
    max-width: 54ch;
}

.hero-sub strong {
    color: var(--text);
}

.hero-ctas {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}

.hero-note {
    margin-top: 14px;
    font-size: 13px;
    color: var(--text-2);
}

.hero-visual {
    /* The animated purple wash comes from the shared .rf-ambient layer in
       motion.css; the panel itself is just the frame around it. */
    position: relative;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--bg-panel);
    overflow: hidden;
    aspect-ratio: 5 / 4;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.45),
        0 8px 32px rgba(167, 78, 158, 0.10);
}

#hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-visual-caption {
    position: absolute;
    left: 14px;
    bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-2);
    background: rgba(10, 10, 15, 0.7);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 5px 12px;
    backdrop-filter: blur(6px);
}

.hero-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-light);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    50% { opacity: 0.4; }
}

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    /* Copy first on a phone: the pitch sells, the animation garnishes. */
    .hero-visual { max-height: 300px; aspect-ratio: auto; height: 260px; }
}

/* ── Trust strip ── */
.strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px 22px;
    padding: 18px clamp(16px, 4vw, 48px);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-2);
    font-size: 14px;
    font-weight: 600;
}

.strip i {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary);
}

/* ── Sections ──
   Padding is asymmetric on purpose: the bottom carries a touch more weight
   than the top, which reads as calmer on scroll than perfectly-even blocks. */
.section {
    max-width: 1180px;
    margin: 0 auto;
    padding: clamp(44px, 8vh, 96px) clamp(16px, 4vw, 48px) clamp(56px, 10vh, 116px);
}

.section h2, .cta h2 {
    font-size: clamp(28px, 3.6vw, 42px);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-sub {
    color: var(--text-2);
    margin-top: 12px;
    max-width: 62ch;
}

.section-alt {
    max-width: none;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-alt > * {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.section-alt > .section-sub {
    margin-top: 10px;
}

/* ── Cards ── */
.cards-3, .cards-4, .demo-cards {
    display: grid;
    gap: 18px;
    margin-top: 36px;
}

.cards-3, .demo-cards { grid-template-columns: repeat(3, 1fr); }
.cards-4 { grid-template-columns: repeat(4, 1fr); }

/* Small-laptop / tablet: hold 2-up on the 3-card rows before dropping to a
   single column on phones. The old rule jumped straight from 3 to 1 at
   980px, leaving a wall of oversized cards on a 900px window. */
@media (max-width: 980px) {
    .cards-3, .demo-cards { grid-template-columns: repeat(2, 1fr); }
    .cards-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .cards-3, .demo-cards { grid-template-columns: 1fr; }
    .cards-4 { grid-template-columns: 1fr; }
}

.card {
    background: linear-gradient(145deg, rgba(55, 55, 60, 0.35) 0%, rgba(30, 30, 36, 0.9) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: rgba(167, 78, 158, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(167, 78, 158, 0.12);
}

.card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.card p {
    color: var(--text-2);
    font-size: 14.5px;
}

.card-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(167, 78, 158, 0.18);
    border: 1px solid rgba(167, 78, 158, 0.5);
    color: var(--primary-light);
    font-weight: 800;
    margin-bottom: 14px;
}

.card-sm { padding: 20px; }
.card-sm h3 { font-size: 16px; }

/* ── Demo cards ── */
.demo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.demo-card h3 {
    font-size: 17px;
    margin: 16px 20px 6px;
}

.demo-card p {
    color: var(--text-2);
    font-size: 14px;
    margin: 0 20px 18px;
}

.demo-card img.demo-thumb {
    width: 100%;
    height: 170px;
    object-fit: cover;
    display: block;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border);
}

/* ── CTA ── */
.cta {
    text-align: center;
    padding: clamp(56px, 10vh, 120px) clamp(16px, 4vw, 48px);
    max-width: 760px;
    margin: 0 auto;
}

.cta p {
    color: var(--text-2);
    margin: 14px 0 26px;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid var(--border);
    padding: 36px clamp(16px, 4vw, 48px) 44px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
}

.footer-links a {
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: var(--primary-light);
}

.footer-note {
    color: var(--text-2);
    font-size: 12.5px;
}

/* ── Signup modal ── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-card {
    position: relative;
    width: min(430px, 100%);
    background: var(--bg-panel);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.modal-card h2 {
    font-size: 22px;
}

.modal-sub {
    color: var(--text-2);
    font-size: 14.5px;
    margin: 8px 0 18px;
}

.modal-card label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    margin: 14px 0 6px;
}

.modal-card input {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 11px 13px;
}

.modal-card input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(167, 78, 158, 0.25);
}

.modal-card .btn-block {
    margin-top: 22px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-2);
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text);
}

.modal-fine {
    color: var(--text-2);
    font-size: 12px;
    margin-top: 14px;
    line-height: 1.5;
}

.form-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13.5px;
    margin-top: 14px;
}

.form-error.hidden, .hidden {
    display: none;
}

.hp-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
}

.sent-icon {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--primary-light);
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: var(--primary-light);
    text-decoration: underline;
    cursor: pointer;
}

#resend-status {
    color: var(--text-2);
    margin-left: 6px;
}

/* ─── Phone polish (≤720px) ─────────────────────────────────────────────── */
html {
    -webkit-tap-highlight-color: transparent;
}

.btn:active, .link-btn:active, .nav-links a:active {
    transform: scale(0.97);
    opacity: 0.85;
}

@media (max-width: 720px) {
    body {
        font-size: 15px;
    }

    .nav {
        padding: 10px 14px;
        padding-top: max(10px, env(safe-area-inset-top, 0px));
    }

    .nav-logo { height: 28px; }
    .nav-name { font-size: 15px; }

    .nav-links .btn {
        padding: 10px 14px;
        font-size: 14px;
    }

    .hero {
        padding-top: 34px;
        padding-bottom: 26px;
        gap: 22px;
    }

    .hero h1 {
        font-size: clamp(34px, 10.5vw, 44px);
    }

    .hero-ctas .btn-lg {
        width: 100%;
        justify-content: center;
        padding: 15px 20px;
    }

    .strip {
        font-size: 12px;
        gap: 8px 14px;
        padding: 14px;
    }

    .section {
        padding-top: 44px;
        padding-bottom: 44px;
    }

    .card { padding: 20px; }

    /* Buttons and links are for thumbs. */
    .btn { min-height: 46px; }

    /* iOS zoom-jumps the page when a focused control is under 16px. */
    .modal-card input {
        font-size: 16px;
    }

    /* Signup becomes a bottom sheet. */
    .modal {
        align-items: flex-end;
        padding: 0;
    }

    .modal-card {
        width: 100%;
        border-radius: 18px 18px 0 0;
        padding: 26px 20px calc(26px + env(safe-area-inset-bottom, 0px));
        max-height: 92dvh;
    }

    .cta {
        padding-top: 48px;
        padding-bottom: 56px;
    }

    .cta .btn-lg {
        width: 100%;
        justify-content: center;
    }

    .footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    }
}
