:root {
    --bg: #050816;
    --bg-soft: #0f172a;
    --accent: #22c55e;
    --accent-soft: rgba(34,197,94,0.12);
    --accent-alt: #38bdf8;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --danger: #f97316;
    --critical: #ef4444;
    --border: rgba(148,163,253,0.15);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --shadow-soft: 0 18px 45px rgba(15,23,42,0.75);
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    background: radial-gradient(circle at top, #111827 0, #020817 40%, #020617 100%);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}

/* Header */

header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 28px;
}

.logo-lockup {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-pill {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 0, var(--accent-alt), var(--accent));
    box-shadow: 0 0 18px rgba(56,189,248,0.4);
}

.logo-text {
    font-size: 14px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
}

h1 {
    font-size: clamp(26px, 4vw, 36px);
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    max-width: 720px;
}

.tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.tag {
    padding: 4px 9px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,253,0.2);
    font-size: 10px;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.tag span.dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
}

/* Layout: main grid */

main {
    /* mobile-first: simple vertical stack */
    display: block;
}

main > .panel {
    margin-bottom: 18px;
}

/* Two-column grid for wider viewports: narrative left, sidebars right */
@media (min-width: 900px) {
    main {
        display: grid;
        grid-template-columns: minmax(0, 1.9fr) minmax(320px, 1fr);
        column-gap: 24px;
        row-gap: 24px;
        align-items: flex-start;
    }

    main > .panel {
        margin-bottom: 0;
        width: 100%;
    }

    /* All main narrative sections stay in the left column */
    main > section.panel {
        grid-column: 1;
    }

    /* All asides stack in the right column as a sidebar column */
    main > aside.panel {
        grid-column: 2;
    }

    /* Make the very first section (the preface) span full width */
    main > section.panel:first-of-type {
        grid-column: 1 / -1;
    }
}

/* Panels & common blocks */

.panel {
    background: radial-gradient(circle at top left, rgba(56,189,248,0.08), transparent),
    radial-gradient(circle at top right, rgba(34,197,94,0.05), transparent),
    var(--bg-soft);
    border-radius: var(--radius-lg);
    padding: 16px 14px 14px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.panel h2 {
    font-size: 16px;
    margin: 0 0 6px;
    font-weight: 600;
}

.panel p {
    font-size: 13px;
    line-height: 1.65;
    margin: 0 0 6px;
    color: var(--muted);
}

.pill-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 9px;
    color: var(--accent-alt);
    background: rgba(15,23,42,0.9);
    border: 1px solid rgba(148,163,253,0.25);
    margin-bottom: 4px;
}

.pill-label .tiny-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--accent);
}

/* Lists */

ul,
ol {
    padding-left: 18px;
    margin: 4px 0 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.6;
}

li {
    margin-bottom: 2px;
}

/* Metric grid */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 10px;
    margin-top: 6px;
}

@media (min-width: 600px) {
    .grid-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.metric-card {
    padding: 8px 9px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148,163,253,0.18);
    background: rgba(9,9,18,0.98);
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.metric-label {
    font-size: 9px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.metric-value {
    font-size: 16px;
    font-weight: 600;
}

.metric-note {
    font-size: 9px;
    color: var(--muted);
}

.metric-critical {
    color: var(--critical);
}

.metric-warn {
    color: var(--danger);
}

/* Scenario / notes */

.scenario-note {
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
}

/* Timeline blocks */

.timeline {
    margin-top: 4px;
    border-radius: var(--radius-md);
    padding: 6px 8px;
    background: radial-gradient(circle at top, rgba(15,23,42,0.9), #020817);
    border: 1px solid rgba(148,163,253,0.18);
    font-size: 11px;
    color: var(--muted);
}

.timeline h3 {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-alt);
}

.timeline-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    column-gap: 6px;
    row-gap: 2px;
    align-items: flex-start;
}

.timeline-year {
    font-size: 10px;
    font-weight: 600;
    color: var(--accent-alt);
}

.timeline-text {
    font-size: 10px;
    line-height: 1.5;
}

/* Comparison table */

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 9px;
    color: var(--muted);
}

.compare-table th,
.compare-table td {
    padding: 4px 5px;
    border: 1px solid rgba(75,85,99,0.6);
}

.compare-table th {
    background: rgba(15,23,42,0.98);
    font-weight: 600;
    color: var(--accent-alt);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Labels */

.scenario-label {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-block;
    margin-bottom: 2px;
}

.fact-label {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(148,163,253,0.1);
    color: var(--accent-alt);
    display: inline-block;
    margin-bottom: 2px;
}

/* Warning box */

.warn-box {
    margin-top: 6px;
    padding: 7px 8px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(248,250,252,0.12);
    background: rgba(15,23,42,0.98);
    font-size: 10px;
    color: var(--muted);
    display: flex;
    gap: 8px;
}

.warn-flag {
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: radial-gradient(circle at 35% 0, var(--danger), var(--critical));
    box-shadow: 0 0 12px rgba(248,113,22,0.6);
    flex-shrink: 0;
}

.pill-ok {
    color: var(--accent);
}

/* Links & footer */

a {
    color: var(--accent-alt);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    margin-top: 26px;
    font-size: 9px;
    color: var(--muted);
    text-align: left;
}

/* Memo banner */

.memo-banner {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: rgba(34,197,94,0.06);
    border: 1px solid rgba(34,197,94,0.4);
    font-size: 10px;
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.memo-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(34,197,94,0.7);
    flex-shrink: 0;
}
