/* ─── DESIGN TOKENS ─── */
:root {
    --bg: #FCFCFC;
    --bg-elevated: #F5F5F3;
    --bg-card: #F9F9F7;
    --border: #E8E8E4;
    --border-strong: #D4D4CE;
    --rule: #EFEFEB;
    --ink: #111110;
    --ink-soft: #3A3A37;
    --ink-muted: #6B6B66;
    --ink-faint: #A8A8A2;
    --accent: #C41230;
    --accent-soft: rgba(196, 18, 48, 0.06);
    --accent-line: rgba(196, 18, 48, 0.2);
    --sans: 'Geist', -apple-system, system-ui, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
    --max-w: 1100px;
    --reading-w: 720px;
    --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    font-weight: 400;
    overflow-x: hidden;
    font-feature-settings: "ss01", "cv11";
}
::selection { background: var(--ink); color: var(--bg); }

img, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

/* ─── NAV ─── */
nav.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    padding: 1.25rem 2rem;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(252, 252, 252, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease, padding 0.3s ease;
}
nav.site-nav.scrolled {
    border-bottom-color: var(--border);
    padding: 0.85rem 2rem;
}

.nav-logo {
    font-family: var(--sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.nav-logo::before {
    content: '';
    width: 9px; height: 9px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
}

.nav-links { display: flex; gap: 2rem; list-style: none; align-items: center; }
.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-soft);
    transition: color 0.2s ease;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); }

.nav-mobile-toggle {
    display: none; background: none; border: none;
    cursor: pointer; padding: 0.5rem;
}
.nav-mobile-toggle span {
    display: block; width: 22px; height: 1.5px;
    background: var(--ink); margin: 5px 0; transition: 0.3s;
}

/* ─── BUTTONS / LINKS ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--ink);
    padding: 0.7rem 1.25rem;
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg);
}
.btn:hover { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }

/* ─── COMMON SECTION ─── */
.section-label {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.section-label::before {
    content: '';
    width: 6px; height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

/* ─── HOME HERO ─── */
.home-hero {
    padding: 8rem 2rem 4rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.home-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-bottom: 2.5rem;
    padding: 0.45rem 0.85rem 0.45rem 0.7rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
}
.home-hero-status .dot {
    width: 7px; height: 7px;
    background: #22C55E;
    border-radius: 50%;
    box-shadow: 0 0 0 0 #22C55E;
    animation: pulse 2.5s ease-out infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.home-hero h1 {
    font-size: clamp(2.6rem, 5.5vw, 4.2rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.home-hero p {
    font-size: clamp(1.05rem, 1.3vw, 1.2rem);
    color: var(--ink-soft);
    line-height: 1.6;
    max-width: 620px;
    margin-bottom: 2rem;
}
.home-hero p strong { color: var(--ink); font-weight: 600; }

.home-hero-links { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* ─── PROJECTS GRID ─── */
.projects-section {
    padding: 4rem 2rem 6rem;
    max-width: var(--max-w);
    margin: 0 auto;
}

.projects-section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}
.projects-section-head h2 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.projects-section-head .count {
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-muted);
}

/* Second section (Home lab) sits directly under the first: no double padding */
.projects-section + .projects-section { padding-top: 0; }

.projects-section-sub {
    margin: -1.75rem 0 2.5rem;
    max-width: 60ch;
    color: var(--ink-soft);
    line-height: 1.6;
}
.projects-section-sub a {
    color: var(--accent);
    font-weight: 500;
    white-space: nowrap;
    text-decoration: underline;
    text-decoration-color: var(--accent-line);
    text-underline-offset: 2px;
}
.projects-section-sub a:hover { text-decoration-color: var(--accent); }

/* Grouped "hub" project pages (CMU / Rose-Hulman): many small projects per page */
.coursework-group { margin: 2.5rem 0; }
.coursework-group > h2 {
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.coursework-item {
    padding: 1.6rem 0;
    border-bottom: 1px solid var(--border);
}
.coursework-group .coursework-item:last-child { border-bottom: none; }
.coursework-course {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}
.coursework-item h3 {
    font-size: 1.18rem;
    letter-spacing: -0.02em;
    margin: 0.3rem 0 0.55rem;
}
.coursework-item h3 a {
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.15s ease;
}
.coursework-item h3 a:hover { border-color: var(--accent); }
.coursement-item p,
.coursework-item p {
    color: var(--ink-soft);
    line-height: 1.65;
    margin-bottom: 0.75rem;
    max-width: var(--reading-w);
}
.coursework-item .project-page-tags { margin-top: 0.25rem; }
.coursework-item-links { margin-top: 0.6rem; font-size: 0.9rem; }
.coursework-item-links a { color: var(--accent); }

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.project-card {
    display: block;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s var(--ease);
    color: inherit;
}
.project-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(17, 17, 16, 0.06);
}
.project-card.featured { grid-column: span 2; }
.project-card.featured .project-thumb { height: 280px; }
@media (max-width: 768px) {
    .project-card.featured { grid-column: span 1; }
    .project-card.featured .project-thumb { height: 180px; }
}

.project-thumb {
    height: 200px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}
.project-thumb img, .project-thumb video {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}
.project-card:hover .project-thumb img,
.project-card:hover .project-thumb video {
    transform: scale(1.03);
}
/* Card thumbnail: centered logo instead of a cropped photo */
.project-thumb.thumb-logo { background: var(--bg-elevated); }
.project-thumb.thumb-logo img {
    width: auto; height: auto;
    max-width: 46%; max-height: 48%;
    object-fit: contain;
}
/* Card thumbnail: two logos side by side */
.project-thumb.thumb-logo-pair {
    background: var(--bg-elevated);
    gap: 1.75rem;
}
.project-thumb.thumb-logo-pair img {
    width: auto; height: auto;
    max-width: 30%; max-height: 42%;
    object-fit: contain;
}

/* Card thumbnail: mosaic of project images behind a centred logo badge */
.project-thumb.thumb-mosaic { background: var(--bg-elevated); }
.project-thumb.thumb-mosaic .mosaic-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 3px;
}
.project-thumb.thumb-mosaic .mosaic-grid img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.project-thumb.thumb-mosaic::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 16, 0.42);
    z-index: 1;
    transition: background 0.4s var(--ease);
}
.project-card:hover .project-thumb.thumb-mosaic::after {
    background: rgba(17, 17, 16, 0.3);
}
.project-thumb.thumb-mosaic .mosaic-badge {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 92px; height: 92px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(17, 17, 16, 0.28);
    z-index: 2;
    transition: transform 0.4s var(--ease);
}
.project-card:hover .project-thumb.thumb-mosaic .mosaic-badge {
    transform: translate(-50%, -50%) scale(1.06);
}
.project-thumb.thumb-mosaic .mosaic-badge img {
    width: 62%; height: 62%;
    object-fit: contain;
    transform: none;
}
.project-card:hover .project-thumb.thumb-mosaic .mosaic-badge img { transform: none; }
@media (max-width: 768px) {
    .project-thumb.thumb-mosaic .mosaic-badge { width: 72px; height: 72px; }
}

.project-thumb-placeholder {
    font-size: 3rem;
    opacity: 0.4;
    user-select: none;
    filter: grayscale(0.6);
    transition: transform 0.4s var(--ease);
}
.project-card:hover .project-thumb-placeholder { transform: scale(1.05); }

.project-body { padding: 1.5rem; }
.project-category {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--accent);
    margin-bottom: 0.75rem;
    font-weight: 500;
}
.project-title {
    font-size: 1.2rem;
    letter-spacing: -0.025em;
    margin-bottom: 0.65rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--ink);
}
.project-desc {
    font-size: 0.93rem;
    color: var(--ink-soft);
    line-height: 1.65;
    margin-bottom: 1rem;
}
.project-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.tag {
    font-size: 0.78rem;
    color: var(--ink-soft);
    background: var(--bg-card);
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-weight: 500;
}

/* ─── PROJECT DETAIL PAGE ─── */
.project-page {
    padding: 7rem 2rem 6rem;
    max-width: var(--reading-w);
    margin: 0 auto;
}

/* Hub pages (index of many projects): wide enough for a real card grid,
   while prose stays at reading width so lines don't run long. */
.project-page.hub { max-width: var(--max-w); }
.project-page.hub .project-page-header,
.project-page.hub > section,
.project-page.hub > p { max-width: var(--reading-w); }

.hub-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px)  { .hub-grid { grid-template-columns: 1fr; } }
.hub-grid .project-card.featured { grid-column: span 1; }
.hub-grid .project-card.featured .project-thumb { height: 200px; }

.project-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--mono);
    font-size: 0.82rem;
    color: var(--ink-muted);
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}
.project-back:hover { color: var(--accent); }
.project-back::before { content: '←'; }

.project-page-header { margin-bottom: 3rem; }
.project-page-category {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    margin-bottom: 1rem;
    font-weight: 500;
}
.project-page-category-with-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.project-page-category-with-logo .project-page-category { margin-bottom: 0; }
.project-company-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
}
.project-page h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 1rem;
    font-weight: 700;
}
.project-page-summary {
    font-size: 1.15rem;
    color: var(--ink-soft);
    line-height: 1.55;
}

.project-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.project-meta-item .label {
    display: block;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
.project-meta-item .value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--ink);
}

.project-page section {
    margin-bottom: 3rem;
}
.project-page h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    line-height: 1.2;
}
.project-page p {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1rem;
}
.project-page p strong { color: var(--ink); font-weight: 600; }

.project-page ul {
    color: var(--ink-soft);
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}
.project-page ul li { margin-bottom: 0.4rem; }

.project-page figure {
    margin: 2rem 0;
}
.project-page figure img,
.project-page figure video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
}
.project-page figcaption {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-top: 0.75rem;
    text-align: center;
}

.video-embed {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin: 2rem 0;
    background: var(--bg-elevated);
}
.video-embed iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: 0;
}
/* Two-up grid of embedded videos */
.video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 2rem 0;
}
.video-grid figure { margin: 0; }
.video-grid .video-embed { margin: 0; }
@media (max-width: 600px) {
    .video-grid { grid-template-columns: 1fr; }
}

.code-block {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--ink);
    overflow-x: auto;
    line-height: 1.6;
    margin: 1.5rem 0;
}

/* Data tables: experiment matrices, results, benchmarks.
   Always wrap in .data-table-wrap so wide tables scroll themselves
   instead of pushing the page sideways. */
.data-table-wrap {
    overflow-x: auto;
    margin: 1.75rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.5;
}
.data-table th,
.data-table td {
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.data-table thead th {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--ink-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table caption {
    caption-side: top;
    text-align: left;
    font-family: var(--mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    background: var(--bg-elevated);
    padding: 0.75rem 0.9rem 0.55rem;
    border-bottom: 1px solid var(--border);
}
/* First column of a matrix: the factor being varied. Shrink to content and
   tint it so grouped rowspan cells read as labels rather than data. */
.data-table td.factor {
    width: 1%;
    font-weight: 600;
    color: var(--ink);
    white-space: nowrap;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
}
/* Stronger rule where a new factor group begins */
.data-table tbody tr.group-start > td { border-top: 1px solid var(--border-strong); }
/* The trained condition everything else is measured against */
.data-table .baseline td { background: var(--accent-soft); }
.data-table .baseline td.factor { background: var(--accent-soft); }

.data-table .outcome { white-space: nowrap; }
.data-table .cell-note {
    display: block;
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--ink-muted);
    white-space: normal;
    margin-top: 0.2rem;
}
.pass, .fail, .untested { font-weight: 600; }
.pass { color: #2C7A4B; }
.fail { color: #A93B26; }
.untested { color: var(--ink-faint); font-weight: 500; }
.pass::before     { content: '✓ '; }
.fail::before     { content: '✗ '; }
.untested::before { content: '○ '; }

/* References / further reading, for pages that lean on outside work */
.references {
    list-style: none;
    counter-reset: ref;
    margin: 1.25rem 0 0;
    padding: 0;
}
.references li {
    position: relative;
    counter-increment: ref;
    padding-left: 2.4rem;
    margin-bottom: 0.75rem;
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ink-soft);
}
.references li::before {
    content: '[' counter(ref) ']';
    position: absolute;
    left: 0;
    top: 0.1rem;
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--ink-faint);
}
.references li:last-child { margin-bottom: 0; }
.references a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 2px;
}
.references a:hover { color: var(--accent); text-decoration-color: var(--accent); }
.references .ref-note {
    display: block;
    color: var(--ink-muted);
    font-size: 0.82rem;
    margin-top: 0.15rem;
}

/* ─── TIMELINE ─── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
    content: '';
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    width: 1px;
    background: var(--border-strong);
}
@media (min-width: 861px) {
    .timeline::before { left: 189px; }
}

.tl-item {
    position: relative;
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: 0 2.25rem;
    padding-bottom: 2.5rem;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
    content: '';
    position: absolute;
    left: 183px; top: 7px;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--border-strong);
    z-index: 1;
    transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.tl-item.now::before { border-color: var(--accent); background: var(--accent); }

.tl-when {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--ink-muted);
    text-align: right;
    padding-top: 0.1rem;
    white-space: nowrap;
}
.tl-where {
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.3;
}
.tl-role {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
    margin-top: 0.15rem;
}
.tl-body > p {
    color: var(--ink-soft);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 0.55rem;
    max-width: 62ch;
}

.tl-links {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(232px, 1fr));
    gap: 0.15rem 1.5rem;
}
.tl-links a {
    display: block;
    padding: 0.34rem 0;
    font-size: 0.9rem;
    color: var(--ink-soft);
    border-bottom: 1px solid var(--rule);
    transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}
.tl-links a::before { content: '↳'; color: var(--ink-faint); margin-right: 0.5rem; font-size: 0.8rem; }
.tl-links a:hover { color: var(--accent); padding-left: 4px; }
.tl-links a:hover::before { color: var(--accent); }
.tl-links .tl-note { color: var(--ink-faint); }

/* Dated project rows inside a timeline era */
.tl-projects { list-style: none; margin: 0.9rem 0 0; padding: 0; }
.tl-projects li { border-bottom: 1px solid var(--rule); }
.tl-projects li:last-child { border-bottom: none; }
.tl-projects a {
    display: grid;
    grid-template-columns: 158px 76px 1fr;
    gap: 0 1.05rem;
    align-items: center;
    padding: 0.4rem 0;
    transition: padding-left 0.18s var(--ease);
}
.tl-projects a:hover { padding-left: 5px; }
.tp-date {
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--ink-faint);
    white-space: nowrap;
}
.tp-title {
    font-size: 0.93rem;
    font-weight: 500;
    color: var(--ink-soft);
    line-height: 1.35;
    transition: color 0.18s var(--ease);
}
.tl-projects a:hover .tp-title { color: var(--accent); }
.tp-note { color: var(--ink-faint); font-weight: 400; }
/* Nested projects under a hub entry */
.tl-sub { list-style: none; margin: 0 0 0.35rem 158px; padding: 0 0 0 0.9rem; border-left: 1px solid var(--border); }
.tl-sub li { border-bottom: none; }
.tl-sub a { display: block; padding: 0.28rem 0; }
.tl-sub .tp-title { font-size: 0.87rem; font-weight: 400; color: var(--ink-muted); }
@media (max-width: 860px) { .tl-sub { margin-left: 0; } }

.tp-thumb {
    display: block;
    width: 72px; height: 48px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.tp-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.35s var(--ease);
}
.tl-projects a:hover .tp-thumb img { transform: scale(1.09); }
.tl-projects a:hover .tp-thumb { border-color: var(--accent-line); }
@media (max-width: 860px) {
    .tl-projects a { grid-template-columns: 72px 1fr; gap: 0 0.85rem; }
    .tp-date { grid-column: 2; font-size: 0.66rem; margin-bottom: 0.1rem; }
    .tp-thumb { grid-row: span 2; }
    .tp-title { grid-column: 2; }
}

@media (max-width: 860px) {
    .tl-item { grid-template-columns: 1fr; gap: 0; padding-left: 2rem; }
    .tl-item::before { left: 3px; top: 6px; }
    .tl-when { text-align: left; margin-bottom: 0.35rem; }
    .tl-links { grid-template-columns: 1fr; }
}

.callout {
    padding: 1.25rem 1.5rem;
    background: var(--accent-soft);
    border-left: 3px solid var(--accent);
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.65;
}
.callout strong { color: var(--ink); }

.project-page-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.project-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}
.media-grid {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
}
.media-grid-2 { grid-template-columns: 1fr 1fr; }
.media-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.media-grid figure { margin: 0; }
.media-grid figure img,
.media-grid figure video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    height: 220px;
    object-fit: cover;
}
@media (max-width: 600px) {
    .media-grid-2, .media-grid-3 { grid-template-columns: 1fr; }
    .media-grid figure img, .media-grid figure video { height: 200px; }
}
/* Sub-topic heading within a numbered project section */
.project-page h3 {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin: 2.25rem 0 0.75rem;
}

/* Problem / Approach sub-structure within a project section */
.pa { margin: 1.25rem 0; }
.pa-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    margin-bottom: 0.35rem;
}
.pa p { margin-bottom: 0; }

/* In-memoriam closer: gary.png is itself a designed memorial card */
.memorial-figure {
    margin: 4rem auto 1rem;
    max-width: 440px;
}
.memorial-figure img {
    display: block;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Diagrams & landscape video: keep natural aspect, never crop */
.fig-row {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}
.fig-row.one { grid-template-columns: 1fr; }
.fig-row figure { margin: 0; }
.fig-row figure img,
.fig-row figure video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    background: #000;
}
@media (max-width: 640px) { .fig-row { grid-template-columns: 1fr; } }

/* Portrait phone-shot videos/photos: 9:16 gallery */
.portrait-gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    margin: 2rem 0;
}
.portrait-gallery figure { margin: 0; }
.portrait-gallery figure img,
.portrait-gallery figure video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    background: #000;
}
.portrait-single { max-width: 300px; margin: 2rem auto; }
.portrait-single video {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
    background: #000;
}

.project-video-link { margin: 1.5rem 0; }
.project-hero-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    object-position: center 40%;
    border-radius: 8px;
    display: block;
}
.project-page video {
    width: 100%;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}

.project-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding-top: 3rem;
    margin-top: 4rem;
    border-top: 1px solid var(--border);
}
.project-nav a {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.2s ease;
}
.project-nav a:hover {
    border-color: var(--ink);
    background: var(--bg-card);
}
.project-nav .nav-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-muted);
    margin-bottom: 0.4rem;
}
.project-nav .nav-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink);
}
.project-nav .next { text-align: right; }
@media (max-width: 600px) {
    .project-nav { grid-template-columns: 1fr; }
    .project-nav .next { text-align: left; }
}

/* ─── ABOUT PAGE ─── */
.about-page {
    padding: 7rem 2rem 6rem;
    max-width: var(--reading-w);
    margin: 0 auto;
}
.about-page h1 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    line-height: 1.1;
    letter-spacing: -0.035em;
    margin-bottom: 2rem;
    font-weight: 700;
}
.about-page p {
    color: var(--ink-soft);
    font-size: 1.05rem;
    line-height: 1.75;
    margin-bottom: 1.25rem;
}
.about-page p strong { color: var(--ink); font-weight: 600; }
.about-page h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}
.about-hero {
    margin-bottom: 2.5rem;
}
.about-photo {
    width: 100%;
    max-height: 560px;
    object-fit: cover;
    object-position: center 50%;
    border-radius: 8px;
    display: block;
}
.edu-entry {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}
.edu-logo-link { flex-shrink: 0; }
.edu-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    margin-top: 0.15rem;
    opacity: 0.9;
}
.edu-entry p { margin-bottom: 0; }
.edu-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    justify-content: center;
}
.edu-text strong { color: var(--ink); font-size: 1rem; }
.edu-meta {
    font-size: 0.875rem;
    color: var(--ink-muted);
    font-family: var(--mono);
}
.edu-desc {
    font-size: 0.95rem;
    color: var(--ink-soft);
    line-height: 1.6;
    margin-top: 0.1rem;
}
.about-page p a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--border); }
.about-page p a:hover { text-decoration-color: var(--ink); }
.about-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

/* ─── FOOTER ─── */
footer.site-footer {
    text-align: center;
    padding: 2.5rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--ink-muted);
    font-family: var(--mono);
    font-size: 0.78rem;
    margin-top: 4rem;
}
footer.site-footer a {
    color: var(--ink-soft);
    transition: color 0.2s ease;
}
footer.site-footer a:hover { color: var(--accent); }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
    nav.site-nav { padding: 1rem 1.25rem; }
    nav.site-nav.scrolled { padding: 0.75rem 1.25rem; }
    .nav-links {
        display: none; position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--bg);
        flex-direction: column;
        padding: 1.25rem;
        gap: 1rem;
        border-bottom: 1px solid var(--border);
        align-items: flex-start;
    }
    .nav-links.open { display: flex; }
    .nav-mobile-toggle { display: block; }

    .home-hero { padding: 6rem 1.25rem 3rem; }
    .projects-section { padding: 3rem 1.25rem 4rem; }
    .project-page, .about-page { padding: 6rem 1.25rem 4rem; }
}
