/* --- Official CJP Variables --- */
:root {
    --saffron: #E0651E;
    --saffron-deep: #B84915;
    --green: #1F5A2E;
    --ink: #1A1108;
    --ink-2: #3A2A1C;
    --paper: #F4EBD7;
    --paper-2: #EADFC4;
    --blood: #8B1A1A;
    
    --display: "Bowlby One", "Impact", sans-serif;
    --condensed: "Oswald", "Arial Narrow", sans-serif;
    --sans: "Inter", -apple-system, system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;
    
    --max: 1280px;
    --gutter: 56px;
    --border-thick: 3px solid var(--ink);
}

/* --- Base & Texture --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    position: relative;
}

/* The Official Printed Noise Texture */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    opacity: 0.25;
    mix-blend-mode: multiply;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08, 0 0 0 0 0.06, 0 0 0 0 0.04, 0 0 0 0.32 0'/></filter><rect width='220' height='220' filter='url(%23n)'/></svg>");
}

/* --- Typography Classes --- */
.display-text {
    font-family: var(--display);
    font-weight: 400;
    line-height: 0.92;
    letter-spacing: -0.005em;
    color: var(--ink);
}

.eyebrow {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--saffron-deep);
    margin-bottom: 16px;
}

.mono-text { font-family: var(--mono); }
.t-saffron { color: var(--saffron-deep); }
.t-green { color: var(--green); }

/* --- Global Layout --- */
.site-header {
    padding: 16px var(--gutter);
    border-bottom: 2px solid var(--ink);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(244, 235, 215, 0.94);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand-title {
    font-family: var(--display);
    font-size: 24px;
    color: var(--ink);
}

.brand-tagline {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--saffron-deep);
}

/* --- Hero Section --- */
.hero {
    border-bottom: var(--border-thick);
    padding: 72px var(--gutter) 90px;
    text-align: center;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--blood);
    margin-bottom: 32px;
    padding: 7px 14px;
    border: 1px solid var(--blood);
    border-radius: 100px;
}

.live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--blood);
    animation: livepulse 1.6s ease-in-out infinite;
}

@keyframes livepulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.65); }
}

.hero .display-text {
    font-size: clamp(48px, 8vw, 100px);
    margin-bottom: 28px;
}

.hero-sub {
    font-family: var(--sans);
    font-size: 19px;
    line-height: 1.55;
    color: var(--ink-2);
    margin-bottom: 38px;
}

/* --- Official Physical Buttons --- */
.btn-primary, .btn-secondary {
    font-family: var(--condensed);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 18px 32px;
    border: 2px solid var(--ink);
    box-shadow: 6px 6px 0 var(--ink);
    transition: all 0.15s;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
}

.btn-primary {
    background: var(--saffron-deep);
    color: var(--paper);
}

.btn-secondary {
    background: var(--ink);
    color: var(--paper);
    width: 100%;
    justify-content: center;
}

/* Hard press interaction */
.btn-primary:hover, .btn-secondary:hover {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--ink);
}

.btn-link {
    background: none; border: none; cursor: pointer;
    font-family: var(--condensed);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--ink);
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-link:hover { color: var(--saffron-deep); }

/* --- Manifesto Sequence --- */
.manifesto {
    background: var(--ink);
    color: var(--paper);
    padding: 120px 20px;
    text-align: center;
    border-bottom: var(--border-thick);
}

.manifesto .display-text {
    color: var(--paper);
}

.sequence-item {
    font-size: clamp(28px, 6vw, 64px);
    margin-bottom: 40px;
    opacity: 0.15;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.sequence-item.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Modal (Printed Card Style) --- */
/* --- Modal (Printed Card Style) & Scrolling Fix --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26, 17, 8, 0.85); 
    display: flex; 
    justify-content: center; 
    align-items: flex-start; /* Changed from 'center' to allow top-down scrolling */
    overflow-y: auto; /* Enables native scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth momentum scrolling on iOS */
    padding: 40px 20px; /* Safe padding so the card never touches the screen edge */
    z-index: 300;
    opacity: 0; pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay.active {
    opacity: 1; pointer-events: all;
}

.modal-card {
    background: var(--paper);
    border: var(--border-thick);
    box-shadow: 12px 12px 0 var(--saffron-deep), 12px 12px 0 3px var(--ink);
    width: 100%; /* Ensures it shrinks on mobile */
    max-width: 500px;
    padding: 40px 30px;
    position: relative;
    margin: auto; /* MAGIC FIX: Centers vertically if shorter than screen, stays top if taller */
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}
.close-btn {
    position: absolute; top: 12px; right: 20px;
    background: none; border: none; cursor: pointer;
    font-family: var(--display);
    font-size: 24px; color: var(--ink);
}

.modal-title {
    font-size: 36px;
    margin-bottom: 24px;
}

.tally-box {
    border: 2px dashed var(--ink-3);
    background: var(--paper-2);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 24px;
    font-size: 12px;
    letter-spacing: 0.1em;
}

/* --- Footer --- */
.site-footer {
    background: var(--ink);
    padding: 30px;
    text-align: center;
}

.fl-badge {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--paper-2);
    text-decoration: none;
}

.fl-badge:hover { color: var(--saffron-2); }

/* --- Additional Variables for the Eligibility Flow --- */
:root {
    --paper-3: #DBCBA5; /* Used for the hover state of the checkboxes */
}

/* --- Eligibility Typography Utilities --- */
.t-italic {
    font-family: "Georgia", serif;
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.modal-lg {
    max-width: 760px; /* Wider modal to accommodate the checklist */
    padding: 64px 40px;
}

/* --- Eligibility Header --- */
.elig-head {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

.elig-title {
    font-size: clamp(38px, 6vw, 64px);
    margin-bottom: 24px;
}

.elig-head .hero-sub {
    font-size: 17px;
    margin-bottom: 0;
}

/* --- Interactive Checklist UI --- */
.checklist {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 48px;
}

.check-item {
    display: grid;
    grid-template-columns: 110px 1fr 64px;
    grid-template-areas: 
        "num title tick" 
        "num sub   tick";
    align-items: center;
    gap: 4px 28px;
    padding: 22px 28px;
    background: var(--paper-2);
    border: 2px solid var(--ink);
    box-shadow: 5px 5px 0 var(--ink);
    transition: all 0.2s;
    cursor: pointer;
}

/* Hide the native browser checkbox */
.check-item input[type="checkbox"] {
    display: none; 
}

.check-item:hover {
    background: var(--paper-3);
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 var(--ink);
}

.ck-num {
    grid-area: num;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.22em;
    color: var(--saffron-deep);
    font-weight: 600;
}

.ck-title {
    grid-area: title;
    font-family: var(--display);
    font-size: 26px;
    color: var(--ink);
    letter-spacing: -0.005em;
    line-height: 1;
}

.ck-sub {
    grid-area: sub;
    font-family: var(--sans);
    font-size: 14.5px;
    font-style: italic;
    color: var(--ink-2);
    margin-top: 6px;
}

/* The visual tick circle */
.ck-tick {
    grid-area: tick;
    width: 48px; height: 48px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    display: grid; place-items: center;
    font-size: 22px;
    color: transparent; /* Tick is hidden by default */
    background: var(--paper);
    transition: all 0.2s;
}

/* The checked state */
.check-item input[type="checkbox"]:checked ~ .ck-tick {
    color: var(--green); /* Shows the tick */
}

/* Generating the checkmark icon natively */
.ck-tick::after {
    content: "✓"; 
    font-family: var(--sans);
    font-weight: 700;
}

/* --- Eligibility Bottom CTA --- */
.elig-cta {
    text-align: center;
}

.elig-fine {
    margin-top: 24px;
    font-family: var(--sans);
    font-size: 14px;
    font-style: italic;
    color: var(--ink-3);
    line-height: 1.6;
}

/* Disabled state logic for the official buttons */
.btn-primary:disabled {
    background: var(--ink-2);
    color: rgba(244, 235, 215, 0.4); /* Faded paper color */
    box-shadow: 6px 6px 0 var(--ink);
    cursor: not-allowed;
    transform: none; /* Prevents the click-down effect */
}

/* Responsive adjustments for checklist */
/* --- Responsive Adjustments for Mobile UX --- */
@media (max-width: 640px) {
    /* Modal Safe Areas */
    .modal-overlay {
        padding: 24px 16px; 
    }
    
    .modal-card {
        padding: 32px 20px;
        /* Scale down the shadow on mobile to prevent horizontal screen breaking */
        box-shadow: 8px 8px 0 var(--saffron-deep), 8px 8px 0 3px var(--ink); 
    }
    
    .modal-lg { 
        padding: 40px 20px; 
    }

    .close-btn { 
        top: 12px; right: 16px; 
    }

    /* Eligibility Typography */
    .elig-title { 
        font-size: 32px; 
        margin-bottom: 16px; 
    }
    
    .elig-head { 
        margin-bottom: 32px; 
    }

    /* Checklist Mobile Grid Optimization */
    .checklist {
        gap: 12px;
    }

    .check-item {
        grid-template-columns: 1fr 40px; /* Tighter column for the tick mark */
        grid-template-areas: 
            "num tick" 
            "title tick" 
            "sub tick";
        padding: 16px;
        gap: 4px 16px;
        box-shadow: 4px 4px 0 var(--ink); /* Scaled down physical shadow */
    }

    .check-item:hover {
        box-shadow: 5px 5px 0 var(--ink);
        transform: translate(-1px, -1px); /* Subtler press effect on mobile */
    }

    .ck-title { 
        font-size: 22px; 
    }
    
    .ck-num { 
        margin-bottom: 2px; 
    }
    
    .ck-sub {
        font-size: 13.5px;
        line-height: 1.4;
    }

    .ck-tick {
        width: 40px; height: 40px;
        font-size: 18px;
    }
}

/* --- Eligibility Verification Loading States --- */
.btn-primary.is-loading {
    background-color: var(--ink) !important;
    color: var(--paper) !important;
    border-color: var(--ink) !important;
    cursor: wait;
    pointer-events: none;
    /* Keeps the button physically pressed down during processing */
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0 var(--ink);
}

.btn-primary.is-loading span {
    display: inline-block;
    font-family: var(--mono);
    font-size: 14px;
    letter-spacing: 0.05em;
    animation: brutalistPulse 0.7s infinite steps(2, end);
}

/* Sharp, intentional step-based pulse matching the zine aesthetic */
@keyframes brutalistPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}