@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@400;500;700&display=swap");

:root {
    --bg-top: #f2f2ef;
    --bg-bottom: #e9e9e4;
    --paper: #fcfcfb;
    --text: #101316;
    --muted: #4f5660;
    --line: #c3c9cf;
    --accent: #152533;
    --accent-soft: #e3e8ee;
    --focus: #0a4f81;
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--text);
    background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
    min-height: 100vh;
    line-height: 1.45;
    position: relative;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(var(--accent-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--accent-soft) 1px, transparent 1px);
    background-size: 24px 24px;
    opacity: 0.3;
    z-index: 0;
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0.4rem;
    background: #ffffff;
    color: #000000;
    border: 2px solid var(--focus);
    padding: 0.45rem 0.6rem;
    z-index: 5;
    text-decoration: none;
}

.skip-link:focus {
    left: 0.6rem;
}

.layout {
    width: min(1120px, 94vw);
    margin: 0 auto;
    padding: 1.2rem 0 2.4rem;
    position: relative;
    z-index: 1;
}

.hero,
.toc,
.section,
.footer {
    border: 1px solid var(--line);
    background: var(--paper);
}

.hero {
    padding: 1.35rem 1.1rem 1.15rem;
    border-top: 3px solid #1f3346;
}

.kicker {
    margin: 0 0 0.3rem;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.79rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

h1,
h2,
h3 {
    margin: 0 0 0.48rem;
    line-height: 1.2;
}

h1 {
    font-size: clamp(1.52rem, 2.8vw, 2.32rem);
    max-width: 24ch;
}

h2 {
    font-size: clamp(1.2rem, 2.2vw, 1.55rem);
}

h3 {
    font-size: 1rem;
}

p {
    margin: 0.26rem 0 0.82rem;
}

.lead {
    max-width: 80ch;
    color: var(--muted);
}

.cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0.9rem 0 1rem;
}

.btn {
    display: inline-block;
    text-decoration: none;
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
    padding: 0.58rem 0.75rem;
}

.btn:hover {
    background: #0c1b28;
    color: #ffffff;
}

.btn-secondary {
    background: #f3f5f7;
    color: var(--accent);
}

.btn-secondary:hover {
    background: #e6ebf0;
    color: #0c1b28;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-top: 0.2rem;
}

.status {
    border: 1px solid var(--line);
    border-top: 3px solid #1f3346;
    background: #f6f9fc;
    padding: 0.68rem 0.64rem;
}

.status h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}

.status p {
    margin: 0;
    font-size: 0.91rem;
}

.diagram {
    margin: 0.95rem 0 0;
    border: 1px solid var(--line);
    background: #f6f8fa;
}

.diagram img {
    width: 100%;
    height: auto;
    display: block;
}

.diagram figcaption {
    border-top: 1px solid var(--line);
    font-size: 0.82rem;
    color: var(--muted);
    padding: 0.48rem 0.62rem;
}

.toc {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
}

.toc a {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--accent);
    padding: 0.56rem 0.74rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.toc a:hover {
    background: var(--accent-soft);
}

.section {
    margin-top: 0.7rem;
    padding: 1rem 1rem 0.95rem;
    border-left: 3px solid #d6e1ec;
    opacity: 0;
    transform: translateY(8px);
    animation: section-enter 0.44s ease forwards;
}

.section h2 {
    color: #13293a;
}

.section:nth-of-type(1) {
    animation-delay: 0.05s;
}

.section:nth-of-type(2) {
    animation-delay: 0.1s;
}

.section:nth-of-type(3) {
    animation-delay: 0.14s;
}

.section:nth-of-type(4) {
    animation-delay: 0.18s;
}

.section:nth-of-type(5) {
    animation-delay: 0.22s;
}

.section:nth-of-type(6) {
    animation-delay: 0.26s;
}

.section:nth-of-type(7) {
    animation-delay: 0.3s;
}

.section:nth-of-type(8) {
    animation-delay: 0.34s;
}

.section:nth-of-type(9) {
    animation-delay: 0.38s;
}

@keyframes section-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
}

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

.plain-list {
    margin: 0.3rem 0 0.84rem;
    padding-left: 1.02rem;
}

.plain-list li {
    margin-bottom: 0.34rem;
}

.mono li,
.mono {
    font-family: "IBM Plex Mono", monospace;
    font-size: 0.9rem;
}

pre,
code {
    font-family: "IBM Plex Mono", monospace;
}

code {
    background: #f0f3f5;
    border: 1px solid #d3dbe2;
    padding: 0 0.24rem;
}

pre {
    margin: 0.3rem 0 0.82rem;
    padding: 0.64rem;
    border: 1px solid var(--line);
    background: #f4f6f8;
    overflow: auto;
    font-size: 0.85rem;
}

pre code {
    border: 0;
    background: transparent;
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
    margin: 0.55rem 0 0.9rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

th,
td {
    border: 1px solid var(--line);
    padding: 0.52rem 0.56rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
}

th {
    background: #e8eef5;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

a {
    color: #0f395f;
}

a:hover {
    color: #072337;
}

a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

.link-disabled {
    opacity: 0.64;
    text-decoration: none;
    cursor: default;
}

.faq-item {
    border: 1px solid var(--line);
    background: #f8f9fa;
    padding: 0.72rem;
    margin-bottom: 0.6rem;
}

.faq-item p {
    margin-bottom: 0;
}

.note {
    font-size: 0.89rem;
    color: var(--muted);
}

.footer {
    margin-top: 0.7rem;
    padding: 0.74rem 1rem;
    font-size: 0.84rem;
    color: var(--muted);
}

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

    .split {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 620px) {
    .layout {
        width: min(1120px, 96vw);
        padding-top: 0.7rem;
    }

    .hero,
    .section,
    .footer {
        padding-left: 0.78rem;
        padding-right: 0.78rem;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .toc a {
        flex: 1 1 46%;
    }

    .split.split-3 {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .section {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
