/* ==========================================================================
   Ignite — prospect project brief
   Self-contained stylesheet. No external dependencies.
   ========================================================================== */

@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/satoshi-variable.woff2') format('woff2-variations'),
         url('../fonts/satoshi-variable.woff2') format('woff2');
    font-weight: 300 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Satoshi';
    src: url('../fonts/satoshi-variable-italic.woff2') format('woff2-variations'),
         url('../fonts/satoshi-variable-italic.woff2') format('woff2');
    font-weight: 300 900;
    font-style: italic;
    font-display: swap;
}

:root {
    /* Nebula brand palette — mirrors the tokens used on nebula.design.
       The form is dark-first; --bg is derived from brand ink (#0f0b22) /
       senary (#2a086f) so the canvas reads as deep "nebula" indigo. */
    --bg: #0b0820;
    --bg-2: #15102e;
    --ink: #f6f5fb;
    --ink-dim: #b3b0c6;
    --ink-mute: #6c687b;          /* brand --charcoal */
    --accent: #d61254;            /* brand --primary    (magenta) */
    --accent-2: #82378c;          /* brand --tertiary   (purple)  */
    --accent-3: #009fe3;          /* brand --secondary  (blue)    */
    --gold: #fdc41f;              /* brand --quaternary */
    --danger: #ff5c6e;
    --success: #2fad66;           /* brand --quinary    (green)   */
    /* RGB channels for the magenta accent, reused in rgba() glows below. */
    --accent-rgb: 214, 18, 84;
    --border: rgba(255, 255, 255, 0.08);
    --card: rgba(255, 255, 255, 0.03);
    --card-hover: rgba(255, 255, 255, 0.06);
    --shadow: 0 40px 80px rgba(0, 0, 0, 0.45);
    --radius: 18px;
    --radius-sm: 10px;
    --ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (prefers-color-scheme: light) {
    :root {
        --bg: #f3f2f7;            /* brand --senary-50 */
        --bg-2: #ffffff;
        --ink: #0f0b22;           /* brand --ink */
        --ink-dim: #4a4660;
        --ink-mute: #6c687b;      /* brand --charcoal */
        --card: rgba(255, 255, 255, 0.7);
        --card-hover: rgba(255, 255, 255, 0.95);
        --border: rgba(15, 11, 34, 0.1);
        --shadow: 0 30px 60px rgba(42, 8, 111, 0.18);
    }
}

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

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Poppins', 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
    font-size: clamp(15px, 1.05vw + 0.6rem, 18px);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1200px 600px at 20% 0%, rgba(214, 18, 84, 0.22), transparent 70%),
        radial-gradient(900px 600px at 100% 100%, rgba(130, 55, 140, 0.20), transparent 70%),
        radial-gradient(700px 500px at 0% 100%, rgba(0, 159, 227, 0.14), transparent 70%);
    z-index: -2;
    pointer-events: none;
    animation: drift 30s ease-in-out infinite alternate;
}
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 24px 24px;
    z-index: -1;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, black, transparent 80%);
}
@media (prefers-color-scheme: light) {
    body::after { background-image: radial-gradient(rgba(10, 10, 20, 0.06) 1px, transparent 1px); }
}

@keyframes drift {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-5%, 3%, 0) scale(1.1); }
}

#gradient-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -3;
    pointer-events: none;
    opacity: 0.6;
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
    #gradient-canvas { display: none; }
    * { transition: none !important; animation: none !important; }
}

/* ---------- Layout ---------- */

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px clamp(20px, 5vw, 60px);
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--ink);
    text-decoration: none;
}
/* The wordmark inherits `color` via fill:currentColor in the SVG, so it
   stays legible on both the dark and light schemes; the orbit mark keeps
   its own brand colours. */
.brand .logo {
    height: 26px;
    width: auto;
    display: block;
}
/* Small product tag so the form still reads as "Nebula · Ignite". */
.brand .ignite-tag {
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    white-space: nowrap;
}

.progress-wrap {
    flex: 1;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ink-dim);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-weight: 600;
}
.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}
@media (prefers-color-scheme: light) {
    .progress-bar { background: rgba(10, 10, 20, 0.08); }
}
.progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    border-radius: 999px;
    transition: width 0.6s var(--ease-out-expo);
    box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.6);
}

/* ---------- Hero / intro ---------- */

.stage {
    flex: 1;
    display: grid;
    /* All three sections (.intro, .question-stage, .review) share this
       single cell — see the `grid-row/column: 1` rule below — so that when
       Alpine crossfades between them there's no layout shift. */
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 1fr;
    padding: 40px clamp(20px, 5vw, 60px) 80px;
    position: relative;
}

.intro,
.question-stage,
.review {
    grid-row: 1;
    grid-column: 1;
    align-self: center;
}

.intro {
    text-align: center;
    max-width: 780px;
    margin: 0 auto;
}
@keyframes intro-fade-up {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
.intro > * {
    animation: intro-fade-up 0.7s var(--ease-out-expo) both;
}
.intro > *:nth-child(1) { animation-delay: 0ms; }
.intro > *:nth-child(2) { animation-delay: 80ms; }
.intro > *:nth-child(3) { animation-delay: 160ms; }
.intro > *:nth-child(4) { animation-delay: 240ms; }
.intro > *:nth-child(5) { animation-delay: 320ms; }
.intro > *:nth-child(n+6) { animation-delay: 400ms; }
.intro .eyebrow {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 24px;
}
.intro h1 {
    font-size: clamp(40px, 7vw, 84px);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.08;
    margin: 0 0 24px;
    padding-bottom: 0.08em;
    background: linear-gradient(180deg, var(--ink) 0%, var(--ink-dim) 120%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.intro p {
    font-size: clamp(16px, 1.4vw + 0.4rem, 20px);
    color: var(--ink-dim);
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}
.intro .meta {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
    font-size: 13px;
    color: var(--ink-mute);
}
.intro .meta span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- Question card ---------- */

.question-stage {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    min-height: 420px;
}
.question {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0;
    pointer-events: none;
}
/* Typeform-style card-stack transition. Alpine sets exactly one of
   .is-future / .is-active / .is-past on each question based on stepIndex.
   Going forward (Next): current slides UP and out, next slides UP from below.
   Going backward (Back): current slides DOWN and out, prev slides DOWN
   from above. Both slides run sequentially (350ms out, 350ms in) so there
   is never a moment where two questions are visible together. */

/* Future: not yet reached. Parked BELOW, waiting to rise into view. */
.question.is-future {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.35s var(--ease-out-expo),
                transform 0.35s var(--ease-out-expo);
}
/* Past: already answered. Parked ABOVE, having slid up off-stage. */
.question.is-past {
    opacity: 0;
    transform: translateY(-40px);
    transition: opacity 0.35s var(--ease-out-expo),
                transform 0.35s var(--ease-out-expo);
}
/* Active: on stage. Incoming transitions wait for the outgoing question to
   clear (~0.35s) before starting — total hand-off ≈ 0.7s, zero overlap. */
.question.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity 0.35s var(--ease-out-expo) 0.35s,
                transform 0.35s var(--ease-out-expo) 0.35s;
}
.question .index {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.question .index .emoji { font-size: 16px; }
.question .label {
    font-size: clamp(26px, 3.4vw + 0.6rem, 44px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin: 0 0 14px;
    color: var(--ink);
}
.question .help {
    font-size: 16px;
    color: var(--ink-dim);
    margin: 0 0 32px;
    line-height: 1.55;
}
/* Grouped step: stacked fields, each with a small sub-label. Uses a
   slightly smaller h2 so the shared heading doesn't dwarf the form. */
.question.is-grouped .label {
    font-size: clamp(24px, 2.4vw + 0.5rem, 36px);
}
.question .field-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
}
.question .sub-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-mute);
    margin-bottom: 6px;
}
/* On grouped steps the inputs can be a touch smaller so five of them fit
   comfortably in the viewport without overflow. */
.question.is-grouped .field input[type="text"],
.question.is-grouped .field input[type="email"],
.question.is-grouped .field input[type="tel"],
.question.is-grouped .field input[type="url"] {
    padding: 14px 18px;
    font-size: clamp(16px, 0.6vw + 0.6rem, 18px);
}

/* ---------- Inputs ---------- */

.field {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="url"],
.field textarea {
    width: 100%;
    padding: 20px 22px;
    font: inherit;
    font-size: clamp(18px, 1.4vw + 0.4rem, 22px);
    font-weight: 500;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
    font-family: inherit;
}
.field input:focus,
.field textarea:focus {
    border-color: var(--accent);
    background: var(--card-hover);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18);
}
.field textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.55;
}
.field textarea.long {
    min-height: 220px;
}
.field .char-count {
    font-size: 12px;
    color: var(--ink-mute);
    text-align: right;
}

.choices {
    display: grid;
    gap: 10px;
}
.choices.grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.choice {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s var(--ease-out-expo);
    user-select: none;
}
.choice:hover {
    background: var(--card-hover);
    border-color: rgba(var(--accent-rgb), 0.4);
    transform: translateY(-1px);
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--ink-mute);
    flex-shrink: 0;
    position: relative;
    transition: all 0.25s;
}
.choice .dot.square { border-radius: 6px; }
.choice.is-selected {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}
.choice.is-selected .dot {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.2);
}
.choice.is-selected .dot::after {
    content: '';
    position: absolute;
    inset: 4px;
    background: white;
    border-radius: inherit;
    transform: scale(0.6);
}
.choice .label { font-weight: 500; font-size: 16px; }

/* ---------- Upload ---------- */

.upload-zone {
    /* <label> is inline by default — flex it so the dashed border wraps
       the icon/text/hint as a proper block. Use a much more visible
       dashed color than `--border` (which is almost invisible on the
       dark background and made the outline look broken). */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.22);
    border-radius: var(--radius);
    padding: 44px 24px;
    text-align: center;
    cursor: pointer;
    background: var(--card);
    transition: border-color 0.25s var(--ease-out-expo),
                background 0.25s var(--ease-out-expo),
                transform 0.25s var(--ease-out-expo);
}
@media (prefers-color-scheme: light) {
    .upload-zone { border-color: rgba(10, 10, 20, 0.18); }
}
.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.08);
}
.upload-zone.is-dragging {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.14);
    transform: scale(1.01);
}
.upload-zone .icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
    filter: saturate(1.1);
}
.upload-zone strong { color: var(--ink); font-weight: 700; }
.upload-zone .hint {
    color: var(--ink-mute);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
    margin-top: 4px;
}
.upload-list {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.upload-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
}
.upload-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-item .size { color: var(--ink-mute); font-size: 12px; }
.upload-item .remove {
    background: none;
    border: none;
    color: var(--ink-mute);
    cursor: pointer;
    font-size: 18px;
    padding: 4px 8px;
    transition: color 0.2s;
}
.upload-item .remove:hover { color: var(--danger); }

/* ---------- Nav buttons ---------- */

.nav {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 36px;
}
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    font: inherit;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
    font-family: inherit;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: white;
    box-shadow: 0 10px 30px rgba(var(--accent-rgb), 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 40px rgba(var(--accent-rgb), 0.5);
}
.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-ghost {
    background: var(--card);
    color: var(--ink-dim);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--card-hover); color: var(--ink); }
.nav .hint {
    font-size: 12px;
    color: var(--ink-mute);
    margin-left: auto;
}
.nav .hint kbd {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 11px;
    background: var(--card);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
}

.error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- Section divider / transition ---------- */

.section-intro {
    text-align: center;
    padding: 60px 0;
}
.section-intro .emoji {
    font-size: 64px;
    display: block;
    margin-bottom: 20px;
    animation: floaty 3s ease-in-out infinite;
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
.section-intro h2 {
    font-size: clamp(36px, 5vw, 64px);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 0 0 12px;
}
.section-intro p {
    font-size: 18px;
    color: var(--ink-dim);
    margin: 0;
}

/* ---------- Review / submit ---------- */

.review {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}
.review h2 {
    font-size: 32px;
    margin: 0 0 8px;
}
.review p { color: var(--ink-dim); margin: 0 0 24px; }
.review .sections {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.review .sec-card {
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.review .sec-card .emoji { font-size: 24px; }
.review .sec-card .check { margin-left: auto; color: var(--success); font-weight: 700; }

/* ---------- Spinner ---------- */

.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Thank you ---------- */

.thanks {
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
    padding: 80px 20px;
}
.thanks .big {
    font-size: 120px;
    margin-bottom: 20px;
    animation: pop 0.6s var(--ease-out-back);
}
@keyframes pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.thanks h1 {
    font-size: clamp(40px, 6vw, 68px);
    margin: 0 0 16px;
    font-weight: 900;
    letter-spacing: -0.03em;
}
.thanks p { font-size: 18px; color: var(--ink-dim); margin: 0 0 32px; }
.thanks .ref {
    font-family: ui-monospace, Menlo, monospace;
    font-size: 12px;
    color: var(--ink-mute);
    padding: 8px 14px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-block;
}

/* ---------- Footer ---------- */

.foot {
    padding: 40px clamp(20px, 5vw, 60px);
    text-align: center;
    font-size: 12px;
    color: var(--ink-mute);
}
.foot a { color: var(--ink-dim); text-decoration: none; }

/* ---------- Dev prefill button (APP_DEBUG only) ---------- */

.dev-prefill {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    padding: 10px 16px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #0f0b22;
    background: linear-gradient(135deg, var(--gold), var(--accent));
    border: none;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(var(--accent-rgb), 0.35);
    transition: transform 0.2s var(--ease-out-expo), box-shadow 0.2s var(--ease-out-expo);
    font-family: inherit;
}
.dev-prefill:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(var(--accent-rgb), 0.5);
}

/* ---------- Honeypot ---------- */

.hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ---------- Mobile tweaks ---------- */

@media (max-width: 640px) {
    .top-bar { padding: 16px 20px; flex-wrap: wrap; }
    .progress-wrap { order: 3; flex: 1 1 100%; }
    .question-stage { min-height: 360px; }
    .question { padding: 20px 0; }
    .field input, .field textarea { font-size: 18px; }
    .nav .hint { display: none; }
    .btn { padding: 14px 22px; }
}
