/* ==========================================================================
   Site CSS — Design System & Component Styles
   Loads AFTER Pico CSS. Overrides Pico defaults where needed while
   preserving Pico's form styling for the petition wizard.
   ========================================================================== */

/* ==========================================================================
   CSS Variables & Design Tokens
   ========================================================================== */
:root {
    --clr-bg-dark: #fcfaf8;
    --clr-bg-card: rgba(255, 255, 255, 0.6);
    --clr-bg-card-hover: rgba(255, 255, 255, 0.95);
    --clr-glass-border: rgba(0, 0, 0, 0.06);
    --clr-text-main: #1f2937;
    --clr-text-muted: #4b5563;
    --clr-accent-orange: #f97316;
    --clr-accent-orange-glow: rgba(249, 115, 22, 0.3);
    --clr-accent-blue: #0ea5e9;
    --clr-accent-blue-glow: rgba(14, 165, 233, 0.3);
    --font-sans: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', system-ui, sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base Resets & Body (override Pico defaults)
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, main {
    font-family: var(--font-sans);
    background-color: var(--clr-bg-dark);
    color: var(--clr-text-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    /* Override Pico's max-width and margin on body and main */
    max-width: none !important;
    margin: 0;
    padding: 0;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 600; line-height: 1.2; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
ul { list-style: none; }

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.container { max-width: 1400px !important; margin: 0 auto; padding: 0 5%; }
.section { padding: 4rem 0; position: relative; z-index: 1; }

/* ==========================================================================
   Glass Navigation
   ========================================================================== */
.glass-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: rgba(252, 250, 248, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--clr-glass-border);
    padding: 1rem 0;
    transition: padding var(--transition-fast), background var(--transition-fast);
}
.glass-nav.scrolled {
    padding: 0.75rem 0;
    background: rgba(252, 250, 248, 0.95);
}
.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 3rem;
}
.logo {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    padding-right: 2rem;
}
.logo span { font-weight: 400; opacity: 0.8; }
.logo .dot { color: var(--clr-accent-orange); font-weight: 800; opacity: 1; }
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    white-space: nowrap;
}
.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--clr-text-muted);
}
.nav-links a:hover { color: var(--clr-text-main); }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.btn-primary {
    background: linear-gradient(135deg, var(--clr-accent-orange), #ff4d00);
    color: #fff;
    box-shadow: 0 4px 20px var(--clr-accent-orange-glow);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px var(--clr-accent-orange-glow);
    color: #fff;
}
.btn-secondary {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-glass-border);
    color: var(--clr-text-main);
}
.btn-secondary:hover {
    background: var(--clr-bg-card-hover);
    transform: translateY(-2px);
}
.large { padding: 1rem 2rem; font-size: 1.05rem; }
.full-width { width: 100%; }

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.hero-bg-gradient {
    position: absolute;
    top: -50%;
    left: -20%;
    width: 140%;
    height: 140%;
    background: radial-gradient(circle at center, rgba(249, 115, 22, 0.12) 0%, rgba(252, 250, 248, 0) 60%);
    z-index: 0;
}
.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    padding: 0 5%;
}
.badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 107, 53, 0.1);
    color: var(--clr-accent-orange);
    border: 1px solid rgba(255, 107, 53, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 2rem;
}
.hero h1 {
    font-size: clamp(3rem, 6vw, 5rem);
    letter-spacing: -2px;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #111827, #4b5563);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero p {
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    color: var(--clr-text-muted);
    margin-bottom: 2.5rem;
    max-width: 1200px;
    margin-inline: auto;
}
.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}
.hero-visual {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    pointer-events: none;
    opacity: 0.4;
}
.sun-orb {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--clr-accent-orange) 0%, rgba(255, 107, 53, 0) 70%);
    filter: blur(40px);
    animation: pulse 8s infinite alternate;
}

/* ==========================================================================
   Section Headers, Cards & Grids
   ========================================================================== */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 900px;
    margin-inline: auto;
}
.section-header h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-header p { color: var(--clr-text-muted); font-size: 1.1rem; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.glass-card {
    background: var(--clr-bg-card);
    border: 1px solid var(--clr-glass-border);
    border-radius: 24px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform var(--transition-smooth), background var(--transition-fast);
}
.glass-card:hover {
    background: var(--clr-bg-card-hover);
    transform: translateY(-5px);
}
.card-icon { font-size: 2.5rem; margin-bottom: 1.5rem; display: inline-block; }
.glass-card h3 { font-size: 1.5rem; margin-bottom: 1rem; }
.glass-card p { color: var(--clr-text-muted); font-size: 0.95rem; }

/* ==========================================================================
   Two-Column Layout (Science Section)
   ========================================================================== */
.visual-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}
.visual-text-grid h2 { font-size: 3rem; margin-bottom: 1.5rem; }
.visual-text-grid p {
    color: var(--clr-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}
.feature-list li {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
}
.feature-list .check {
    color: var(--clr-accent-blue);
    background: rgba(59, 130, 246, 0.1);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
}

/* ==========================================================================
   Statistics Panel
   ========================================================================== */
.stats-glass {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(255, 255, 255, 0.4) 100%);
    border: 1px solid var(--clr-glass-border);
    border-radius: 24px;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    backdrop-filter: blur(16px);
    margin-left: 2rem;
}
.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.stat-number {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(to right, var(--clr-accent-blue), #60a5fa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.stat-label { color: var(--clr-text-muted); font-weight: 500; }

/* ==========================================================================
   Action Section & Forms
   ========================================================================== */
.action-section { position: relative; overflow: hidden; }
.action-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 100%;
    background: radial-gradient(circle at center, rgba(255, 107, 53, 0.08) 0%, var(--clr-bg-dark) 70%);
    z-index: 0;
}
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--clr-glass-border);
    border-radius: 24px;
    padding: 4rem;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}
.action-container h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.action-container > p {
    color: var(--clr-text-muted);
    margin-bottom: 3rem;
    max-width: 500px;
    margin-inline: auto;
}

/* Custom form UI (non-Pico forms in advocacy sections) */
.custom-form-ui { width: 100%; text-align: left; }
.form-instruction {
    font-size: 0.85rem;
    color: var(--clr-text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}
.input-group { margin-bottom: 1.5rem; }
.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--clr-text-main);
}
.input-group input {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--clr-glass-border);
    border-radius: 8px;
    color: var(--clr-text-main);
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border var(--transition-fast);
}
.input-group input:focus {
    outline: none;
    border-color: var(--clr-accent-orange);
}

/* Form messages */
.form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 500;
}
.form-message.success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}
.form-message.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.hidden { display: none; }
.btn-loading { opacity: 0.7; cursor: wait; }

/* ==========================================================================
   Warning Box (petition warnings)
   ========================================================================== */
.warning-box {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #92400e;
}

/* ==========================================================================
   HTMX Indicators (petition wizard loading states)
   ========================================================================== */
.htmx-indicator {
    opacity: 0;
    transition: opacity 200ms ease-in;
}
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}
#wizard { min-height: 200px; }

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    padding: 4rem 0 2rem;
    border-top: 1px solid var(--clr-glass-border);
    margin-top: 4rem;
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
}
.footer-brand p {
    color: var(--clr-text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}
.footer-links {
    display: flex;
    gap: 2rem;
}
.footer-links a {
    color: var(--clr-text-muted);
    font-weight: 500;
}
.footer-links a:hover { color: var(--clr-text-main); }
.footer-links a svg {
    vertical-align: middle;
    transition: color var(--transition-fast);
}
.footer-links a:hover svg { color: var(--clr-text-main); }
.footer-bottom {
    text-align: center;
    color: var(--clr-text-muted);
    font-size: 0.85rem;
}
.footer-attribution {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}
.footer-attribution a {
    text-decoration: underline;
    text-underline-offset: 2px;
}
.footer-attribution a:hover { color: var(--clr-text-main); }

/* ==========================================================================
   Scroll Animations
   ========================================================================== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}
.fade-in {
    opacity: 0;
    transition: opacity 1.2s ease-out;
}
.fade-up.visible, .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}
@keyframes pulse {
    0%   { transform: scale(1);   opacity: 0.5; }
    50%  { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1);   opacity: 0.5; }
}

/* ==========================================================================
   Responsive — 768px breakpoint
   ========================================================================== */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .hero { padding-top: 6rem; }
    .hero-actions {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
    .visual-text-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .visual-text-grid h2 { font-size: 2.5rem; }
    .glass-panel { padding: 2.5rem 1.5rem; }
    .cards-grid {
        grid-template-columns: 1fr;
    }
}
