:root {
    --bg: #0c0d12;
    --panel: rgba(18, 22, 34, 0.74);
    --panel-strong: rgba(22, 28, 44, 0.92);
    --line: rgba(255, 255, 255, 0.12);
    --text: #f2eee6;
    --muted: #b8b0a4;
    --hot: #ff784f;
    --acid: #ffd166;
    --cold: #6dd3ce;
    --safe: #9ad1a3;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: "Space Grotesk", "Avenir Next", "Trebuchet MS", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(255, 120, 79, 0.22), transparent 28%),
        radial-gradient(circle at 80% 10%, rgba(109, 211, 206, 0.16), transparent 25%),
        linear-gradient(145deg, #06070b 0%, #131727 48%, #0b0d14 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

.noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.05;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.4) 0.6px, transparent 0.8px);
    background-size: 12px 12px;
    mix-blend-mode: screen;
}

.shell {
    position: relative;
    width: min(1160px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 72px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(10, 11, 18, 0.72);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
}

.brand,
.nav a,
.info-card a,
.back-link {
    color: inherit;
    text-decoration: none;
}

.brand {
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 1rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.nav a {
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--muted);
    transition: 180ms ease;
}

.nav a:hover,
.nav a.is-active {
    color: var(--text);
    border-color: rgba(255, 209, 102, 0.28);
    background: rgba(255, 209, 102, 0.08);
}

.hero-card,
.story-card,
.stats-card,
.info-card,
.error-screen {
    border: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.hero-card {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border-radius: 28px;
    margin-bottom: 24px;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -40px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 209, 102, 0.18), transparent 68%);
}

.hero-card.narrow {
    padding-bottom: 26px;
}

.eyebrow {
    margin-bottom: 14px;
    color: var(--cold);
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tag,
.code-pill,
.mini-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 0.8rem;
}

.mini-label {
    color: var(--muted);
}

h1,
h2,
h3,
strong {
    margin: 0;
    font-weight: 700;
}

h1 {
    margin-top: 16px;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    line-height: 0.95;
    max-width: 11ch;
}

h2 {
    font-size: clamp(1.6rem, 3vw, 2.3rem);
}

h3 {
    font-size: 1.3rem;
}

p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.lead {
    max-width: 66ch;
    margin-top: 16px;
    font-size: 1.08rem;
    color: var(--text);
}

.hero-grid,
.details-grid,
.card-grid,
.error-meta {
    display: grid;
    gap: 20px;
}

.hero-grid {
    grid-template-columns: minmax(0, 2.1fr) minmax(280px, 1fr);
    align-items: end;
}

.hero-grid-tight {
    align-items: start;
}

.status-panel,
.stats-card {
    padding: 22px;
    border-radius: 22px;
    background: var(--panel-strong);
}

.status-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.status-line:last-child {
    border-bottom: 0;
}

.status-line span {
    color: var(--muted);
}

.cards-section {
    margin-top: 34px;
}

.cards-section.compact {
    margin-top: 24px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: end;
    margin-bottom: 16px;
}

.card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.info-card {
    padding: 22px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transform: translateY(0);
    transition: transform 180ms ease, border-color 180ms ease;
}

.info-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 120, 79, 0.34);
}

.card-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.code-pill {
    color: var(--acid);
}

.route-line {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    font-family: "IBM Plex Mono", "Fira Code", monospace;
    font-size: 0.85rem;
}

.info-card a,
.back-link {
    width: fit-content;
    padding: 11px 14px;
    border-radius: 14px;
    background: linear-gradient(120deg, rgba(255, 120, 79, 0.22), rgba(255, 209, 102, 0.14));
    border: 1px solid rgba(255, 209, 102, 0.22);
}

.safe-card {
    border-color: rgba(154, 209, 163, 0.18);
}

.hard-card {
    border-color: rgba(255, 120, 79, 0.24);
    background:
        linear-gradient(180deg, rgba(255, 120, 79, 0.08), rgba(18, 22, 34, 0.74)),
        var(--panel);
}

.safe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.details-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
}

.story-card,
.stats-card {
    border-radius: 24px;
    padding: 28px;
}

.story-card {
    display: grid;
    gap: 16px;
}

.chaos-note h2 {
    margin-bottom: 14px;
}

.alert-panel {
    border: 1px solid rgba(255, 120, 79, 0.18);
}

.error-screen {
    min-height: calc(100vh - 180px);
    padding: 42px;
    border-radius: 30px;
    display: grid;
    align-content: center;
    gap: 20px;
    text-align: left;
}

.error-code {
    font-size: clamp(5rem, 18vw, 11rem);
    line-height: 0.85;
    color: var(--hot);
    text-shadow: 0 0 30px rgba(255, 120, 79, 0.32);
}

.error-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.error-meta div {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.error-meta span,
.hint {
    color: var(--muted);
}

@media (max-width: 920px) {
    .hero-grid,
    .details-grid,
    .card-grid,
    .safe-grid,
    .error-meta,
    .section-heading {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: start;
    }
}

@media (max-width: 640px) {
    .shell {
        width: min(100% - 20px, 1160px);
        padding-top: 12px;
    }

    .topbar,
    .hero-card,
    .story-card,
    .stats-card,
    .info-card,
    .error-screen {
        padding: 18px;
        border-radius: 20px;
    }

    h1 {
        font-size: 2.6rem;
    }
}
