:root {
    --paper: #fafaf8;
    --ink: #111111;
    --ink-2: #2a2a2a;
    --muted: #6b6b6b;
    --muted-2: #9a9a9a;
    --rule: #e6e4df;
    --rule-2: #ececec;
    --serif: "Newsreader", "Source Serif 4", Georgia, serif;
    --sans: "Inter", -apple-system, system-ui, sans-serif;
    --mono: "Source Code Pro", "Inconsolata", "Courier New", monospace;
    --code-selection-green: #9dae8f;
    --code-syntax-green: rgb(166, 184, 150, 0.99);
    --code-highlight-ink: #17181b;
}

::selection {
    background: #e2e2e2;
}
::-moz-selection {
    background: #e2e2e2;
}

main,
article,
aside,
code,
samp,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
    overflow: visible;
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
a {
    color: inherit;
    text-decoration: none;
}
em,
i {
    font-style: italic;
}
button {
    background: transparent;
    border: 0;
    box-shadow: none;
    font: inherit;
    height: auto;
    margin: 0;
    padding: 0;
    width: auto;
}

.page {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 56px 0;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 28px 0 22px;
    border-bottom: 1px solid var(--rule);
}
.brand {
    font-family: var(--sans);
    font-weight: 500;
    font-size: 15px;
    letter-spacing: 0.12em;
    color: var(--ink);
}
.nav {
    display: flex;
    align-items: center;
    gap: 36px;
}
.nav a,
.nav span {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-2);
    padding-bottom: 4px;
}
.nav a.active {
    border-bottom: 1.5px solid var(--ink);
}
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #1a1a1a;
    padding: 9px 16px 9px 18px;
    border-radius: 3px;
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.contact-btn .arr {
    font-size: 14px;
    line-height: 1;
}
.mobile-nav-toggle,
.mobile-nav-button,
.mobile-nav {
    display: none;
}

/* ── Hero ───────────────────────────────────────────────────── */
.hero {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 64px;
    padding: 88px 0 110px;
}
.eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 38px;
}
.hero h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(54px, 7.2vw, 84px);
    line-height: 1.04;
    letter-spacing: -0.012em;
    margin: 0 0 36px;
    color: var(--ink);
    max-width: 12ch;
}
.hero-sub {
    font-size: 15px;
    line-height: 1.65;
    color: #3a3a3a;
    max-width: 38ch;
    margin: 0;
}

.caps {
    align-items: center;
    justify-content: center;
    padding-top: 8px;
    display: flex;
    flex-direction: column;
}
.hero-diagram {
    display: block;
    width: min(100%, 420px);
    height: auto;
    opacity: 0.9;
}
.caps picture {
    display: block;
}

/* ── Section head: Selected Systems ─────────────────────────── */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-top: 1px solid var(--rule);
    border-bottom: 1px solid var(--rule);
}
.section-head .label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink);
    font-weight: 500;
    margin: 0;
}
/* ── Project row ────────────────────────────────────────────── */
.proj {
    display: grid;
    grid-template-columns: 70px 1fr 420px;
    gap: 36px;
    padding: 38px 0 42px;
    border-bottom: 1px solid var(--rule);
    align-items: start;
}
.proj:last-child {
    border-bottom: 0;
}
.proj > div:first-child {
    display: grid;
    justify-items: center;
}
.proj-index {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 38px;
    line-height: 1;
    color: var(--ink);
    letter-spacing: -0.01em;
    text-align: center;
}
.proj-icon {
    display: block;
    width: 48px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 8px;
    opacity: 0.35;
}
.proj-body {
    padding-top: 0;
}
.proj-title {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.012em;
    margin: 0 0 12px;
    color: var(--ink);
}
.proj-title a {
    color: inherit;
    text-decoration: none;
}
.proj-title a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}
.proj-title .tracked-wordmark,
body.doc-page h1.tracked-wordmark {
    letter-spacing: 0.14em;
}
.proj-tag {
    font-size: 14px;
    color: var(--ink-2);
    margin: 0 0 12px;
    line-height: 1.5;
}
.proj-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 0 0 22px;
    max-width: 44ch;
}
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.tag {
    font-size: 11.5px;
    letter-spacing: 0.02em;
    color: #3a3a3a;
    background: #fff;
    padding: 5px 12px;
    border-radius: 4px;
}
.proj-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
    background: transparent;
    position: relative;
}
.proj-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.proj-img picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* ── Footer ─────────────────────────────────────────────────── */
.footer {
    display: grid;
    grid-template-columns: 1.2fr 1.35fr 0.9fr;
    gap: 48px;
    padding: 60px 0 64px;
    border-top: 1px solid var(--rule);
    margin-top: 24px;
}
.footer h4 {
    font-size: 11px;
    letter-spacing: 0.22em;
    line-height: 1.1;
    text-transform: uppercase;
    margin: 0 0 4px;
    font-weight: 500;
    color: var(--ink);
}
.footer p {
    font-size: 13px;
    line-height: 1.65;
    color: #3a3a3a;
    margin: 0;
}
.footer-mark {
    width: 56px;
    height: 56px;
    margin-top: 16px;
    color: var(--ink);
}
.email-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--ink);
}
.avail-block {
    margin-top: 18px;
}

/* ── Responsive ─────────────────────────────────────────────── */

/* Medium screens: tighten the project image column */
@media (max-width: 1100px) {
    .proj {
        grid-template-columns: 60px 1fr 340px;
        gap: 28px;
    }
}

/* Tablet / narrow desktop: stack hero, projects, footer */
@media (max-width: 900px) {
    .page {
        padding: 0 32px;
    }

    .header {
        padding: 22px 0 18px;
    }
    .nav {
        gap: 20px;
    }
    .nav a:nth-child(n + 3),
    .nav span:nth-child(n + 3) {
        display: none;
    } /* keep first two nav items */

    .hero {
        grid-template-columns: 1fr;
        gap: 56px;
        padding: 56px 0 72px;
    }
    .hero h1 {
        max-width: 18ch;
    }
    .hero-sub {
        max-width: 56ch;
    }

    .proj {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 32px 0 36px;
    }
    .proj > div:first-child {
        display: flex;
        align-items: center;
        gap: 18px;
        justify-items: initial;
    }
    .proj-icon {
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        transform: translateY(-4px);
    }
    .proj-img {
        aspect-ratio: 16 / 9;
        max-width: 560px;
    }

    .footer {
        grid-template-columns: 1fr 1fr;
        gap: 36px 32px;
        padding: 48px 0 56px;
    }
    .footer-bio {
        grid-column: 1 / -1;
    }
}

/* Phone */
@media (max-width: 640px) {
    .page {
        padding: 0 20px;
    }

    .header {
        padding: 18px 0 14px;
        gap: 12px;
        flex-wrap: wrap;
    }
    .brand {
        font-size: 14px;
        letter-spacing: 0.14em;
    }
    .nav {
        display: none;
    } /* drop nav on small phones */
    .contact-btn {
        display: none;
    }
    .mobile-nav-button {
        border-radius: 3px;
        cursor: pointer;
        display: inline-block;
        height: 34px;
        margin-left: auto;
        position: relative;
        width: 42px;
        z-index: 60;
    }
    .mobile-nav-button::before,
    .mobile-nav-button::after,
    .mobile-nav-icon {
        background: var(--ink);
        display: block;
        height: 1px;
        left: 12px;
        position: absolute;
        top: 17px;
        transform-origin: center;
        transition:
            opacity 0.15s ease,
            top 0.15s ease,
            transform 0.15s ease;
        width: 18px;
    }
    .mobile-nav-button::before,
    .mobile-nav-button::after {
        content: "";
    }
    .mobile-nav-button::before {
        top: 12px;
    }
    .mobile-nav-button::after {
        top: 22px;
    }
    .mobile-nav-icon {
        color: transparent;
        font-size: 0;
        overflow: hidden;
        white-space: nowrap;
    }
    .mobile-nav-toggle:checked ~ .mobile-nav-button::before {
        top: 17px;
        transform: rotate(45deg);
    }
    .mobile-nav-toggle:checked ~ .mobile-nav-button .mobile-nav-icon {
        opacity: 0;
    }
    .mobile-nav-toggle:checked ~ .mobile-nav-button::after {
        top: 17px;
        transform: rotate(-45deg);
    }
    .mobile-nav {
        align-items: center;
        background: rgba(226, 226, 226, 0.88);
        backdrop-filter: blur(10px);
        display: none;
        flex-direction: column;
        gap: 30px;
        inset: 0;
        justify-content: center;
        padding: 32px;
        position: fixed;
        z-index: 50;
    }
    .mobile-nav a,
    .mobile-nav span {
        color: var(--ink-2);
        font-size: 15px;
        letter-spacing: 0.18em;
        line-height: 1;
        text-transform: uppercase;
    }
    .mobile-nav-toggle:checked ~ .mobile-nav {
        display: flex;
    }

    .hero {
        gap: 40px;
        padding: 40px 0 56px;
    }
    .eyebrow {
        margin-bottom: 26px;
        font-size: 10.5px;
    }
    .hero h1 {
        font-size: clamp(40px, 11vw, 60px);
        max-width: 100%;
    }
    .hero-sub {
        font-size: 14.5px;
    }

    .section-head {
        padding: 14px 0;
    }
    .section-head .label {
        font-size: 10.5px;
        letter-spacing: 0.18em;
    }

    .proj {
        padding: 28px 0 32px;
        gap: 16px;
    }
    .proj-index {
        font-size: 30px;
    }
    .proj-title {
        font-size: 30px;
    }
    .proj-tag {
        font-size: 13.5px;
    }
    .proj-desc {
        font-size: 13px;
    }
    .tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .footer {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0 48px;
    }
    .footer-bio {
        grid-column: auto;
    }
    .footer-mark {
        width: 44px;
        height: 44px;
    }
}

/* ── Doc Pages ──────────────────────────────────────────── */

body.doc-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 72px 40px 96px;
}

body.doc-page h1 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.08;
    letter-spacing: -0.012em;
    margin: 0 0 18px;
    color: var(--ink);
}

body.doc-page h2 {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: -0.008em;
    margin: 56px 0 14px;
    color: var(--ink);
}

body.doc-page h3 {
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 28px 0 10px;
}

body.doc-page p {
    font-size: 14px;
    line-height: 1.65;
    color: #3a3a3a;
    margin: 0 0 16px;
}

body.doc-page p:last-child {
    margin-bottom: 0;
}

body.doc-page em {
    font-style: italic;
}

body.doc-page hr {
    border: none;
    border-top: 1px solid var(--rule);
    margin: 48px 0;
}

body.doc-page hr.thin {
    border-top-width: 0.5px;
    margin: 32px 0;
}

.page-images {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 16px;
    margin: 32px 0;
}

.page-images img {
    width: 45%;
    height: auto;
    border-radius: 6px;
}

body.doc-page code {
    display: inline;
    font-family: "Inconsolata", "Courier New", monospace;
    font-size: 13px;
    background: #f3f2ee;
    padding: 1px 5px;
    border-radius: 2px;
    color: var(--ink-2);
}

.capability-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 48px;
    row-gap: 32px;
    margin: 32px 0 0;
}

.capability-card {
    padding: 0;
}

body.doc-page .capability-card h2 {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.16em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 12px;
}

.capability-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

body.doc-page .capability-card li {
    font-size: 14px;
    line-height: 1.35;
    color: #3a3a3a;
    margin: 0 0 2px;
}

/* Navigation */
.back {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    margin-bottom: 48px;
    transition: color 0.15s ease;
}

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

/* Doc header labels */
.doc-label {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 14px;
}

.subtitle {
    font-family: var(--serif);
    font-weight: 400;
    font-size: 18px;
    line-height: 1.45;
    color: var(--ink-2);
    margin-bottom: 20px;
}

.meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 20px;
}

.meta.tags {
    margin-bottom: 20px;
}

.status-line {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.04em;
    margin-bottom: 20px;
}

.status-line span {
    color: var(--ink-2);
}

/* Feature lists */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
}

.feature-list li {
    font-size: 14px;
    line-height: 1.6;
    color: #3a3a3a;
    padding-left: 20px;
    position: relative;
    margin-bottom: 6px;
}

.feature-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--muted-2);
    font-size: 0.9em;
}

/* Tables */
.stack-table,
.files-table,
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
}

.stack-table td,
.files-table td,
.doc-table td,
.doc-table th {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 10px 16px 10px 0;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
    color: var(--ink-2);
}

.stack-table td:first-child,
.doc-table td:first-child {
    color: var(--muted);
    white-space: nowrap;
    width: 30%;
    font-size: 13px;
}

.files-table td:first-child {
    font-family: "Inconsolata", "Courier New", monospace;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    width: 42%;
    padding-right: 20px;
}

.doc-table th {
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    text-align: left;
}

.milestone-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
}

.milestone-table td {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 10px 16px 10px 0;
    border-bottom: 1px solid var(--rule);
    vertical-align: top;
    color: var(--ink-2);
}

.milestone-table td:first-child {
    font-family: "Inconsolata", "Courier New", monospace;
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    width: 4%;
    padding-right: 16px;
}

.milestone-table td:nth-child(2) {
    font-weight: 500;
    color: var(--ink);
    width: 30%;
}

.milestone-table td:nth-child(3) {
    font-size: 12px;
    white-space: nowrap;
    width: 16%;
    padding-right: 16px;
}

.milestone-table td:last-child {
    color: var(--muted);
    font-size: 13px;
}

.accepted {
    color: var(--ink-2) !important;
}
.pending {
    color: var(--muted-2) !important;
}

/* Code blocks */
.code-block {
    background: #20231d;
    border-left: 0;
    border-radius: 10px;
    box-shadow:
        0 5px 7px -5px rgba(42, 42, 36, 0.27),
        0 13px 18px -10px rgba(42, 42, 36, 0.22),
        13px 13px 18px -10px rgba(42, 42, 36, 0.27),
        -13px 13px 18px -10px rgba(42, 42, 36, 0.27),
        0 23px 30px -20px rgba(42, 42, 36, 0.16),
        23px 23px 30px -20px rgba(42, 42, 36, 0.19),
        -23px 23px 30px -20px rgba(42, 42, 36, 0.19);
    padding: 16px 20px;
    margin: 16px 8px 40px;
    overflow-x: auto;
}

.code-block pre {
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.65;
    color: #e7e3d8;
    white-space: pre;
}

.code-block pre::selection,
.code-block pre *::selection {
    background-color: var(--code-selection-green);
    color: var(--code-highlight-ink);
}

.code-block pre::-moz-selection,
.code-block pre *::-moz-selection {
    background-color: var(--code-selection-green);
    color: var(--code-highlight-ink);
}

.code-token-comment {
    color: #8f9887;
}

.code-token-selector {
    color: #d7c88f;
}

.code-token-property,
.code-token-path {
    color: #9fb6d8;
}

.code-token-at-rule {
    color: #c6a7d8;
}

.code-token-function,
.code-token-command {
    color: var(--code-syntax-green);
}

.code-token-keyword,
.code-token-string {
    color: #b9b28a;
}

.code-token-number,
.code-token-flag {
    color: #d6a77a;
}

.code-token-operator,
.code-token-punctuation,
.code-token-tree {
    color: #6f786b;
}

.code-invisible {
    color: #53605a;
    opacity: 0.48;
    user-select: none;
}

.code-space {
    padding: 0 0.02em;
}

.code-return {
    margin-left: 0.22em;
}

.code-caption {
    font-size: 12px;
    color: var(--muted);
    margin-top: -8px;
    margin-bottom: 16px;
    padding-left: 20px;
}

/* Callout notes */
.origin-note,
.context-note,
.constraint-note,
.status-note,
.principle-note {
    border-left: 2px solid var(--rule);
    padding: 14px 20px;
    margin: 24px 0;
}

.origin-note p,
.context-note p,
.constraint-note p,
.status-note p,
.principle-note p {
    font-family: var(--serif);
    font-size: 15px;
    line-height: 1.55;
    color: var(--ink-2);
    margin-bottom: 0;
    font-style: italic;
}

/* Contrast columns */
.contrast-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin: 16px 0 24px;
}

.contrast-col h3 {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 10px;
}

.contrast-col ul {
    list-style: none;
    padding: 0;
}

.contrast-col li {
    font-size: 13.5px;
    line-height: 1.55;
    color: #3a3a3a;
    padding-left: 18px;
    position: relative;
    margin-bottom: 5px;
}

.contrast-col li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--muted-2);
    font-size: 0.9em;
}

/* Project links */
.project-links {
    margin-top: 16px;
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.project-links a {
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-2);
    text-decoration: none;
    padding-bottom: 2px;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.project-links a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* Credits and sources */
.credits,
.sources {
    list-style: none;
    padding: 0;
    margin: 12px 0 20px;
}

.credits li,
.sources li {
    font-size: 13.5px;
    line-height: 1.6;
    color: #3a3a3a;
    padding-left: 18px;
    position: relative;
    margin-bottom: 6px;
}

.credits li::before,
.sources li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--muted-2);
}

.credits a,
.sources a,
body.doc-page p a {
    color: var(--ink-2);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.credits a:hover,
.sources a:hover,
body.doc-page p a:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* Footer */
body.doc-page footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--rule);
}

body.doc-page footer p {
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--muted);
    text-align: left;
    margin-bottom: 0;
}

body.doc-page .footer-links {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 24px;
}

body.doc-page footer a {
    color: var(--muted);
    border-bottom: 0;
    text-decoration: none;
    transition: color 0.15s ease;
}

body.doc-page footer a:hover {
    color: var(--ink);
}

/* Doc page responsive */
@media (max-width: 640px) {
    body.doc-page {
        padding: 40px 16px 72px;
    }
    body.doc-page h1 {
        font-size: clamp(28px, 7vw, 40px);
    }
    body.doc-page h2 {
        font-size: 22px;
        margin: 40px 0 12px;
    }
    .capability-grid {
        grid-template-columns: 1fr;
    }
    .contrast-columns {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
