@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&display=swap');

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

:root {
    --bg: #FAFAFA;
    --bg-white: #FFFFFF;
    --bg-subtle: #F3F4F6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-dim: #9CA3AF;
    --accent: #0A6E5C;
    --accent-light: #10B981;
    --accent-bg: #ECFDF5;
    --danger: #991B1B;
    --danger-light: #DC2626;
    --danger-bg: #FEF2F2;
    --amber: #92400E;
    --amber-light: #D97706;
    --border: #E5E7EB;
    --border-strong: #D1D5DB;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

/* NAV */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    padding: 14px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(250, 250, 250, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-brand {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-logo { width: 26px; height: 26px; flex-shrink: 0; }

.nav-brand span { color: var(--text-muted); font-weight: 400; font-size: 13px; letter-spacing: 0; margin-left: 8px; }

.nav-links { display: flex; gap: 24px; list-style: none; }

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

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

.nav-links a[aria-current="page"] {
    color: var(--accent);
    font-weight: 600;
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-primary);
    padding: 4px 8px;
    line-height: 1;
}

.nav-cta {
    padding: 7px 18px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
}

/* HERO */
.hero {
    padding: 140px 24px 80px;
    max-width: 860px;
    margin: 0 auto;
}

.hero-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 20px;
}

.hero h1 {
    font-size: clamp(32px, 4.5vw, 52px);
    font-weight: 800;
    line-height: 1.15;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.hero-sub {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 640px;
    font-weight: 400;
    line-height: 1.8;
    margin-bottom: 40px;
}

.hero-result {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: var(--accent-bg);
    border: 1px solid #A7F3D0;
    border-radius: 8px;
}

.hero-result .number {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
}

.hero-result .detail {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.hero-result .detail strong { color: var(--text-primary); }

/* SECTIONS */
.section {
    padding: 80px 24px;
    max-width: 960px;
    margin: 0 auto;
}

.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.section-title {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.section-desc {
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.8;
    margin-bottom: 40px;
}

/* DIVIDER */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    max-width: 960px;
    margin: 0 auto;
}

/* BACKTEST TABLE */
.backtest-table {
    width: 100%;
    border-collapse: collapse;
    margin: 32px 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.backtest-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-subtle);
    border-bottom: 1px solid var(--border);
}

.backtest-table td {
    padding: 12px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.backtest-table tr:last-child td { border-bottom: none; }

.backtest-table .fire-name { font-weight: 600; color: var(--text-primary); }

.backtest-table .mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.tag-detected {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.tag-don {
    display: inline-block;
    padding: 2px 8px;
    background: #FEF3C7;
    color: var(--amber);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.tag-clear {
    display: inline-block;
    padding: 2px 8px;
    background: var(--bg-subtle);
    color: var(--text-muted);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

/* CAMP FIRE CONTEXT */
.context-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--danger-light);
    border-radius: 4px;
    padding: 24px 28px;
    margin: 32px 0;
}

.context-box h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.context-box p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* CHART CONTAINER */
.chart-container {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    margin: 32px 0;
}

.chart-container h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
}

.chart-container .subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.chart-container canvas { max-height: 320px; }

/* WEATHER TABLE */
.weather-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}

.weather-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.weather-card h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

.weather-card.fire-day { border-top: 3px solid var(--danger-light); }
.weather-card.fire-day h4 { color: var(--danger); }
.weather-card.calm-day { border-top: 3px solid var(--accent); }
.weather-card.calm-day h4 { color: var(--accent); }

.weather-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.weather-row:last-child { border-bottom: none; }
.weather-row .label { color: var(--text-muted); }

.weather-row .value {
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
}

.weather-row .value.danger { color: var(--danger-light); }
.weather-row .value.safe { color: var(--accent); }

/* REROUTING CARDS */
.reroute-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-top: 3px solid var(--accent);
    border-radius: 8px;
    padding: 24px 28px;
    margin: 32px 0;
}

.reroute-card.risk-only {
    border-top-color: var(--amber-light);
}

.reroute-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.reroute-card .reroute-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.reroute-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.reroute-stat .stat-num {
    font-size: 22px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent);
}

.reroute-stat .stat-num.amber {
    color: var(--amber-light);
}

.reroute-stat .stat-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.avoided-corridor {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 16px 20px;
    margin-top: 16px;
}

.avoided-corridor h5 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.corridor-edges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.corridor-edge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
}

.corridor-edge .edge-entropy {
    color: var(--danger-light);
    font-weight: 600;
}

.corridor-arrow {
    color: var(--text-dim);
    font-size: 14px;
}

.reroute-note {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.6;
}

.cross-fire-badge {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid #A7F3D0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* METHODOLOGY */
.methodology {
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px 28px;
    margin: 32px 0;
}

.methodology h5 {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.methodology p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.8;
}

.methodology .source {
    display: block;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-dim);
}

/* HOW IT WORKS */
.pipeline {
    display: flex;
    align-items: flex-start;
    gap: 0;
    margin: 32px 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px 24px;
    overflow-x: auto;
}

.pipeline-step {
    flex: 1;
    text-align: center;
    padding: 0 16px;
    min-width: 140px;
}

.pipeline-step .step-num {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    border: 2px solid #A7F3D0;
}

.pipeline-step .step-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pipeline-step .step-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

.pipeline-arrow {
    flex-shrink: 0;
    color: var(--border-strong);
    font-size: 18px;
    margin-top: 8px;
    padding: 0 4px;
}

/* CRISIS STATS */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 32px 0;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-card .stat-source {
    font-size: 11px;
    color: var(--text-dim);
}

/* CTA */
.cta-section {
    padding: 80px 24px;
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 800;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.cta-button {
    display: inline-block;
    padding: 14px 36px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    border-radius: 6px;
}

.cta-contact {
    margin-top: 16px;
    font-size: 13px;
    color: var(--text-dim);
}

.cta-contact a { color: var(--accent); text-decoration: none; }

/* FOOTER */
footer {
    padding: 32px 24px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-brand {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 6px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 16px 24px;
        gap: 12px;
    }
    .nav-links.open { display: flex; }
    .hero-result { flex-direction: column; gap: 8px; text-align: center; }
    .weather-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr; }
    .pipeline { flex-direction: column; align-items: center; }
    .pipeline-arrow { transform: rotate(90deg); }
    .backtest-table { font-size: 12px; }
    .backtest-table th, .backtest-table td { padding: 8px 10px; }
    .reroute-stats { grid-template-columns: 1fr; }
    .corridor-edges { flex-direction: column; align-items: flex-start; }
}

/* FIRE GRID — 14-fire heatmap */
.fire-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin: 32px 0;
}

.fire-tile {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    position: relative;
    transition: box-shadow 0.2s;
}

.fire-tile:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.06); }

.fire-tile.detected { border-left: 4px solid var(--accent); }
.fire-tile.not-detected { border-left: 4px solid var(--text-dim); }
.fire-tile.don-recovered { border-left: 4px solid var(--amber-light); }

.fire-tile .tile-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.fire-tile .tile-date {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.fire-tile .tile-stats {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.fire-tile .tile-stats .stat-key {
    color: var(--text-muted);
    font-size: 11px;
}

.fire-tile .tile-stats .stat-val {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    font-size: 13px;
}

.fire-tile .tile-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tile-tag.tag-det { background: var(--accent-bg); color: var(--accent); }
.tile-tag.tag-don { background: #FEF3C7; color: var(--amber); }
.tile-tag.tag-miss { background: var(--bg-subtle); color: var(--text-dim); }

/* L_DEE SEVERITY */
.ldee-bar-container {
    margin: 32px 0;
}

.ldee-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.ldee-bar:last-child { border-bottom: none; }

.ldee-bar .ldee-name {
    width: 140px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    flex-shrink: 0;
}

.ldee-bar .ldee-deaths {
    width: 40px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.ldee-bar .ldee-track {
    flex: 1;
    height: 20px;
    background: var(--bg-subtle);
    border-radius: 3px;
    position: relative;
    overflow: hidden;
}

.ldee-bar .ldee-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.ldee-bar .ldee-value {
    width: 50px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

/* MORPHOLOGY SPOTLIGHT */
.morphology-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    margin: 32px 0;
}

.morphology-card h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
}

.morph-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.morph-metric {
    text-align: center;
    padding: 12px;
    background: var(--bg-subtle);
    border-radius: 6px;
}

.morph-metric .metric-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.morph-metric .metric-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* TIERED ALERTING */
.tier-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}

.tier-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
}

.tier-card.tier-1 { border-top: 3px solid var(--accent); }
.tier-card.tier-2 { border-top: 3px solid var(--amber-light); }

.tier-card .tier-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.tier-card.tier-1 .tier-label { color: var(--accent); }
.tier-card.tier-2 .tier-label { color: var(--amber); }

.tier-card .tier-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.tier-card .tier-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 12px 0;
}

.tier-card .tier-stat {
    padding: 8px;
    background: var(--bg-subtle);
    border-radius: 4px;
    text-align: center;
}

.tier-card .tier-stat .ts-val {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
}

.tier-card.tier-1 .ts-val { color: var(--accent); }
.tier-card.tier-2 .ts-val { color: var(--amber-light); }

.tier-card .tier-stat .ts-label {
    font-size: 11px;
    color: var(--text-muted);
}

.tier-card p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 12px;
}

/* DON EVOLUTION COMPARISON */
.evolution-compare {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: center;
    margin: 32px 0;
}

.evolution-box {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

.evolution-box .evo-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    font-weight: 800;
}

.evolution-box.raw .evo-value { color: var(--text-muted); }
.evolution-box.evolved .evo-value { color: var(--accent); }

.evolution-box .evo-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.evolution-box .evo-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.evolution-arrow {
    font-size: 28px;
    color: var(--accent);
    font-weight: 800;
}

/* ABOUT PAGE */
.about-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 28px;
    margin: 24px 0;
}

.about-card h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.patent-list {
    list-style: none;
    margin: 12px 0;
}

.patent-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--text-secondary);
}

.patent-list li:last-child { border-bottom: none; }

.patent-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.patent-status.granted { background: var(--accent-bg); color: var(--accent); }
.patent-status.pending { background: #FEF3C7; color: var(--amber); }

.data-source-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin: 16px 0;
}

.data-source-item {
    padding: 16px;
    background: var(--bg-subtle);
    border-radius: 6px;
}

.data-source-item .ds-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.data-source-item .ds-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

/* RESPONSIVE ADDITIONS */
@media (max-width: 768px) {
    .fire-grid { grid-template-columns: 1fr; }
    .tier-grid { grid-template-columns: 1fr; }
    .evolution-compare { grid-template-columns: 1fr; }
    .evolution-arrow { transform: rotate(90deg); text-align: center; }
    .morph-metrics { grid-template-columns: repeat(2, 1fr); }
    .data-source-grid { grid-template-columns: 1fr; }
    .ldee-bar .ldee-name { width: 100px; font-size: 11px; }
}

/* PRINT */
@media print {
    .nav { display: none; }
    .hero { padding-top: 40px; }
    body { font-size: 12px; }
}
