/*
 * Shared design tokens + navbar/footer styles — used by every page.
 * Header/footer markup comes from header.js/footer.js; this file is what
 * makes them look identical everywhere. Page-specific styles (hero,
 * content sections, etc.) stay in each page's own <style> block — only
 * truly shared rules belong here, so this file is the only place navbar
 * or footer appearance ever needs to change.
 */

:root {
    --bg: #000000;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.72);
    --accent: #E8A870;
    --success: #66CC80;
    --warning: #F29966;
    --divider: rgba(255, 255, 255, 0.2);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    /* clip, not hidden -- `hidden` makes this a scroll container, which
       silently disables position:sticky for every descendant (the bug that
       previously forced the pinned carousel/skeleton sections to emulate
       sticky from JS on every frame, and the root cause of their scroll
       jitter). `clip` prevents horizontal overflow identically without
       creating a scroll container, so native sticky works. */
    overflow-x: clip;
}

body {
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 400;
    background-color: var(--bg);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip;
    max-width: 100vw;
}

/* Layout — default page container. Pages that want a different content
   width (e.g. a narrower reading column) can override `.container`
   locally; header/footer always stay at the values below regardless,
   since the scoped `header .container` / `footer .container` rules further
   down are more specific and win. */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 48px;
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 8px 0;
    background: #090909;
    transition: background 0.3s ease, backdrop-filter 0.3s ease;
}

/* Scoped so header/footer always render at the same width as the landing
   page, regardless of what max-width a given page uses for its own body
   content container. */
header .container,
footer .container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 48px;
}

@media (max-width: 768px) {
    header .container,
    footer .container {
        padding: 0 24px;
    }
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: var(--text-primary);
    position: relative;
    top: -1.5px;
}

.logo-mark {
    height: 22px;
    width: auto;
    display: block;
}

.header-cta {
    color: #000000;
    background: #D6B25E;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    display: inline-flex;
    align-items: center;
    border: 1px solid #D6B25E;
    border-radius: 9999px;
    padding: 3.5px 11px;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.header-cta:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}

.header-signup-wrap {
    position: relative;
    right: -8px;
}

.header-signup-wrap .header-signup-form {
    max-width: 260px;
    padding: 3.5px 1.5px 3.5px 20px;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: background 0.18s ease, box-shadow 0.18s ease, max-width 0.28s ease;
}

/* Expands leftward on focus -- the button stays anchored to the
   navbar's right edge (header .container is justify-content:space-between),
   so widening the pill's max-width naturally extends its left edge only. */
.header-signup-wrap .header-signup-form:focus-within {
    background: rgba(255, 255, 255, 0.12);
    max-width: 340px;
}

.header-signup-wrap .header-signup-form input[type="email"] {
    font-size: 16px;
}

.header-signup-wrap .header-signup-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.55);
    font-weight: 400;
}

.header-signup-wrap .header-signup-form button {
    font-size: 14px;
    padding: 3.5px 11px;
}

.header-signup-message {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    max-width: 220px;
    width: max-content;
    text-align: right;
    margin-top: 0;
    font-size: 13px;
}

/* Success confirmation replaces the form entirely (see header.js's
   onSuccess) -- rendered in place, within the navbar row where the form
   was, not as the floating toast below the navbar that
   .header-signup-message uses for transient errors. Overrides
   .header-signup-message's position:absolute via the extra class + ancestor
   selector (higher specificity, no !important needed). */
.header-signup-wrap .header-signup-message.header-signup-success {
    position: static;
    max-width: 240px;
    width: auto;
    text-align: center;
    margin-top: 0;
    font-size: 12.5px;
    line-height: 1.35;
}

@media (max-width: 560px) {
    .header-signup-wrap .header-signup-message.header-signup-success {
        max-width: 190px;
        font-size: 12px;
    }
}

@media (max-width: 560px) {
    header {
        padding: 7px 0;
    }

    header .container {
        gap: 28px;
    }

    .header-signup-wrap .header-signup-form {
        max-width: 250px;
        width: auto;
        padding: 1px 0 1px 16px;
        gap: 10px;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
        transition: background 0.18s ease, box-shadow 0.18s ease, max-width 0.28s ease;
    }

    /* Expands leftward on focus, same as desktop -- button side stays put.
       Capped well under the logo's available room (measured empirically:
       300px caused the whole pill to overflow past the viewport edge
       instead of growing purely leftward, once logo+pill together
       exceeded the container's content width). */
    .header-signup-wrap .header-signup-form:focus-within {
        max-width: 255px;
    }

    /* Kept at 16px (not shrunk) -- anything smaller makes iOS Safari
       zoom the viewport in on focus. Placeholder is sized down
       separately below since ::placeholder doesn't affect the zoom check.
       flex:1 + min-width (inherited pattern from the main .signup-form
       hero button, which never has this problem) -- NOT a fixed pixel
       width. A fixed width was tuned to fit "Join Waitlist"; the CTA text
       is expected to change over time, and a hardcoded width silently
       breaks (clips the button off the edge of the screen, since
       .header-signup-wrap sits flush against the navbar's right edge)
       the moment a longer label doesn't fit the number it was tuned for.
       flex:1/min-width instead gives the button (flex-shrink:0,
       white-space:nowrap below) first claim on the pill's max-width, and
       the input absorbs whatever's left -- correct for any button text,
       automatically, with no number to re-tune later. */
    .header-signup-wrap .header-signup-form input[type="email"] {
        font-size: 16px;
        flex: 1 1 auto;
        min-width: 40px;
    }

    .header-signup-wrap .header-signup-form input[type="email"]::placeholder {
        font-size: 15px;
    }

    .header-signup-wrap .header-signup-form button {
        font-size: 14px;
        padding: 3.5px 11px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .header-signup-message {
        max-width: 160px;
        font-size: 12px;
    }
}

/* Footer */
footer {
    padding: 48px 0 8px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 16px;
}

.footer-text {
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    footer .container {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-links {
        order: -1;
        align-items: flex-start;
    }

    .footer-text {
        flex: none;
    }
}

.footer-links a {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

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

/* Waitlist signup form — shared markup/behavior comes from waitlist-form.js,
   used wherever a page embeds #signupForm (see index.html for the markup
   to copy). */
.signup-form {
    display: flex;
    align-items: center;
    gap: 0;
    max-width: 460px;
    margin: 0 auto;
    width: 100%;
    border: 1px solid var(--text-primary);
    border-radius: 1000px;
    padding: 6px 6px 6px 20px;
    transition: border-color 0.2s;
}

.signup-form:focus-within {
    border-color: var(--accent);
}

.signup-form input[type="email"] {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 15px;
    font-weight: 400;
    padding: 0;
    outline: none;
    min-width: 0;
}

.signup-form input[type="email"]::placeholder {
    color: var(--text-secondary);
}

.signup-form button {
    background: #D6B25E;
    color: var(--bg);
    border: none;
    border-radius: 9999px;
    font-family: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
    font-weight: 400;
    padding: 3.5px 11px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
}

.signup-form button:hover,
.signup-form button:active {
    background: var(--accent);
    color: var(--bg);
}

.signup-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.signup-message {
    margin-top: 16px;
    font-size: 15px;
    font-weight: 400;
    color: var(--text-secondary);
}

.signup-message.success {
    color: var(--text-primary);
}

.signup-message.error {
    color: var(--warning);
}

@media (max-width: 560px) {
    .signup-form {
        padding: 5px 5px 5px 16px;
    }

    .signup-form input[type="email"] {
        font-size: 16px;
    }
}
