:root {
    --paper: #FDFCF8;
    --ink: #1C2321;
    --muted: #6A716C;
    --faint: #9AA09B;
    --hairline: #E6E4DB;
    --mark: #F8E24A;
    --mark-soft: #FBF3C0;
    --pine: #1D5C49;
}

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

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

body {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Spectral', Georgia, serif;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--pine);
    text-decoration: none;
}

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

.shell {
    width: 100%;
    max-width: 52rem;
    margin: 0 auto;
    padding: 0 1.75rem;
}

/* nav */
header {
    padding: 1.9rem 0 0;
}

body.doc header {
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 1.4rem;
}

.nav {
    display: flex;
    justify-content: flex-end;
    gap: 1.8rem;
}

.nav a {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted);
    padding-bottom: 2px;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

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

/* home hero */
body.home main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 3.5rem 0 4rem;
}

.hero {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
    gap: 3.5rem;
}

.eyebrow {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 1.4rem;
}

.hero h1 {
    font-size: clamp(1.35rem, 4vw, 1.6rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.01em;
    margin-bottom: 1.3rem;
}

.tagline {
    font-size: clamp(1.15rem, 2.2vw, 1.4rem);
    font-weight: 300;
    line-height: 1.5;
    max-width: 30em;
    margin-bottom: 2.2rem;
}

mark {
    color: inherit;
    font-weight: 400;
    padding: 0.02em 0.1em;
    background-color: transparent;
    background-image: linear-gradient(100deg,
        rgba(248, 226, 74, 0) 0.8%,
        rgba(248, 226, 74, 0.9) 3%,
        rgba(248, 226, 74, 0.5) 97%,
        rgba(248, 226, 74, 0) 99%);
    background-repeat: no-repeat;
    background-size: 100% 40%;
    background-position: 0 88%;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

@media (prefers-reduced-motion: no-preference) {
    .tagline mark {
        background-size: 0% 40%;
        animation: sweep 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
        animation-delay: 0.5s;
    }

    @keyframes sweep {
        to { background-size: 100% 40%; }
    }
}

.affiliation {
    font-size: 1rem;
    color: var(--ink);
    margin-bottom: 2.4rem;
}

.affiliation .sep {
    color: var(--faint);
    margin: 0 0.5rem;
}

.proof {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.6rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--muted);
    padding-top: 1.6rem;
    border-top: 1px solid var(--hairline);
}

.proof b {
    color: var(--ink);
    font-weight: 500;
}

.hero-cta {
    margin-top: 2.4rem;
}

.hero-cta a {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--mark);
    padding-bottom: 3px;
    transition: background 0.2s ease;
}

.hero-cta a:hover {
    background: var(--mark-soft);
}

.portrait {
    flex: none;
    width: 11rem;
    height: 16.5rem;
    object-fit: cover;
    object-position: center 30%;
    filter: grayscale(1) contrast(1.03);
    border: 1px solid var(--hairline);
    box-shadow: -0.6rem 0.6rem 0 var(--mark-soft);
    transition: filter 0.4s ease;
}

.portrait:hover {
    filter: grayscale(0) contrast(1);
}

/* document pages */
.page-head {
    padding: 4rem 0 1rem;
}

.page-head h1 {
    font-size: clamp(1.9rem, 4vw, 2.6rem);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.01em;
    margin: 0.7rem 0 0.6rem;
}

.page-head .eyebrow {
    margin-bottom: 0;
    color: var(--muted);
}

.page-head p {
    color: var(--muted);
    max-width: 40em;
}

section {
    border-top: 1px solid var(--hairline);
    padding: 3.2rem 0;
}

section:first-of-type {
    border-top: none;
}

section h2 {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1.8rem;
}

section h2::before {
    content: '';
    display: inline-block;
    width: 0.6em;
    height: 0.6em;
    background: var(--mark);
    margin-right: 0.7em;
}

/* feature card */
.feature {
    display: block;
    border: 1px solid var(--hairline);
    padding: 1.8rem 2rem;
}

.feature + .feature {
    margin-top: 1.4rem;
}

.feature h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.feature .kicker {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.7rem;
}

.feature p {
    color: var(--muted);
    max-width: 42em;
}

.feature-links {
    margin-top: 1.3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
}

.feature-links a {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--mark);
    padding-bottom: 2px;
    transition: background 0.2s ease;
}

.feature-links a:hover {
    background: var(--mark-soft);
}

/* research areas */
.areas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 2.2rem;
}

.areas h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.areas p {
    font-size: 0.98rem;
    color: var(--muted);
}

/* list rows: publications, writings */
.row {
    display: grid;
    grid-template-columns: 8.5rem 1fr auto;
    gap: 0.3rem 1.6rem;
    align-items: baseline;
    padding: 1.05rem 0.8rem;
    border-top: 1px solid var(--hairline);
    transition: background 0.15s ease;
}

.row:last-of-type {
    border-bottom: 1px solid var(--hairline);
}

.row:hover {
    background: var(--mark-soft);
}

.row .meta,
.row .cites {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.row .title {
    font-size: 1.05rem;
    font-weight: 500;
}

.row .note {
    grid-column: 2;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--muted);
}

.row-more {
    margin-top: 1.6rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.inline-link {
    border-bottom: 1px solid var(--mark);
}

.inline-link:hover {
    background: var(--mark-soft);
}

/* footer */
footer {
    border-top: 1px solid var(--hairline);
    padding: 2.2rem 0 2.6rem;
    margin-top: 2rem;
}

body.home footer {
    border-top: none;
    margin-top: 0;
    padding: 1.6rem 0 2.2rem;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.6rem 1.6rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--faint);
}

.footer-row ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
}

.footer-row a {
    color: var(--muted);
    transition: color 0.2s ease;
}

.footer-row a:hover {
    color: var(--ink);
}

@media (max-width: 40rem) {
    .hero {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .portrait {
        order: -1;
        width: 8.5rem;
        height: 12.75rem;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 0.15rem;
    }

    .row .note {
        grid-column: 1;
    }
}

/* breadcrumb (nested pages) */
.breadcrumb {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--faint);
    padding-top: 2.4rem;
}

.breadcrumb a {
    color: var(--muted);
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--ink);
    border-color: var(--mark);
}

/* transcript picker (index + provider hubs) */
.pick {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem;
}

.pick a {
    display: block;
    border: 1px solid var(--hairline);
    border-left: 3px solid var(--mark);
    padding: 1.5rem 1.6rem;
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.pick a:hover {
    background: var(--mark-soft);
}

/* transcript file list (leaves) */
.count {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 1.6rem;
}

.tlist {
    list-style: none;
}

.tlist li a {
    display: block;
    padding: 0.75rem 0.8rem;
    border-top: 1px solid var(--hairline);
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--ink);
    word-break: break-word;
    transition: background 0.15s ease;
}

.tlist li:last-child a {
    border-bottom: 1px solid var(--hairline);
}

.tlist li a:hover {
    background: var(--mark-soft);
}

/* mentees & collaborators list */
.people {
    list-style: none;
    padding-left: 0;
}

.people li {
    padding: 0.22rem 0;
    line-height: 1.5;
    font-size: 0.9rem;
    color: var(--muted);
}

.people .who {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 500;
}

.people .sep {
    color: var(--faint);
    margin: 0 0.45rem;
}

/* subtle section permalinks */
section h2 {
    scroll-margin-top: 1.5rem;
}

section h2 .permalink {
    margin-left: 0.55rem;
    color: var(--faint);
    font-weight: 400;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, color 0.2s ease;
}

section h2:hover .permalink,
section h2 .permalink:focus-visible {
    opacity: 1;
}

section h2 .permalink:hover {
    color: var(--pine);
}

/* home builder intro */
.intro {
    font-size: clamp(0.98rem, 1.2vw, 1.05rem);
    line-height: 1.7;
    color: #3C423D;
    max-width: 34em;
}

.intro + .intro {
    margin-top: 1.2rem;
}

.org {
    white-space: nowrap;
}

.orglogo {
    height: 0.62em;
    width: auto;
    vertical-align: -0.02em;
    margin-left: 0.3em;
}

/* footer social icons */
.social {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.social a {
    display: inline-flex;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.social a:hover {
    opacity: 1;
}

.social img {
    height: 1rem;
    width: auto;
    display: block;
}

/* mentee-list logos a touch larger than the hero ones */
.people .orglogo {
    height: 0.95em;
    vertical-align: -0.16em;
    margin-left: 0.35em;
}

/* inline links inside the builder intro */
.intro a {
    color: inherit;
    border-bottom: 1px solid var(--mark);
    transition: background 0.2s ease;
}

.intro a:hover {
    background: var(--mark-soft);
}

/* long-form essay */
.dek {
    font-size: clamp(1.1rem, 1.8vw, 1.3rem);
    font-weight: 300;
    line-height: 1.5;
    color: var(--muted);
    max-width: 34em;
    margin-top: 0.7rem;
}

.post-figure {
    margin: 1.8rem 0 2.6rem;
}

.post-figure img {
    display: block;
    width: 100%;
    max-width: 34rem;
    height: auto;
    border: 1px solid var(--hairline);
}

.post-figure figcaption {
    font-family: 'IBM Plex Mono', ui-monospace, monospace;
    font-size: 0.75rem;
    color: var(--muted);
    margin-top: 0.6rem;
}

.post {
    max-width: 40em;
    padding-bottom: 1rem;
}

.post p {
    margin-bottom: 1.15rem;
    font-size: 1.08rem;
    line-height: 1.78;
    color: #3C423D;
}

.post h2 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--ink);
    letter-spacing: -0.01em;
    margin: 2.6rem 0 1rem;
}

.post a {
    color: inherit;
    border-bottom: 1px solid var(--mark);
    transition: background 0.2s ease;
}

.post a:hover {
    background: var(--mark-soft);
}

/* intro line under a section heading */
.lede-note {
    color: var(--muted);
    max-width: 42em;
    font-size: 0.9rem;
    margin-bottom: 1.8rem;
}
