/*
 * hgaladima.com — portfolio + blog
 *
 * Editorial design system. Fraunces (display serif) + Inter (body sans).
 * OKLCH color palette with warm neutrals. Fluid type + spacing via clamp().
 * Respects prefers-color-scheme and prefers-reduced-motion.
 */

/* -------- Design tokens -------- */

:root {
    /* Palette — light mode */
    --paper: oklch(98% 0.008 80);            /* warm off-white */
    --paper-elevated: oklch(100% 0 0);        /* pure white for surfaces */
    --surface: oklch(97% 0.006 80);           /* subtle card tint */
    --ink: oklch(18% 0.02 260);               /* deep near-black, cool */
    --ink-strong: oklch(12% 0.02 260);
    --ink-muted: oklch(45% 0.015 260);
    --ink-faint: oklch(62% 0.01 260);
    --divider: oklch(90% 0.008 260);
    --divider-strong: oklch(82% 0.01 260);
    --accent: oklch(52% 0.17 246);            /* refined blue, replaces #1976d2 */
    --accent-hover: oklch(44% 0.19 246);
    --accent-soft: oklch(95% 0.035 246);      /* subtle accent wash */
    --warm: oklch(62% 0.14 55);               /* refined terracotta */
    --warm-hover: oklch(54% 0.16 55);
    --warm-soft: oklch(95% 0.03 55);

    /* Typography */
    --font-display: "Fraunces", "Iowan Old Style", "Apple Garamond", "Baskerville",
                    "Times New Roman", serif;
    --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    /* Fluid type scale (Utopia-style), clamped between 320px and 1240px viewport */
    --step--1: clamp(0.875rem, 0.83rem + 0.22vw, 0.95rem);
    --step-0:  clamp(1rem,     0.95rem + 0.27vw, 1.1rem);
    --step-1:  clamp(1.2rem,   1.1rem + 0.5vw,   1.375rem);
    --step-2:  clamp(1.45rem,  1.28rem + 0.82vw, 1.7rem);
    --step-3:  clamp(1.73rem,  1.48rem + 1.24vw, 2.15rem);
    --step-4:  clamp(2.07rem,  1.7rem + 1.85vw,  2.75rem);
    --step-5:  clamp(2.49rem,  1.92rem + 2.86vw, 3.5rem);
    --step-6:  clamp(2.99rem,  2.1rem + 4.45vw,  4.5rem);
    --step-7:  clamp(3.58rem,  2.27rem + 6.55vw, 5.75rem);
    --step-display: clamp(4rem, 2.4rem + 8vw, 7rem);  /* hero name */

    /* Spacing (fluid) */
    --space-3xs: clamp(0.25rem, 0.23rem + 0.09vw, 0.3125rem);
    --space-2xs: clamp(0.5rem,  0.47rem + 0.18vw, 0.625rem);
    --space-xs:  clamp(0.75rem, 0.7rem + 0.27vw,  0.9375rem);
    --space-s:   clamp(1rem,    0.93rem + 0.36vw, 1.25rem);
    --space-m:   clamp(1.5rem,  1.4rem + 0.55vw,  1.875rem);
    --space-l:   clamp(2rem,    1.86rem + 0.73vw, 2.5rem);
    --space-xl:  clamp(3rem,    2.79rem + 1.09vw, 3.75rem);
    --space-2xl: clamp(4rem,    3.71rem + 1.45vw, 5rem);
    --space-3xl: clamp(6rem,    5.57rem + 2.18vw, 7.5rem);
    --space-4xl: clamp(8rem,    7.14rem + 4.36vw, 12rem);

    /* Layout */
    --measure: 38rem;
    --measure-wide: 44rem;
    --container: 72rem;
    --container-narrow: 44rem;
    --radius-sm: 0.375rem;
    --radius: 0.75rem;
    --radius-lg: 1.25rem;

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
    --dur-fast: 160ms;
    --dur: 260ms;
    --dur-slow: 500ms;

    /* Shadows — considered, not dramatic */
    --shadow-xs: 0 1px 2px oklch(18% 0.02 260 / 0.05);
    --shadow-sm: 0 2px 8px oklch(18% 0.02 260 / 0.06);
    --shadow:    0 8px 24px -8px oklch(18% 0.02 260 / 0.12);
    --shadow-lg: 0 24px 48px -16px oklch(18% 0.02 260 / 0.18);
}

@media (prefers-color-scheme: dark) {
    :root {
        --paper: oklch(14% 0.02 260);
        --paper-elevated: oklch(17% 0.02 260);
        --surface: oklch(19% 0.02 260);
        --ink: oklch(92% 0.015 80);
        --ink-strong: oklch(98% 0.005 80);
        --ink-muted: oklch(70% 0.018 80);
        --ink-faint: oklch(52% 0.015 260);
        --divider: oklch(28% 0.02 260);
        --divider-strong: oklch(36% 0.02 260);
        --accent: oklch(72% 0.15 246);
        --accent-hover: oklch(82% 0.13 246);
        --accent-soft: oklch(25% 0.06 246);
        --warm: oklch(72% 0.13 55);
        --warm-hover: oklch(80% 0.12 55);
        --warm-soft: oklch(25% 0.04 55);
        --shadow-xs: 0 1px 2px oklch(0% 0 0 / 0.3);
        --shadow-sm: 0 2px 8px oklch(0% 0 0 / 0.4);
        --shadow:    0 8px 24px -8px oklch(0% 0 0 / 0.5);
        --shadow-lg: 0 24px 48px -16px oklch(0% 0 0 / 0.6);
    }
}

/* -------- Reset + base -------- */

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-feature-settings: "ss01", "cv11";
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-main {
    flex: 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 400;
    font-variation-settings: "opsz" 48, "SOFT" 0, "WONK" 0;
    line-height: 1.08;
    letter-spacing: -0.02em;
    color: var(--ink-strong);
    margin: 0 0 var(--space-xs);
    text-wrap: balance;
}

h1 { font-size: var(--step-5); font-variation-settings: "opsz" 144, "SOFT" 0; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; letter-spacing: -0.01em; }

p {
    margin: 0 0 var(--space-s);
    text-wrap: pretty;
}

a {
    color: var(--accent);
    text-decoration: none;
    text-underline-offset: 0.18em;
    text-decoration-thickness: 1px;
    transition: color var(--dur-fast) var(--ease-out),
                text-decoration-color var(--dur-fast) var(--ease-out);
}

a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
    text-decoration-color: var(--accent-hover);
}

strong { font-weight: 600; color: var(--ink-strong); }
em { font-style: italic; }

hr {
    border: 0;
    height: 1px;
    background: var(--divider);
    margin: var(--space-xl) 0;
}

blockquote {
    margin: var(--space-m) 0;
    padding: 0 0 0 var(--space-s);
    border-left: 2px solid var(--warm);
    font-family: var(--font-display);
    font-variation-settings: "opsz" 24, "SOFT" 50;
    font-style: italic;
    font-size: var(--step-1);
    line-height: 1.4;
    color: var(--ink-muted);
}

code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: var(--surface);
    padding: 0.15em 0.4em;
    border-radius: var(--radius-sm);
    border: 1px solid var(--divider);
}

pre {
    background: var(--surface);
    padding: var(--space-s);
    border-radius: var(--radius);
    border: 1px solid var(--divider);
    overflow-x: auto;
    font-size: var(--step--1);
    line-height: 1.5;
    margin: var(--space-m) 0;
}

pre code { background: none; border: 0; padding: 0; }

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

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

::selection {
    background: var(--warm-soft);
    color: var(--ink-strong);
}

/* -------- Header / nav -------- */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in oklch, var(--paper) 80%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--dur) var(--ease-out),
                background var(--dur) var(--ease-out);
}

.site-header.is-scrolled {
    border-bottom-color: var(--divider);
}

.site-header-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: var(--space-s) var(--space-m);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-m);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-family: var(--font-display);
    font-size: var(--step-0);
    font-weight: 500;
    font-variation-settings: "opsz" 14, "SOFT" 30;
    letter-spacing: -0.01em;
    color: var(--ink-strong);
    border-bottom: none;
    white-space: nowrap;
    transition: color var(--dur-fast) var(--ease-out);
}

.site-brand:hover { color: var(--accent); text-decoration: none; }

.site-brand-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface);
    border: 1px solid var(--divider);
    box-shadow: 0 0 0 2px var(--paper),
                0 0 0 3px color-mix(in oklch, var(--warm) 50%, transparent);
    transition: box-shadow var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
    flex-shrink: 0;
}

.site-brand:hover .site-brand-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--paper),
                0 0 0 3px var(--warm);
}

.site-brand-name {
    position: relative;
}

.site-brand-name::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--warm);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur) var(--ease-out);
}

.site-brand:hover .site-brand-name::after {
    transform: scaleX(1);
}

.site-nav-list {
    display: flex;
    gap: clamp(1rem, 2vw, 1.75rem);
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav-list a {
    color: var(--ink-muted);
    font-size: var(--step--1);
    font-weight: 500;
    text-decoration: none;
    padding: var(--space-3xs) 0;
    position: relative;
    letter-spacing: 0.005em;
    border-bottom: none;
}

.site-nav-list a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--dur) var(--ease-out);
}

.site-nav-list a:hover,
.site-nav-list a.active {
    color: var(--ink-strong);
}

.site-nav-list a:hover::after,
.site-nav-list a.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

.site-nav-list a.active { color: var(--accent); }

.nav-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--divider-strong);
    color: var(--ink);
    padding: var(--space-3xs) var(--space-xs);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--step--1);
    gap: var(--space-3xs);
    align-items: center;
}

@media (max-width: 720px) {
    .nav-toggle {
        display: inline-flex;
    }
    .site-nav-list {
        display: none;
        position: absolute;
        top: 100%;
        right: var(--space-m);
        flex-direction: column;
        background: var(--paper-elevated);
        border: 1px solid var(--divider);
        border-radius: var(--radius);
        padding: var(--space-s) var(--space-m);
        gap: var(--space-xs);
        box-shadow: var(--shadow);
        min-width: 10rem;
    }
    .site-nav-list.open { display: flex; }
}

/* -------- Main layout container -------- */

.site-main {
    max-width: var(--container);
    width: 100%;
    margin: 0 auto;
    padding: 0 var(--space-m);
}

.layout-prose {
    max-width: var(--measure);
    margin: 0 auto;
    padding: var(--space-2xl) 0;
}

.layout-prose h1 { margin-bottom: var(--space-m); }

/* -------- Hero — poster-style with bell-curve mark -------- */

.hero {
    padding: clamp(4rem, 6vw, 8rem) 0 clamp(3rem, 5vw, 6rem);
    position: relative;
    overflow: hidden;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-eyebrow {
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    margin: 0 0 var(--space-m);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.hero-eyebrow::before {
    content: "";
    display: inline-block;
    width: 2.5rem;
    height: 1px;
    background: var(--warm);
}

.hero-display {
    font-family: var(--font-display);
    font-size: var(--step-display);
    font-weight: 400;
    font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
    line-height: 0.92;
    letter-spacing: -0.035em;
    margin: 0 0 var(--space-l);
    color: var(--ink-strong);
    text-wrap: balance;
}

.hero-display-accent {
    font-style: italic;
    font-variation-settings: "opsz" 144, "SOFT" 80;
    color: var(--warm);
}

.hero-tagline {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 18, "SOFT" 30;
    font-size: var(--step-2);
    font-weight: 400;
    line-height: 1.35;
    color: var(--ink-muted);
    max-width: 30ch;
    margin: 0 0 var(--space-xl);
    text-wrap: balance;
}

.hero-actions {
    display: flex;
    gap: var(--space-s);
    flex-wrap: wrap;
    align-items: center;
}

.hero-mark {
    position: absolute;
    top: 50%;
    right: calc(var(--space-m) * -1);
    transform: translateY(-50%);
    width: clamp(240px, 32vw, 420px);
    height: auto;
    opacity: 0.18;
    color: var(--accent);
    z-index: 0;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .hero-mark { opacity: 0.22; }
}

@media (max-width: 900px) {
    .hero-mark {
        opacity: 0.08;
        right: -10%;
        width: 80%;
    }
}

/* -------- Buttons -------- */

.button {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    padding: var(--space-xs) var(--space-m);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: var(--step-0);
    font-weight: 500;
    letter-spacing: -0.005em;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--dur-fast) var(--ease-out),
                border-color var(--dur-fast) var(--ease-out),
                color var(--dur-fast) var(--ease-out),
                transform var(--dur-fast) var(--ease-out);
}

.button:hover { text-decoration: none; transform: translateY(-1px); }
.button:active { transform: translateY(0); }

.button-primary {
    background: var(--ink-strong);
    color: var(--paper);
}

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

.button-ghost {
    color: var(--ink-strong);
    border-color: var(--divider-strong);
    background: transparent;
}

.button-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-soft);
}

.button-arrow::after {
    content: " →";
    transition: transform var(--dur-fast) var(--ease-out);
}

.button-arrow:hover::after {
    transform: translateX(3px);
    display: inline-block;
}

/* -------- Sections / dividers -------- */

.section {
    padding: var(--space-3xl) 0;
    position: relative;
}

.section-divider {
    margin: 0 auto var(--space-2xl);
    width: 3rem;
    height: 1.5rem;
    opacity: 0.4;
    color: var(--warm);
    display: block;
}

.section-eyebrow {
    display: block;
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    margin: 0 0 var(--space-xs);
}

.section-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "SOFT" 0;
    font-size: var(--step-4);
    font-weight: 400;
    letter-spacing: -0.025em;
    margin: 0 0 var(--space-m);
    max-width: 22ch;
    line-height: 1.08;
    color: var(--ink-strong);
}

.section-lede {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 18, "SOFT" 20;
    font-size: var(--step-1);
    color: var(--ink-muted);
    max-width: 50ch;
    margin: 0 0 var(--space-xl);
    line-height: 1.5;
}

/* -------- "What I do" — numbered editorial grid -------- */

.practice {
    border-top: 1px solid var(--divider);
}

.practice-item {
    display: grid;
    grid-template-columns: minmax(4rem, 1fr) minmax(0, 3fr);
    gap: var(--space-l);
    padding: var(--space-xl) 0;
    border-bottom: 1px solid var(--divider);
    transition: background var(--dur) var(--ease-out);
}

.practice-item:hover {
    background: color-mix(in oklch, var(--warm-soft) 50%, transparent);
}

.practice-number {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 144, "SOFT" 0;
    font-size: var(--step-4);
    font-weight: 300;
    color: var(--warm);
    line-height: 1;
    letter-spacing: -0.03em;
    font-feature-settings: "tnum";
}

.practice-body h3 {
    margin: 0 0 var(--space-xs);
    font-size: var(--step-2);
    font-variation-settings: "opsz" 48, "SOFT" 0;
}

.practice-body h3 a {
    color: var(--ink-strong);
    border-bottom: none;
}

.practice-body h3 a:hover { color: var(--accent); text-decoration: none; }

.practice-description {
    color: var(--ink-muted);
    max-width: var(--measure);
    margin: 0 0 var(--space-s);
}

.practice-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: var(--step--1);
    font-weight: 500;
    letter-spacing: 0.005em;
    color: var(--accent);
}

.practice-link::after {
    content: "→";
    transition: transform var(--dur-fast) var(--ease-out);
    display: inline-block;
}

.practice-link:hover { text-decoration: none; }
.practice-link:hover::after { transform: translateX(3px); }

@media (max-width: 640px) {
    .practice-item {
        grid-template-columns: 1fr;
        gap: var(--space-s);
    }
    .practice-number { font-size: var(--step-3); }
}

/* -------- Magazine-style post list (home) -------- */

.post-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.post-list-item {
    border-bottom: 1px solid var(--divider);
}

.post-list-item:last-child { border-bottom: 0; }

.post-list-link {
    display: grid;
    grid-template-columns: 10rem 1fr;
    gap: var(--space-l);
    padding: var(--space-m) 0;
    color: var(--ink);
    border-bottom: none;
    align-items: baseline;
    transition: transform var(--dur) var(--ease-out);
}

.post-list-link:hover {
    text-decoration: none;
    transform: translateX(4px);
}

.post-list-date {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 500;
    color: var(--ink-muted);
    letter-spacing: 0.005em;
    text-transform: uppercase;
    font-feature-settings: "tnum";
    white-space: nowrap;
}

.post-list-text {
    display: flex;
    flex-direction: column;
    gap: var(--space-3xs);
}

.post-list-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 48, "SOFT" 0;
    font-size: var(--step-2);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink-strong);
    margin: 0;
    transition: color var(--dur-fast) var(--ease-out);
}

.post-list-link:hover .post-list-title {
    color: var(--accent);
}

.post-list-summary {
    color: var(--ink-muted);
    font-size: var(--step-0);
    line-height: 1.5;
    margin: 0;
    max-width: 60ch;
}

@media (max-width: 640px) {
    .post-list-link {
        grid-template-columns: 1fr;
        gap: var(--space-2xs);
        padding: var(--space-s) 0;
    }
}

/* -------- Blog index (magazine) -------- */

.post-index-header {
    padding: var(--space-2xl) 0 var(--space-xl);
    border-bottom: 1px solid var(--divider);
    margin-bottom: var(--space-xl);
}

.post-index-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 144, "SOFT" 0;
    font-size: var(--step-6);
    font-weight: 400;
    margin: 0 0 var(--space-xs);
    letter-spacing: -0.035em;
    color: var(--ink-strong);
}

.post-index-kicker {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 18, "SOFT" 30;
    font-size: var(--step-1);
    color: var(--ink-muted);
    max-width: 55ch;
    margin: 0;
    line-height: 1.5;
}

.post-year-label {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    padding: var(--space-m) 0 var(--space-s);
    border-top: 1px solid var(--divider);
    display: block;
    margin-top: var(--space-l);
}

.post-year-label:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

/* -------- Post (single) — editorial reading layout -------- */

.post {
    padding: var(--space-2xl) 0 var(--space-3xl);
    max-width: var(--measure);
    margin: 0 auto;
}

.post-header {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-l);
    border-bottom: 1px solid var(--divider);
}

.post-kicker {
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    margin: 0 0 var(--space-s);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
}

.post-kicker::before {
    content: "";
    display: inline-block;
    width: 1.75rem;
    height: 1px;
    background: var(--warm);
}

.post-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 144, "SOFT" 0;
    font-size: var(--step-5);
    font-weight: 400;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--ink-strong);
    margin: 0 0 var(--space-m);
}

.post-meta {
    font-size: var(--step--1);
    color: var(--ink-muted);
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    align-items: center;
}

.post-meta time {
    font-feature-settings: "tnum";
    font-weight: 500;
    color: var(--ink);
}

.post-meta .post-tag {
    color: var(--warm);
    font-weight: 500;
    font-size: var(--step--1);
}

.post-summary {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 24, "SOFT" 30;
    font-style: italic;
    font-size: var(--step-1);
    color: var(--ink-muted);
    margin: var(--space-m) 0 0;
    line-height: 1.4;
    text-wrap: balance;
}

.post-body {
    font-size: var(--step-0);
    line-height: 1.7;
    color: var(--ink);
}

/* Drop cap on the first paragraph */
.post-body > p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 144, "SOFT" 40;
    font-size: 4.2em;
    line-height: 0.85;
    float: left;
    margin: 0.12em 0.12em 0 -0.04em;
    color: var(--warm);
    font-weight: 400;
}

.post-body h2 {
    font-size: var(--step-3);
    margin-top: var(--space-xl);
    font-variation-settings: "opsz" 72, "SOFT" 0;
}

.post-body h3 {
    font-size: var(--step-2);
    margin-top: var(--space-l);
}

.post-body ul, .post-body ol {
    padding-left: var(--space-m);
    margin: var(--space-s) 0;
}

.post-body li {
    margin: var(--space-2xs) 0;
    padding-left: var(--space-3xs);
}

.post-body li::marker { color: var(--warm); }

.post-body a {
    text-decoration: underline;
    text-decoration-color: color-mix(in oklch, var(--accent) 40%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.14em;
    transition: text-decoration-color var(--dur-fast) var(--ease-out);
}

.post-body a:hover {
    text-decoration-color: var(--accent);
}

.post-footer {
    margin-top: var(--space-2xl);
    padding-top: var(--space-l);
    border-top: 1px solid var(--divider);
    font-size: var(--step--1);
}

.post-footer a { font-weight: 500; }

/* -------- Prose (about, research, etc.) — marker fallback for generic lists -------- */

.site-main > article > h1:first-child,
.site-main > article > h1:first-child + p {
    max-width: var(--measure);
}

.site-main p, .site-main ul, .site-main ol,
.site-main h2, .site-main h3, .site-main h4 {
    max-width: var(--measure);
}

.site-main > article > h1 {
    font-size: var(--step-5);
    font-variation-settings: "opsz" 144, "SOFT" 0;
    margin: var(--space-2xl) 0 var(--space-l);
    letter-spacing: -0.03em;
}

.site-main > article > h2 {
    margin-top: var(--space-xl);
    font-size: var(--step-3);
    border-bottom: 1px solid var(--divider);
    padding-bottom: var(--space-xs);
}

/* -------- Contact page grid -------- */

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: var(--space-m);
    margin: var(--space-l) 0;
}

.contact-card {
    background: var(--surface);
    border: 1px solid var(--divider);
    border-radius: var(--radius);
    padding: var(--space-m);
    transition: border-color var(--dur) var(--ease-out),
                transform var(--dur) var(--ease-out);
}

.contact-card:hover {
    border-color: var(--warm);
    transform: translateY(-2px);
}

.contact-card h2 {
    margin-top: 0;
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    padding-bottom: var(--space-2xs);
    border: none;
}

.contact-note {
    font-size: var(--step--1);
    color: var(--ink-muted);
    margin-top: var(--space-xs);
}

.contact-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-links li {
    padding: var(--space-3xs) 0;
    font-size: var(--step--1);
}

/* -------- Research / CV niceties -------- */

.pub-list {
    list-style: none;
    padding: 0;
    margin: var(--space-l) 0;
    counter-reset: pub;
}

.pub-entry {
    position: relative;
    padding: var(--space-m) 0 var(--space-m) var(--space-xl);
    border-bottom: 1px solid var(--divider);
    counter-increment: pub;
}

.pub-entry::before {
    content: counter(pub, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: var(--space-m);
    font-family: var(--font-display);
    font-variation-settings: "opsz" 96, "SOFT" 0;
    font-size: var(--step-1);
    color: var(--warm);
    font-feature-settings: "tnum";
}

.pub-entry:last-child { border-bottom: 0; }

.pub-title {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 24, "SOFT" 0;
    font-weight: 500;
    font-size: var(--step-0);
    display: block;
    margin: var(--space-2xs) 0;
    color: var(--ink-strong);
}

.pub-venue { color: var(--ink-muted); }

.cv-download {
    margin: var(--space-m) 0 var(--space-xs);
}

.cv-updated {
    color: var(--ink-muted);
    font-size: var(--step--1);
    margin: 0 0 var(--space-xl);
}

.cv-footer-note {
    color: var(--ink-muted);
    font-size: var(--step--1);
    font-style: italic;
}

/* -------- Footer -------- */

.site-footer {
    border-top: 1px solid var(--divider);
    padding: var(--space-2xl) 0 var(--space-xl);
    background: var(--surface);
    margin-top: var(--space-3xl);
}

.site-footer-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 var(--space-m);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: var(--space-l) var(--space-xl);
    align-items: start;
}

.footer-brand {
    font-family: var(--font-display);
    font-variation-settings: "opsz" 72, "SOFT" 0;
    font-size: var(--step-2);
    letter-spacing: -0.02em;
    margin: 0 0 var(--space-xs);
    line-height: 1.1;
    color: var(--ink-strong);
}

.footer-description {
    color: var(--ink-muted);
    font-size: var(--step--1);
    max-width: 28ch;
    line-height: 1.5;
}

.footer-column-title {
    font-family: var(--font-body);
    font-size: var(--step--1);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--warm);
    margin: 0 0 var(--space-xs);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    padding: var(--space-3xs) 0;
    font-size: var(--step--1);
}

.footer-column a {
    color: var(--ink);
    border-bottom: none;
}

.footer-column a:hover { color: var(--accent); text-decoration: underline; }

.footer-colophon {
    font-size: var(--step--1);
    color: var(--ink-faint);
    line-height: 1.6;
    max-width: 32ch;
    font-style: italic;
    font-family: var(--font-display);
    font-variation-settings: "opsz" 14, "SOFT" 20;
}

.footer-meta {
    max-width: var(--container);
    margin: var(--space-xl) auto 0;
    padding: var(--space-s) var(--space-m) 0;
    border-top: 1px solid var(--divider);
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-xs);
    font-size: var(--step--1);
    color: var(--ink-faint);
}

/* -------- Motion utilities -------- */

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--dur-slow) var(--ease-out),
                transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; }
}

/* -------- Skip link for a11y -------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--accent);
    color: var(--paper);
    padding: var(--space-xs) var(--space-s);
    z-index: 100;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 500;
    font-size: var(--step--1);
    border-bottom: none;
}

.skip-link:focus {
    left: 0;
    text-decoration: none;
}
