/* ============================================================
   Qualifier — Ethereal Glass
   OLED base, mesh orbs, double-bezel enclosures, spring motion.
   ============================================================ */

:root {
    --bg: #050505;
    --ink: #f4f4f5;
    --ink-dim: #a1a1aa;
    --ink-faint: #6b6b74;
    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.14);
    --violet: #8b7cf6;
    --hair: rgba(255, 255, 255, 0.08);
    --hair-strong: rgba(255, 255, 255, 0.14);
    --shell-bg: rgba(255, 255, 255, 0.035);
    --core-bg: #0a0a0c;
    --spring: cubic-bezier(0.32, 0.72, 0, 1);
    --r-shell: 2.25rem;
    --r-core: calc(2.25rem - 0.5rem);
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    min-height: 100dvh;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', ui-sans-serif, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ---------- Ambient field ---------- */

.mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    display: block;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.5;
    will-change: transform;
}

.orb-a {
    width: 46vw;
    height: 46vw;
    min-width: 380px;
    min-height: 380px;
    top: -14vh;
    left: -8vw;
    background: radial-gradient(circle, rgba(52, 211, 153, 0.4), transparent 68%);
    animation: drift-a 26s var(--spring) infinite alternate;
}

.orb-b {
    width: 40vw;
    height: 40vw;
    min-width: 320px;
    min-height: 320px;
    bottom: -18vh;
    right: -10vw;
    background: radial-gradient(circle, rgba(139, 124, 246, 0.34), transparent 68%);
    animation: drift-b 32s var(--spring) infinite alternate;
}

@keyframes drift-a {
    to {
        transform: translate3d(6vw, 8vh, 0) scale(1.14);
    }
}

@keyframes drift-b {
    to {
        transform: translate3d(-7vw, -6vh, 0) scale(1.1);
    }
}

.grain {
    position: fixed;
    inset: 0;
    z-index: 60;
    pointer-events: none;
    opacity: 0.032;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Floating rail ---------- */

.rail {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    padding: 1.5rem 1rem 0;
    opacity: 0;
    transform: translate3d(0, -12px, 0);
    transition: opacity 700ms var(--spring), transform 700ms var(--spring);
}

.rail.on {
    opacity: 1;
    transform: none;
}

.rail-inner {
    display: flex;
    align-items: center;
    gap: 1.15rem;
    padding: 0.6rem 1.15rem;
    border-radius: 999px;
    background: rgba(10, 10, 12, 0.6);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
    border: 1px solid var(--hair);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.07);
}

.rail-mark {
    font-size: 0.6rem;
    letter-spacing: 0.22em;
    font-weight: 600;
    color: var(--ink-faint);
    text-decoration: none;
    transition: color 420ms var(--spring);
}

.rail-mark:hover {
    color: var(--accent);
}

.dots {
    display: flex;
    gap: 5px;
}

.dot {
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    transition: transform 600ms var(--spring), background-color 600ms var(--spring);
}

.dot.done {
    background: var(--accent);
}

.dot.now {
    background: var(--accent);
    transform: scale(1.9);
}

.rail-step {
    font-size: 0.65rem;
    font-variant-numeric: tabular-nums;
    color: var(--ink-faint);
    min-width: 2.6rem;
    text-align: right;
}

/* ---------- Stage + double-bezel ---------- */

.stage {
    position: relative;
    z-index: 10;
    flex: 1;
    width: 100%;
    max-width: 46rem;
    margin: 0 auto;
    padding: 4rem 1rem 6rem;
    display: flex;
    align-items: center;
}

.shell {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--r-shell);
    background: var(--shell-bg);
    border: 1px solid var(--hair);
    box-shadow: 0 40px 120px -40px rgba(0, 0, 0, 0.9);
}

.core {
    padding: 3rem 2.75rem 2.5rem;
    border-radius: var(--r-core);
    background: var(--core-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.09);
}

.hidden {
    display: none !important;
}

/* ---------- Type ---------- */

.eyebrow {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(52, 211, 153, 0.2);
}

h1 {
    margin: 1.6rem 0 0;
    font-size: clamp(2.1rem, 5.4vw, 3.1rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
    font-weight: 600;
}

h1 em {
    font-style: italic;
    font-weight: 300;
    color: var(--accent);
}

h2 {
    margin: 1.5rem 0 0;
    font-size: clamp(1.4rem, 3.4vw, 1.95rem);
    line-height: 1.2;
    letter-spacing: -0.025em;
    font-weight: 600;
}

.lede {
    margin: 1.15rem 0 0;
    color: var(--ink-dim);
    font-size: 1.02rem;
    max-width: 34rem;
}

.hint {
    margin: 0.7rem 0 0;
    color: var(--ink-faint);
    font-size: 0.85rem;
}

.disclosure {
    margin: 1.6rem 0 0;
    padding: 0.85rem 1rem;
    border-left: 2px solid rgba(139, 124, 246, 0.5);
    background: rgba(139, 124, 246, 0.06);
    border-radius: 0 0.65rem 0.65rem 0;
    color: var(--ink-dim);
    font-size: 0.86rem;
}

.nudge {
    margin: 1rem 0 0;
    color: #fbbf6e;
    font-size: 0.85rem;
}

.fineprint {
    margin: 1.75rem 0 0;
    color: var(--ink-faint);
    font-size: 0.76rem;
    line-height: 1.65;
}

/* ---------- Answers ---------- */

.answers {
    margin: 1.9rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.9rem;
    width: 100%;
    padding: 0.95rem 1.15rem;
    text-align: left;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--hair);
    border-radius: 1rem;
    cursor: pointer;
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    animation: rise 620ms var(--spring) forwards;
    transition: background-color 420ms var(--spring), border-color 420ms var(--spring), transform 420ms var(--spring);
}

.opt:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: var(--hair-strong);
}

.opt:active {
    transform: scale(0.985);
}

.opt.sel {
    background: var(--accent-soft);
    border-color: rgba(52, 211, 153, 0.45);
}

.tick {
    flex: 0 0 auto;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--hair-strong);
    display: grid;
    place-items: center;
    transition: background-color 420ms var(--spring), border-color 420ms var(--spring);
}

.opt.sel .tick {
    background: var(--accent);
    border-color: var(--accent);
}

.tick svg {
    opacity: 0;
    transition: opacity 300ms var(--spring);
    color: #04140d;
}

.opt.sel .tick svg {
    opacity: 1;
}

.opt-note {
    display: block;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    color: var(--ink-faint);
}

@keyframes rise {
    to {
        opacity: 1;
        transform: none;
    }
}

textarea,
input[type='text'],
input[type='email'] {
    width: 100%;
    padding: 1rem 1.15rem;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--hair);
    border-radius: 1rem;
    resize: vertical;
    opacity: 0;
    transform: translate3d(0, 14px, 0);
    animation: rise 620ms var(--spring) forwards;
    transition: border-color 420ms var(--spring), background-color 420ms var(--spring);
}

textarea:focus,
input:focus {
    outline: none;
    border-color: rgba(52, 211, 153, 0.45);
    background: rgba(255, 255, 255, 0.045);
}

textarea::placeholder,
input::placeholder {
    color: var(--ink-faint);
}

.field-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.field + .field {
    margin-top: 1.15rem;
}

/* ---------- Buttons ---------- */

.controls {
    margin: 2.1rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.controls-end {
    flex-wrap: wrap;
}

.cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.6rem 0.6rem 0.6rem 1.5rem;
    margin-left: auto;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    color: #05100b;
    background: var(--accent);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 500ms var(--spring), opacity 500ms var(--spring), box-shadow 500ms var(--spring);
    box-shadow: 0 10px 34px -12px rgba(52, 211, 153, 0.8);
}

#startBtn,
#rPrimary {
    margin-left: 0;
    margin-top: 2.3rem;
}

.cta:hover:not(:disabled) {
    box-shadow: 0 16px 44px -12px rgba(52, 211, 153, 0.9);
}

.cta:active:not(:disabled) {
    transform: scale(0.978);
}

.cta:disabled {
    opacity: 0.32;
    cursor: not-allowed;
    box-shadow: none;
}

.cta-icon {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    background: rgba(4, 20, 13, 0.14);
    transition: transform 500ms var(--spring);
}

.cta:hover:not(:disabled) .cta-icon {
    transform: translate3d(3px, -1px, 0) scale(1.06);
}

.ghost {
    padding: 0.6rem 1.15rem;
    font: inherit;
    font-size: 0.88rem;
    color: var(--ink-dim);
    background: transparent;
    border: 1px solid var(--hair);
    border-radius: 999px;
    cursor: pointer;
    transition: color 420ms var(--spring), border-color 420ms var(--spring), transform 420ms var(--spring);
}

.ghost:hover {
    color: var(--ink);
    border-color: var(--hair-strong);
}

.ghost:active {
    transform: scale(0.985);
}

.ghost.danger:hover {
    color: #fca5a5;
    border-color: rgba(252, 165, 165, 0.4);
}

.ghost[hidden] {
    display: none;
}

/* ---------- Result readback ---------- */

.readback {
    margin: 1.9rem 0 0;
    padding: 1.35rem 1.5rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--hair);
}

.rb-row {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.5rem 0;
    font-size: 0.87rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.rb-row:last-child {
    border-bottom: none;
}

.rb-k {
    color: var(--ink-faint);
    flex: 0 0 auto;
}

.rb-v {
    color: var(--ink);
    text-align: right;
}

/* ---------- Metrics ---------- */

.metric-grid {
    margin: 2rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.6rem;
}

.metric {
    padding: 1.25rem 1.15rem;
    border-radius: 1.15rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--hair);
}

.metric b {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.metric span {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

/* ---------- Foot ---------- */

.foot {
    position: relative;
    z-index: 10;
    padding: 0 1rem 2.5rem;
    text-align: center;
    font-size: 0.72rem;
    color: var(--ink-faint);
}

/* ---------- Entrance ---------- */

.reveal {
    opacity: 0;
    transform: translate3d(0, 26px, 0);
    filter: blur(6px);
    animation: enter 900ms var(--spring) forwards;
}

@keyframes enter {
    to {
        opacity: 1;
        transform: none;
        filter: blur(0);
    }
}

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

@media (max-width: 768px) {
    .stage {
        padding: 2rem 1rem 4rem;
        align-items: flex-start;
    }

    .core {
        padding: 2rem 1.35rem 1.75rem;
    }

    .controls {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .cta,
    .ghost {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .rb-row {
        flex-direction: column;
        gap: 0.15rem;
    }

    .rb-v {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal,
    .opt,
    textarea,
    input {
        opacity: 1;
        transform: none;
        filter: none;
    }
}
