/* =========================================================
   DIFURRENT
   Global stylesheet
   Responsive production stylesheet
   ========================================================= */


/* =========================================================
   01. FONT FACES
   ========================================================= */

@font-face {
    font-family: "Söhne";
    src: url("/assets/fonts/soehne-buch.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Söhne";
    src: url("/assets/fonts/soehne-halbfett.woff2") format("woff2");
    font-style: normal;
    font-weight: 700;
    font-display: swap;
}


/* =========================================================
   02. DESIGN TOKENS
   ========================================================= */

:root {
    color-scheme: dark;

    --bg: #0a0a0a;
    --surface: #111111;
    --surface-strong: #1f1f1f;

    --text: #ffffff;
    --muted: #bfbfbf;
    --faint: #6f6f6f;

    --line: #292929;
    --line-strong: #484848;

    --accent: #3882f6;
    --accent-soft: rgba(56, 130, 246, 0.12);

    --header-height: 72px;
    --content-width: 1440px;

    --page-gutter: clamp(1rem, 3vw, 3rem);

    /* Article geometry */
    --article-width: 1280px;
    --article-reading-width: 800px;
    --article-toc-width: 220px;
    --article-gap: clamp(2.5rem, 5vw, 5rem);

    --mono:
        "IBM Plex Mono",
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    --sans:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    --display:
        "Söhne",
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;

    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

    --fast: 160ms;
    --normal: 280ms;
    --slow: 650ms;
}

[data-theme="light"] {
    color-scheme: light;

    --bg: #f4f4f1;
    --surface: #ffffff;
    --surface-strong: #e9e9e5;

    --text: #0a0a0a;
    --muted: #555555;
    --faint: #888888;

    --line: #d8d8d3;
    --line-strong: #aaaaa4;

    --accent: #2468d8;
    --accent-soft: rgba(36, 104, 216, 0.1);
}


/* =========================================================
   03. RESET
   ========================================================= */

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

html {
    scroll-behavior: smooth;
    background: var(--bg);
    overflow-x: clip;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    overflow-x: clip;
}

body.nav-open {
    overflow: hidden;
}

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

img,
video {
    height: auto;
}

button,
input,
textarea,
select {
    max-width: 100%;
    font: inherit;
}

button {
    color: inherit;
}

a {
    color: inherit;
}

::selection {
    background: var(--accent);
    color: #ffffff;
}

[hidden] {
    display: none !important;
}


/* =========================================================
   04. ACCESSIBILITY
   ========================================================= */

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

.skip-link {
    position: fixed;
    top: 0;
    left: 1rem;
    z-index: 9999;
    padding: 0.7rem 1rem;
    background: var(--accent);
    color: #ffffff;
    font-family: var(--mono);
    font-size: 0.65rem;
    text-decoration: none;
    transform: translateY(-120%);
    transition: transform var(--fast) ease;
}

.skip-link:focus {
    transform: translateY(1rem);
}


/* =========================================================
   05. GLOBAL LAYOUT
   ========================================================= */

.container {
    width: min(
        calc(100% - (var(--page-gutter) * 2)),
        var(--content-width)
    );
    min-width: 0;
    margin-inline: auto;
}

.section {
    position: relative;
    min-width: 0;
    padding-block: clamp(5rem, 9vw, 9rem);
    border-bottom: 1px solid var(--line);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 3rem;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
}

.section-label::before {
    content: "";
    width: 22px;
    height: 1px;
    flex: 0 0 auto;
    background: var(--accent);
}

.section-label span:first-child {
    color: var(--accent);
}


/* =========================================================
   06. HEADER
   ========================================================= */

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 1000;
    width: 100%;
    height: var(--header-height);
    border-bottom: 1px solid var(--line);
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

[data-theme="light"] .site-header {
    background: rgba(244, 244, 241, 0.92);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    flex-shrink: 0;
    color: var(--text);
    font-family: var(--display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    text-decoration: none;
}

.wordmark::before {
    content: "";
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    margin-right: 0.55rem;
    background: var(--accent);
    animation: wordmarkPulse 3s ease-in-out infinite;
}

@keyframes wordmarkPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 transparent;
    }

    50% {
        box-shadow: 0 0 0 6px var(--accent-soft);
    }
}

.desktop-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(1rem, 1.7vw, 1.7rem);
    min-width: 0;
    margin-inline: 2rem;
}

.desktop-nav a,
.x-link,
.social-link {
    position: relative;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color var(--fast) ease;
}

.desktop-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -7px;
    left: 0;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--normal) var(--ease);
}

.desktop-nav a:hover,
.desktop-nav a[aria-current="page"],
.x-link:hover,
.social-link:hover {
    color: var(--text);
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
    transform: scaleX(1);
    transform-origin: left;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: clamp(0.65rem, 1vw, 1rem);
    min-width: 0;
    flex-shrink: 0;
}

.x-link,
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}


/* =========================================================
   07. THEME
   ========================================================= */

.theme-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color var(--fast) ease;
}

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

.theme-button::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border: 1px solid currentColor;
    border-radius: 50%;
}

.theme-menu {
    position: fixed;
    top: calc(var(--header-height) - 2px);
    right: max(
        1rem,
        calc((100vw - var(--content-width)) / 2)
    );
    z-index: 1100;
    width: min(150px, calc(100vw - 2rem));
    padding: 0.35rem;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.theme-menu button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0.7rem;
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.62rem;
    text-align: left;
    text-transform: uppercase;
}

.theme-menu button:hover,
.theme-menu button[aria-checked="true"] {
    background: var(--surface-strong);
    color: var(--text);
}

.theme-menu button[aria-checked="true"]::after {
    content: "●";
    color: var(--accent);
    font-size: 0.45rem;
}


/* =========================================================
   08. MOBILE MENU
   ========================================================= */

.menu-toggle {
    display: none;
    position: relative;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.menu-toggle span {
    position: absolute;
    left: 50%;
    width: 13px;
    height: 1px;
    background: currentColor;
    transform: translateX(-50%);
    transition:
        transform var(--normal) var(--ease),
        opacity var(--fast) ease;
}

.menu-toggle span:first-child {
    transform: translate(-50%, -3px);
}

.menu-toggle span:last-child {
    transform: translate(-50%, 3px);
}

.mobile-nav {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: calc(100dvh - var(--header-height));
    padding:
        1rem
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-10px);
    transition:
        opacity var(--normal) ease,
        visibility var(--normal) ease,
        transform var(--normal) var(--ease);
}

.mobile-nav.is-open,
body.nav-open .mobile-nav {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

body.nav-open .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
    padding: clamp(0.9rem, 3vw, 1.1rem) 0;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--display);
    font-size: clamp(1.7rem, 7vw, 2rem);
    letter-spacing: -0.04em;
    line-height: 1;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.mobile-nav a::after {
    content: "↗";
    flex: 0 0 auto;
    margin-left: 1rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.8rem;
}


/* =========================================================
   09. HERO
   ========================================================= */

.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--header-height);
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            to right,
            var(--line) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            var(--line) 1px,
            transparent 1px
        );
    background-size: clamp(55px, 5vw, 80px) clamp(55px, 5vw, 80px);
    opacity: 0.28;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 28%;
    width: 1px;
    background: var(--line);
    animation: heroScan 10s ease-in-out infinite;
}

@keyframes heroScan {
    0%,
    100% {
        opacity: 0.1;
        transform: translateX(0);
    }

    50% {
        opacity: 0.65;
        transform: translateX(45vw);
    }
}

.hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns:
        minmax(45px, 0.16fr)
        minmax(0, 1.1fr)
        minmax(280px, 0.85fr);
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100dvh - var(--header-height));
    min-width: 0;
    gap: clamp(1.5rem, 5vw, 6rem);
}

.hero-index {
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-top: clamp(4rem, 8vw, 8rem);
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.58rem;
    line-height: 1.4;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.hero-index span:first-child {
    color: var(--accent);
}

.hero-content {
    min-width: 0;
    padding-block: clamp(4rem, 6vw, 6rem);
}

.hero-title {
    max-width: 10ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3.2rem, 6.8vw, 8rem);
    font-weight: 700;
    line-height: 0.88;
    letter-spacing: -0.065em;
    overflow-wrap: normal;
}

.hero-description {
    max-width: 48ch;
    margin: clamp(1.75rem, 3vw, 2.25rem) 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    line-height: 1.7;
}

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


/* =========================================================
   10. HERO SYSTEM
   ========================================================= */

.hero-system {
    position: relative;
    width: 100%;
    max-width: 580px;
    aspect-ratio: 1;
    min-width: 0;
    margin-inline: auto;
}

.system-frame {
    position: absolute;
    inset: 4%;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    overflow: hidden;
}

.system-frame::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            to right,
            transparent 49.8%,
            var(--line) 50%,
            transparent 50.2%
        ),
        linear-gradient(
            to bottom,
            transparent 49.8%,
            var(--line) 50%,
            transparent 50.2%
        );
    opacity: 0.6;
}

.system-frame::after {
    content: "";
    position: absolute;
    top: -25%;
    left: 0;
    width: 100%;
    height: 25%;
    border-top: 1px solid var(--accent);
    opacity: 0.55;
    animation: systemScan 5s linear infinite;
    pointer-events: none;
}

@keyframes systemScan {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(500%);
    }
}

.system-header,
.system-footer {
    position: absolute;
    right: clamp(0.65rem, 2vw, 1rem);
    left: clamp(0.65rem, 2vw, 1rem);
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.system-header {
    top: clamp(0.65rem, 2vw, 1rem);
}

.system-footer {
    bottom: clamp(0.65rem, 2vw, 1rem);
}

.system-footer span:first-child {
    color: var(--accent);
}

.system-map {
    position: absolute;
    inset: 0;
    overflow: hidden;
}


/* =========================================================
   11. SYSTEM NODES
   ========================================================= */

.node {
    position: absolute;
    z-index: 4;
    width: 9px;
    height: 9px;
    border: 1px solid var(--accent);
    background: var(--bg);
    box-shadow: 0 0 0 4px var(--accent-soft);
    animation: nodePulse 3s ease-in-out infinite;
}

.node::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--accent);
}

.node-a {
    top: 28%;
    left: 24%;
}

.node-b {
    top: 21%;
    right: 23%;
    animation-delay: 0.5s;
}

.node-c {
    top: 52%;
    left: 49%;
    animation-delay: 1s;
}

.node-d {
    right: 19%;
    bottom: 28%;
    animation-delay: 1.5s;
}

.node-e {
    bottom: 18%;
    left: 28%;
    animation-delay: 2s;
}

@keyframes nodePulse {
    0%,
    100% {
        box-shadow: 0 0 0 3px var(--accent-soft);
    }

    50% {
        box-shadow: 0 0 0 8px transparent;
    }
}


/* =========================================================
   12. SYSTEM TRACES
   ========================================================= */

.trace {
    position: absolute;
    z-index: 2;
    height: 1px;
    background: var(--line-strong);
    transform-origin: left center;
}

.trace::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 38px;
    height: 1px;
    background: var(--accent);
    transform: translateY(-50%);
    animation: signalFlow 3.5s linear infinite;
}

@keyframes signalFlow {
    from {
        transform: translate(-50px, -50%);
    }

    to {
        transform: translate(400px, -50%);
    }
}

.trace-a {
    top: 29%;
    left: 25%;
    width: 40%;
    transform: rotate(-18deg);
}

.trace-b {
    top: 25%;
    left: 27%;
    width: 38%;
    transform: rotate(17deg);
    animation-delay: 0.8s;
}

.trace-c {
    top: 53%;
    left: 29%;
    width: 40%;
    transform: rotate(-27deg);
    animation-delay: 1.2s;
}

.trace-d {
    top: 55%;
    left: 51%;
    width: 29%;
    transform: rotate(28deg);
    animation-delay: 1.8s;
}

.trace-e {
    top: 72%;
    left: 29%;
    width: 36%;
    transform: rotate(-12deg);
    animation-delay: 2.2s;
}


/* =========================================================
   13. BUTTONS
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 0;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.62rem;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        color var(--fast) ease,
        background-color var(--fast) ease,
        border-color var(--fast) ease,
        transform var(--fast) ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button-primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.button-primary:hover {
    background: transparent;
    color: var(--accent);
}

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


/* =========================================================
   14. TEXT BUTTON
   ========================================================= */

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-family: var(--mono);
    font-size: 0.63rem;
    letter-spacing: 0.04em;
    text-decoration: none;
    text-transform: uppercase;
}

.text-button span {
    transition: transform var(--fast) ease;
}

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

.text-button:hover span {
    transform: translate(3px, -3px);
}


/* =========================================================
   15. PHILOSOPHY
   ========================================================= */

.philosophy-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.75fr)
        minmax(0, 1.25fr);
    min-width: 0;
    gap: clamp(3rem, 9vw, 10rem);
}

.philosophy-grid h2 {
    max-width: 9ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(2.8rem, 5vw, 5.5rem);
    line-height: 0.92;
    letter-spacing: -0.055em;
}

.copy-column {
    max-width: 65ch;
    min-width: 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.75;
}

.copy-column p {
    margin: 0 0 1.5rem;
}

.copy-emphasis {
    padding-top: 1rem;
    color: var(--text);
    font-family: var(--display);
    font-size: 1.2rem;
}


/* =========================================================
   16. AREAS
   ========================================================= */

.areas-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-width: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.area {
    position: relative;
    min-width: 0;
    min-height: 330px;
    padding: 1.5rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    transition: background-color var(--normal) ease;
}

.area::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width var(--slow) var(--ease);
}

.area:hover {
    background: var(--surface);
}

.area:hover::before {
    width: 100%;
}

.area-number {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.62rem;
}

.area h3 {
    margin: 5rem 0 1rem;
    font-family: var(--display);
    font-size: clamp(1.7rem, 2.4vw, 2.5rem);
    line-height: 1;
    letter-spacing: -0.045em;
    overflow-wrap: anywhere;
}

.area p {
    max-width: 30ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}


/* =========================================================
   17. WORK
   ========================================================= */

.featured-project {
    position: relative;
    min-width: 0;
    min-height: clamp(460px, 45vw, 520px);
    border: 1px solid var(--line);
    overflow: hidden;
    background:
        linear-gradient(
            to right,
            transparent calc(58% - 1px),
            var(--line) calc(58% - 1px),
            var(--line) 58%,
            transparent 58%
        );
}

.featured-project::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(
            to right,
            var(--line) 1px,
            transparent 1px
        ),
        linear-gradient(
            to bottom,
            var(--line) 1px,
            transparent 1px
        );
    background-size: clamp(55px, 5vw, 70px) clamp(55px, 5vw, 70px);
    opacity: 0.2;
}

.project-meta {
    position: absolute;
    top: clamp(1rem, 2vw, 1.5rem);
    right: clamp(1rem, 2vw, 1.5rem);
    left: clamp(1rem, 2vw, 1.5rem);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    min-width: 0;
}

.tag-list span {
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--line);
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.55rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.project-content {
    position: absolute;
    right: clamp(1rem, 5vw, 8%);
    bottom: clamp(1.5rem, 6vw, 8%);
    left: clamp(1rem, 5vw, 8%);
    z-index: 2;
    max-width: 570px;
    min-width: 0;
}

.project-kicker {
    margin: 0 0 1rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.project-content h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3.5rem, 8vw, 9rem);
    line-height: 0.82;
    letter-spacing: -0.07em;
    overflow-wrap: anywhere;
}

.project-content > p:not(.project-kicker) {
    max-width: 52ch;
    margin: 1.5rem 0 2rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    border-left: 1px solid var(--line);
}

.project-placeholder {
    min-width: 0;
    min-height: 230px;
    padding: 1.5rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.project-placeholder > span {
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.6rem;
}

.project-placeholder h3 {
    margin: 4rem 0 0.75rem;
    font-family: var(--display);
    font-size: 1.4rem;
    overflow-wrap: anywhere;
}

.project-placeholder p {
    max-width: 35ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
}


/* =========================================================
   18. ENGINEERING NOTE
   ========================================================= */

.engineering-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.8fr)
        minmax(0, 1.2fr);
    min-width: 0;
    gap: clamp(3rem, 9vw, 10rem);
}

.engineering-grid h2 {
    max-width: 11ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3rem, 5vw, 5.5rem);
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.engineering-subjects {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.engineering-subjects span {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 75px;
    padding: 1rem 1.25rem;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.65rem;
    line-height: 1.4;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    transition:
        color var(--fast) ease,
        background-color var(--fast) ease;
}

.engineering-subjects span::before {
    content: "+";
    flex: 0 0 auto;
    margin-right: 0.7rem;
    color: var(--accent);
}

.engineering-subjects span:hover {
    background: var(--surface);
    color: var(--text);
}


/* =========================================================
   19. ABOUT
   ========================================================= */

.about-grid {
    display: grid;
    grid-template-columns:
        minmax(0, 0.75fr)
        minmax(0, 1.25fr);
    min-width: 0;
    gap: clamp(3rem, 9vw, 10rem);
}

.about-grid h2 {
    max-width: 10ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3rem, 6vw, 7rem);
    line-height: 0.88;
    letter-spacing: -0.06em;
}


/* =========================================================
   20. WRITING / ARTICLE LISTING
   ========================================================= */

.writing-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    min-width: 0;
    gap: 2rem;
    margin-bottom: 3rem;
}

.writing-header h2 {
    max-width: 9ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3rem, 5vw, 6rem);
    line-height: 0.88;
    letter-spacing: -0.06em;
}

.article-grid,
.articles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 0;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
}

.article-grid > .articles-grid {
    display: contents;
}

.article-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    overflow: hidden;
    transition: background-color var(--normal) ease;
}

.article-card:hover {
    background: var(--surface);
}

.article-card-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns:
        minmax(0, 1.4fr)
        minmax(0, 0.6fr);
    min-width: 0;
}

.article-card-media {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
}

.article-card-featured .article-card-media {
    min-height: 0;
    aspect-ratio: auto;
    border-right: 1px solid var(--line);
    border-bottom: 0;
}

.article-card-media img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    filter: saturate(0.82);
    transition:
        transform 700ms var(--ease),
        filter 400ms ease;
}

.article-card:hover .article-card-media img {
    transform: scale(1.025);
    filter: saturate(1);
}

.article-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(1rem, 2vw, 1.25rem);
    background: var(--surface-strong);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-card-placeholder span:last-child {
    color: var(--faint);
}

.article-card-index {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding-inline: 0.45rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(10, 10, 10, 0.76);
    color: #ffffff;
    font-family: var(--mono);
    font-size: 0.6rem;
    backdrop-filter: blur(8px);
}

.article-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: clamp(1.25rem, 2.5vw, 1.5rem);
}

.article-card-featured .article-card-body {
    padding: clamp(1.5rem, 3vw, 2.25rem);
}

.article-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    margin-bottom: 1.25rem;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

.article-card-meta span:first-child {
    color: var(--accent);
}

.article-card-separator {
    color: var(--line-strong);
}

.article-card-title {
    max-width: none;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.5rem, 2vw, 2.1rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    overflow-wrap: anywhere;
}

.article-card-featured .article-card-title {
    font-size: clamp(2rem, 3.2vw, 3.6rem);
    line-height: 0.95;
}

.article-card-title a {
    color: var(--text);
    text-decoration: none;
}

.article-card-title a:hover {
    color: var(--accent);
}

.article-card-excerpt {
    max-width: 52ch;
    margin: 1rem 0 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.65;
}

.article-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    max-width: 100%;
    margin-top: auto;
    padding-top: 1.75rem;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-decoration: none;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.article-card-link:hover {
    color: var(--accent);
}

.article-card-arrow {
    flex: 0 0 auto;
    transition: transform var(--fast) ease;
}

.article-card-link:hover .article-card-arrow {
    transform: translate(3px, -3px);
}

.empty-state {
    margin: 0;
    padding: 2rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.65rem;
}


/* =========================================================
   21. CONTACT
   ========================================================= */

.contact {
    overflow: hidden;
}

.contact-content {
    position: relative;
    min-width: 0;
}

.contact-content h2 {
    max-width: 8ch;
    margin: 0;
    font-family: var(--display);
    font-size: clamp(4rem, 9vw, 10rem);
    line-height: 0.82;
    letter-spacing: -0.075em;
    overflow-wrap: anywhere;
}

.contact-lead {
    max-width: 42ch;
    margin: 2rem 0 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.7;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    min-width: 0;
    margin-top: 3rem;
}

.contact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    max-width: 100%;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.65rem;
    line-height: 1.4;
    text-decoration: none;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    transition:
        color var(--fast) ease,
        border-color var(--fast) ease;
}

.contact-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.contact-link span {
    flex: 0 0 auto;
    transition: transform var(--fast) ease;
}

.contact-link:hover span {
    transform: translate(3px, -3px);
}


/* =========================================================
   22. FOOTER
   ========================================================= */

.site-footer {
    padding-block: 2rem;
    border-top: 1px solid var(--line);
}

.footer-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    min-width: 0;
    gap: 2rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
}

.footer-brand strong {
    font-family: var(--display);
    font-size: 0.85rem;
}

.footer-brand span,
.footer-inner > span {
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.04em;
    line-height: 1.4;
    text-transform: uppercase;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
    min-width: 0;
}

.footer-links a {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.58rem;
    text-decoration: none;
    text-transform: uppercase;
}

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


/* =========================================================
   23. CONSENT BANNER
   ========================================================= */

.consent-banner {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    left: max(1rem, env(safe-area-inset-left));
    z-index: 2000;
    width: auto;
    max-width: 1100px;
    margin-inline: auto;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.consent-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 2rem;
    padding: 1.1rem 1.25rem;
}

.consent-label {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.62rem;
    text-transform: uppercase;
}

.consent-inner p:last-child {
    max-width: 65ch;
    margin: 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.consent-actions {
    display: flex;
    flex-shrink: 0;
    gap: 0.5rem;
}


/* =========================================================
   24. CONSENT MODAL
   ========================================================= */

.consent-modal {
    position: fixed;
    inset: 0;
    z-index: 2100;
    overflow-x: hidden;
    overflow-y: auto;
    padding:
        max(1rem, env(safe-area-inset-top))
        max(1rem, env(safe-area-inset-right))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, env(safe-area-inset-left));
}

.consent-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
}

.consent-dialog {
    position: relative;
    z-index: 1;
    width: min(620px, 100%);
    max-width: 100%;
    margin: 8vh auto 2rem;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.consent-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    min-width: 0;
    gap: 1.5rem;
    padding: 1.5rem;
    border-bottom: 1px solid var(--line);
}

.eyebrow {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--accent);
    font-family: var(--mono);
    font-size: 0.58rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.consent-dialog h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(1.7rem, 5vw, 2rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.dialog-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition:
        color var(--fast) ease,
        border-color var(--fast) ease;
}

.dialog-close:hover {
    border-color: var(--text);
    color: var(--text);
}

.consent-options {
    padding-inline: 1.5rem;
    min-width: 0;
}

.consent-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 0;
    gap: 2rem;
    padding-block: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.consent-option > div:first-child {
    min-width: 0;
}

.consent-option strong {
    font-family: var(--display);
    font-size: 0.9rem;
}

.consent-option p {
    max-width: 42ch;
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
    line-height: 1.5;
}

.consent-required {
    flex-shrink: 0;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.56rem;
    white-space: nowrap;
    text-transform: uppercase;
}

.switch {
    position: relative;
    flex: 0 0 auto;
    width: 42px;
    height: 23px;
}

.switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.switch span {
    position: absolute;
    inset: 0;
    border: 1px solid var(--line-strong);
    background: var(--surface-strong);
    cursor: pointer;
    transition:
        background-color var(--fast) ease,
        border-color var(--fast) ease;
}

.switch span::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 15px;
    height: 15px;
    background: var(--faint);
    transition:
        transform var(--fast) var(--ease),
        background-color var(--fast) ease;
}

.switch input:checked + span {
    background: var(--accent);
    border-color: var(--accent);
}

.switch input:checked + span::after {
    background: #ffffff;
    transform: translateX(18px);
}

.switch input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.consent-dialog-actions {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
    gap: 0.5rem;
    padding: 1.5rem;
}


/* =========================================================
   25. PROJECT DIALOG
   ========================================================= */

.project-dialog {
    width: min(850px, calc(100vw - 2rem));
    max-width: 100%;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.55);
    overflow: auto;
}

.project-dialog::backdrop {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
}

.project-dialog > .dialog-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 2;
}

.dialog-content {
    min-width: 0;
    padding: clamp(2rem, 5vw, 4rem);
}

.dialog-content h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.85;
    letter-spacing: -0.065em;
    overflow-wrap: anywhere;
}

.dialog-lead {
    max-width: 55ch;
    margin: 2rem 0;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.7;
}

.dialog-body {
    max-width: 65ch;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    line-height: 1.7;
}

.dialog-body p {
    margin: 0 0 1.25rem;
}

.dialog-content > .tag-list {
    margin-top: 2rem;
}


/* =========================================================
   26. ARTICLE READER
   ========================================================= */

.article-page main {
    min-width: 0;
    padding-top: 0;
}

.article-header {
    position: relative;
    padding-top: calc(var(--header-height) + clamp(3rem, 5vw, 4.5rem));
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.article-header-inner {
    position: relative;
    z-index: 2;

    width: min(
        calc(100% - (var(--page-gutter) * 2)),
        var(--article-width)
    );

    margin-inline: auto;
    min-width: 0;

    padding-block:
        clamp(2rem, 4vw, 3rem)
        clamp(3rem, 6vw, 4.5rem);
}

.article-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: 100%;
    margin-bottom: clamp(2rem, 4vw, 3rem);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-decoration: none;
    text-transform: uppercase;
}

.article-back span {
    flex: 0 0 auto;
    font-size: 1rem;
    transition: transform var(--fast) ease;
}

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

.article-back:hover span {
    transform: translateX(-4px);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    min-width: 0;
    margin-bottom: 24px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1.5;
    text-transform: uppercase;
}

.article-meta span:first-child {
    color: var(--accent);
}

.article-header h1,
.article-header-inner > h1 {
    width: 100%;
    max-width: 18ch;
    margin: 0;
    color: var(--text);
    font-family: var(--display);
    font-size: clamp(3rem, 6vw, 6.5rem);
    font-weight: 700;
    letter-spacing: -0.065em;
    line-height: 0.92;
    text-wrap: balance;
    overflow-wrap: anywhere;
}

.article-description {
    max-width: 62ch;
    margin: 28px 0 0;
    color: var(--muted);
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    line-height: 1.7;
}

.article-author {
    margin: 24px 0 0;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-transform: uppercase;
}


/* =========================================================
   27. ARTICLE COVER
   ========================================================= */

.article-cover {
    position: relative;

    width: min(
        calc(100% - (var(--page-gutter) * 2)),
        var(--article-width)
    );

    min-height: clamp(220px, 35vw, 420px);

    margin-inline: auto;

    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
}

.article-cover::before {
    content: "";
    position: absolute;
    inset: clamp(10px, 1.5vw, 18px);
    z-index: 1;
    border: 1px solid rgba(127, 127, 127, 0.12);
    pointer-events: none;
}

.article-cover::after {
    content: "";
    position: absolute;
    top: 50%;
    right: clamp(10px, 1.5vw, 18px);
    left: clamp(10px, 1.5vw, 18px);
    z-index: 1;
    height: 1px;
    background: rgba(127, 127, 127, 0.12);
    pointer-events: none;
}

.article-cover img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: inherit;
    object-fit: cover;
}


/* =========================================================
   28. ARTICLE LAYOUT
   ========================================================= */

.article-layout {
    display: grid;

    grid-template-columns:
        minmax(12rem, var(--article-toc-width))
        minmax(0, 1fr);

    width: min(
        calc(100% - (var(--page-gutter) * 2)),
        72rem
    );

    margin-inline: auto;

    min-width: 0;

    column-gap: clamp(
        2rem,
        5vw,
        var(--article-gap)
    );

    align-items: start;

    padding-block:
        clamp(4rem, 7vw, 5.5rem)
        clamp(5rem, 9vw, 7.5rem);
}


/* =========================================================
   29. ARTICLE TOC
   ========================================================= */

.article-toc {
    position: sticky;
    top: calc(var(--header-height) + 2rem);

    align-self: start;

    min-width: 0;
    max-width: 100%;
}

.toc-label {
    display: block;

    padding-bottom: 0.875rem;

    border-bottom: 1px solid var(--line);

    color: var(--faint);

    font-family: var(--mono);
    font-size: 0.66rem;
    font-weight: 500;

    letter-spacing: 0.1em;
    line-height: 1.4;

    text-transform: uppercase;
}

.article-toc nav {
    margin-top: 0.875rem;
}

.article-toc [data-toc-list] {
    display: flex;
    flex-direction: column;

    gap: 0.125rem;

    min-width: 0;
}

.article-toc a {
    display: block;

    min-width: 0;

    padding:
        0.4375rem
        0.625rem;

    border-left: 1px solid transparent;

    color: var(--faint);

    font-family: var(--mono);
    font-size: 0.67rem;
    line-height: 1.5;

    text-decoration: none;

    overflow-wrap: anywhere;

    transition:
        color var(--fast) ease,
        border-color var(--fast) ease,
        padding-left var(--fast) ease;
}

.article-toc a:hover,
.article-toc a.is-active {
    padding-left: 0.875rem;

    border-left-color: var(--accent);

    color: var(--text);
}


/* =========================================================
   30. ARTICLE CONTENT
   ========================================================= */

.article-content {
    min-width: 0;
    width: 100%;
}


/* =========================================================
   31. ARTICLE LAYOUT RESPONSIVE
   ========================================================= */

@media (max-width: 800px) {
    .article-layout {
        grid-template-columns: 1fr;

        width: min(
            calc(100% - (var(--page-gutter) * 2)),
            48rem
        );

        row-gap: 3rem;
    }

    .article-toc,
    .article-content {
        grid-column: 1;
    }

    .article-toc {
        position: static;
    }
}

/* =========================================================
   30. ARTICLE CONTENT
   ========================================================= */

.article-content {
    width: 100%;
    min-width: 0;
    max-width: var(--article-reading-width);
    color: var(--text);
    font-size: 1.0625rem;
    line-height: 1.8;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.article-content > * {
    max-width: 100%;
}

.article-content > *:first-child {
    margin-top: 0;
}

.article-content > *:last-child {
    margin-bottom: 0;
}

.article-content p {
    min-width: 100%;
    min-width: 0;
    margin: 0 0 1.7em;
    color: var(--text);
}

.article-content h2,
.article-content h3,
.article-content h4 {
    max-width: 100%;
    scroll-margin-top: 120px;
    color: var(--text);
    font-family: var(--display);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    overflow-wrap: anywhere;
    text-wrap: balance;
}

.article-content h2 {
    margin: 1.8em 0 0.8em;
    font-size: clamp(2rem, 4vw, 3rem);
}

.article-content h3 {
    margin: 1.8em 0 0.7em;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.article-content h4 {
    margin: 1.8em 0 0.65em;
    font-size: 1.3rem;
}

.article-content strong {
    color: var(--text);
    font-weight: 700;
}

.article-content em {
    color: var(--muted);
}

.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.article-content a:hover {
    text-decoration-thickness: 2px;
}

.article-content ul,
.article-content ol {
    width: 100%;
    max-width: 100%;
    margin: 0 0 1.8em;
    padding-left: 1.5em;
}

.article-content li {
    min-width: 0;
    margin-bottom: 0.65em;
    padding-left: 0.25em;
    overflow-wrap: break-word;
}

.article-content li::marker {
    color: var(--accent);
}

.article-content blockquote {
    max-width: 100%;
    margin: 1.8rem 0;
    padding: 22px 0 22px 24px;
    border-left: 2px solid var(--accent);
    color: var(--muted);
    font-size: 1.12rem;
    line-height: 1.7;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content hr {
    width: 100%;
    height: 1px;
    margin: 4rem 0;
    border: 0;
    background: var(--line);
}


/* =========================================================
   31. ARTICLE CODE
   ========================================================= */

.article-content code {
    max-width: 100%;
    padding: 0.16em 0.38em;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.82em;
    overflow-wrap: anywhere;
}

.article-content pre {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 2.2rem 0;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.article-content pre::before {
    content: "CODE";
    display: block;
    margin-bottom: 18px;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
}

.article-content pre code {
    display: block;
    width: max-content;
    min-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.78rem;
    line-height: 1.75;
    white-space: pre;
    overflow-wrap: normal;
}

.article-content kbd {
    padding: 0.2em 0.45em;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.75em;
}


/* =========================================================
   32. ARTICLE IMAGES
   ========================================================= */

.article-content img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    margin: 1.8rem 0;
    border: 1px solid var(--line);
}

.article-content figure {
    width: 100%;
    max-width: 100%;
    margin: 1.8rem 0;
    overflow: hidden;
}

.article-content figure img {
    margin: 0;
}

.article-content figcaption {
    margin-top: 10px;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.66rem;
    line-height: 1.5;
}


/* =========================================================
   33. ARTICLE TABLES
   ========================================================= */

.article-content .table-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 2.5rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    -webkit-overflow-scrolling: touch;
}

.article-content table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.article-content th,
.article-content td {
    padding: 13px 15px;
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.article-content th:last-child,
.article-content td:last-child {
    border-right: 0;
}

.article-content th {
    background: var(--surface);
    color: var(--text);
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-content tr:last-child td {
    border-bottom: 0;
}


/* =========================================================
   34. ARTICLE CALLOUT
   ========================================================= */

.article-content .callout {
    width: 100%;
    max-width: 100%;
    margin: 2.5rem 0;
    padding: 22px 24px;
    border: 1px solid var(--line);
    background: var(--surface);
    overflow-wrap: break-word;
}

.article-content .callout strong {
    display: block;
    margin-bottom: 8px;
    font-family: var(--mono);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-content .callout p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   35. ARTICLE FOOTER
   ========================================================= */

.article-footer {
    width: 100%;
    max-width: 100%;
    margin-top: clamp(4rem, 8vw, 6rem);
    padding-top: 28px;
    border-top: 1px solid var(--line);
    color: var(--faint);
    font-family: var(--mono);
    font-size: 0.68rem;
    line-height: 1.6;
}


/* =========================================================
   36. REVEAL ANIMATION
   ========================================================= */

.section,
.article-card,
.area {
    opacity: 1;
    transform: none;
}

.js-reveal .section:not(.is-visible),
.js-reveal .article-card:not(.is-visible),
.js-reveal .area:not(.is-visible) {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 700ms var(--ease),
        transform 700ms var(--ease);
}

.js-reveal .section.is-visible,
.js-reveal .article-card.is-visible,
.js-reveal .area.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* =========================================================
   37. LARGE TABLET / SMALL DESKTOP
   ========================================================= */

@media (max-width: 1199px) {

    :root {
        --header-height: 68px;
    }

    .desktop-nav {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .hero-grid {
        grid-template-columns:
            55px
            minmax(0, 1fr)
            minmax(260px, 0.8fr);

        gap: clamp(1.5rem, 4vw, 2rem);
    }

    .hero-title {
        font-size: clamp(3.2rem, 7vw, 6rem);
    }

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

    .philosophy-grid,
    .engineering-grid,
    .about-grid {
        grid-template-columns:
            minmax(0, 1fr)
            minmax(0, 1fr);

        gap: clamp(3rem, 6vw, 5rem);
    }

    .project-content {
        left: 6%;
    }

    .article-header-inner,
    .article-cover {
        width: min(
            calc(100% - 3rem),
            960px
        );
    }

    .article-layout {
        width: min(
            calc(100% - 3rem),
            960px
        );

        grid-template-columns:
            minmax(150px, 200px)
            minmax(0, 1fr);

        column-gap: clamp(2rem, 4vw, 3rem);
    }

    .article-content {
        max-width: none;
    }
}


/* =========================================================
   38. DESKTOP ARTICLE LAYOUT
   ========================================================= */

@media (min-width: 1200px) {

    .article-header-inner,
    .article-cover {
        width: min(
            calc(100% - 6rem),
            var(--article-width)
        );
    }

    .article-header-inner {
        padding-block:
            clamp(2.5rem, 4vw, 4rem)
            clamp(4rem, 6vw, 5rem);
    }

    .article-header h1,
    .article-header-inner > h1 {
        max-width: 17ch;
        font-size: clamp(4rem, 5.5vw, 6.5rem);
    }

    .article-description {
        max-width: 68ch;
    }

    .article-cover {
        min-height: clamp(320px, 30vw, 460px);
    }

    .article-layout {
        width: min(
            calc(100% - 6rem),
            calc(
                var(--article-toc-width) +
                var(--article-reading-width) +
                var(--article-gap)
            )
        );

        grid-template-columns:
            minmax(180px, var(--article-toc-width))
            minmax(0, var(--article-reading-width));

        column-gap: var(--article-gap);
    }

    .article-content {
        min-width: var(--article-reading-width);
    }
}


/* =========================================================
   39. TABLET
   ========================================================= */

@media (max-width: 900px) {

    .section {
        padding-block: clamp(4rem, 9vw, 7rem);
    }

    .hero-grid {
        grid-template-columns:
            48px
            minmax(0, 1fr)
            minmax(220px, 0.65fr);
    }

    .hero-content {
        padding-block: 4rem;
    }

    .hero-system {
        max-width: 100%;
    }

    .philosophy-grid,
    .engineering-grid,
    .about-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .article-header-inner {
        padding-block: 2rem 3.5rem;
    }

    .article-header h1,
    .article-header-inner > h1 {
        font-size: clamp(3rem, 9vw, 5.5rem);
    }

    .article-header-inner,
    .article-cover {
        width: calc(100% - 2rem);
    }

    .article-cover {
        min-height: 280px;
    }

    .article-cover img {
        min-height: 280px;
    }

    .article-layout {
        display: block;
        width: calc(100% - 2rem);
        padding-block: 4rem 5.5rem;
    }

    .article-toc {
        position: static;
        margin-bottom: 3rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--line);
    }

    .article-toc [data-toc-list] {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2px;
    }

    .article-toc a {
        border-left: 0;
        border-bottom: 1px solid transparent;
    }

    .article-toc a:hover,
    .article-toc a.is-active {
        padding-left: 10px;
        border-left: 0;
        border-bottom-color: var(--accent);
    }

    .article-content {
        width: 100%;
        max-width: none;
    }

    .article-card-featured {
        grid-template-columns: 1fr;
    }

    .article-card-featured .article-card-media {
        min-height: 0;
        aspect-ratio: 16 / 10;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .consent-inner {
        align-items: flex-start;
    }
}


/* =========================================================
   40. MOBILE
   ========================================================= */

@media (max-width: 700px) {

    :root {
        --header-height: 62px;
        --page-gutter: 1rem;
    }

    .container {
        width: calc(100% - 2rem);
    }

    .header-inner {
        width: 100%;
    }

    .header-actions {
        gap: 0.7rem;
    }

    .theme-button-label {
        display: none;
    }

    .x-link,
    .social-link {
        display: none;
    }

    .mobile-nav {
        padding-top: 1rem;
    }

    .hero {
        min-height: auto;
    }

    .hero::after {
        display: none;
    }

    .hero-grid {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        min-height: auto;
        gap: 0;
    }

    .hero-index {
        display: flex;
        flex-direction: row;
        align-items: center;
        padding-top: 3rem;
        writing-mode: initial;
        transform: none;
    }

    .hero-content {
        padding-block: 3rem 4rem;
    }

    .hero-title {
        max-width: 9ch;
        font-size: clamp(3.3rem, 15vw, 5.5rem);
    }

    .hero-description {
        margin-top: 1.75rem;
    }

    .hero-system {
        max-width: 100%;
        margin-bottom: 4rem;
    }

    .system-header,
    .system-footer {
        font-size: 0.48rem;
    }

    .philosophy-grid h2,
    .engineering-grid h2 {
        max-width: 10ch;
    }

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

    .area {
        min-height: 260px;
    }

    .featured-project {
        min-height: 500px;
    }

    .featured-project {
        background:
            linear-gradient(
                to bottom,
                transparent calc(58% - 1px),
                var(--line) calc(58% - 1px),
                var(--line) 58%,
                transparent 58%
            );
    }

    .featured-project::before {
        top: 58%;
        right: 0;
        bottom: auto;
        left: 0;
        width: 100%;
        height: 1px;
        background: var(--line);
        opacity: 1;
    }

    .featured-project::after {
        display: none;
    }

    .project-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

    .project-content {
        right: 1.5rem;
        bottom: 1.5rem;
        left: 1.5rem;
        max-width: none;
    }

    .project-content h2 {
        font-size: clamp(4rem, 18vw, 6rem);
    }

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

    .engineering-subjects {
        grid-template-columns: 1fr;
    }

    .writing-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 1.5rem;
    }

    .article-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article-card-featured {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
    }

    .article-card-featured .article-card-media {
        min-height: 0;
        aspect-ratio: 16 / 10;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .article-card-featured .article-card-body {
        padding: 1.5rem;
    }

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

    .article-card-body {
        padding: 1.25rem;
    }

    .article-card-title {
        font-size: 1.75rem;
    }

    .article-card-featured .article-card-title {
        font-size: clamp(2rem, 10vw, 3.2rem);
    }

    .contact-content h2 {
        font-size: clamp(4rem, 20vw, 7rem);
    }

    .contact-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .footer-inner {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .footer-links {
        order: 2;
    }

    .consent-banner {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
    }

    .consent-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 1rem;
    }

    .consent-actions {
        width: 100%;
    }

    .consent-actions .button {
        flex: 1;
    }

    .consent-option {
        align-items: flex-start;
        gap: 1rem;
    }

    .consent-dialog {
        margin-top: 3vh;
    }

    .consent-dialog-actions {
        flex-direction: column-reverse;
    }

    .consent-dialog-actions .button {
        width: 100%;
    }

    .article-header {
        padding-top: calc(var(--header-height) + 2.75rem);
    }

    .article-header-inner {
        padding-top: 1.75rem;
        padding-bottom: 2.75rem;
    }

    .article-back {
        margin-bottom: 2rem;
    }

    .article-meta {
        gap: 6px;
        font-size: 0.58rem;
    }

    .article-header h1,
    .article-header-inner > h1 {
        max-width: 100%;
        font-size: clamp(3rem, 13vw, 5rem);
        line-height: 0.9;
    }

    .article-description {
        margin-top: 24px;
        font-size: 1rem;
        line-height: 1.65;
    }

    .article-cover {
        width: calc(100% - 2rem);
        min-height: 220px;
    }

    .article-cover img {
        min-height: 220px;
    }

    .article-cover::before {
        inset: 10px;
    }

    .article-cover::after {
        right: 10px;
        left: 10px;
    }

    .article-layout {
        width: calc(100% - 2rem);
        padding-top: 3rem;
        padding-bottom: 4.5rem;
    }

    .article-toc {
        margin-bottom: 2.5rem;
    }

    .article-toc [data-toc-list] {
        grid-template-columns: 1fr;
    }

    .article-content {
        font-size: 1rem;
        line-height: 1.8;
    }

    .article-content h2 {
        font-size: 2rem;
    }

    .article-content h3 {
        font-size: 1.5rem;
    }

    .article-content pre {
        margin-right: 0;
        margin-left: 0;
        padding: 18px;
    }

    .article-content blockquote {
        padding-left: 18px;
        font-size: 1rem;
    }

    .article-content .table-wrapper {
        width: 100%;
    }

    .article-content .callout {
        padding: 18px;
    }

    .article-content table {
        min-width: 520px;
    }

    .dialog-content {
        padding: 2rem 1.25rem;
    }
}


/* =========================================================
   41. SMALL MOBILE
   ========================================================= */

@media (max-width: 560px) {

    .section {
        padding-block: 4rem;
    }

    .section-label {
        margin-bottom: 2rem;
    }

    .hero-title {
        max-width: 100%;
    }

    .hero-actions {
        width: 100%;
    }

    .hero-actions .button {
        flex: 1 1 auto;
    }

    .project-content {
        right: 1rem;
        bottom: 1.25rem;
        left: 1rem;
    }

    .project-content h2 {
        font-size: clamp(3.4rem, 17vw, 5.5rem);
    }

    .article-card-featured .article-card-body {
        padding: 1.25rem;
    }

    .article-card-title {
        font-size: 1.55rem;
    }

    .article-card-featured .article-card-title {
        font-size: clamp(1.9rem, 10vw, 3rem);
    }

    .article-card-index {
        top: 0.75rem;
        left: 0.75rem;
    }

    .consent-dialog-header,
    .consent-options,
    .consent-dialog-actions {
        padding-inline: 1rem;
    }

    .consent-option {
        gap: 0.75rem;
    }

    .consent-option p {
        font-size: 0.72rem;
    }

    .article-header h1,
    .article-header-inner > h1 {
        font-size: clamp(2.65rem, 13vw, 4.5rem);
    }

    .article-cover {
        width: calc(100% - 1.5rem);
    }

    .article-layout,
    .article-header-inner {
        width: calc(100% - 1.5rem);
    }

    .article-content pre {
        padding: 1rem;
    }

    .article-content pre code {
        font-size: 0.7rem;
    }

    .article-content table {
        min-width: 480px;
    }
}


/* =========================================================
   42. VERY SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {

    :root {
        --page-gutter: 0.75rem;
    }

    .container {
        width: calc(100% - 1.5rem);
    }

    .mobile-nav {
        padding-inline: 0.75rem;
    }

    .mobile-nav a {
        font-size: 1.7rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .hero-index {
        font-size: 0.52rem;
    }

    .hero-content {
        padding-block: 2.5rem 3rem;
    }

    .hero-title {
        font-size: clamp(2.9rem, 15vw, 3.7rem);
    }

    .hero-actions {
        align-items: stretch;
        flex-direction: column;
    }

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

    .system-frame {
        inset: 2%;
    }

    .system-header,
    .system-footer {
        right: 0.65rem;
        left: 0.65rem;
        font-size: 0.43rem;
    }

    .featured-project {
        min-height: 450px;
    }

    .project-meta {
        top: 1rem;
        right: 1rem;
        left: 1rem;
    }

    .project-content h2 {
        font-size: clamp(3.1rem, 16vw, 4.5rem);
    }

    .contact-content h2 {
        font-size: clamp(3.6rem, 19vw, 6rem);
    }

    .consent-banner {
        right: 0.5rem;
        bottom: 0.5rem;
        left: 0.5rem;
    }

    .consent-inner {
        padding: 1rem;
    }

    .consent-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .consent-actions .button {
        width: 100%;
    }

    .project-dialog {
        width: calc(100% - 1rem);
    }

    .dialog-content {
        padding: 2rem 1.25rem;
    }

    .project-dialog > .dialog-close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .article-cover {
        width: calc(100% - 1rem);
    }

    .article-layout,
    .article-header-inner {
        width: calc(100% - 1rem);
    }

    .article-content {
        font-size: 0.98rem;
    }

    .article-content blockquote {
        padding-left: 14px;
    }

    .article-content .callout {
        padding: 1rem;
    }

    .article-content table {
        min-width: 440px;
    }
}


/* =========================================================
   43. SHORT VIEWPORTS
   ========================================================= */

@media (max-height: 700px) and (min-width: 701px) {

    .hero-content {
        padding-block: 3rem;
    }

    .hero-index {
        padding-top: 3rem;
    }
}


/* =========================================================
   44. HOVER CAPABILITY
   ========================================================= */

@media (hover: none) {

    .button:hover,
    .article-card:hover .article-card-media img {
        transform: none;
    }

    .article-card:hover .article-card-media img {
        filter: saturate(0.82);
    }

    .area:hover {
        background: var(--bg);
    }

    .area:hover::before {
        width: 0;
    }
}


/* =========================================================
   45. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}