/* ============================================================================
   VolRoc landing — style.css
   ----------------------------------------------------------------------------
   Design principles:
   - restraint over expression
   - typographic hierarchy over visual noise
   - warm near-black (not pure black) for institutional feel
   - one accent (pale gold) used sparingly
   - generous negative space
   ============================================================================ */

/* ---------------------------------------------------------------------------
   Design tokens
   --------------------------------------------------------------------------- */
:root {
    /* Color palette — warm institutional dark */
    --bg:              #0A0908;     /* warm near-black */
    --bg-elevated:     #14110F;     /* subtle elevation */
    --fg:              #F5EFE6;     /* warm off-white, aged paper */
    --fg-muted:        #9B9489;     /* warm grey for secondary text */
    --fg-dim:          #5C564E;     /* tertiary, decorative */
    --gold:            #C9A961;     /* pale gold accent */
    --gold-muted:      #7A6840;     /* gold for borders, decorative rules */
    --border:          #2A2622;     /* very subtle form/divider borders */

    /* Typography */
    --font-serif:      "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --font-sans:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

    /* Spacing — geometric scale */
    --space-xxs:       0.25rem;
    --space-xs:        0.5rem;
    --space-sm:        1rem;
    --space-md:        1.5rem;
    --space-lg:        2.5rem;
    --space-xl:        4rem;
    --space-xxl:       6rem;

    /* Transitions */
    --t-fast:          150ms ease-out;
    --t-med:           300ms ease-out;
    --t-slow:          600ms ease-out;
}

/* ---------------------------------------------------------------------------
   Reset + base
   --------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--font-serif);
    font-weight: 400;
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
    /* Subtle film-grain via radial gradient — almost invisible but adds depth */
    background-image:
        radial-gradient(ellipse at top, rgba(20, 17, 15, 0.3) 0%, transparent 60%),
        radial-gradient(ellipse at bottom, rgba(20, 17, 15, 0.2) 0%, transparent 60%);
    background-attachment: fixed;

    /* Render text crisply on dark backgrounds */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ---------------------------------------------------------------------------
   Layout shell
   --------------------------------------------------------------------------- */
.page {
    min-height: 100vh;
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    gap: var(--space-xl);
    padding: var(--space-xxl) var(--space-lg) var(--space-lg);
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

/* ---------------------------------------------------------------------------
   Brand block
   --------------------------------------------------------------------------- */
.brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.wordmark {
    font-family: var(--font-serif);
    font-weight: 400;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    letter-spacing: -0.02em;
    color: var(--fg);
    line-height: 1;
    margin: 0;
}

.period {
    color: var(--gold);
}

.brand-dot {
    width: 4px;
    height: 4px;
    background: var(--gold);
    border-radius: 50%;
    margin-top: -0.5rem;
}

.eyebrow {
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--gold);
    line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   Hero block — headline + form
   --------------------------------------------------------------------------- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    justify-content: center;
}

.headline {
    font-family: var(--font-serif);
    font-weight: 300;
    font-size: clamp(2rem, 5.5vw, 3.5rem);
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--fg);
    max-width: 36ch;
}

.headline em {
    font-style: italic;
    font-weight: 400;
    color: var(--fg);
}

.rule {
    width: 3rem;
    height: 1px;
    background: var(--gold-muted);
    opacity: 0.7;
}

/* ---------------------------------------------------------------------------
   Waitlist form
   --------------------------------------------------------------------------- */
.waitlist {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    max-width: 32rem;
    border: 1px solid var(--border);
    background: transparent;
    transition: border-color var(--t-med);
}

.waitlist:focus-within {
    border-color: var(--gold-muted);
}

.waitlist-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 1rem 1.25rem;
    font-family: var(--font-serif);
    font-size: 1rem;
    color: var(--fg);
    letter-spacing: 0.01em;
    min-width: 0;
}

.waitlist-input::placeholder {
    color: var(--fg-dim);
    font-style: italic;
}

.waitlist-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.waitlist-cta {
    border: none;
    border-left: 1px solid var(--border);
    background: transparent;
    color: var(--gold);
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-med);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.waitlist-cta:hover:not(:disabled) {
    background: rgba(201, 169, 97, 0.06);
    color: var(--fg);
}

.waitlist-cta:focus-visible {
    outline: 1px solid var(--gold);
    outline-offset: 2px;
}

.waitlist-cta:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cta-arrow {
    transition: transform var(--t-fast);
}

.waitlist-cta:hover:not(:disabled) .cta-arrow {
    transform: translateX(2px);
}

/* Loading state — replace text with spinner */
.waitlist-cta.is-loading .cta-text,
.waitlist-cta.is-loading .cta-arrow {
    opacity: 0;
}

.waitlist-cta.is-loading::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    border: 1px solid transparent;
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 700ms linear infinite;
}

.waitlist-cta {
    position: relative;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Honeypot — visually hidden but accessible to bots that read DOM */
.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ---------------------------------------------------------------------------
   Form status messages
   --------------------------------------------------------------------------- */
.form-status {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    letter-spacing: 0.04em;
    color: var(--fg-muted);
    min-height: 1.2rem;
    transition: color var(--t-med);
}

.form-status.is-success {
    color: var(--gold);
}

.form-status.is-error {
    color: #C97961;  /* muted terracotta — not aggressive red */
}

/* ---------------------------------------------------------------------------
   Waveform — telemetry trace, not decoration
   --------------------------------------------------------------------------- */
.waveform-wrap {
    width: 100%;
    height: 120px;
    overflow: hidden;
    opacity: 0.65;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-lg);
    pointer-events: none;
}

.waveform {
    width: 100%;
    height: 100%;
    display: block;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.footer {
    padding-top: var(--space-md);
}

.footer-text {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 1.125rem;
    color: var(--fg);
    letter-spacing: 0.05em;
}

.period-muted {
    color: var(--gold);
}

/* ---------------------------------------------------------------------------
   Utility
   --------------------------------------------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------------------------------------------------------------------------
   Responsive — mobile-first refinements
   --------------------------------------------------------------------------- */

/* Tablet down */
@media (max-width: 768px) {
    .page {
        padding: var(--space-xl) var(--space-md) var(--space-md);
        gap: var(--space-lg);
    }

    .waveform-wrap {
        height: 80px;
        margin-top: var(--space-lg);
    }
}

/* Mobile — stack the form, smaller headline */
@media (max-width: 480px) {
    .page {
        padding: var(--space-lg) var(--space-md) var(--space-md);
    }

    .wordmark {
        font-size: 2.25rem;
    }

    .eyebrow {
        font-size: 0.6875rem;
        letter-spacing: 0.18em;
    }

    .headline {
        font-size: 1.625rem;
        line-height: 1.25;
    }

    /* Stack form vertically on small screens */
    .waitlist {
        flex-direction: column;
    }

    .waitlist-cta {
        border-left: none;
        border-top: 1px solid var(--border);
        justify-content: center;
        padding: 0.875rem 1.5rem;
    }

    .waveform-wrap {
        height: 60px;
    }
}

/* Very narrow */
@media (max-width: 360px) {
    .headline {
        font-size: 1.4rem;
    }
}

/* ---------------------------------------------------------------------------
   Motion preferences
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Waveform JS reads this media query and renders a static frame */
}

/* ---------------------------------------------------------------------------
   Print
   --------------------------------------------------------------------------- */
@media print {
    body {
        background: white;
        color: black;
    }
    .waveform-wrap, .brand-dot, .rule {
        display: none;
    }
}
