/* ---------- Tokens ---------- */
:root {
    --bg: #000;
    --surface: #0b0b0b;
    --ink: #ededed;
    --muted: #999;
    --line: #222;
    --accent: #b5a6ff;
    --accent-soft: rgba(181, 166, 255, 0.14);

    --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;

    --wrap: 1040px;
    --gutter: clamp(16px, 5vw, 40px);
    --radius: 10px;
    color-scheme: dark;
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1.0625rem;
    font-weight: 300;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd {
    margin: 0;
}

ul,
ol {
    padding: 0;
    list-style: none;
}

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

sup {
    font-size: 0.65em;
    line-height: 0;
}

a {
    color: inherit;
    text-decoration-color: var(--line);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.2em;
    transition: color 0.15s, text-decoration-color 0.15s;
}

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

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

::selection {
    background: var(--accent-soft);
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -4rem;
    z-index: 10;
    padding: 0.5rem 0.9rem;
    background: var(--ink);
    color: var(--bg);
    font-family: var(--sans);
    font-size: 0.8rem;
    border-radius: 6px;
}

.skip-link:focus {
    top: 0.75rem;
    color: var(--bg);
}

/* ---------- Shared type ---------- */
.eyebrow,
.site-nav,
.pub-meta,
.card-kind,
.more,
.page-note,
.site-footer,
.timeline dt {
    font-family: var(--sans);
    font-size: 0.8125rem;
    line-height: 1.5;
    letter-spacing: 0.01em;
}

.eyebrow {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 1.25rem;
}

h1 {
    font-size: clamp(2.5rem, 7vw, 4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -1px;
}

h2 {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.5px;
}

h3 {
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.3;
}

.lede {
    font-size: clamp(1.25rem, 2.4vw, 1.4375rem);
    line-height: 1.45;
    max-width: 36ch;
}

.more {
    color: var(--muted);
    text-decoration: none;
    white-space: nowrap;
}

/* ---------- Header ---------- */
.site-header {
    border-bottom: 1px solid var(--line);
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 4rem;
}

.site-name {
    font-size: 1.0625rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 3vw, 1.75rem);
}

.site-nav a {
    color: var(--muted);
    text-decoration: none;
    padding-block: 0.5rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
    color: var(--ink);
}

.site-nav a[aria-current="page"] {
    box-shadow: 0 1px 0 var(--ink);
}

/* ---------- Hero ---------- */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(2rem, 6vw, 5rem);
    padding-block: clamp(3rem, 9vw, 6.5rem);
}

.hero-text > * + * {
    margin-top: 1.25rem;
}

.hero-text > .eyebrow + h1 {
    margin-top: 0;
}

.hero-text > p:not(.lede):not(.eyebrow) {
    color: var(--muted);
    max-width: 52ch;
}

.hero-text .profile-links {
    margin-top: 1.5rem;
}

.hero-photo {
    display: block;
    width: clamp(160px, 26vw, 300px);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}

.hero-photo img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.profile-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-left: -9px;
}

.profile-links .link {
    display: grid;
    place-items: center;
    width: 35px;
    height: 35px;
    color: var(--ink);
}

.profile-links .link:hover {
    color: var(--accent);
}

.icon {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* ---------- Sections ---------- */
.section {
    padding-block: clamp(2.5rem, 6vw, 4rem);
    border-top: 1px solid var(--line);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 2rem;
}

/* ---------- Publications ---------- */
.pub {
    padding-block: 1.25rem;
    border-top: 1px solid var(--line);
}

.pubs > .pub:first-child {
    border-top: 0;
    padding-top: 0;
}

.pub-title {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    max-width: 46rem;
}

.pub-title a {
    text-decoration: none;
}

.pub-title a:hover {
    text-decoration: underline;
}

.pub-authors {
    margin-top: 0.35rem;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: 46rem;
}

.pub-authors strong {
    color: var(--ink);
    font-weight: 600;
}

.pub-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.9rem;
    margin-top: 0.6rem;
    color: var(--muted);
}

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

.tag {
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
}

.pub-year {
    display: grid;
    grid-template-columns: 6rem minmax(0, 1fr);
    gap: 1rem;
    padding-block: 1.75rem;
    border-top: 1px solid var(--line);
}

.pub-year-label {
    font-family: var(--sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--muted);
    line-height: 1.9;
}

/* ---------- Cards ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.card {
    position: relative;
    padding: 1.5rem 3rem 1.5rem 1.5rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: border-color 0.15s, transform 0.15s;
}

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

.card-image {
    position: absolute;
    inset: 0 var(--image-inset, 0%);
    width: calc(100% - 2 * var(--image-inset, 0%));
    height: 100%;
    object-fit: cover;
    opacity: var(--image-opacity, 0.3);
    z-index: -1;
    border-radius: calc(var(--radius) - 1px);
    transition: opacity 0.15s;
}

.card-image-inset {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 14%, #000 86%, transparent);
}

.card-has-image:hover .card-image {
    opacity: calc(var(--image-opacity, 0.3) + 0.1);
}

.card-has-image {
    isolation: isolate;
}

.card-has-image .card-kind,
.card-has-image .card-text,
.card-has-image .card-arrow {
    color: var(--ink);
}

.card-kind {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
}

.card-kind .icon {
    width: 13px;
    height: 13px;
    margin-right: 0.45rem;
    vertical-align: -2px;
}

.card-title a {
    text-decoration: none;
}

/* Make the whole card clickable */
.card-title a::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
}

.card-text {
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
}

.card-arrow {
    position: absolute;
    top: 1.35rem;
    right: 1.5rem;
    color: var(--muted);
    font-family: var(--sans);
    transition: color 0.15s;
}

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

/* ---------- Inner pages ---------- */
.page-head {
    padding-block: clamp(2.5rem, 7vw, 4.5rem) clamp(1.75rem, 4vw, 2.5rem);
}

.page-head h1 {
    font-size: clamp(2.25rem, 6vw, 3.25rem);
}

.page-head .lede {
    margin-top: 1.25rem;
    color: var(--muted);
}

.page-note {
    color: var(--muted);
    margin-bottom: 1.5rem;
}

.page-note a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

main {
    padding-bottom: clamp(3rem, 8vw, 6rem);
}

.about {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: clamp(1.5rem, 5vw, 4rem);
}

.about-photo {
    width: clamp(140px, 22vw, 240px);
    border-radius: var(--radius);
    border: 1px solid var(--line);
}

.prose {
    max-width: 40rem;
}

.prose > p + p {
    margin-top: 1.1rem;
}

.prose h2 {
    margin-top: 3rem;
    margin-bottom: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--line);
}

.timeline dt {
    color: var(--ink);
    font-weight: 500;
    margin-top: 1.25rem;
}

.timeline .years {
    margin-left: 0.6rem;
    color: var(--muted);
    font-weight: 300;
    white-space: nowrap;
}

.timeline dt:first-child {
    margin-top: 0;
}

.timeline dd {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.55;
    margin-top: 0.2rem;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.site-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 2rem;
    padding-block: 1.75rem;
}

.site-footer .profile-links {
    margin-left: 0;
    margin-right: -9px;
}

.site-footer .profile-links .link {
    color: var(--muted);
}

.site-footer .profile-links .link:hover {
    color: var(--accent);
}

/* ---------- Small screens ---------- */
@media (max-width: 760px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .hero-photo {
        order: -1;
        width: 128px;
    }

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

    .pub-year {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

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

@media (max-width: 520px) {
    .site-header-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding-block: 0.9rem 0.4rem;
    }

    .site-nav {
        gap: 1.25rem;
    }

    .section-head {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
