:root {
    --bg: #fbf8f2;
    --bg-rgb: 251, 248, 242;
    --text: #1a1a1a;
    --text-muted: #5a5a5a;
    --border: #e5e5e5;
    --font-serif: 'Libre Baskerville', Georgia, serif;
    --font-sans: 'Archivo', -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    font-weight: 300;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 512px 512px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* <picture> is a transparent wrapper for AVIF/JPG source negotiation —
   take it out of the layout so children inherit parent box rules directly. */
picture {
    display: contents;
}

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

/* Cross-document View Transitions: opt this site into the browser's
   built-in page-transition system. Modern browsers (Chrome 126+,
   Safari 18.2+) will animate elements that share a view-transition-name
   between pages; everything else just navigates normally. */
@view-transition {
    navigation: auto;
}

/* The small header mark on home/project/research pages morphs from the
   embossed cover logo (.logo-frame on index.html). */
.logo img {
    view-transition-name: site-logo;
}

/* Slow the cross-document logo morph and root crossfade slightly so the
   transition reads as deliberate rather than abrupt. */
::view-transition-old(site-logo),
::view-transition-new(site-logo) {
    animation-duration: 0.7s;
    animation-timing-function: cubic-bezier(0.65, 0, 0.35, 1);
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.5s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reduced-motion users opt out of the page transition entirely. */
@media (prefers-reduced-motion: reduce) {
    ::view-transition-group(*),
    ::view-transition-old(*),
    ::view-transition-new(*) {
        animation: none !important;
    }
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: max(24px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-right)) 24px max(40px, env(safe-area-inset-left));
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: rgba(var(--bg-rgb), 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    will-change: transform;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 44px;
    min-height: 44px;
}

.logo img {
    height: 48px;
    width: auto;
    display: block;
}

nav {
    display: flex;
    gap: 32px;
}

nav a {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    transition: color 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

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

/* Hero - Minimal */
.hero {
    padding: 140px 40px 60px;
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: clamp(28px, 4vw, 36px);
    font-weight: 400;
    line-height: 1.4;
    max-width: 600px;
}

.hero h1 em {
    font-style: italic;
}

/* Projects Section */
.projects {
    padding: 40px 40px 100px;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 24px;
}

.project-item {
    cursor: pointer;
    display: block;
    text-decoration: none;
}

.project-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 16px;
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s ease;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (hover: hover) and (pointer: fine) {
    .project-item:hover .project-image {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08),
                    0 4px 12px rgba(0, 0, 0, 0.04);
    }

    .project-item:hover .project-image img {
        transform: scale(1.04);
    }

    .project-item:hover .project-info {
        transform: translateX(4px);
    }

    .contact-email:hover::after {
        transform: scaleX(1);
    }
}

.project-info {
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.project-text h3 {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 400;
    margin-bottom: 4px;
}

.project-text p {
    font-size: 12px;
    color: var(--text-muted);
}

.project-meta {
    text-align: right;
    flex-shrink: 0;
}

.project-year {
    font-size: 12px;
    color: var(--text-muted);
}

.project-award {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    margin-top: 4px;
}

/* About Section */
.about {
    padding: 80px 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    border-top: 1px solid var(--border);
}

.about-left h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
    line-height: 1.4;
}

.about-left p {
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 16px;
    font-size: 14px;
}

.about-right {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.expertise-item {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.expertise-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.expertise-value {
    font-size: 14px;
    line-height: 1.5;
}

/* Contact */
.contact {
    padding: 100px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.contact h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 20px;
}

.contact-email {
    font-size: 15px;
    position: relative;
    display: inline-block;
}

.contact-email::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: var(--text);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

/* Footer */
footer {
    padding: 24px max(40px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-muted);
}

.social-links {
    display: flex;
    gap: 24px;
}

.social-links a {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--text);
}

/* ==================== */
/* PROJECT PAGE STYLES  */
/* ==================== */

.project-header {
    padding: 140px 40px 60px;
    max-width: 800px;
}

.project-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 40px;
    transition: color 0.3s ease;
    min-height: 44px;
}

.project-header .back-link:hover {
    color: var(--text);
}

.project-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 400;
    margin-bottom: 24px;
    line-height: 1.2;
}

.project-header .project-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.project-details {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.project-detail {
    min-width: 120px;
}

.project-detail-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.project-detail-value {
    font-size: 14px;
}

.project-detail-value a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.project-detail-value a:hover {
    color: var(--text-muted);
}

/* Project Content */
.project-content {
    padding: 0 40px 80px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-description {
    max-width: 1000px;
    margin: 0 auto 60px;
}

.project-description p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    font-weight: 450;
    margin-bottom: 20px;
}

/* Project Images */
.project-images {
    display: flex;
    flex-direction: column;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.project-images img {
    width: 100%;
    height: auto;
    display: block;
}

.project-images figure {
    margin: 0;
}

.project-images figcaption {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-style: italic;
    padding-top: 12px;
    max-width: 720px;
}

.project-images .image-full {
    width: 100%;
}

.project-images .image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Editorial pairing: text on the left, vertically stacked images on the right */
.project-images .text-with-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.project-images .text-with-stack .image-text {
    padding-top: 0;
    position: sticky;
    top: 120px;
}

.project-images .image-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Inline text blocks between images */
.project-images .image-text {
    max-width: 100%;
    padding: 20px 0;
}

.project-images .image-text p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    font-weight: 450;
    margin-bottom: 16px;
}

.project-images .image-text p:last-child {
    margin-bottom: 0;
}

/* Project Navigation */
.project-nav {
    display: flex;
    justify-content: space-between;
    padding: 40px;
    border-top: 1px solid var(--border);
    margin-top: 80px;
}

.project-nav a {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    transition: color 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

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

.project-nav .next {
    margin-left: auto;
}

/* Responsive */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .about {
        grid-template-columns: 1fr;
        gap: 48px;
    }

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

    .project-images .text-with-stack {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-images .text-with-stack .image-text {
        position: static;
    }
}

@media (max-width: 768px) {
    header {
        padding: 20px max(24px, env(safe-area-inset-right)) 20px max(24px, env(safe-area-inset-left));
        justify-content: space-between;
    }

    .logo {
        position: static;
        transform: none;
    }

    .logo img {
        height: 36px;
    }

    nav {
        gap: 20px;
    }

    .hero,
    .projects,
    .about,
    .contact,
    .project-header,
    .project-content,
    .project-nav {
        padding-left: 24px;
        padding-right: 24px;
    }

    .project-info {
        flex-direction: column;
        gap: 8px;
    }

    .project-meta {
        text-align: left;
    }

    .project-details {
        gap: 24px;
    }
}

/* Accessibility: Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Accessibility: Focus states */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 4px;
}

/* Accessibility: Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}

/* Reveal animation initial state via CSS — only when JS available and motion allowed.
   Pre-hides reveal targets so they don't flash before animations.js runs.
   .js class is set by an inline script in <head>; non-JS users see content unhidden.
   The first project card is left without data-reveal so it paints immediately as LCP. */
@media (prefers-reduced-motion: no-preference) {
    .js [data-reveal] {
        opacity: 0;
        transform: translateY(50px);
    }
}

/* ==================== */
/* RESEARCH / ARTICLE   */
/* ==================== */

/* Section index page (/research.html) */
.research-header {
    padding: 140px 40px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.research-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 400;
    margin-bottom: 16px;
    line-height: 1.2;
}

.research-header .research-subtitle {
    font-size: 15px;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.6;
}

.research-index {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 40px 100px;
    display: flex;
    flex-direction: column;
}

.research-entry {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 32px;
    padding: 32px 0;
    border-top: 1px solid var(--border);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.research-entry:last-child {
    border-bottom: 1px solid var(--border);
}

.research-entry-meta {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    line-height: 1.6;
    padding-top: 6px;
}

.research-entry-meta span {
    display: block;
}

.research-entry-body h2 {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 8px;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.research-entry-body p {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 12px;
    max-width: 600px;
}

.research-entry-tags {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

@media (hover: hover) and (pointer: fine) {
    .research-entry:hover .research-entry-body h2 {
        transform: translateX(4px);
    }
}

/* Article page (/research/[slug].html) */
.article-header {
    padding: 140px 40px 40px;
    max-width: 1000px;
    margin: 0 auto;
}

.article-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 40px;
    transition: color 0.3s ease;
    min-height: 44px;
}

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

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 32px;
}

.article-meta span:not(:last-child)::after {
    content: '·';
    margin-left: 12px;
    color: var(--text-muted);
}

.article-header h1 {
    font-family: var(--font-serif);
    font-size: clamp(32px, 5vw, 44px);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 16px;
    max-width: 800px;
}

.article-subtitle {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 18px;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 32px;
    max-width: 800px;
}

.article-provenance {
    font-style: italic;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-muted);
    border-left: 2px solid var(--border);
    padding: 4px 0 4px 20px;
    margin: 24px 0 8px;
    max-width: 800px;
}

/* Inline TOC — outer width 920px matches the content rail of .article-body and .article-header */
.article-toc {
    max-width: 920px;
    margin: 48px auto 64px;
    padding: 36px 48px;
    border-top: 1px solid var(--text);
    border-bottom: 1px solid var(--text);
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 56px;
    row-gap: 32px;
    column-count: auto;
    columns: auto;
}

.article-toc-label {
    grid-column: 1 / -1;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin: 0 0 4px;
}

.article-toc-section {
    break-inside: avoid;
}

.article-toc-part {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--text);
    margin: 0 0 16px;
}

.article-toc-part span {
    color: var(--text-muted);
    margin-right: 12px;
    letter-spacing: 0.32em;
}

.article-toc ol {
    list-style: decimal-leading-zero;
    padding-left: 2.5em;
    margin: 0;
}

.article-toc li {
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.article-toc a {
    color: var(--text-muted);
    transition: color 0.3s ease;
}

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

/* Article body */
.article-body {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 40px 40px;
}

.article-body section {
    margin-bottom: 16px;
}

.article-body h2 {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 64px;
    margin-bottom: 24px;
    scroll-margin-top: 100px;
    max-width: 800px;
}

.article-body h3 {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    margin-top: 40px;
    margin-bottom: 16px;
    scroll-margin-top: 100px;
    max-width: 800px;
}

.article-body p {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    font-weight: 450;
    margin-bottom: 20px;
    max-width: 800px;
}

.article-body ul,
.article-body ol {
    padding-left: 1.5em;
    margin-bottom: 20px;
    max-width: 800px;
}

.article-body li {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    font-weight: 450;
    margin-bottom: 8px;
}

.article-body li > ul,
.article-body li > ol {
    margin-top: 8px;
    margin-bottom: 0;
}

.article-body blockquote {
    font-style: italic;
    border-left: 2px solid var(--text-muted);
    padding: 4px 0 4px 24px;
    margin: 24px 0;
    color: var(--text-muted);
    max-width: 800px;
}

.article-body blockquote p {
    color: inherit;
    margin-bottom: 12px;
}

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

.article-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 5px;
    border-radius: 2px;
}

.article-body pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.04);
    padding: 16px 20px;
    border-radius: 2px;
    overflow-x: auto;
    margin-bottom: 20px;
    max-width: 800px;
}

.article-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.article-body a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.article-body a:hover {
    color: var(--text-muted);
}

.article-body sup {
    line-height: 0;
}

.article-body sup a {
    text-decoration: none;
    font-size: 0.75em;
    padding: 0 2px;
}

.article-body strong {
    font-weight: 600;
}

.article-body em {
    font-style: italic;
}

.article-body hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 48px 0;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 32px 0;
    border-top: 1px solid var(--text);
    border-bottom: 1px solid var(--border);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    line-height: 1.5;
    min-width: 600px;
}

.article-body thead th {
    text-align: left;
    font-weight: 500;
    border-bottom: 1px solid var(--text);
    padding: 14px 16px;
    vertical-align: bottom;
    background: transparent;
}

.article-body tbody td {
    border-bottom: 1px solid var(--border);
    padding: 14px 16px;
    vertical-align: top;
    font-weight: 400;
}

.article-body tbody tr:last-child td {
    border-bottom: none;
}

.article-body table strong {
    font-weight: 500;
}

/* Footnotes + acknowledgments */
.article-footnotes {
    max-width: 1000px;
    margin: 80px auto 0;
    padding: 32px 40px;
    border-top: 1px solid var(--border);
}

.article-footnotes-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.article-footnotes ol {
    padding-left: 1.5em;
    max-width: 800px;
}

.article-footnotes li {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.article-acknowledgments {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 40px 40px;
}

.article-acknowledgments p {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 12px;
    max-width: 800px;
}

/* Article navigation (prev/next) */
.article-nav {
    display: flex;
    justify-content: space-between;
    padding: 40px;
    border-top: 1px solid var(--border);
    margin-top: 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.article-nav a {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    transition: color 0.3s ease;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
}

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

.article-nav .next {
    margin-left: auto;
}

/* Part labels — major divisions of the article. Sit above the first section H2 of each part.
   max-width override is needed so the border-top spans the full content rail and aligns with the TOC. */
.article-part-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 96px !important;
    margin-bottom: 36px !important;
    padding-top: 28px;
    border-top: 1px solid var(--text);
    line-height: 1.3 !important;
    font-size: inherit !important;
    max-width: 100% !important;
}

.article-part-label .article-part-num {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.32em;
    color: var(--text-muted);
}

.article-part-label .article-part-name {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 24px;
    color: var(--text);
    line-height: 1.25;
}

/* The first part label opens the article right after the TOC.
   Drop its top border to avoid a double line with the TOC's bottom border. */
section:first-of-type .article-part-label {
    margin-top: 48px !important;
    border-top: none;
    padding-top: 0;
}

/* Case meta — anonymized project descriptor under each case section H2 */
.article-case-meta {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14px !important;
    line-height: 1.6 !important;
    color: var(--text-muted);
    margin-top: -16px;
    margin-bottom: 28px !important;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
    max-width: 800px;
}

/* Article figures (inline SVG diagrams or PDF-extracted images) */
.article-figure {
    max-width: 800px;
    margin: 40px 0;
}

.article-figure svg {
    display: block;
    width: 100%;
    height: auto;
    color: var(--text);
    overflow: visible;
}

.article-figure img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.article-figure figcaption {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-muted);
    margin-top: 14px;
    font-style: italic;
    max-width: 720px;
}

/* Case study callout — frames a real-project illustration of the surrounding text */
.article-case {
    max-width: 800px;
    margin: 40px 0;
    padding: 28px 32px 24px;
    border-top: 1px solid var(--text);
    border-bottom: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.018);
}

.article-case-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.article-case-title {
    font-family: var(--font-serif);
    font-size: 19px;
    font-weight: 400;
    line-height: 1.3;
    margin-bottom: 20px;
}

.article-case-stats {
    display: flex;
    gap: 32px;
    flex-wrap: wrap;
    margin: 0 0 20px;
    padding: 14px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.article-case-stat {
    flex: 0 1 auto;
}

.article-case-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 4px;
    line-height: 1.4;
}

.article-case-stat-value {
    font-family: var(--font-serif);
    font-size: 22px;
    line-height: 1.2;
    font-feature-settings: 'tnum' 1;
}

.article-case p {
    font-size: 15px !important;
    line-height: 1.7 !important;
    margin-bottom: 12px !important;
}

.article-case p:last-child {
    margin-bottom: 0 !important;
}

.article-case .article-figure {
    margin: 8px 0 20px;
}

.article-case .article-figure figcaption {
    font-size: 11px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .research-header,
    .research-index,
    .article-header,
    .article-toc,
    .article-body,
    .article-footnotes,
    .article-acknowledgments,
    .article-nav {
        padding-left: 24px;
        padding-right: 24px;
    }

    .research-entry {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .article-toc {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 24px;
    }

    .article-toc ol {
        columns: 1;
    }

    .article-body table {
        font-size: 13px;
    }

    .article-body thead th,
    .article-body tbody td {
        padding: 10px 12px;
    }

    .article-body h2 {
        margin-top: 48px;
    }

    .article-case {
        padding: 22px 22px 20px;
    }

    .article-case-stats {
        gap: 20px;
    }

    .article-case-stat-value {
        font-size: 19px;
    }
}