/* FARS API — Editorial data-product aesthetic
   Inspired by ProPublica, The Marshall Project, FiveThirtyEight.
   Dark masthead, sharp serif headlines, data-forward, authoritative. */

:root {
    --ink: #0a0a0f;
    --ink-light: #2a2a35;
    --ink-muted: #6b6b7b;
    --paper: #fafaf8;
    --paper-warm: #f4f3ef;
    --accent: #c8102e;
    --accent-dark: #9a0c23;
    --accent-glow: rgba(200, 16, 46, 0.08);
    --blue: #1a5276;
    --green: #1e7145;
    --gold: #b8860b;
    --border: #e2e0db;
    --code-bg: #1a1a22;
    --code-fg: #d4d4d8;
    --code-comment: #6b7280;
    --code-keyword: #c8102e;
    --code-string: #b8860b;
    --code-param: #1a5276;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --mono: 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
    --max-w: 860px;
    --max-w-wide: 1080px;
}

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

body {
    font-family: var(--sans);
    color: var(--ink);
    background: var(--paper);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

/* ── NAV ─────────────────────────────────────────── */

.nav {
    background: var(--ink);
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 52px;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.nav a {
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 0 14px;
    height: 52px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
}
.nav a:hover { color: white; }
.nav a.active { color: white; border-bottom-color: var(--accent); }
.nav .brand {
    color: white;
    font-family: var(--serif);
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    padding-left: 0;
    margin-right: 8px;
}
.nav .brand span { color: var(--accent); }

/* ── HERO (landing only) ─────────────────────────── */

.hero {
    background: var(--ink);
    color: white;
    padding: 64px 24px 56px;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 39px,
        rgba(255,255,255,0.03) 39px,
        rgba(255,255,255,0.03) 40px
    );
    pointer-events: none;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
    font-family: var(--serif);
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.15;
    max-width: 780px;
    letter-spacing: -0.02em;
}
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead {
    font-size: 1.05rem;
    line-height: 1.75;
    opacity: 0.78;
    max-width: 620px;
    margin-top: 20px;
}
.hero .cta-row { margin-top: 32px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 48px;
    flex-wrap: wrap;
}
.hero-stat { }
.hero-stat .num {
    font-family: var(--mono);
    font-size: 1.9rem;
    font-weight: 500;
    color: white;
}
.hero-stat .label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}

/* ── PAGE HERO (subpages) ────────────────────────── */

.page-hero {
    background: var(--ink);
    color: white;
    padding: 52px 24px 48px;
}
.page-hero h1 {
    font-family: var(--serif);
    font-size: 2.1rem;
    font-weight: 900;
    line-height: 1.2;
    max-width: var(--max-w);
    margin: 0 auto;
    letter-spacing: -0.01em;
}
.page-hero p {
    max-width: var(--max-w);
    margin: 12px auto 0;
    opacity: 0.72;
    font-size: 1rem;
}

/* ── CONTAINERS & SECTIONS ───────────────────────── */

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.container.wide { max-width: var(--max-w-wide); }

.section { padding: 56px 24px; }
.section.alt { background: var(--paper-warm); }

.section h2 {
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 8px;
}
.section h3 {
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 6px;
}
.section p { color: var(--ink-muted); font-size: 0.95rem; }

/* ── CONTENT (article pages) ─────────────────────── */

.content { padding: 48px 24px; }
.content h2 {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 40px 0 12px;
    color: var(--ink);
    letter-spacing: -0.01em;
}
.content h2:first-child { margin-top: 0; }
.content h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 28px 0 8px;
    color: var(--ink-light);
}
.content p { color: var(--ink-muted); margin-bottom: 16px; font-size: 0.95rem; line-height: 1.75; }
.content ul, .content ol { margin: 0 0 16px 20px; color: var(--ink-muted); font-size: 0.95rem; }
.content li { margin-bottom: 6px; line-height: 1.65; }
.content code {
    font-family: var(--mono);
    font-size: 0.82em;
    background: var(--paper-warm);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--border);
}
.content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(200,16,46,0.3); }
.content a:hover { border-bottom-color: var(--accent); }
.content strong { color: var(--ink); }

/* ── BUTTONS ─────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
}
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; color: white; border: 1.5px solid rgba(255,255,255,0.3); }
.btn-outline:hover { border-color: white; background: rgba(255,255,255,0.06); }
.btn-dark { background: var(--ink); color: white; }
.btn-dark:hover { background: var(--ink-light); }
.cta-btn { display: inline-block; padding: 12px 24px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 0.88rem; background: var(--ink); color: white; }
.cta-btn:hover { background: var(--ink-light); }

/* ── CODE BLOCKS ─────────────────────────────────── */

.code-block {
    background: var(--code-bg);
    color: var(--code-fg);
    border-radius: 8px;
    padding: 24px;
    font-family: var(--mono);
    font-size: 0.8rem;
    line-height: 1.85;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid rgba(255,255,255,0.06);
}
.code-block .c { color: var(--code-comment); }
.code-block .u { color: var(--code-keyword); font-weight: 500; }
.code-block .p { color: var(--code-string); }

/* ── GRIDS ───────────────────────────────────────── */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 28px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 28px; }

@media (max-width: 700px) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ── CARDS ────────────────────────────────────────── */

.card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
}
.card h3 {
    font-family: var(--serif);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--ink);
}
.card p { font-size: 0.9rem; color: var(--ink-muted); }

/* ── TABLES ──────────────────────────────────────── */

.cmp-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.85rem;
}
.cmp-table th {
    background: var(--ink);
    color: white;
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.cmp-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--ink-muted);
}
.cmp-table tr:nth-child(even) { background: var(--paper-warm); }
.cmp-table .y { color: var(--green); font-weight: 700; }
.cmp-table .n { color: #ccc; }

/* ── PRICING ─────────────────────────────────────── */

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 32px;
}
@media (max-width: 700px) { .pricing-cards { grid-template-columns: 1fr; } }

.price-card {
    background: white;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    transition: border-color 0.15s;
}
.price-card:hover { border-color: var(--ink-muted); }
.price-card.featured { border-color: var(--accent); border-width: 2px; position: relative; }
.price-card.featured::before {
    content: 'MOST POPULAR';
    position: absolute;
    top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 3px 12px;
    border-radius: 3px;
}
.price-card h3 {
    font-family: var(--sans);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--ink-muted);
    margin-bottom: 8px;
}
.price-card .price {
    font-family: var(--serif);
    font-size: 2.4rem;
    font-weight: 900;
    color: var(--ink);
}
.price-card .price span { font-size: 0.85rem; font-weight: 400; color: var(--ink-muted); font-family: var(--sans); }
.price-card ul { list-style: none; margin: 18px 0 0; text-align: left; }
.price-card li { padding: 5px 0; font-size: 0.88rem; color: var(--ink-muted); }
.price-card li::before { content: '\2713\0020'; color: var(--green); font-weight: 700; }

/* ── FAQ ─────────────────────────────────────────── */

.faq { margin-top: 28px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
    padding: 16px 0;
    cursor: pointer;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--ink);
}
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--accent); font-family: var(--sans); }
.faq details[open] summary::after { content: '\2212'; }
.faq .answer { padding: 0 0 18px; font-size: 0.92rem; color: var(--ink-muted); line-height: 1.75; }

/* ── TRY IT ──────────────────────────────────────── */

.try-section { background: var(--paper-warm); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.try-form { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.try-form input {
    padding: 11px 14px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-family: var(--mono);
    font-size: 0.88rem;
    width: 200px;
    background: white;
}
.try-form input:focus { outline: none; border-color: var(--accent); }
.try-form button {
    padding: 11px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 6px;
    font-family: var(--sans);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
}
.try-form button:hover { background: var(--accent-dark); }

.try-result {
    background: var(--code-bg);
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
    color: white;
    text-align: left;
}
.try-result .stat-row { display: flex; gap: 40px; flex-wrap: wrap; }
.try-result .stat-item { }
.try-result .stat-item .num { font-family: var(--mono); font-size: 2rem; font-weight: 500; }
.try-result .stat-item .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.45); margin-top: 2px; }
.try-result ul { margin: 16px 0 0 18px; font-size: 0.88rem; color: rgba(255,255,255,0.7); }

/* ── FOOTER ──────────────────────────────────────── */

footer {
    background: var(--ink);
    color: rgba(255,255,255,0.4);
    padding: 36px 24px;
    font-size: 0.78rem;
}
footer a { color: rgba(255,255,255,0.55); text-decoration: none; }
footer a:hover { color: white; }
footer .footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin-bottom: 10px; }

/* ── REPORT PAGE ─────────────────────────────────── */

.report-container { max-width: 900px; margin: 0 auto; padding: 40px 24px; }
.report-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    margin-bottom: 20px;
}
.report-card h2 {
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.buy-btn {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 16px 40px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
    text-decoration: none;
}
.buy-btn:hover { background: var(--accent-dark); }

/* ── RESPONSIVE ──────────────────────────────────── */

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .page-hero h1 { font-size: 1.6rem; }
    .hero-stats { gap: 28px; }
    .hero-stat .num { font-size: 1.5rem; }
    .nav { gap: 0; }
    .nav a { padding: 0 10px; font-size: 0.75rem; }
    .cmp-table { font-size: 0.78rem; }
    .cmp-table th, .cmp-table td { padding: 7px 8px; }
}
