/* ============================================================
   CrunchyNews — Landing Page
   Sleek, modern, conversion-focused design
   ============================================================ */

:root {
    --bg:          #08090e;
    --bg-surface:  #12141c;
    --bg-elevated: #1a1d28;
    --border:      rgba(255, 255, 255, 0.07);
    --border-hover:rgba(255, 255, 255, 0.14);

    --text:        #f0f0f5;
    --text-secondary: #9197a6;
    --text-muted:  #5c6272;

    --accent:      #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.18);
    --accent-hover:#2563eb;

    --success:     #22c55e;
    --error:       #ef4444;

    --radius:      10px;
    --radius-lg:   16px;
    --transition:  180ms ease;

    /* Borough palette */
    --manhattan:    #3b82f6;
    --brooklyn:     #8b5cf6;
    --queens:       #f59e0b;
    --bronx:        #ef4444;
    --statenisland: #10b981;
    --allnyc:       #64748b;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.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;
}

/* ─── Page Container ────────────────────────────────────────────────────── */

.page {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ─── Nav ───────────────────────────────────────────────────────────────── */

.nav {
    padding: 28px 0;
    text-align: center;
}

.nav-logo, .footer-logo {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.nav-logo span, .footer-logo span {
    color: var(--accent);
}

/* ─── Hero ──────────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 60px 0 48px;
}

.hero-headline {
    font-size: clamp(38px, 7vw, 56px);
    font-weight: 800;
    line-height: 1.08;
    letter-spacing: -2px;
    margin-bottom: 20px;
    color: var(--text);
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

/* ─── Signup Form ───────────────────────────────────────────────────────── */

.signup-form {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
}

.email-row {
    display: flex;
    gap: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 5px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.email-row:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.email-input {
    flex: 1;
    min-width: 0;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.email-input::placeholder {
    color: var(--text-muted);
}

.email-input.input-error {
    color: var(--error);
}

.subscribe-btn {
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.subscribe-btn:hover {
    background: var(--accent-hover);
}

.subscribe-btn:active {
    transform: scale(0.97);
}

.subscribe-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
}

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

@keyframes nudge {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.18); }
}

/* Pulse classes — applied via JS */
.edition-check.pulse {
    animation: nudge 1.6s ease-in-out infinite;
}

.borough-row-check.pulse {
    animation: nudge 1.6s ease-in-out infinite;
}

/* ─── Edition Selection ─────────────────────────────────────────────────── */

.edition-section {
    margin-top: 24px;
}

/* Featured "All NYC" button */
.edition-main {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: left;
}

.edition-main:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.edition-main.active {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.edition-main-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.edition-main-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.edition-main-desc {
    font-size: 13px;
    color: var(--text-muted);
}

.edition-main.active .edition-main-desc {
    color: var(--text-secondary);
}

.edition-check {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    color: transparent;
}

.edition-check svg {
    width: 16px;
    height: 16px;
}

.edition-main.active .edition-check {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* Borough add-on label */
.borough-addon-label {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin: 20px 0 10px;
    font-weight: 500;
}

/* Borough compact rows — 2-column grid */
.borough-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.borough-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    text-align: left;
}

.borough-row:hover {
    border-color: var(--border-hover);
    background: var(--bg-elevated);
}

.borough-row-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.borough-row:hover .borough-row-name {
    color: var(--text);
}

.borough-row-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition);
    color: transparent;
}

.borough-row-check svg {
    width: 13px;
    height: 13px;
}

/* Last odd item centers in 2-col grid */
.borough-row:last-child:nth-child(odd) {
    grid-column: 1 / -1;
    max-width: calc(50% - 3px);
    justify-self: center;
}

/* Active states — borough-specific colors */
.borough-row.active {
    border-color: transparent;
}

.borough-row.active .borough-row-name {
    color: var(--text);
}

.borough-row[data-borough="Manhattan"].active {
    border-color: var(--manhattan);
    background: rgba(59, 130, 246, 0.08);
}
.borough-row[data-borough="Manhattan"].active .borough-row-check {
    background: var(--manhattan); border-color: var(--manhattan); color: #fff;
}

.borough-row[data-borough="Brooklyn"].active {
    border-color: var(--brooklyn);
    background: rgba(139, 92, 246, 0.08);
}
.borough-row[data-borough="Brooklyn"].active .borough-row-check {
    background: var(--brooklyn); border-color: var(--brooklyn); color: #fff;
}

.borough-row[data-borough="Queens"].active {
    border-color: var(--queens);
    background: rgba(245, 158, 11, 0.08);
}
.borough-row[data-borough="Queens"].active .borough-row-check {
    background: var(--queens); border-color: var(--queens); color: #1a1d28;
}

.borough-row[data-borough="Bronx"].active {
    border-color: var(--bronx);
    background: rgba(239, 68, 68, 0.08);
}
.borough-row[data-borough="Bronx"].active .borough-row-check {
    background: var(--bronx); border-color: var(--bronx); color: #fff;
}

.borough-row[data-borough="Staten Island"].active {
    border-color: var(--statenisland);
    background: rgba(16, 185, 129, 0.08);
}
.borough-row[data-borough="Staten Island"].active .borough-row-check {
    background: var(--statenisland); border-color: var(--statenisland); color: #fff;
}

/* ─── Form Messages ─────────────────────────────────────────────────────── */

.form-message {
    margin-top: 16px;
    padding: 12px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    text-align: center;
    font-weight: 500;
}

.form-message.message-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.25);
    color: var(--success);
}

.form-message.message-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: var(--error);
}

/* ─── Legal ─────────────────────────────────────────────────────────────── */

.legal-text {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
}

/* ─── Value Props ───────────────────────────────────────────────────────── */

.value-props {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.prop {
    text-align: center;
}

.prop-num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text);
}

.prop-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.prop-divider {
    width: 1px;
    height: 36px;
    background: var(--border);
}

/* ─── How It Works ──────────────────────────────────────────────────────── */

.how-it-works {
    padding: 56px 0;
}

.section-title {
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 36px;
    color: var(--text);
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition);
}

.step:hover {
    border-color: var(--border-hover);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--accent-glow);
    color: var(--accent);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.step-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ─── Footer ────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.footer p {
    font-size: 12px;
    color: var(--text-muted);
}

.footer a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover {
    color: var(--text-secondary);
}

/* ─── Responsive ────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
    .hero {
        padding: 40px 0 36px;
    }

    .hero-headline {
        font-size: 34px;
        letter-spacing: -1.5px;
    }

    .hero-sub {
        font-size: 16px;
        margin-bottom: 32px;
    }

    .email-row {
        flex-direction: column;
        gap: 0;
    }

    .email-input {
        padding: 14px 16px;
    }

    .subscribe-btn {
        width: 100%;
        padding: 14px;
        border-radius: 8px;
    }

    .borough-row {
        padding: 10px 14px;
    }

    .borough-list {
        grid-template-columns: 1fr;
    }

    .borough-row:last-child:nth-child(odd) {
        max-width: none;
        justify-self: stretch;
    }

    .value-props {
        gap: 20px;
    }

    .prop-num {
        font-size: 22px;
    }

    .step {
        padding: 16px 18px;
    }
}

@media (max-width: 380px) {
    .page {
        padding: 0 16px;
    }

    .hero-headline {
        font-size: 28px;
    }

    .value-props {
        flex-direction: column;
        gap: 16px;
    }

    .prop-divider {
        width: 40px;
        height: 1px;
    }
}
