/* ───────────────────────────── Tokens */

:root {
    --bg: #f2f3f4;
    --plate: #e7e9ec;
    --surface: #e9ebee;
    --line: #d2d6db;
    --line-strong: #a7aeb7;
    --text: #15181c;
    --muted: #59616b;
    --accent: #2b44e0;
    --on-accent: #ffffff;

    --scene-shade: #c9ced5;
    --scene-light: #f8f9fa;
    --scene-ink: #1d232b;
    --scene-ink-alpha: 0.55;
    --holo: #2b44e0;
    --holo-2: #18257a;

    --sans: 'Schibsted Grotesk', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --page: 1280px;
    --gutter: clamp(16px, 4vw, 56px);
    --nav-h: 68px;
    color-scheme: light;
}

:root[data-theme="dark"] {
    --bg: #15181c;
    --plate: #1b1f24;
    --surface: #1d2127;
    --line: #2c3239;
    --line-strong: #4a525d;
    --text: #eceef0;
    --muted: #9ba3ad;
    --accent: #8597ff;
    --on-accent: #0d1233;

    --scene-shade: #1e2329;
    --scene-light: #3b424c;
    --scene-ink: #d6dce4;
    --scene-ink-alpha: 0.32;
    --holo: #8aa2ff;
    --holo-2: #dfe5ff;
    color-scheme: dark;
}

/* ───────────────────────────── Base */

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

* {
    margin: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 24px);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img,
svg,
canvas,
iframe,
video {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
}

a:hover {
    text-decoration-color: currentColor;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

button {
    font: inherit;
    color: inherit;
}

h1,
h2,
h3 {
    font-weight: 500;
    line-height: 1.12;
    text-wrap: balance;
}

p,
li,
dd {
    text-wrap: pretty;
}

ul[class],
ol[class] {
    list-style: none;
    padding: 0;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -100px;
    z-index: 200;
    background: var(--text);
    color: var(--bg);
    padding: 8px 14px;
}

.skip-link:focus {
    top: 12px;
}

/* ───────────────────────────── Navigation */

.site-nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 100;
    height: var(--nav-h);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.site-nav.is-scrolled {
    border-bottom-color: var(--line);
}

.nav-inner {
    max-width: var(--page);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 32px);
}

.nav-name {
    font-weight: 600;
    text-decoration: none;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: clamp(16px, 2.5vw, 32px);
}

.nav-links a,
.theme-toggle,
.nav-toggle {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a[aria-current="page"],
.theme-toggle:hover,
.nav-toggle:hover {
    color: var(--text);
}

.theme-toggle,
.nav-toggle {
    background: none;
    border: 0;
    padding: 10px 0;
    cursor: pointer;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-right: -10px;
}

.theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

.nav-toggle {
    display: none;
}

@media (max-width: 760px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 4px var(--gutter) 16px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        display: none;
    }

    .nav-links.is-open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 0;
        font-size: 1.2rem;
        color: var(--text);
        border-top: 1px solid var(--line);
    }

    .nav-links a:first-child {
        border-top: 0;
    }
}

/* ───────────────────────────── Hero */

.hero {
    max-width: var(--page);
    margin: 0 auto;
    padding: calc(var(--nav-h) + clamp(32px, 6vh, 72px)) var(--gutter) clamp(48px, 8vh, 96px);
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: clamp(32px, 4vw, 64px);
    align-items: center;
    min-height: min(100svh, 980px);
}

.hero h1 {
    font-size: clamp(2.1rem, 3.6vw, 3.5rem);
    letter-spacing: -0.022em;
    line-height: 1.08;
}

.hero-lede {
    margin-top: 28px;
    max-width: 30em;
    color: var(--muted);
    font-size: 1.125rem;
}

.hero-links {
    margin-top: 32px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    max-width: 26em;
}

.hero-links li {
    border-bottom: 1px solid var(--line);
}

.hero-links a {
    display: block;
    padding: 12px 0;
    text-decoration: none;
    font-weight: 500;
}

.hero-links a:hover {
    color: var(--accent);
}

.hero-figure {
    margin-right: calc(-1 * var(--gutter));
}

.hero-canvas {
    position: relative;
    aspect-ratio: 5 / 4;
    max-height: calc(100svh - var(--nav-h) - 140px);
    min-height: 340px;
    width: 100%;
    background: var(--plate);
}

.hero-canvas canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
    touch-action: pan-y;
    opacity: 0;
    transition: opacity 0.6s;
}

.hero-figure.is-ready canvas {
    opacity: 1;
}

.hero-figure.is-unavailable {
    display: none;
}

.view-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
    margin-top: 14px;
    padding-right: var(--gutter);
}

.view-switch button {
    padding: 4px 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.95rem;
}

.view-switch button:hover {
    color: var(--text);
}

.view-switch button[aria-pressed="true"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.hero-figure figcaption {
    margin-top: 12px;
    max-width: 40em;
    padding-right: var(--gutter);
    font-size: 0.875rem;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .hero-figure {
        margin-left: calc(-1 * var(--gutter));
    }

    .hero-canvas {
        aspect-ratio: 4 / 3;
        max-height: none;
    }

    .hero-figure figcaption,
    .view-switch {
        padding-left: var(--gutter);
    }
}

/* ───────────────────────────── Sections */

.section {
    max-width: var(--page);
    margin: 0 auto;
    padding: clamp(80px, 11vw, 144px) var(--gutter) 0;
}

.section-head {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 12px clamp(32px, 4vw, 64px);
    align-items: baseline;
    padding-top: 20px;
    margin-bottom: clamp(36px, 5vw, 56px);
    border-top: 1px solid var(--text);
}

.section-head h2 {
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    letter-spacing: -0.018em;
}

.section-head p {
    color: var(--muted);
    max-width: 34em;
}

@media (max-width: 760px) {
    .section-head {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ───────────────────────────── About */

.about {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 32px clamp(32px, 4vw, 64px);
    align-items: start;
}

.portrait {
    position: relative;
    aspect-ratio: 1;
    max-width: 460px;
    background: #000;
    overflow: hidden;
    cursor: crosshair;
}

.portrait img,
.portrait canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.about-copy p {
    max-width: 34em;
    font-size: 1.125rem;
}

.about-copy p + p {
    margin-top: 16px;
}

.about-copy p:last-child {
    color: var(--muted);
}

@media (max-width: 760px) {
    .about {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ───────────────────────────── Featured: 2 x 2 grid */

.featured {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(48px, 6vw, 72px) clamp(24px, 3vw, 40px);
}

.case-media {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--surface);
    cursor: pointer;
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.case-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(.2, .7, .2, 1);
}

.case-media img[data-fit="contain"] {
    object-fit: contain;
    padding: 8%;
}

.case-media:hover img {
    transform: scale(1.02);
}

/* Typographic cover for projects without imagery */
.case-media.is-type {
    background-color: var(--plate);
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: -1px -1px;
}

.case-type {
    position: absolute;
    left: 7%;
    right: 7%;
    bottom: 9%;
    display: flex;
    flex-direction: column;
    text-align: left;
    font-size: clamp(1.4rem, 2.6vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.case-type span:not(:first-child) {
    color: var(--muted);
}

.case h3 {
    margin-top: 18px;
    font-size: clamp(1.25rem, 1.7vw, 1.5rem);
    letter-spacing: -0.012em;
}

.case-link {
    padding: 0;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font-weight: inherit;
    letter-spacing: inherit;
    line-height: inherit;
}

.case:hover .case-link {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

.case-meta {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.95rem;
}

.case-summary {
    margin-top: 10px;
    max-width: 34em;
}

@media (max-width: 760px) {
    .featured {
        grid-template-columns: minmax(0, 1fr);
    }
}

.text-button {
    margin-top: 16px;
}

.case-body .specs {
    margin-top: 0;
}

.case-text-only .case-body {
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
    .case-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .case-media {
        aspect-ratio: 16 / 10;
    }
}

.text-button {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 0.22em;
    text-decoration-thickness: 1px;
}

.text-button:hover {
    color: var(--accent);
    text-decoration-color: currentColor;
}

/* Key/value table, used on case studies, project pages, and the resume */
.specs {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0 20px;
    margin-top: 24px;
    font-size: 0.92rem;
}

.specs dt,
.specs dd {
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.specs dt {
    color: var(--muted);
}

/* ───────────────────────────── Index */

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin-bottom: 24px;
}

.filter {
    padding: 6px 0;
    border: 0;
    border-bottom: 1px solid transparent;
    background: none;
    cursor: pointer;
    color: var(--muted);
}

.filter:hover {
    color: var(--text);
}

.filter[aria-pressed="true"] {
    color: var(--text);
    border-bottom-color: var(--text);
}

.filter .count {
    font-size: 0.75em;
    vertical-align: super;
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}

.index-list {
    border-bottom: 1px solid var(--line);
}

.index-list li[hidden] {
    display: none;
}

.index-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) minmax(0, 13rem) minmax(0, 11rem);
    gap: 4px 24px;
    align-items: center;
    width: 100%;
    padding: 14px 0;
    border: 0;
    border-top: 1px solid var(--line);
    background: none;
    text-align: left;
    cursor: pointer;
}

.index-row:hover {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
}

.index-thumb {
    width: 112px;
    aspect-ratio: 4 / 3;
    background: var(--surface);
    overflow: hidden;
}

.index-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.index-thumb img[data-fit="contain"] {
    object-fit: contain;
}

.index-title {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.3;
}

.index-row:hover .index-title {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
}

.index-summary {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.45;
}

.index-type,
.index-when {
    color: var(--muted);
    font-size: 0.92rem;
}

@media (max-width: 900px) {
    .index-row {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: start;
    }

    .index-thumb {
        width: 96px;
        grid-row: span 3;
    }

    .index-summary {
        display: none;
    }
}

.ask-about {
    margin-top: 32px;
    max-width: 44em;
    color: var(--muted);
}

/* ───────────────────────────── Experience */

.timeline > li {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 8px clamp(32px, 4vw, 64px);
    padding: 28px 0;
    border-top: 1px solid var(--line);
}

.timeline > li:first-child {
    border-top: 0;
    padding-top: 0;
}

.timeline .when {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.timeline h3 {
    font-size: 1.25rem;
}

.timeline .where {
    color: var(--muted);
    margin-top: 4px;
}

.timeline ul {
    margin-top: 12px;
    padding-left: 1.1em;
    max-width: 40em;
}

.timeline ul li + li {
    margin-top: 6px;
}

.timeline ul li::marker {
    color: var(--line-strong);
}

@media (max-width: 760px) {
    .timeline > li {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ───────────────────────────── Stack */

.stack > div {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 4px clamp(32px, 4vw, 64px);
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

.stack > div:first-child {
    border-top: 0;
    padding-top: 0;
}

.stack dt {
    color: var(--muted);
}

@media (max-width: 760px) {
    .stack > div {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ───────────────────────────── Contact + footer */

.contact {
    padding-bottom: clamp(80px, 10vw, 128px);
}

.contact h2 {
    padding-top: 20px;
    border-top: 1px solid var(--text);
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    letter-spacing: -0.018em;
}

.contact > p {
    margin-top: 16px;
    max-width: 34em;
    color: var(--muted);
}

.contact-email {
    margin-top: 28px !important;
    font-size: clamp(1.5rem, 4.4vw, 3.25rem);
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text) !important;
    overflow-wrap: anywhere;
}

.contact-email a {
    text-decoration-thickness: 2px;
    text-underline-offset: 0.16em;
}

.contact-email a:hover {
    color: var(--accent);
}

.contact-links {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 32px;
    font-weight: 500;
}

.site-footer {
    max-width: var(--page);
    margin: 0 auto;
    padding: 24px var(--gutter) 32px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

/* ───────────────────────────── Buttons (resume download, project links) */

.button {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 10px 18px;
    border: 1px solid var(--text);
    background: none;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
}

.button:hover {
    background: var(--text);
    color: var(--bg);
}

/* ───────────────────────────── Project sheet */

.project-sheet {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(900px, 100vw);
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;
    padding: 0;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.project-sheet::backdrop {
    background: rgba(10, 12, 16, 0.5);
}

.project-sheet[open] {
    animation: sheet-in 0.32s cubic-bezier(.2, .7, .2, 1);
}

@keyframes sheet-in {
    from {
        transform: translateX(48px);
        opacity: 0;
    }
}

.sheet-bar {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 clamp(16px, 4vw, 48px);
    height: 60px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.95rem;
}

.sheet-close {
    background: none;
    border: 0;
    padding: 10px 0;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
}

.sheet-close:hover {
    color: var(--accent);
}

.sheet-content {
    padding: clamp(28px, 4vw, 48px) clamp(16px, 4vw, 48px) 56px;
}

.sheet-content h2 {
    font-size: clamp(2rem, 4.4vw, 3rem);
    letter-spacing: -0.022em;
}

.sheet-org {
    color: var(--muted);
    margin-top: 10px;
}

.sheet-summary {
    font-size: 1.25rem;
    line-height: 1.5;
    margin-top: 24px;
    max-width: 32em;
}

.sheet-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.sheet-cover {
    margin-top: 32px;
    background: var(--surface);
}

.sheet-cover img {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    margin: 0 auto;
}

.sheet-content > .specs {
    margin-top: 32px;
    max-width: 40em;
}

.blocks {
    margin-top: 40px;
    display: grid;
    gap: 24px;
}

.blocks > p,
.blocks > ul {
    max-width: 38em;
}

.blocks > ul {
    padding-left: 1.1em;
}

.blocks > ul li + li {
    margin-top: 8px;
}

.blocks h3 {
    font-size: 1.3rem;
    margin-top: 16px;
}

.blocks figure {
    background: var(--surface);
}

.blocks figure img {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.blocks figcaption {
    padding-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    background: var(--bg);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}

.gallery a {
    display: block;
    aspect-ratio: 4 / 3;
    background: var(--surface);
    overflow: hidden;
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery a:first-child {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
}

.frame {
    width: 100%;
    background: var(--surface);
}

.frame iframe,
.frame video {
    width: 100%;
    border: 0;
}

.frame.is-video {
    aspect-ratio: 16 / 9;
}

.frame.is-video iframe {
    height: 100%;
}

.sheet-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 64px;
    padding-top: 20px;
    border-top: 1px solid var(--text);
}

.sheet-nav button {
    text-align: left;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    font-weight: 500;
    font-size: 1.1rem;
    line-height: 1.3;
}

.sheet-nav button:hover {
    color: var(--accent);
}

.sheet-nav button:last-child {
    text-align: right;
}

.sheet-nav small {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
}

body.has-sheet {
    overflow: hidden;
}

/* ───────────────────────────── Document pages (resume, write-ups) */

.doc {
    max-width: var(--page);
    margin: 0 auto;
    padding: calc(var(--nav-h) + clamp(40px, 7vw, 96px)) var(--gutter) 96px;
}

.doc-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 24px;
    padding-bottom: 32px;
}

.doc-head h1 {
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: -0.025em;
    line-height: 1.02;
}

.doc-head .role {
    margin-top: 14px;
    font-size: 1.15rem;
    color: var(--muted);
    max-width: 36em;
}

.doc-contact {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 24px;
}

.doc-section {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: 12px clamp(32px, 4vw, 64px);
    padding: 24px 0 48px;
    border-top: 1px solid var(--text);
}

.doc-section > h2 {
    font-size: 1.25rem;
}

.doc-section > div {
    max-width: 46em;
}

.doc-section .entry + .entry {
    margin-top: 32px;
}

.entry-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 16px;
}

.entry-head h3 {
    font-size: 1.125rem;
}

.entry-head .when {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.entry .where {
    color: var(--muted);
    margin-top: 2px;
}

.entry ul,
.doc-section > div > ul {
    margin-top: 10px;
    padding-left: 1.1em;
}

.entry ul li + li,
.doc-section > div > ul li + li {
    margin-top: 6px;
}

.doc-section .specs {
    margin-top: 0;
    font-size: 1rem;
}

.doc-section .specs dt:first-of-type,
.doc-section .specs dd:first-of-type {
    border-top: 0;
    padding-top: 0;
}

@media (max-width: 760px) {
    .doc-head,
    .doc-section {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc-section .specs {
        grid-template-columns: minmax(0, 1fr);
    }

    .doc-section .specs dd {
        border-top: 0;
        padding-top: 0;
    }
}

@media print {
    .site-nav,
    .site-footer,
    .doc-head .button,
    .skip-link {
        display: none;
    }

    :root,
    :root[data-theme="dark"] {
        --bg: #fff;
        --text: #000;
        --muted: #444;
        --line: #ccc;
    }

    .doc {
        padding: 0;
    }

    .doc-section {
        padding: 12px 0 20px;
        break-inside: avoid;
    }
}

/* ───────────────────────────── Motion preferences */

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

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
