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

/* =========================================================
   DIFURRENT
   Global stylesheet
   Design system ported from noklash/di-furrent
   ========================================================= */


/* =========================================================
   01. DESIGN TOKENS
   ========================================================= */

:root {
    color-scheme: light;

    /* Palette — di-furrent/src/index.css:4 */
    --bg: #f1f0eb;
    --surface: #f8f7f2;
    --strong: #e5e4de;
    --text: #111211;
    --muted: #5c5f5d;
    --faint: #7d817e;
    --line: #cecec7;
    --line2: #969993;
    --accent: #245edb;
    --soft: rgba(36, 94, 219, 0.1);

    /* Legacy aliases (previous destination token names) */
    --surface-strong: var(--strong);
    --line-strong: var(--line2);
    --accent-soft: var(--soft);

    /* Type — di-furrent/src/index.css:4 */
    --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    /* Motion */
    --ease: cubic-bezier(0.22, 0.75, 0.23, 1);
    --fast: 160ms;
    --normal: 280ms;
    --slow: 650ms;

    /* Layout geometry */
    --header-height: 70px;
    --content-width: 1420px;
    --shell-gutter: clamp(32px, 6vw, 96px);
    --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);
}

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

    --bg: #0b0c0c;
    --surface: #111313;
    --strong: #191b1a;
    --text: #f1f2ec;
    --muted: #a6aaa6;
    --faint: #6f7471;
    --line: #292c2a;
    --line2: #4d514e;
    --accent: #6e9cff;
    --soft: rgba(110, 156, 255, 0.11);
}


/* =========================================================
   02. 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: 15px;
    line-height: 1.6;
    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;
    color: inherit;
}

button {
    border: 0;
    background: none;
    cursor: pointer;
}

a {
    color: inherit;
}

code,
pre,
kbd {
    font-family: var(--mono);
}

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

[hidden] {
    display: none !important;
}


/* =========================================================
   03. ACCESSIBILITY
   ========================================================= */

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

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    background: var(--accent);
    color: #ffffff;
    font: 10px var(--mono);
    text-decoration: none;
    transform: translateY(-150%);
}

.skip-link:focus {
    transform: none;
}


/* =========================================================
   04. GLOBAL LAYOUT
   ========================================================= */

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

.section {
    position: relative;
    min-width: 0;
    padding-block: clamp(80px, 9.5vw, 150px);
    border-top: 1px solid var(--line);
}

.philosophy,
.work {
    background: var(--surface);
}

.section-label {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    margin-bottom: clamp(44px, 5vw, 66px);
    color: var(--faint);
    font: 10px var(--mono);
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

/* Short accent rule that leads every section number, matching
   the technical-sheet markings on the live site. */
.section-label::before {
    content: "";
    flex: 0 0 auto;
    width: 22px;
    height: 1px;
    background: var(--accent);
}

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


/* =========================================================
   05. HEADER
   ========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-width: 0;
    height: var(--header-height);
}

.wordmark {
    justify-self: start;
    display: inline-flex;
    align-items: baseline;
    padding: 0;
    color: var(--text);
    font: 600 17px var(--display);
    letter-spacing: 0.04em;
    text-decoration: none;
}

.wordmark::after {
    content: ".";
    color: var(--accent);
}

.wordmark span {
    color: var(--accent);
}

.desktop-nav {
    display: flex;
    gap: 34px;
    min-width: 0;
}

.desktop-nav a {
    position: relative;
    padding: 8px 0;
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
}

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

.desktop-nav a:hover {
    color: var(--text);
}

.desktop-nav a:hover::after,
.desktop-nav a[aria-current="page"]::after {
    right: 0;
}

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

.header-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.x-link,
.social-link {
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color var(--fast) ease;
}

.x-link:hover,
.social-link:hover {
    color: var(--text);
}


/* =========================================================
   06. THEME CONTROL
   ========================================================= */

.theme-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-shrink: 0;
    padding: 6px 9px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition:
        color var(--fast) ease,
        border-color var(--fast) ease;
}

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

.theme-button::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 1px solid var(--line2);
    border-radius: 50%;
    background: linear-gradient(90deg, #ecece8 50%, #1a1b1b 50%);
}

.theme-menu {
    position: fixed;
    top: calc(var(--header-height) - 2px);
    right: max(1rem, calc((100vw - var(--content-width)) / 2));
    z-index: 1100;
    display: flex;
    flex-direction: column;
    width: min(160px, calc(100vw - 2rem));
    padding: 3px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.theme.theme-menu {
    position: fixed;
    top: calc(var(--header-height) - 2px);
    right: max(1rem, calc((100vw - var(--content-width)) / 2));
    z-index: 1100;
    display: flex;
    flex-direction: column;
    width: min(160px, calc(100vw - 2rem));
    padding: 3px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.theme-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 9px;
    border: 0;
    background: transparent;
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
    transition:
        background-color var(--fast) ease,
        color var(--fast) ease;
}

.theme-menu button::before {
    content: "";
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border: 1px solid var(--line2);
    border-radius: 50%;
}

.theme-menu button[data-theme-choice="light"]::before {
    background: #ecece8;
}

.theme-menu button[data-theme-choice="dark"]::before {
    background: #1a1b1b;
}

.theme-menu button[data-theme-choice="system"]::before {
    background: linear-gradient(90deg, #ecece8 50%, #1a1b1b 50%);
}

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

/* Reference segmented control (di-furrent/src/index.css:7).
   Not used by current markup; kept for the optional stage 8 adoption. */

.theme-control {
    display: flex;
    padding: 3px;
    border: 1px solid var(--line);
}

.theme-control button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    color: var(--faint);
    font: 9px var(--mono);
    text-transform: uppercase;
}

.theme-control button.active {
    background: var(--strong);
    color: var(--text);
}

.theme-control i {
    width: 8px;
    height: 8px;
    border: 1px solid var(--line2);
    border-radius: 50%;
}

.theme-control .light {
    background: #ecece8;
}

.theme-control .dark {
    background: #1a1b1b;
}

.theme-control .system {
    background: linear-gradient(90deg, #ecece8 50%, #1a1b1b 50%);
}


/* =========================================================
   07. MOBILE MENU
   ========================================================= */

.menu-toggle {
    display: none;
    place-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 12px 0 12px 20px;
    border: 0;
    background: none;
    color: var(--text);
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: currentColor;
}

.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, var(--shell-gutter))
        max(1rem, env(safe-area-inset-bottom))
        max(1rem, var(--shell-gutter));
    border-bottom: 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: 500 25px var(--display);
    letter-spacing: -0.04em;
    line-height: 1;
    text-decoration: none;
    overflow-wrap: anywhere;
}

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


/* =========================================================
   08. HERO
   ========================================================= */

.hero {
    position: relative;
    isolation: isolate;
    display: grid;
    align-items: center;
    min-height: calc(100svh - var(--header-height));
    min-width: 0;
    overflow: hidden;
}

/* Technical drawing sheet, cut to exactly one viewport. The header is
   sticky and in flow, so the sheet stops on the fold rather than
   running on into the sections below. */

.hero::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: calc(100vh - var(--header-height));
    height: calc(100svh - var(--header-height));
    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);
    -webkit-mask-image: linear-gradient(to bottom, #000 74%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 74%, transparent 100%);
    opacity: 0.28;
    pointer-events: none;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 28%;
    width: 1px;
    height: calc(100vh - var(--header-height));
    height: calc(100svh - var(--header-height));
    background: linear-gradient(
        to bottom,
        transparent,
        var(--line) 16%,
        var(--line) 84%,
        transparent
    );
    pointer-events: none;
    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: 1.18fr 0.82fr;
    align-items: center;
    min-width: 0;
    gap: clamp(48px, 8vw, 130px);
    padding-block: clamp(70px, 9vw, 140px);
}

.hero-index {
    grid-column: 1 / -1;
    align-self: start;
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    color: var(--faint);
    font: 10px var(--mono);
    letter-spacing: 0.09em;
    line-height: 1;
    text-transform: uppercase;
}

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

.hero-content {
    min-width: 0;
}

.hero-title {
    max-width: 850px;
    margin: 44px 0 34px;
    color: var(--text);
    font: 500 clamp(44px, 5.2vw, 92px) / 0.95 var(--display);
    letter-spacing: -0.06em;
    overflow-wrap: break-word;
}

.hero-title em {
    color: var(--muted);
    font-style: normal;
}

.hero-description {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

/* Reference hero-bottom shape (di-furrent/src/index.css:8).
   Kept for the optional stage 2 alignment. */

.hero-bottom {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    min-width: 0;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.hero-bottom p {
    max-width: 520px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}


/* =========================================================
   09. HERO SYSTEM MAP
   ========================================================= */

.hero-system {
    position: relative;
    justify-self: end;
    width: min(100%, 650px);
    min-width: 0;
}

.system-frame {
    /* The hero schematic stands on the dark technical surface the
       featured project uses. The tokens are re-mapped locally, so the
       rings, labels and signals below all resolve to that surface
       without disturbing the global light set. */
    --bg: #090b0a;
    --surface: #090b0a;
    --text: #ecefe9;
    --muted: #a8ada7;
    --faint: #737873;
    --line: #242724;
    --line2: #323632;
    --accent: #6e9cff;
    --soft: rgba(110, 156, 255, 0.14);

    position: relative;
    aspect-ratio: 1.08;
    border: 1px solid var(--line);
    background-color: var(--surface);
    overflow: hidden;
    animation: resolve var(--slow) both;
}

/* Slow scan bar sweeping the schematic. It paints above the
   rings and nodes, below the frame labels. */
.system-frame::after {
    content: "";
    position: absolute;
    top: -30%;
    left: 0;
    width: 100%;
    height: 30%;
    border-top: 1px solid var(--accent);
    background: linear-gradient(
        to bottom,
        rgba(110, 156, 255, 0.06),
        rgba(110, 156, 255, 0)
    );
    opacity: 0.6;
    pointer-events: none;
    animation: systemScan 7s linear infinite;
}

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

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

@keyframes resolve {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.system-header,
.system-footer,
.map-meta,
.visual-head,
.visual-foot {
    position: absolute;
    right: 20px;
    left: 20px;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    min-width: 0;
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.system-header,
.map-meta,
.visual-head {
    top: 18px;
}

.system-footer,
.visual-foot {
    bottom: 18px;
}

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

/* Terminal chrome: a live prompt on the left, a status lamp on the
   right, so the sheet reads as a running instrument. */
.system-prompt,
.system-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.system-prompt {
    overflow: hidden;
    white-space: nowrap;
}

.system-prompt b {
    flex: 0 0 auto;
    color: var(--accent);
    font-weight: 400;
}

.system-prompt span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.system-caret {
    flex: 0 0 auto;
    width: 5px;
    height: 9px;
    background: var(--accent);
    animation: caretBlink 1.3s linear infinite;
}

@keyframes caretBlink {
    0%,
    54% {
        opacity: 1;
    }

    56%,
    100% {
        opacity: 0;
    }
}

.system-status {
    flex: 0 0 auto;
}

.system-status i {
    flex: 0 0 auto;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--soft);
    animation: statusPulse 2.4s ease-in-out infinite;
}

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

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

.system-map {
    position: absolute;
    inset: 40px 16px 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Radial schematic, drawn the way a monitoring instrument plots a
   system: domains ride the rings, signals run outward from the mark.
   The stage is a query container, so every mark inside it scales with
   the sheet rather than with the viewport. */
.map-stage {
    position: relative;
    height: 100%;
    max-width: 100%;
    aspect-ratio: 1;
    flex: 0 0 auto;
    container-type: size;
}

.map-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px dashed var(--line2);
    border-radius: 50%;
    opacity: 0.7;
    pointer-events: none;
    animation: mapSpin 90s linear infinite;
}

/* Outer witness ring. */
.map-ring-outer {
    width: 92%;
    aspect-ratio: 1;
    margin: -46% 0 0 -46%;
    animation-duration: 120s;
}

/* The course the domains travel on. */
.map-ring-mid {
    width: 66%;
    aspect-ratio: 1;
    margin: -33% 0 0 -33%;
    border-style: solid;
    animation-direction: reverse;
}

/* Bore around the mark. */
.map-ring-inner {
    width: 46%;
    aspect-ratio: 1;
    margin: -23% 0 0 -23%;
    border-style: solid;
    border-color: var(--line);
    animation: none;
}

@keyframes mapSpin {
    to {
        transform: rotate(360deg);
    }
}

/* One turning figure. Links and domain nodes share the orbit, so a
   signal always lands on the domain it belongs to. */
.map-orbit {
    position: absolute;
    inset: 0;
    animation: mapOrbit 180s linear infinite;
}

@keyframes mapOrbit {
    to {
        transform: rotate(360deg);
    }
}

/* Signal channel. The link itself draws no stroke, so the sheet stays
   clean: the channel is only seen while a signal is travelling it. */
.map-link {
    --a: 0deg;
    --d: 0s;

    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 1px;
    height: 33%;
    transform: rotate(var(--a));
    transform-origin: 50% 100%;
    animation: mapAppear 1s calc(var(--d) * 0.3) ease-out both;
}

/* The signal: a short wake plus a glowing head, both riding the link
   outward. The head lands on the domain as its node flashes. */
.map-link::before {
    content: "";
    position: absolute;
    bottom: 4%;
    left: 50%;
    width: 1px;
    height: 18%;
    margin-left: -0.5px;
    background: linear-gradient(to top, rgba(110, 156, 255, 0), rgba(110, 156, 255, 0.55));
    opacity: 0;
    animation: mapWake 2.8s var(--d) linear infinite;
}

.map-link::after {
    content: "";
    position: absolute;
    bottom: 4%;
    left: 50%;
    width: 5px;
    width: 1.8cqw;
    height: 5px;
    height: 1.8cqw;
    margin-left: -2.5px;
    margin-left: -0.9cqw;
    border-radius: 50%;
    background: radial-gradient(circle, #e6edff 0%, var(--accent) 42%, rgba(110, 156, 255, 0) 74%);
    opacity: 0;
    animation: mapFlow 2.8s var(--d) linear infinite;
}

@keyframes mapFlow {
    0% {
        bottom: 4%;
        opacity: 0;
    }

    12% {
        opacity: 1;
    }

    84% {
        opacity: 1;
    }

    100% {
        bottom: 96%;
        opacity: 0;
    }
}

@keyframes mapWake {
    0% {
        bottom: 4%;
        opacity: 0;
    }

    22% {
        opacity: 0.9;
    }

    84% {
        opacity: 0.45;
    }

    100% {
        bottom: 78%;
        opacity: 0;
    }
}

@keyframes mapAppear {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.map-link-1 {
    --a: 0deg;
    --d: 0s;
}

.map-link-2 {
    --a: 51.43deg;
    --d: 0.4s;
}

.map-link-3 {
    --a: 102.86deg;
    --d: 0.8s;
}

.map-link-4 {
    --a: 154.29deg;
    --d: 1.2s;
}

.map-link-5 {
    --a: 205.71deg;
    --d: 1.6s;
}

.map-link-6 {
    --a: 257.14deg;
    --d: 2s;
}

.map-link-7 {
    --a: 308.57deg;
    --d: 2.4s;
}

.map-sat {
    position: absolute;
    inset: 0;
    animation: mapAppear 1s calc(var(--d, 0s) * 0.3) ease-out both;
}

/* Counter-turns against the orbit, so the domain labels stay level
   while the figure turns. */
.map-sat-node {
    position: absolute;
    top: var(--y, 50%);
    left: var(--x, 50%);
    display: grid;
    place-items: center;
    width: 34px;
    width: 12cqw;
    aspect-ratio: 1;
    margin: -17px 0 0 -17px;
    margin: -6cqw 0 0 -6cqw;
    border: 1px solid var(--line2);
    border-radius: 50%;
    background: var(--surface);
    animation:
        mapUpright 180s linear infinite,
        mapFlash 2.8s var(--d, 0s) ease-in-out infinite;
}

@keyframes mapUpright {
    to {
        transform: rotate(-360deg);
    }
}

@keyframes mapFlash {
    0%,
    72% {
        border-color: var(--line2);
        box-shadow: 0 0 0 0 rgba(110, 156, 255, 0);
    }

    86% {
        border-color: var(--accent);
        box-shadow: 0 0 16px rgba(110, 156, 255, 0.4);
    }

    100% {
        border-color: var(--line2);
        box-shadow: 0 0 0 0 rgba(110, 156, 255, 0);
    }
}

/* The halo that lifts off the node as its signal lands. */
.map-sat-node::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--accent);
    border-radius: 50%;
    opacity: 0;
    animation: mapPing 2.8s var(--d, 0s) ease-out infinite;
}

@keyframes mapPing {
    0%,
    72% {
        transform: scale(1);
        opacity: 0;
    }

    84% {
        opacity: 0.5;
    }

    100% {
        transform: scale(1.6);
        opacity: 0;
    }
}

.map-sat-node i {
    width: 5px;
    width: 1.9cqw;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--line2);
    animation: mapDot 2.8s var(--d, 0s) linear infinite;
}

@keyframes mapDot {
    0%,
    72% {
        background: var(--line2);
        box-shadow: none;
    }

    86% {
        background: var(--accent);
        box-shadow: 0 0 10px var(--accent);
    }

    100% {
        background: var(--line2);
        box-shadow: none;
    }
}

.map-sat-node small {
    position: absolute;
    top: 100%;
    left: 50%;
    margin-top: 7px;
    margin-top: max(6px, 2.6cqw);
    color: var(--faint);
    font-family: var(--mono);
    font-size: 7px;
    font-size: max(6.5px, 2.5cqw);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    transform: translateX(-50%);
    animation: mapLabel 2.8s var(--d, 0s) ease-in-out infinite;
}

@keyframes mapLabel {
    0%,
    74% {
        color: var(--faint);
    }

    87% {
        color: var(--accent);
    }

    100% {
        color: var(--faint);
    }
}

/* Evenly spaced at 360/7 degrees, placed at 33% of the stage:
   left = 50% + 33% x sin(a), top = 50% - 33% x cos(a). */
.map-sat-1 {
    --x: 50%;
    --y: 17%;
}

.map-sat-2 {
    --x: 75.8%;
    --y: 29.43%;
}

.map-sat-3 {
    --x: 82.17%;
    --y: 57.34%;
}

.map-sat-4 {
    --x: 64.32%;
    --y: 79.73%;
}

.map-sat-5 {
    --x: 35.68%;
    --y: 79.73%;
}

.map-sat-6 {
    --x: 17.83%;
    --y: 57.34%;
}

.map-sat-7 {
    --x: 24.2%;
    --y: 29.43%;
}

.map-core {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42%;
    aspect-ratio: 1;
    margin: -21% 0 0 -21%;
    border: 1px solid var(--line2);
    border-radius: 50%;
    background: var(--surface);
    box-shadow: inset 0 0 40px rgba(110, 156, 255, 0.07);
    text-align: center;
    animation: mapAppear 1.1s 0.15s ease-out both;
}

/* Accent ring idling inside the mark. */
.map-core::before {
    content: "";
    position: absolute;
    inset: 9%;
    border: 1px dashed var(--accent);
    border-radius: 50%;
    opacity: 0.5;
    animation:
        mapSpin 60s linear infinite,
        mapIdle 5.6s ease-in-out infinite;
}

@keyframes mapIdle {
    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.72;
    }
}

.map-core strong {
    position: relative;
    color: var(--text);
    font-family: var(--display);
    font-size: 12px;
    font-size: max(9px, 4.4cqw);
    font-weight: 500;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.map-core span {
    position: relative;
    max-width: 62%;
    color: var(--faint);
    font-family: var(--mono);
    font-size: 6px;
    font-size: max(6px, 2.2cqw);
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.map-readout {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 6;
    display: grid;
    gap: 7px;
    width: 160px;
    padding: 15px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--faint);
    font: 7px var(--mono);
    text-transform: uppercase;
}

.map-readout strong {
    color: var(--text);
    font-size: 10px;
    text-transform: uppercase;
}


/* =========================================================
   10. SYSTEM NODES
   ========================================================= */

/* Standalone node mark. The hero sheet now plots the radial `.map-*`
   layer below instead; this primitive stays available for other
   schematics. */

.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(--soft);
    animation: nodePulse 3s ease-in-out infinite;
}

/* Solid core, so each node reads as a live junction. */
.node::before {
    content: "";
    position: absolute;
    inset: 2px;
    background: var(--accent);
}

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

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

.map-node {
    position: absolute;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    background: var(--surface);
    color: var(--faint);
    font: 7px var(--mono);
    text-transform: uppercase;
    transform: translate(-50%, -50%);
}

.map-node i {
    width: 8px;
    height: 8px;
    border: 1px solid var(--line2);
}

.map-node.active {
    color: var(--text);
}

.map-node.active i {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--soft);
}

.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;
}


/* =========================================================
   11. SYSTEM TRACES
   ========================================================= */

/* Standalone signal trace. The hero sheet now plots the radial
   `.map-*` layer instead; this primitive stays available. */

.trace {
    --rotate: 0deg;
    --delay: 0s;
    --draw: 0.3s;

    position: absolute;
    z-index: 2;
    height: 1px;
    background: var(--line2);
    transform: rotate(var(--rotate));
    transform-origin: left center;
    animation: traceDraw 1.4s var(--draw) both;
}

@keyframes traceDraw {
    from {
        transform: rotate(var(--rotate)) scaleX(0);
    }

    to {
        transform: rotate(var(--rotate)) scaleX(1);
    }
}

/* The travelling signal is a short accent segment riding the
   trace. Its run is measured against the trace itself, so every
   line finishes cleanly instead of overshooting the frame. */
.trace::after {
    content: "";
    position: absolute;
    top: 50%;
    left: -50px;
    width: 38px;
    height: 1px;
    background: var(--accent);
    transform: translateY(-50%);
    animation: signalFlow 3.5s var(--delay) linear infinite;
}

@keyframes signalFlow {
    from {
        left: -50px;
        opacity: 0;
    }

    12%,
    84% {
        opacity: 1;
    }

    to {
        left: calc(100% + 20px);
        opacity: 0;
    }
}

.trace-a {
    --rotate: -18deg;
    --delay: 0s;
    --draw: 0.3s;

    top: 29%;
    left: 25%;
    width: 40%;
}

.trace-b {
    --rotate: 17deg;
    --delay: 0.9s;
    --draw: 0.55s;

    top: 25%;
    left: 27%;
    width: 38%;
}

.trace-c {
    --rotate: -27deg;
    --delay: 1.8s;
    --draw: 0.8s;

    top: 53%;
    left: 29%;
    width: 40%;
}

.trace-d {
    --rotate: 28deg;
    --delay: 2.7s;
    --draw: 1.05s;

    top: 55%;
    left: 51%;
    width: 29%;
}

.trace-e {
    --rotate: -12deg;
    --delay: 3.6s;
    --draw: 1.3s;

    top: 72%;
    left: 29%;
    width: 36%;
}

.signal {
    fill: var(--accent);
}


/* =========================================================
   12. BUTTONS
   ========================================================= */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    max-width: 100%;
    padding: 11px 16px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    overflow-wrap: anywhere;
    transition:
        background-color var(--fast) ease,
        border-color var(--fast) ease,
        color var(--fast) ease;
}

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

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

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

.button-secondary {
    border-color: var(--line);
    background: transparent;
    color: var(--muted);
}

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


/* =========================================================
   13. TEXT LINK / TEXT BUTTON
   ========================================================= */

.text-link,
.text-button {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    max-width: 100%;
    padding: 0 0 8px;
    border: 0;
    border-bottom: 1px solid;
    background: none;
    color: var(--text);
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    overflow-wrap: anywhere;
    transition: color var(--fast) ease;
}

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

.text-link > span:last-child,
.text-button > span:last-child,
.arrow {
    display: inline-block;
    flex-shrink: 0;
    color: var(--accent);
    transition: transform var(--fast) ease;
}

a:hover .arrow,
button:hover .arrow,
a:hover > .text-link > span:last-child,
a.text-link:hover > span:last-child,
button.text-link:hover > span:last-child,
a.text-button:hover > span:last-child,
button.text-button:hover > span:last-child {
    transform: translate(3px, -3px);
}
/* =========================================================
   14. PHILOSOPHY / METHOD
   ========================================================= */

.two-col,
.philosophy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    gap: clamp(60px, 12vw, 190px);
    margin: 70px 0 120px;
}

.two-col h2,
.philosophy-grid h2,
.domains-head h2,
.areas-intro h2,
.writing-head h2,
.writing-header h2,
.engineering-grid h2,
.about-grid h2,
.contact h2 {
    margin: 0;
    color: var(--text);
    font: 500 clamp(42px, 5.4vw, 82px) / 1.02 var(--display);
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}

.body-copy,
.copy-column {
    align-self: end;
    min-width: 0;
}

.body-copy p,
.copy-column p {
    margin: 0 0 1.45em;
    color: var(--muted);
    line-height: 1.75;
}

.body-copy p:last-child,
.copy-column p:last-child {
    margin-bottom: 0;
}

.body-copy .lead,
.copy-column .lead,
.philosophy .copy-column p:first-child,
.about-lead {
    color: var(--text);
    font: 500 clamp(24px, 2vw, 31px) / 1.3 var(--display);
    letter-spacing: -0.03em;
}

.copy-emphasis {
    color: var(--text);
}

.method {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    min-width: 0;
    border-top: 1px solid var(--line2);
}

.method > div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 190px;
    padding: 26px;
    border-right: 1px solid var(--line);
}

.method > div:first-child {
    padding-left: 0;
}

.method > div:last-child {
    border-right: 0;
}

.method span {
    color: var(--accent);
    font: 10px var(--mono);
}

.method strong {
    margin-top: auto;
    color: var(--text);
    font: 500 clamp(20px, 2vw, 28px) var(--display);
    letter-spacing: -0.03em;
}

.method small {
    margin-top: 8px;
    color: var(--faint);
    font: 9px var(--mono);
}


/* =========================================================
   15. AREAS / DOMAIN LIST
   ========================================================= */

.domains-head,
.areas-intro {
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    align-items: end;
    min-width: 0;
    gap: 50px;
    margin: 70px 0 100px;
}

.domains-head p,
.areas-intro p {
    max-width: 420px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.domain-list,
.areas-grid {
    display: block;
    min-width: 0;
    border-top: 1px solid var(--line2);
}

.domain-list article {
    display: grid;
    grid-template-columns: 80px 0.7fr 1.3fr 30px;
    align-items: baseline;
    min-width: 0;
    gap: 35px;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
    transition:
        padding var(--normal) var(--ease),
        background-color var(--normal) var(--ease);
}

.area {
    display: grid;
    grid-template-columns: 80px 0.7fr 1.3fr;
    align-items: baseline;
    min-width: 0;
    gap: 35px;
    padding: 28px 0;
    border-bottom: 1px solid var(--line);
    transition:
        padding var(--normal) var(--ease),
        background-color var(--normal) var(--ease);
}

.domain-list article:hover,
.area:hover {
    padding-inline: 12px;
    background: var(--surface);
}

.domain-list span,
.domain-list b,
.area-number {
    color: var(--accent);
    font: 10px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.domain-list h3,
.area h3 {
    margin: 0;
    color: var(--text);
    font: 500 28px var(--display);
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.domain-list p,
.area p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.domain-list b {
    justify-self: end;
}


/* =========================================================
   16. WORK / FEATURED PROJECT / PROJECT LIST
   ========================================================= */

.featured-project {
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 600px;
    min-width: 0;
    margin-top: 70px;
    border: 1px solid var(--line);
    overflow: hidden;
}

/* Blueprint grid behind the copy panel, as on the live site. */
.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;
    pointer-events: none;
}

.featured-project:has(.process-visual) {
    grid-template-columns: 0.8fr 1.2fr;
}

.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    min-width: 0;
    gap: 20px;
    padding: clamp(20px, 3vw, 26px) clamp(30px, 4vw, 66px);
    border-bottom: 1px solid var(--line);
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.featured-project:has(.process-visual) .project-meta {
    padding: 0 0 22px;
    border-bottom: 0;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    gap: 14px;
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-copy,
.project-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: clamp(30px, 4vw, 66px);
}

.project-kicker {
    margin: 0 0 18px;
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.project-copy h2,
.project-content h2 {
    margin: auto 0 25px;
    color: var(--text);
    font: 500 clamp(52px, 6vw, 88px) var(--display);
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}

.project-copy p,
.project-content p {
    margin: 0 0 45px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}

.project-copy .text-link,
.project-content .text-button,
.project-content .text-link {
    align-self: start;
}

code {
    font-family: var(--mono);
    color: var(--text);
}

.process-visual {
    position: relative;
    min-height: 520px;
    min-width: 0;
    padding: 90px 8% 70px;
    border-left: 1px solid var(--line);
    background: #090b0a;
    color: #ecefe9;
}

.process-tree {
    border-top: 1px solid #323632;
}

.process-tree > div {
    position: relative;
    display: grid;
    grid-template-columns: 55px 1fr 1fr;
    min-width: 0;
    padding: 18px;
    border-bottom: 1px solid #242724;
    color: #737873;
    font: 11px var(--mono);
}

.process-tree .indent-1 {
    margin-left: 9%;
}

.process-tree .indent-2 {
    margin-left: 18%;
}

.process-tree .indent-1::before,
.process-tree .indent-2::before {
    content: "";
    position: absolute;
    top: -19px;
    left: -28px;
    width: 28px;
    height: 40px;
    border-bottom: 1px solid #3d423e;
    border-left: 1px solid #3d423e;
}

.process-tree span {
    color: #6e9cff;
}

.process-tree strong {
    color: #e2e6df;
    font-weight: 400;
}

.process-tree .active {
    border-left: 2px solid #6e9cff;
    background: rgba(110, 156, 255, 0.09);
}

.process-visual .visual-foot {
    inset: auto 20px 20px;
}

.project-list,
.project-grid {
    display: block;
    min-width: 0;
    margin-top: 80px;
    border-top: 1px solid var(--line2);
}

.project-list article {
    display: grid;
    grid-template-columns: 140px 1fr 50px;
    align-items: center;
    min-width: 0;
    gap: 40px;
    padding: 38px 0;
    border-bottom: 1px solid var(--line);
}

.project-list small {
    color: var(--faint);
    font: 9px var(--mono);
}

.project-list h3 {
    margin: 0 0 8px;
    color: var(--text);
    font: 500 29px var(--display);
    letter-spacing: -0.035em;
}

.project-list p {
    margin: 0;
    color: var(--muted);
}

.project-list a {
    justify-self: end;
    text-decoration: none;
}

.project-placeholder {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 40px;
    padding: 38px 0;
    border-bottom: 1px solid var(--line);
}

.project-placeholder > span {
    color: var(--faint);
    font: 9px var(--mono);
}

.project-placeholder > div {
    min-width: 0;
}

.project-placeholder h3 {
    margin: 0 0 8px;
    color: var(--text);
    font: 500 29px var(--display);
    letter-spacing: -0.035em;
}

.project-placeholder p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}


/* =========================================================
   17. ENGINEERING NOTE
   ========================================================= */

.engineering-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: end;
    min-width: 0;
    gap: clamp(60px, 12vw, 190px);
    margin-top: 70px;
}

.engineering-subjects {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    gap: 7px;
    margin-top: 30px;
}

.engineering-subjects span {
    padding: 10px 14px;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* =========================================================
   18. ABOUT
   ========================================================= */

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    gap: clamp(60px, 12vw, 190px);
    margin: 70px 0 0;
}

.about-secondary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    gap: clamp(40px, 6vw, 80px);
    margin-top: clamp(70px, 8vw, 120px);
    padding-top: clamp(40px, 5vw, 60px);
    border-top: 1px solid var(--line);
}

.about-secondary-block {
    min-width: 0;
}

.about-secondary-block p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.about-closing {
    margin-top: clamp(70px, 8vw, 120px);
    padding-top: clamp(40px, 5vw, 60px);
    border-top: 1px solid var(--line);
}

.about-closing p {
    max-width: 52ch;
    margin: 0;
    color: var(--muted);
    line-height: 1.75;
}

.about-closing h3 {
    margin: 22px 0 0;
    color: var(--text);
    font: 500 clamp(30px, 3.4vw, 52px) / 1.05 var(--display);
    letter-spacing: -0.05em;
}

.eyebrow {
    display: block;
    margin-bottom: 0.65rem;
    color: var(--faint);
    font: 10px var(--mono);
    letter-spacing: 0.09em;
    text-transform: uppercase;
}


/* =========================================================
   19. WRITING / ARTICLE CARDS
   ========================================================= */

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

.writing-head .section-label {
    margin-bottom: 38px;
}

.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 {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    min-width: 0;
}

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

.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,
.article-card-image 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,
.article-card:hover .article-card-image 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(--strong);
    color: var(--muted);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    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 var(--line2);
    background: var(--bg);
    color: var(--text);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
}

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

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

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

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

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

.article-card-title {
    max-width: none;
    margin: 0;
    color: var(--text);
    font: 500 clamp(1.5rem, 2vw, 2.1rem) / 1.05 var(--display);
    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.9rem;
    line-height: 1.65;
}

.article-card-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1.75rem;
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-card-footer .text-button {
    margin-left: auto;
    padding-bottom: 0;
    border-bottom: 0;
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-card-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: 100%;
    margin-top: auto;
    padding-top: 1.75rem;
    color: var(--text);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    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;
    color: var(--accent);
    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: 9px var(--mono);
}

.articles-empty {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: center;
    min-width: 0;
    gap: 20px;
    padding: 70px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.articles-empty-index {
    color: var(--accent);
    font: 10px var(--mono);
}

.articles-empty-label {
    margin: 0 0 10px;
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.articles-empty-text {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.articles-error .articles-empty-index {
    color: var(--faint);
}

.article-row {
    display: grid;
    grid-template-columns: 60px 170px minmax(0, 1fr) 125px 30px;
    align-items: center;
    min-width: 0;
    min-height: 125px;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.article-row > span:first-child,
.article-row small,
.article-row time {
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-row h3 {
    margin: 0;
    color: var(--text);
    font: 500 clamp(18px, 2vw, 27px) / 1.25 var(--display);
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.article-row:hover h3 {
    color: var(--accent);
}

.article-row time {
    justify-self: end;
}

.article-row .arrow,
.article-row > span:last-child {
    justify-self: end;
}


/* =========================================================
   20. WRITING PAGE / ARCHIVE
   ========================================================= */

.writing-hero,
.article-index-header {
    min-width: 0;
    padding-block: clamp(90px, 13vw, 190px) clamp(80px, 10vw, 140px);
}

.writing-hero h1,
.article-index-header h1 {
    margin: 45px 0 30px;
    color: var(--text);
    font: 500 clamp(62px, 9vw, 140px) / 0.92 var(--display);
    letter-spacing: -0.07em;
    overflow-wrap: anywhere;
}

.writing-hero p,
.article-index-header p {
    max-width: 600px;
    margin: 0;
    color: var(--muted);
    font-size: 19px;
    line-height: 1.6;
}

.article-index-header .article-back {
    margin-bottom: clamp(2rem, 4vw, 3rem);
}

.archive {
    min-width: 0;
    padding-bottom: 150px;
}

.archive-tools {
    display: flex;
    align-items: end;
    justify-content: space-between;
    min-width: 0;
    gap: 50px;
    padding: 24px 0;
    border-top: 1px solid var(--line2);
    border-bottom: 1px solid var(--line2);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    gap: 7px;
}

.filters button {
    padding: 10px 14px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition:
        background-color var(--fast) ease,
        color var(--fast) ease;
}

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

.search {
    display: grid;
    min-width: 290px;
    gap: 7px;
}

.search span {
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search input {
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid var(--line2);
    background: transparent;
    color: var(--text);
    outline: 0;
}

.search input:focus {
    border-bottom-color: var(--accent);
}

.archive-count {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archive-list {
    display: block;
    min-width: 0;
}

.archive-row {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) 140px 30px;
    min-width: 0;
    gap: 35px;
    padding: 42px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.archive-row > span:first-child {
    color: var(--accent);
    font: 10px var(--mono);
}

.archive-row small {
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.archive-row h2 {
    max-width: 900px;
    margin: 16px 0 14px;
    color: var(--text);
    font: 500 clamp(24px, 3vw, 42px) / 1.08 var(--display);
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.archive-row:hover h2 {
    color: var(--accent);
}

.archive-row p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.archive-row time {
    justify-self: end;
    color: var(--faint);
    font: 9px var(--mono);
}

.archive-row .arrow,
.archive-row > span:last-child {
    justify-self: end;
}

.empty {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    gap: 20px;
    padding: 70px 0;
    border-bottom: 1px solid var(--line);
}

.empty h2 {
    margin: 0;
    color: var(--text);
    font: 500 30px var(--display);
    letter-spacing: -0.035em;
}

.empty p {
    color: var(--muted);
}

.empty button {
    border-bottom: 1px solid;
    color: var(--text);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


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

.contact {
    padding-block: clamp(100px, 13vw, 190px);
    border-top: 0;
    background: var(--text);
    color: var(--bg);
    overflow: hidden;
}

.contact .section-label {
    color: color-mix(in srgb, var(--bg) 55%, transparent);
}

.contact .section-label > span:first-child {
    color: color-mix(in srgb, var(--bg) 80%, transparent);
}

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

.contact-content h2,
.contact-copy h2 {
    max-width: 12ch;
    margin: 0;
    color: var(--bg);
    font: 500 clamp(42px, 5.4vw, 82px) / 1.02 var(--display);
    letter-spacing: -0.055em;
    overflow-wrap: anywhere;
}

.contact-lead,
.contact-copy > p {
    max-width: 42ch;
    margin: 1.25rem 0 0;
    font-size: 1rem;
    line-height: 1.7;
    opacity: 0.72;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-width: 0;
    gap: 10vw;
    margin-top: clamp(3.5rem, 7vw, 5.5rem);
}

.contact-services {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-top: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
    align-self: start;
}

.contact-service {
    position: relative;
    min-width: 0;
    padding: 1.5rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
}

.contact-service h3 {
    margin: 1rem 0 0.75rem;
    color: var(--bg);
    font: 500 clamp(1.4rem, 2vw, 1.75rem) / 1.1 var(--display);
    letter-spacing: -0.04em;
}

.contact-service p {
    max-width: 38ch;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.65;
    opacity: 0.7;
}

.contact-form-wrapper,
.contact-copy {
    min-width: 0;
    padding: clamp(1.5rem, 3vw, 2rem);
    border: 1px solid color-mix(in srgb, var(--bg) 22%, transparent);
    background: transparent;
}

.contact-form-wrapper > p {
    max-width: 42ch;
    margin: 0 0 1.75rem;
    font-size: 0.85rem;
    line-height: 1.6;
    opacity: 0.7;
}

.contact-email {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 1rem 0 1.5rem;
    padding: 24px 0;
    border-block: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
    color: var(--bg);
    font: 500 clamp(21px, 2.5vw, 37px) var(--display);
    letter-spacing: -0.03em;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.contact-email span {
    flex: 0 0 auto;
    font-family: var(--mono);
    font-size: 0.85rem;
    transition: transform var(--fast) ease;
}

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

.contact-form {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1.15rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.45rem;
}

.form-field label {
    color: inherit;
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.55;
}

.form-field input,
.form-field textarea {
    width: 100%;
    min-width: 0;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--bg) 35%, transparent);
    background: transparent;
    color: inherit;
    font-family: var(--sans);
    font-size: 0.95rem;
    line-height: 1.4;
    outline: none;
    transition: border-color var(--fast) ease;
}

.form-field input:hover,
.form-field textarea:hover {
    border-bottom-color: color-mix(in srgb, var(--bg) 60%, transparent);
}

.form-field input:focus,
.form-field textarea:focus {
    border-bottom-color: var(--accent);
}

.form-field textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form .button {
    align-self: flex-start;
    margin-top: 0.35rem;
}

.contact .button-primary {
    border-color: var(--bg);
    background: var(--bg);
    color: var(--text);
}

.contact .button-secondary {
    border-color: color-mix(in srgb, var(--bg) 35%, transparent);
    color: var(--bg);
}

.contact .button-secondary:hover {
    border-color: var(--bg);
    background: color-mix(in srgb, var(--bg) 12%, transparent);
    color: var(--bg);
}


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

.site-footer {
    padding-block: clamp(44px, 6vw, 68px);
    border-top: 1px solid var(--line);
}

.footer-inner,
.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    min-width: 0;
    gap: clamp(24px, 4vw, 64px);
}

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

/* The header wordmark signs off with an accent dot, so the
   footer brand echoes it and the two read as one mark. */
.footer-brand strong,
.footer-grid strong {
    color: var(--text);
    font: 600 16px var(--display);
    letter-spacing: 0.04em;
}

.footer-brand strong::after,
.footer-grid strong::after {
    content: ".";
    color: var(--accent);
}

.footer-brand span,
.footer-grid p {
    margin: 0;
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-transform: uppercase;
}

.footer-nav,
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-width: 0;
    gap: clamp(14px, 1.8vw, 26px);
}

.footer-nav a,
.footer-nav button,
.footer-links a,
.footer-links button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--muted);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color var(--fast) ease;
}

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

.footer-inner > span,
.footer-base {
    color: var(--faint);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
}
/* =========================================================
   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);
    background: var(--surface);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.25);
    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.4rem;
    color: var(--text);
    font: 9px var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.consent-actions {
    display: flex;
    flex-shrink: 0;
    flex-wrap: wrap;
    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: color-mix(in srgb, var(--text) 72%, transparent);
    backdrop-filter: blur(5px);
    -webkit-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);
    background: var(--surface);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
    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);
}

.consent-dialog h2 {
    margin: 0;
    color: var(--text);
    font: 500 clamp(1.7rem, 5vw, 2.1rem) / 1 var(--display);
    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);
    font-size: 1.1rem;
    line-height: 1;
    transition:
        color var(--fast) ease,
        border-color var(--fast) ease;
}

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

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

.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 {
    color: var(--text);
    font: 500 0.95rem var(--display);
    letter-spacing: -0.02em;
}

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

.consent-required {
    flex-shrink: 0;
    color: var(--faint);
    font: 8px var(--mono);
    letter-spacing: 0.08em;
    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(--line2);
    background: var(--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 {
    border-color: var(--accent);
    background: 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;
    flex-wrap: wrap;
    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);
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.35);
    overflow: auto;
}

.project-dialog::backdrop {
    background: color-mix(in srgb, var(--text) 75%, transparent);
    backdrop-filter: blur(6px);
    -webkit-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;
    color: var(--text);
    font: 500 clamp(3rem, 7vw, 6rem) / 0.85 var(--display);
    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;
    min-width: 0;
    padding-top: clamp(60px, 8vw, 110px);
    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));
    min-width: 0;
    margin-inline: auto;
    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: 9px var(--mono);
    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;
    min-width: 0;
    gap: 9px;
    margin-bottom: 24px;
    color: var(--faint);
    font: 9px var(--mono);
    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: 500 clamp(3rem, 6vw, 6.5rem) / 0.92 var(--display);
    letter-spacing: -0.065em;
    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: 9px var(--mono);
    letter-spacing: 0.08em;
    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 var(--line);
    opacity: 0.6;
    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: var(--line);
    opacity: 0.6;
    pointer-events: none;
}

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

/* Neutralises the duplicated wrapper emitted by
   api/article-page.js renderDocument() (div.article-cover > figure.article-cover)
   until stage 4 corrects the markup. */

.article-cover > .article-cover {
    width: 100%;
    min-height: 0;
    margin: 0;
    border: 0;
}

.article-cover > .article-cover::before,
.article-cover > .article-cover::after {
    content: none;
}


/* =========================================================
   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);
    min-width: 0;
    margin-inline: auto;
    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: 9px var(--mono);
    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;
    min-width: 0;
    gap: 0.125rem;
}

.article-toc a {
    display: block;
    min-width: 0;
    padding: 0.4375rem 0.625rem;
    border-left: 1px solid transparent;
    color: var(--faint);
    font: 9px var(--mono);
    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);
}

.toc-subheading,
.toc-subitem > a {
    padding-left: 1.4rem;
    color: var(--faint);
    opacity: 0.85;
}


/* =========================================================
   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: 0;
    margin: 0 0 1.7em;
    color: var(--text);
}

.article-content h1,
.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: 500;
    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: 600;
}

.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: 8px var(--mono);
    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(--line2);
    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: 9px var(--mono);
    line-height: 1.5;
}


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

.article-content .table-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 2.5rem 0;
    border: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    -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-right: 1px solid var(--line);
    border-bottom: 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: 9px var(--mono);
    letter-spacing: 0.08em;
    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: 9px var(--mono);
    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: 9px var(--mono);
    line-height: 1.6;
}


/* =========================================================
   36. REVEAL / ANIMATION CONTRACT
   =========================================================
   `setupReveal()` (public/script.js:700) adds `.is-visible`
   but never adds `.js-reveal`, so the rules below stay inert
   exactly as before. The contract is preserved unchanged.
   ========================================================= */

.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. CORRECTION TO §21
   .contact-copy is not a bordered panel in the reference
   (di-furrent/src/index.css:14). It only offsets vertically.
   ========================================================= */

.contact-copy {
    padding: 50px 0 0;
    border: 0;
    background: transparent;
}


/* =========================================================
   38. ARTICLE LAYOUT COLLAPSE
   ========================================================= */

@media (max-width: 1100px) {

    .article-layout {
        grid-template-columns: minmax(0, 1fr);
        width: min(calc(100% - (var(--page-gutter) * 2)), 48rem);
        row-gap: clamp(2rem, 5vw, 3rem);
    }

    .article-toc {
        position: static;
        top: auto;
    }

    .article-toc [data-toc-list] {
        gap: 0.25rem;
    }

    .article-toc a {
        padding-left: 0;
    }

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

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


/* =========================================================
   39. TABLET  (di-furrent/src/index.css:18)
   ========================================================= */

@media (max-width: 980px) {

    .header-inner {
        grid-template-columns: 1fr auto;
    }

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

    .menu-toggle {
        display: inline-grid;
    }

    .header-actions {
        display: flex;
        align-items: center;
    }

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

    .hero-system {
        justify-self: end;
        width: min(100%, 650px);
    }

    .two-col,
    .philosophy-grid,
    .engineering-grid,
    .about-grid,
    .about-secondary,
    .areas-intro,
    .domains-head,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .engineering-grid,
    .about-grid {
        align-items: start;
    }

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

    .method > div {
        min-height: 135px;
        padding-inline: 0;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .method > div:last-child {
        border-bottom: 0;
    }

    .domain-list article {
        grid-template-columns: 45px minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 18px;
    }

    .domain-list b {
        display: none;
    }

    .area {
        grid-template-columns: 45px minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 18px;
    }

    .featured-project,
    .featured-project:has(.process-visual) {
        grid-template-columns: 1fr;
    }

    .project-copy,
    .project-content {
        min-height: 460px;
    }

    .process-visual {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .project-list article {
        grid-template-columns: 110px minmax(0, 1fr) 40px;
        gap: 24px;
    }

    .project-placeholder {
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 24px;
    }

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

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

    .article-row {
        grid-template-columns: 45px minmax(0, 1fr) 100px 20px;
    }

    .article-row small {
        display: none;
    }

    .archive-row {
        grid-template-columns: 45px minmax(0, 1fr) 110px 20px;
        gap: 20px;
    }

    .archive-tools {
        gap: 30px;
    }

    .search {
        min-width: 220px;
    }

    .footer-inner,
    .footer-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 22px 32px;
    }

    .footer-nav,
    .footer-links {
        grid-row: 2;
        grid-column: 1 / -1;
    }
}


/* =========================================================
   40. MOBILE  (di-furrent/src/index.css:19)
   ========================================================= */

@media (max-width: 640px) {

    :root {
        --header-height: 62px;
        --shell-gutter: 16px;
    }

    .container,
    .shell {
        width: calc(100% - 32px);
    }

    .mobile-nav {
        top: var(--header-height);
    }

    .theme-button {
        padding: 6px 8px;
    }

    .section {
        padding-block: 85px;
    }

    .hero-grid {
        gap: 65px;
        padding-block: 65px 85px;
    }

    .hero-title {
        margin: 32px 0 45px;
        font-size: clamp(47px, 14vw, 68px);
    }

    .hero-description {
        font-size: 16px;
    }

    .map-readout {
        display: none;
    }

    .system-footer span:nth-child(n + 3) {
        display: none;
    }

    .two-col,
    .philosophy-grid,
    .engineering-grid,
    .about-grid {
        gap: 35px;
        margin: 55px 0 70px;
    }

    .areas-intro,
    .domains-head {
        margin: 55px 0 60px;
    }

    .two-col h2,
    .philosophy-grid h2,
    .engineering-grid h2,
    .about-grid h2,
    .domains-head h2,
    .areas-intro h2,
    .writing-head h2,
    .writing-header h2,
    .contact-content h2,
    .contact-copy h2 {
        font-size: 43px;
    }

    .domain-list article,
    .area {
        grid-template-columns: 35px minmax(0, 1fr) 20px;
        gap: 12px;
    }

    .domain-list p,
    .area p {
        grid-column: 2 / -1;
    }

    .featured-project {
        margin-inline: -16px;
        border-inline: 0;
    }

    .project-meta {
        padding-inline: 16px;
    }

    .project-copy,
    .project-content {
        min-height: 480px;
        padding-inline: 16px;
    }

    .process-visual {
        min-height: 430px;
        padding-inline: 16px;
    }

    .process-tree > div {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .process-tree small,
    .process-visual .visual-foot span:nth-child(2) {
        display: none;
    }

    .project-list article {
        grid-template-columns: minmax(0, 1fr) 30px;
        gap: 12px;
    }

    .project-list small {
        grid-column: 1 / -1;
    }

    .project-placeholder {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .project-placeholder h3,
    .project-list h3 {
        font-size: 24px;
    }

    .writing-head,
    .writing-header {
        display: grid;
        gap: 40px;
        margin-bottom: 55px;
    }

    .writing-header .text-button,
    .writing-head .text-button {
        justify-self: start;
    }

    .article-grid,
    .articles-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .article-row {
        grid-template-columns: 30px minmax(0, 1fr) 20px;
        min-height: 96px;
        gap: 12px;
    }

    .article-row time {
        display: none;
    }

    .articles-empty {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 12px;
        padding: 50px 0;
    }

    .contact-copy {
        padding-top: 20px;
    }

    .contact-email {
        font-size: 18px;
    }

    .contact-form-wrapper {
        padding: 1.25rem;
    }

    .writing-hero h1,
    .article-index-header h1 {
        font-size: 61px;
        margin: 32px 0 24px;
    }

    .writing-hero p,
    .article-index-header p {
        font-size: 16px;
    }

    .archive {
        padding-bottom: 90px;
    }

    .archive-tools {
        display: grid;
        gap: 24px;
    }

    .search {
        min-width: 0;
    }

    .archive-row {
        grid-template-columns: 32px minmax(0, 1fr) 20px;
        gap: 10px;
        padding: 32px 0;
    }

    .archive-row time {
        display: none;
    }

    .archive-row h2 {
        font-size: 26px;
    }

    .archive-row p {
        font-size: 14px;
    }

    .empty {
        grid-template-columns: 40px minmax(0, 1fr);
        gap: 10px;
        padding: 50px 0;
    }

    .empty button {
        grid-column: 2;
        justify-self: start;
    }

    .footer-inner,
    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .footer-nav,
    .footer-links {
        grid-row: auto;
        grid-column: auto;
    }

    .footer-inner > span,
    .footer-base {
        white-space: normal;
    }

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

    .consent-actions {
        width: 100%;
    }

    .consent-dialog {
        margin: 4vh auto 2rem;
    }

    .consent-option {
        gap: 1rem;
    }

    .article-header-inner {
        padding-block: 1.5rem 2.5rem;
    }

    .article-header h1,
    .article-header-inner > h1 {
        font-size: clamp(2.25rem, 11vw, 3.25rem);
    }

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

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

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


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

@media (max-width: 420px) {

    .hero-title {
        font-size: clamp(38px, 12vw, 50px);
    }

    .two-col h2,
    .philosophy-grid h2,
    .engineering-grid h2,
    .about-grid h2,
    .domains-head h2,
    .areas-intro h2,
    .writing-head h2,
    .writing-header h2,
    .contact-content h2,
    .contact-copy h2 {
        font-size: 36px;
    }

    .project-copy h2,
    .project-content h2 {
        font-size: clamp(40px, 13vw, 60px);
    }

    .writing-hero h1,
    .article-index-header h1 {
        font-size: 46px;
    }

    .project-placeholder h3,
    .project-list h3,
    .area h3,
    .domain-list h3 {
        font-size: 21px;
    }

    .footer-inner,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

    .article-layout {
        width: calc(100% - 32px);
    }
}


/* =========================================================
   42. SHORT VIEWPORTS / HOVER CAPABILITY / REDUCED MOTION
   ========================================================= */

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

    .hero {
        min-height: auto;
    }

    .hero-grid {
        padding-block: 70px;
    }
}

@media (hover: none) {

    .area:hover,
    .domain-list article:hover {
        padding-inline: 0;
        background: transparent;
    }

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

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

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

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

    .signal {
        display: none;
    }

    .trace {
        transform: rotate(var(--rotate));
    }
}

/* =========================================================
   43. RUNTIME CONTRACT COMPLETIONS
   =========================================================
   These rules close the gap between the markup and the
   contracts expected by public/script.js and
   public/notion-articles.js. The footer cookie-settings
   button they once patched is now owned by section 22.
   ========================================================= */

/* Inline SVG arrow icons need explicit sizing. The text-link
   convention remains the U+2197 glyph, which is sized by its
   own font, so both paths stay visually identical. */

.arrow {
    width: 15px;
    height: 15px;
}

/* script.js marks the active theme choice with aria-pressed and
   .is-selected (the stylesheet previously only knew
   aria-checked, which nothing sets). */

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

/* script.js opens the mobile navigation with
   `html.mobile-nav-open` and locks the page behind it, rather
   than the previous `body.nav-open` pair. */

html.mobile-nav-open {
    overflow: hidden;
}

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

/* notion-articles.js renders the writing list as
   .article-list > .article-row rather than a card grid, so the
   .article-grid container has to collapse to a plain block. */

.article-grid:has(.article-list) {
    display: block;
    border: 0;
}

.article-list {
    display: block;
    min-width: 0;
    border-top: 1px solid var(--line2);
}

/* Reveal contract used by script.js: `.reveal-ready` is applied
   only when motion is allowed, `.is-visible` once in view. */

.reveal-ready {
    opacity: 0;
    transform: translateY(20px);
    transition:
        opacity 700ms var(--ease),
        transform 700ms var(--ease);
}

.reveal-ready.is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .reveal-ready,
    .reveal-ready.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
