:root {
    --brand-navy: #2a2f73;
    --brand-red: #ca3126;
    --brand-green: #007f21;
    --ink: #171a2f;
    --muted: #5f6477;
    --line: #dfe1ea;
    --surface: #ffffff;
    --surface-soft: #f5f6fb;
    --surface-code: #171a2f;
    --code-ink: #f6f7ff;
    --focus: #ca3126;
    --content-width: 1200px;
    --shadow: 0 18px 45px rgb(31 35 82 / 10%);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 75% 0%, rgb(202 49 38 / 6%), transparent 28rem),
        linear-gradient(180deg, #fbfbfe 0, #fff 32rem);
    color: var(--ink);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    font-size: 1rem;
    line-height: 1.7;
}

a {
    color: var(--brand-navy);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--brand-red);
}

a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible,
summary:focus-visible {
    border-radius: 0.2rem;
    outline: 3px solid rgb(202 49 38 / 45%);
    outline-offset: 3px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

code,
pre {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

code {
    font-size: 0.9em;
}

:not(pre) > code {
    border: 1px solid #e1e3ef;
    border-radius: 0.3rem;
    background: #f2f3f9;
    padding: 0.12em 0.35em;
    color: #272c68;
}

h1,
h2,
h3 {
    color: var(--brand-navy);
    font-weight: 750;
    letter-spacing: -0.025em;
    line-height: 1.18;
}

h1 {
    max-width: none;
    margin: 0;
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h3 {
    margin: 2.4rem 0 0.65rem;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
}

p,
ul,
ol {
    max-width: 72ch;
}

.skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    translate: 0 -180%;
    border-radius: 0.4rem;
    background: var(--brand-red);
    padding: 0.65rem 1rem;
    color: #fff;
    font-weight: 700;
}

.skip-link:focus {
    translate: 0;
}

.site-header {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 5rem;
    border-bottom: 1px solid rgb(42 47 115 / 10%);
    background: rgb(255 255 255 / 92%);
    padding: 0.7rem max(1.25rem, calc((100vw - var(--content-width)) / 2));
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
}

.brand img {
    width: 9.5rem;
    height: auto;
}

.header-links {
    display: flex;
    gap: 1.3rem;
    font-size: 0.92rem;
    font-weight: 700;
}

.header-links a {
    text-decoration: none;
}

.page-shell {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 6.5rem);
    max-width: var(--content-width);
    margin: 0 auto;
    padding: clamp(2.5rem, 7vw, 6.5rem) 1.25rem 5rem;
}

.table-of-contents {
    position: sticky;
    top: 7rem;
    align-self: start;
    max-height: calc(100vh - 9rem);
    overflow-y: auto;
    padding-right: 1rem;
}

.eyebrow,
.section-number {
    margin: 0 0 0.7rem;
    color: var(--brand-red);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.table-of-contents ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.table-of-contents li + li {
    margin-top: 0.18rem;
}

.table-of-contents a {
    display: block;
    border-left: 2px solid transparent;
    padding: 0.28rem 0.65rem;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.35;
    text-decoration: none;
}

.table-of-contents a:hover,
.table-of-contents a:focus-visible {
    border-color: var(--brand-red);
    color: var(--brand-navy);
}

main {
    min-width: 0;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(14rem, 20rem);
    align-items: end;
    gap: clamp(2rem, 6vw, 5rem);
    padding-bottom: clamp(1.75rem, 3vw, 2.5rem);
}

.lede {
    max-width: 56ch;
    margin: 1.5rem 0 0;
    color: var(--muted);
    font-size: clamp(1.08rem, 2vw, 1.3rem);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.8rem;
    border: 1px solid var(--brand-navy);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    font-weight: 750;
    text-decoration: none;
}

.button.primary {
    background: var(--brand-navy);
    color: #fff;
}

.button.primary:hover {
    border-color: var(--brand-red);
    background: var(--brand-red);
}

.button.secondary {
    background: #fff;
}

.version-card {
    overflow: hidden;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.version-card div {
    padding: 1rem 1.2rem;
}

.version-card div + div {
    border-top: 1px solid var(--line);
}

.version-card dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.version-card dd {
    overflow-wrap: anywhere;
    margin: 0.25rem 0 0;
    color: var(--brand-navy);
    font-weight: 750;
}

.guide-section {
    border-top: 1px solid var(--line);
    padding: clamp(3.5rem, 8vw, 7rem) 0 clamp(0.75rem, 1.5vw, 1.25rem);
}

.guide-section > :last-child {
    margin-bottom: 0;
}

.guide-section > p:first-of-type:not(.section-number) {
    margin-top: 0;
}

.guide-section > p,
.guide-section > ul,
.guide-section > ol {
    color: #3d4156;
}

.guide-section li + li {
    margin-top: 0.55rem;
}

.callout {
    max-width: 72ch;
    border: 1px solid rgb(42 47 115 / 18%);
    border-left: 0.3rem solid var(--brand-navy);
    border-radius: 0.45rem;
    background: var(--surface-soft);
    padding: 1rem 1.2rem;
    color: #30344c;
}

.callout strong {
    color: var(--brand-navy);
}

.callout.warning {
    border-color: rgb(202 49 38 / 18%);
    border-left-color: var(--brand-red);
    background: #fff7f5;
}

.callout.warning strong {
    color: #9f2119;
}

.code-block,
.example-output,
.log-sample,
.field-sample {
    max-width: 54rem;
    margin: 1.2rem 0 2rem;
    overflow: hidden;
    border: 1px solid #2e3352;
    border-radius: 0.65rem;
    background: var(--surface-code);
    box-shadow: 0 12px 28px rgb(23 26 47 / 12%);
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 2.4rem;
    border-bottom: 1px solid #343954;
    background: #20243d;
    padding: 0.35rem 0.55rem 0.35rem 1rem;
    color: #bfc4de;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.copy-button {
    border: 1px solid #555b7d;
    border-radius: 0.35rem;
    background: transparent;
    padding: 0.28rem 0.65rem;
    color: #f5f6ff;
    cursor: pointer;
    font: inherit;
    letter-spacing: 0;
    text-transform: none;
}

.copy-button:hover {
    border-color: #fff;
    background: rgb(255 255 255 / 8%);
}

pre {
    margin: 0;
    overflow-x: auto;
    padding: 1.1rem 1.2rem;
    color: var(--code-ink);
    font-size: clamp(0.79rem, 1.4vw, 0.9rem);
    line-height: 1.65;
    tab-size: 4;
}

.example-output {
    border-color: #ced2e4;
    background: #f5f6fb;
    box-shadow: none;
}

.example-output > span {
    display: block;
    border-bottom: 1px solid #d9dce9;
    padding: 0.45rem 1rem;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.example-output pre {
    color: #252943;
}

.log-sample summary,
.field-sample summary {
    padding: 0.8rem 1rem;
    color: #f6f7ff;
    cursor: pointer;
    font-weight: 700;
}

.log-sample[open] summary,
.field-sample[open] summary {
    border-bottom: 1px solid #343954;
}

.table-wrap {
    max-width: 58rem;
    margin: 1.5rem 0 2rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
}

table {
    width: 100%;
    min-width: 42rem;
    border-collapse: collapse;
    background: var(--surface);
    font-size: 0.93rem;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 0.8rem 1rem;
    text-align: left;
    vertical-align: top;
}

thead th {
    background: var(--surface-soft);
    color: var(--brand-navy);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

tbody th {
    width: 35%;
    color: var(--ink);
    font-weight: 650;
}

tbody tr:last-child th,
tbody tr:last-child td {
    border-bottom: 0;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    max-width: 58rem;
    margin: 1.5rem 0 2.5rem;
}

.status-grid article {
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface);
    padding: 1rem;
}

.status-grid article:last-child {
    grid-column: span 2;
}

.status-grid article > code {
    color: var(--brand-navy);
    font-weight: 800;
}

.status-grid p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

figure {
    max-width: 62rem;
    margin: 2rem 0 3rem;
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: #fff;
    padding: clamp(0.5rem, 2vw, 1rem);
    box-shadow: var(--shadow);
}

.narrow-figure {
    max-width: 38rem;
}

figcaption {
    padding: 0.7rem 0.35rem 0.1rem;
    color: var(--muted);
    font-size: 0.86rem;
}

.migration-list {
    margin: 1.5rem 0 0;
    padding-left: 1.5rem;
}

.migration-list li::marker {
    color: var(--brand-red);
    font-weight: 800;
}

.resource-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    max-width: 58rem;
}

.resource-grid a {
    display: flex;
    flex-direction: column;
    min-height: 10rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: var(--surface);
    padding: 1.1rem;
    color: var(--ink);
    text-decoration: none;
    transition:
        border-color 150ms ease,
        translate 150ms ease,
        box-shadow 150ms ease;
}

.resource-grid a:hover {
    translate: 0 -0.15rem;
    border-color: rgb(42 47 115 / 45%);
    box-shadow: var(--shadow);
}

.resource-grid span {
    color: var(--brand-red);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.resource-grid strong {
    margin-top: 0.55rem;
    color: var(--brand-navy);
    font-size: 1.05rem;
}

.resource-grid small {
    margin-top: auto;
    padding-top: 1rem;
    color: var(--muted);
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    max-width: var(--content-width);
    margin: 0 auto;
    border-top: 1px solid var(--line);
    padding: 2rem 1.25rem 3rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.site-footer p {
    margin: 0;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

@media (max-width: 900px) {
    html {
        scroll-padding-top: 5rem;
    }

    .site-header {
        min-height: 4.3rem;
    }

    .brand img {
        width: 8rem;
    }

    .page-shell {
        display: block;
        padding-top: 2rem;
    }

    .table-of-contents {
        position: static;
        max-height: none;
        margin-bottom: 3.5rem;
        border: 1px solid var(--line);
        border-radius: 0.6rem;
        background: var(--surface);
        padding: 1rem;
    }

    .table-of-contents ol {
        columns: 2;
        column-gap: 1rem;
    }

    .table-of-contents li {
        break-inside: avoid;
    }

    .hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

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

    .version-card div + div {
        border-top: 0;
        border-left: 1px solid var(--line);
    }
}

@media (max-width: 600px) {
    body {
        font-size: 0.96rem;
    }

    .site-header {
        padding-inline: 1rem;
    }

    .brand img {
        width: 7.2rem;
    }

    .header-links {
        gap: 0.75rem;
        font-size: 0.82rem;
    }

    .page-shell {
        padding-inline: 1rem;
    }

    .table-of-contents {
        overflow-x: auto;
        margin-bottom: 2.25rem;
        padding: 0.8rem;
    }

    .table-of-contents .eyebrow {
        margin-left: 0.65rem;
    }

    .table-of-contents ol {
        display: flex;
        width: max-content;
        columns: auto;
        gap: 0.2rem;
    }

    .table-of-contents li + li {
        margin-top: 0;
    }

    .table-of-contents a {
        border-bottom: 2px solid transparent;
        border-left: 0;
        padding: 0.3rem 0.65rem;
        white-space: nowrap;
    }

    .table-of-contents a:hover,
    .table-of-contents a:focus-visible {
        border-bottom-color: var(--brand-red);
        border-left-color: transparent;
    }

    .version-card {
        display: block;
    }

    .version-card div + div {
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .hero-actions,
    .hero-actions .button {
        width: 100%;
    }

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

    .status-grid article:last-child {
        grid-column: auto;
    }

    .site-footer {
        display: block;
    }

    .site-footer a {
        display: inline-block;
        margin-top: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .resource-grid a {
        transition: none;
    }
}

@media print {
    body {
        background: #fff;
        color: #000;
        font-size: 10pt;
    }

    .site-header {
        position: static;
    }

    .header-links,
    .table-of-contents,
    .copy-button,
    .hero-actions,
    .site-footer a {
        display: none;
    }

    .page-shell {
        display: block;
        max-width: none;
        padding: 1rem;
    }

    .hero {
        display: block;
    }

    .guide-section {
        break-inside: avoid;
        padding: 2rem 0;
    }

    a {
        color: #000;
    }

    pre {
        white-space: pre-wrap;
    }
}
