/* ============================================================
   FONTS — self-hosted (ui/static/fonts, see its README).
   Variable fonts: one file per style and subset covers every weight.
   Loading them from Google would send every visitor's IP to Google.
   ============================================================ */
@font-face {
    font-family: 'Cormorant';
    font-style: italic;
    font-weight: 300 400;
    font-display: swap;
    src: url('/static/fonts/cormorant-italic-latin-ext-b1555b55.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Cormorant';
    font-style: italic;
    font-weight: 300 400;
    font-display: swap;
    src: url('/static/fonts/cormorant-italic-latin-6083e8c7.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Cormorant';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('/static/fonts/cormorant-normal-latin-ext-aeb47ae0.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Cormorant';
    font-style: normal;
    font-weight: 300 500;
    font-display: swap;
    src: url('/static/fonts/cormorant-normal-latin-766e1b19.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/jetbrains-mono-normal-latin-ext-505dfba8.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'JetBrains Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/jetbrains-mono-normal-latin-14425ba9.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('/static/fonts/jost-normal-latin-ext-312ef2b8.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Jost';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('/static/fonts/jost-normal-latin-7726a5cd.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
    /* Backgrounds */
    --bg-deep:       #0B0806;
    --bg-base:       #110E0A;
    --bg-surface:    #181310;
    --bg-elevated:   #201A15;

    /* Borders */
    --border-subtle:  #251E18;
    --border-default: #342B23;
    --border-strong:  #4A3D33;

    /* Accent — Ember Red */
    --accent:        #C63B24;
    --accent-hover:  #D94E36;
    --accent-active: #A82E1A;
    --accent-dim:    #2D100A;
    --accent-glow:   rgba(198, 59, 36, 0.22);

    /* Bronze (secondary accent) */
    --bronze:        #9A7352;
    --bronze-hover:  #B0875F;
    --bronze-dim:    #261A0F;

    /* Text */
    --text-primary:   #EDE4D8;
    --text-secondary: #A0907F;
    --text-muted:     #5F5048;
    --text-disabled:  #3A3028;

    /* Semantic */
    --color-success: #4A8C5C;
    --color-error:   #C63B24;

    /* Typography */
    --font-display: 'Cormorant', Georgia, serif;
    --font-body:    'Jost', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    /* Spacing (4px base) */
    --space-1:  0.25rem;
    --space-2:  0.5rem;
    --space-3:  0.75rem;
    --space-4:  1rem;
    --space-5:  1.25rem;
    --space-6:  1.5rem;
    --space-8:  2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Layout */
    --nav-height:        64px;
    --container-max:     1200px;
    --container-padding: clamp(1.5rem, 4vw, 4rem);

    /* Radius */
    --radius-sm:   4px;
    --radius-md:   8px;
    --radius-lg:   12px;
    --radius-full: 9999px;

    /* Transitions */
    --t-fast: 150ms ease;
    --t-base: 250ms ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Subtle grain overlay on every page */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
    background-size: 256px;
    pointer-events: none;
    z-index: 9000;
    opacity: 0.55;
}

/* ============================================================
   LOGO
   ============================================================ */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    flex-shrink: 0;
}

.logo-word {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 1.05rem;
    letter-spacing: 0.14em;
    color: var(--text-primary);
    text-transform: uppercase;
}

.logo-word em {
    font-style: normal;
    color: var(--accent);
}

/* ============================================================
   NAV
   ============================================================ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 var(--container-padding);
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(11, 8, 6, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-inner {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    text-transform: uppercase;
    transition: color var(--t-fast);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8125rem;
    letter-spacing: 0.07em;
    border: none;
    cursor: pointer;
    padding: 0.625rem 1.5rem;
    border-radius: var(--radius-sm);
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), border-color var(--t-fast), color var(--t-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.45;
    pointer-events: none;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 2px 10px rgba(198, 59, 36, 0.3);
}
.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 18px rgba(198, 59, 36, 0.5);
    transform: translateY(-1px);
}
.btn-primary:active { background: var(--accent-active); transform: none; }

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: none;
}
.btn-ghost:hover { color: var(--text-primary); }

.btn-bronze {
    background: var(--bronze);
    color: #fff;
    font-weight: 600;
}
.btn-bronze:hover { background: var(--bronze-hover); transform: translateY(-1px); }

.btn-sm  { font-size: 0.75rem; padding: 0.4rem 1rem; }
.btn-lg  { font-size: 0.9375rem; padding: 0.875rem 2.5rem; }
.btn-xl  { font-size: 1rem; padding: 1rem 3rem; letter-spacing: 0.08em; }
.btn-full { width: 100%; justify-content: center; }

/* Submit button (full-width form use) */
.btn-submit {
    width: 100%;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.07em;
    padding: 0.875rem;
    cursor: pointer;
    transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    box-shadow: 0 2px 12px rgba(198, 59, 36, 0.3);
}
.btn-submit:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 20px rgba(198, 59, 36, 0.5);
    transform: translateY(-1px);
}
.btn-submit:active { background: var(--accent-active); transform: none; }
.btn-submit:disabled { opacity: 0.45; pointer-events: none; }

/* ============================================================
   FORM FIELDS
   ============================================================ */
.field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.field-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.field-hint  { font-size: 0.75rem; color: var(--text-muted); }
.field-error { font-size: 0.75rem; color: var(--color-error); display: none; }

.field.has-error .field-error { display: block; }
.field.has-error .field-hint  { display: none; }

.input-wrap { position: relative; display: block; }

.input-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    transition: color var(--t-fast);
}
.input-wrap:focus-within .input-icon { color: var(--accent); }

.input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 300;
    padding: 0.6875rem 0.875rem 0.6875rem 2.75rem;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    outline: none;
    -webkit-appearance: none;
}
.input::placeholder { color: var(--text-muted); }
.input:hover  { border-color: var(--border-strong); }
.input:focus  { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.input.error,
.field.has-error .input {
    border-color: var(--color-error);
}
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(198, 59, 36, 0.18); }

/* Input without left icon */
.input-no-icon { padding-left: 0.875rem; }

.password-toggle {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    transition: color var(--t-fast);
}
.password-toggle:hover { color: var(--text-secondary); }

/* Consent checkbox */
.consent-box {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.consent-box.checked {
    border-color: var(--accent);
    background: var(--accent-dim);
}
.consent-label {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    cursor: pointer;
}
.consent-label input[type="checkbox"] { display: none; }
.checkbox-box {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast), border-color var(--t-fast);
    margin-top: 1px;
}
.consent-label input[type="checkbox"]:checked ~ .checkbox-box {
    background: var(--accent);
    border-color: var(--accent);
}
.consent-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 300;
    line-height: 1.55;
}
.consent-text a { color: var(--accent); }
.consent-text a:hover { text-decoration: underline; }

/* Form divider */
.form-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

/* Error banner */
.error-banner {
    display: none;
    background: rgba(198, 59, 36, 0.08);
    border: 1px solid rgba(198, 59, 36, 0.25);
    border-radius: var(--radius-md);
    padding: 0.75rem 0.875rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 300;
}
.error-banner.visible { display: block; }

/* Success box */
.success-box { display: none; text-align: center; padding: 1rem 0; }
.success-box.visible { display: block; }
.success-icon {
    width: 56px;
    height: 56px;
    background: rgba(74, 140, 92, 0.1);
    border: 1px solid rgba(74, 140, 92, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}
.success-box h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 400;
    margin-bottom: 0.75rem;
}
.success-box p { font-size: 0.9rem; color: var(--text-secondary); font-weight: 300; line-height: 1.7; }
.success-box .resend { margin-top: 1.5rem; font-size: 0.8125rem; color: var(--text-muted); }
.success-box .resend button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
}
.success-box .resend button:hover { text-decoration: underline; }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: var(--radius-full);
}
.badge-default { background: var(--bg-elevated); color: var(--text-secondary); }
.badge-accent  { background: var(--accent-dim);  color: var(--accent); }
.badge-bronze  { background: var(--bronze-dim);  color: var(--bronze); }
.badge-success { background: rgba(74,140,92,0.12); color: var(--color-success); }

/* ============================================================
   SECTION UTILITIES
   ============================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
}

.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
}
.section-eyebrow::before {
    content: '';
    display: block;
    width: 20px;
    height: 1px;
    background: var(--accent);
}

/* Text for screen readers only. */
.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;
}

/* ============================================================
   SPIN ANIMATION (buttons loading state)
   ============================================================ */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.7s linear infinite; }