/* ============================================================
   Hayden Coffey — shared site styles
   Design system: ink + amber/cyan, Space Grotesk / Newsreader / JetBrains Mono
   Used by index.html and the html/ subpages.
   ============================================================ */

:root {
    --ink: #0D1017;
    --panel: #12161D;
    --line: rgba(236, 230, 216, 0.13);
    --line-strong: rgba(236, 230, 216, 0.22);
    --paper: #ECE6D8;
    --muted: #A2A9B4;
    --faint: #7A828D;
    --hot: #E8A44C;
    --cold: #5AB0C4;

    --serif: "Newsreader", Georgia, serif;
    --display: "Space Grotesk", system-ui, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, monospace;

    --maxw: 1160px;
    --readw: 720px;
}

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

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--serif);
    font-size: 1.13rem;
    line-height: 1.72;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.wrap {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 0 32px;
}

a {
    color: var(--hot);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover,
a:focus-visible {
    color: #f4c079;
}

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

/* ---------- Eyebrow / section labels ---------- */
.eyebrow {
    font-family: var(--mono);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cold);
    margin: 0;
}

.section-label {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--cold);
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 0 0 34px;
}

.section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line-strong);
}

section {
    padding: 58px 0;
    border-top: 1px solid var(--line);
    scroll-margin-top: 28px;
}

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

/* ---------- Hero (home page) ---------- */
.hero {
    padding: clamp(56px, 11vh, 116px) 0 52px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: center;
}

.hero-name {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.9rem, 8vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    margin: 16px 0 0;
    color: var(--paper);
}

.hero-thesis {
    font-family: var(--serif);
    font-size: clamp(1.3rem, 2.6vw, 1.62rem);
    line-height: 1.5;
    color: var(--paper);
    margin: 24px 0 0;
    max-width: 32ch;
}

.hero-thesis .em {
    color: var(--hot);
    font-style: italic;
}

.portrait {
    width: clamp(200px, 44vw, 400px);
    height: clamp(200px, 44vw, 400px);
    border-radius: 14px;
    object-fit: cover;
    filter: grayscale(0.15);
    border: 1px solid var(--line-strong);
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 22px;
    margin: 30px 0 0;
    font-family: var(--mono);
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.hero-meta {
    margin: 20px 0 0;
    font-family: var(--mono);
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
}

.hero-meta .dot {
    color: var(--faint);
}

.updated {
    margin: 14px 0 0;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: var(--faint);
}

/* ---------- Subpage header ---------- */
.subhead {
    padding: clamp(40px, 8vh, 84px) 0 40px;
}

.back-link {
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.03em;
    color: var(--muted);
    display: inline-block;
    margin: 0 0 24px;
}

.back-link:hover,
.back-link:focus-visible {
    color: var(--hot);
}

.page-title {
    font-family: var(--display);
    font-weight: 600;
    font-size: clamp(2.4rem, 6vw, 3.5rem);
    line-height: 1.04;
    letter-spacing: -0.02em;
    margin: 8px 0 0;
    color: var(--paper);
}

/* ---------- Prose ---------- */
.prose p {
    margin: 0 0 20px;
    color: #ddd7ca;
}

.prose p:last-child {
    margin-bottom: 0;
}

/* ---------- Publications ---------- */
.pub {
    margin: 0 0 36px;
}

.pub:last-child {
    margin-bottom: 0;
}

.pub-title {
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.34rem;
    line-height: 1.32;
    margin: 0 0 7px;
}

.pub-title a {
    color: var(--paper);
    background-image: linear-gradient(var(--hot), var(--hot));
    background-size: 0% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
    transition: background-size 0.25s ease, color 0.15s ease;
}

.pub-title a:hover,
.pub-title a:focus-visible {
    color: var(--hot);
    background-size: 100% 1px;
}

.pub-authors {
    margin: 0;
    font-size: 1.06rem;
    color: var(--muted);
    line-height: 1.5;
}

.pub-authors .me {
    color: var(--paper);
    font-weight: 500;
}

.pub-venue {
    margin: 6px 0 0;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
}

/* ---------- Roles (experience / education) ---------- */
.entry {
    margin: 0 0 32px;
}

.entry:last-child {
    margin-bottom: 0;
}

.entry-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.entry-title {
    font-family: var(--display);
    font-weight: 500;
    font-size: 1.2rem;
    letter-spacing: -0.01em;
    margin: 0;
    color: var(--paper);
}

.entry-when {
    flex: none;
    font-family: var(--mono);
    font-size: 0.8rem;
    letter-spacing: 0.03em;
    color: var(--faint);
    white-space: nowrap;
}

.entry-when .now {
    color: var(--hot);
}

.entry-org {
    margin: 4px 0 0;
    font-size: 1.06rem;
    color: var(--cold);
}

.entry-desc {
    margin: 9px 0 0;
    font-size: 1.05rem;
    color: var(--muted);
    line-height: 1.55;
}

.entry-desc a {
    color: var(--muted);
    text-decoration: underline;
    text-decoration-color: var(--line-strong);
    text-underline-offset: 2px;
}

.entry-desc a:hover {
    color: var(--hot);
    text-decoration-color: var(--hot);
}

/* ---------- Reference / link lists (subpages) ---------- */
.reflist {
    list-style: none;
    counter-reset: item;
    margin: 0;
    padding: 0;
}

.reflist > li {
    counter-increment: item;
    position: relative;
    padding: 0 0 18px 48px;
    margin: 0 0 18px;
    border-bottom: 1px solid var(--line);
    font-size: 1.06rem;
    line-height: 1.6;
    color: #ddd7ca;
}

.reflist > li:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.reflist > li::before {
    content: counter(item, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: 0.32em;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--cold);
}

.reflist b {
    color: var(--paper);
    font-weight: 500;
}

.reflist p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 1.0rem;
    line-height: 1.55;
}

/* ---------- Footer ---------- */
footer {
    padding: 48px 0 64px;
    border-top: 1px solid var(--line);
}

.foot-note {
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 0.03em;
    color: var(--faint);
    margin: 0;
}

/* ---------- Layout with outline panel ---------- */
.layout {
    display: grid;
    grid-template-columns: 208px minmax(0, 1fr);
    gap: 60px;
    align-items: start;
}

.panel {
    position: sticky;
    top: 40px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    padding: 22px 24px 24px;
    font-family: var(--mono);
}

.panel-label {
    font-size: 0.74rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cold);
    margin: 0 0 12px;
}

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

.panel-sep {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 22px 0;
}

.outline a {
    display: block;
    padding: 6px 0 6px 13px;
    border-left: 2px solid transparent;
    color: var(--muted);
    font-size: 0.88rem;
    letter-spacing: 0.01em;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.outline a:hover,
.outline a:focus-visible {
    color: var(--paper);
}

.outline a.active {
    color: var(--hot);
    border-left-color: var(--hot);
}

.panel-links a {
    display: block;
    padding: 6px 0;
    color: var(--muted);
    font-size: 0.88rem;
    transition: color 0.15s ease;
}

.panel-links a:hover,
.panel-links a:focus-visible {
    color: var(--hot);
}

/* ---------- Motion ---------- */
.js .reveal {
    opacity: 0;
    transform: translateY(14px);
}

.js .reveal.in {
    opacity: 1;
    transform: none;
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

    .js .reveal.in {
        transition: none;
    }

    a,
    .pub-title a {
        transition: none;
    }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
    .layout {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .panel {
        position: static;
    }
}

@media (max-width: 560px) {
    html {
        font-size: 16px;
    }

    .wrap {
        padding: 0 22px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .portrait {
        order: -1;
    }

    .entry-head {
        flex-direction: column;
        gap: 2px;
    }
}
