@font-face { font-family: Inter; src: url('/fonts/inter-latin.woff2') format('woff2'); font-style: normal; font-weight: 100 900; font-display: swap; }
@font-face { font-family: Spectral; src: url('/fonts/spectral-400-latin.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: Spectral; src: url('/fonts/spectral-400i-latin.woff2') format('woff2'); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: Spectral; src: url('/fonts/spectral-600-latin.woff2') format('woff2'); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); font-style: normal; font-weight: 400 700; font-display: swap; }

:root {
    color-scheme: light;
    --bg: #faf9f7;
    --text: #272923;
    --secondary: #63655f;
    --accent: #4e6483;
    --rule: #deded7;
    --wash: #f0f0ea;
    --serif: Spectral, Georgia, serif;
    --sans: Inter, system-ui, sans-serif;
    --mono: 'JetBrains Mono', ui-monospace, monospace;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --margin: 234px;
    --gutter: 64px;
    --track: 40px;
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #1b1e25;
    --text: #eee9e0;
    --secondary: #b1b3ba;
    --accent: #a5b9d8;
    --rule: #393e47;
    --wash: #262b34;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: 40px; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
body, .theme-toggle { transition: background-color .25s ease, color .25s ease; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 400; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button[hidden] { display: none; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
main:focus { outline: none; }
.wrap { width: min(1040px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: fixed; top: 12px; left: 12px; z-index: 5; padding: 10px 18px; background: var(--text); color: var(--bg); transform: translateY(-160%); }
.skip-link:focus { transform: none; }

/* Page shell: main column plus a true margin column. Notes and the drawing live in the margin. */
.profile-block { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) var(--margin); column-gap: var(--gutter); }
.chapter { min-width: 0; }

/* Hero */
.hero { padding: 96px 0 72px; align-items: center; }
h1 { font-family: var(--serif); font-size: clamp(48px, 5vw, 66px); line-height: 1.1; letter-spacing: -2.4px; }
.name-stop { color: var(--accent); }
.intro { max-width: 600px; margin-top: 28px; font-family: var(--serif); font-size: 25px; line-height: 1.55; text-wrap: pretty; }
.text-link { display: inline-flex; align-items: center; gap: 16px; min-height: 44px; font-size: 13px; font-weight: 500; color: var(--accent); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 7px; text-decoration-thickness: 1px; transition: text-decoration-color .25s; }
.link-arrow { display: inline-block; font-size: 19px; line-height: 1; transition: transform .3s var(--ease); }
.text-link:hover, .text-link:focus-visible { text-decoration-color: var(--accent); }
.text-link:hover .link-arrow { transform: translate(3px, -3px); }
.location { padding-bottom: 6px; }
.canal-houses { display: block; width: var(--margin); height: auto; color: var(--accent); margin-bottom: 18px; }
.location-city { font-family: var(--serif); font-style: italic; font-size: 23px; }
.location-note { margin-top: 4px; color: var(--secondary); font-size: 12px; line-height: 1.8; }

/* Section rail: the page's map, outside the reading column. */
.section-nav { position: fixed; top: 152px; right: calc(50% + 548px); display: grid; z-index: 2; }
.section-nav::before { content: ''; position: absolute; top: 20px; bottom: 20px; right: 2px; width: 1px; background: var(--rule); }
.nav-logo { min-height: 64px; margin-bottom: 4px; }
.nav-logo img { display: block; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--bg); box-sizing: border-box; }
:root:not([data-theme="dark"]) .nav-logo img { content: url('/images/logo-sidebar-dark.png'); }
.section-nav a[aria-current] img { border-color: var(--accent); }
.section-nav a { position: relative; display: flex; align-items: center; justify-content: flex-end; gap: 14px; min-height: 40px; color: var(--secondary); font-size: 11px; letter-spacing: .2px; white-space: nowrap; transition: color .2s; }
.section-nav a::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--bg); border: 1px solid var(--secondary); box-sizing: content-box; transition: background .2s, border-color .2s, box-shadow .2s; }
.section-nav a:hover { color: var(--text); }
.section-nav a[aria-current] { color: var(--accent); }
.section-nav a[aria-current]::after { border-color: var(--accent); }
/* One marker slides between stops instead of each dot switching on and off. */
.nav-marker { position: absolute; right: 0; top: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); transform: translateY(-50%); transition: top .45s var(--ease); }
.section-nav:not(.has-marker) .nav-marker { display: none; }
.section-nav:not(.has-marker) a[aria-current]::after { background: var(--accent); }

/* Chapters */
.chapter-heading { padding-bottom: 8px; }
h2 { font-family: var(--serif); font-size: 30px; line-height: 1.25; letter-spacing: -.6px; }
.chapter-heading > p { margin-top: 8px; font-size: 14px; color: var(--secondary); }
#career { padding-top: 24px; }

/* Timeline: one track, no boxes. The track is the structure. */
.timeline { position: relative; margin-top: 28px; padding-left: var(--track); }
.timeline::before { content: ''; position: absolute; left: 4px; top: 26px; bottom: 10px; width: 1px; background: var(--rule); }
.role { position: relative; }
.role::before { content: ''; position: absolute; left: calc(-1 * var(--track) + 1px); top: 27px; width: 7px; height: 7px; border: 1px solid var(--secondary); border-radius: 50%; background: var(--bg); transition: background .25s, border-color .25s, box-shadow .25s; }
.current-role::before { top: 25px; background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.role-heading { position: relative; padding: 20px 0; }
.role-meta { display: flex; align-items: center; gap: 14px; color: var(--secondary); font-family: var(--mono); font-size: 11px; line-height: 1.5; letter-spacing: .1px; }
.role h3 { font-family: var(--serif); font-size: 26px; line-height: 1.3; margin: 6px 0 2px; letter-spacing: -.4px; transition: color .2s; }
.role-subtitle { display: block; color: var(--secondary); font-size: 13px; line-height: 1.6; }
.role-body { padding: 2px 0 26px; max-width: 560px; }
.story > p { font-size: 15.5px; line-height: 1.8; color: var(--secondary); text-wrap: pretty; }
.current-role .story > p { color: var(--text); }
.story > p + p { margin-top: 16px; }
.timeline-note { position: relative; padding: 6px 0 6px; font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--secondary); }
.timeline-note::before { content: ''; position: absolute; left: calc(-1 * var(--track) + 4px); top: 50%; width: 14px; height: 1px; background: var(--rule); }

/* Collapsed roles: the whole heading is the control; hover lights the dot and name together. */
summary { cursor: pointer; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary.role-heading { margin-inline: -16px; padding-inline: 16px 56px; border-radius: 8px; transition: background-color .2s; }
summary.role-heading:hover { background: var(--wash); }
.role:has(> summary:hover)::before, .role:has(> summary:focus-visible)::before, details[open].role::before { border-color: var(--accent); background: var(--accent); }
.role:has(> summary:hover) h3 { color: var(--accent); }
summary.role-heading:focus-visible { outline-offset: 0; }
.disclosure-icon { position: absolute; top: 50%; right: 18px; width: 12px; height: 12px; transform: translateY(-50%); color: var(--secondary); transition: color .2s; }
summary:hover .disclosure-icon { color: var(--accent); }
.disclosure-icon::before, .disclosure-icon::after { content: ''; position: absolute; top: 5px; left: 0; width: 12px; height: 1px; background: currentColor; }
.disclosure-icon::after { transform: rotate(90deg); transition: transform .35s var(--ease); }
details[open]:not([data-expanded="false"]) > summary .disclosure-icon::after { transform: rotate(0); }
details > .role-body { padding-top: 4px; }

/* Margin notes: inline asides that JavaScript lifts into the margin next to their + mark. */
.note-mark { color: var(--accent); font-family: var(--sans); font-weight: 600; font-size: 14px; margin-left: 4px; }
.margin-note { margin: 14px 0 8px; padding-left: 18px; border-left: 1px solid var(--rule); max-width: 460px; }
.margin-note p { font-family: var(--serif); font-style: italic; font-size: 17px; line-height: 1.55; color: var(--secondary); text-wrap: pretty; }
.margin-note p::before { content: '+ '; color: var(--accent); font-style: normal; font-family: var(--sans); font-weight: 600; font-size: 12px; vertical-align: 2px; margin-right: 2px; }
.margin-note.is-placed { position: absolute; width: var(--margin); margin: 0; padding: 0 12px 0 0; border: 0; max-width: none; transition: top .35s var(--ease), opacity .3s; }
.margin-note.is-placed[hidden] { display: block; opacity: 0; pointer-events: none; }
.margin-note.is-placed p { font-size: 18px; }

/* Off duty */
.personal { padding-top: 64px; }
.personal-lead { max-width: 520px; }
.interests { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--rule); }
.interests dt { font-family: var(--serif); font-size: 19px; letter-spacing: -.2px; margin-bottom: 8px; }
.interests dd { font-size: 14.5px; color: var(--secondary); line-height: 1.8; text-wrap: pretty; }

/* Sign-off */
.contact { padding: 64px 0 56px; }
.contact .chapter { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; padding-top: 28px; border-top: 1px solid var(--rule); }
.contact h2 { font-size: 24px; }
.site-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--rule); padding-block: 24px 36px; color: var(--secondary); font-size: 11px; }
.site-footer p span { margin-inline: 9px; }
.footer-actions { display: flex; align-items: center; gap: 24px; }
.theme-toggle { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--secondary); text-underline-offset: 5px; }
.theme-toggle:hover, .back-top:hover { color: var(--accent); }
.theme-toggle:hover { text-decoration: underline; }
.back-top { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; }

/* 404 */
.masthead { display: flex; align-items: center; justify-content: space-between; padding-block: 32px; }
.wordmark { display: inline-flex; align-items: center; min-height: 44px; font-size: 20px; font-weight: 600; letter-spacing: -1px; }
.wordmark span { color: var(--accent); }
.eyebrow { color: var(--secondary); font-family: var(--serif); font-style: italic; font-size: 17px; }
.not-found { min-height: 65vh; padding-block: 100px; }
.not-found h1 { margin: 12px 0 20px; }
.not-found > p:not(.eyebrow) { color: var(--secondary); margin-bottom: 24px; }

/* One load moment: the name and intro settle while the houses draw in. Nothing else moves by itself. */
@media (prefers-reduced-motion: no-preference) {
    .hero-enter { animation: enter .95s var(--ease) both; }
    h1.hero-enter { animation-delay: .07s; }
    .intro { animation-delay: .21s; }
    .location { animation-delay: .32s; }
    .canal-houses { animation: houses-enter 1.6s ease-out .2s both; }
}
@keyframes enter { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes houses-enter { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 1279px) { .section-nav { display: none; } }
@media (max-width: 1000px) {
    :root { --margin: 195px; --gutter: 40px; }
    .interests { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 760px) {
    :root { --margin: 135.2px; --track: 32px; }
    .wrap { width: calc(100% - 48px); }
    .masthead { padding-block: 20px; }
    .profile-block { grid-template-columns: 1fr; }
    .hero { padding: 48px 0 40px; row-gap: 36px; }
    h1 { font-size: clamp(46px, 9vw, 64px); letter-spacing: -2px; }
    .intro { font-size: 22px; margin-top: 22px; }
    .location { display: grid; grid-template-columns: var(--margin) 1fr; column-gap: 24px; align-items: end; padding-bottom: 0; }
    .canal-houses { grid-row: span 2; margin: 0; }
    .location-city { font-size: 21px; align-self: end; }
    .location-note { align-self: start; margin-top: 2px; }
    #career { padding-top: 16px; }
    h2 { font-size: 27px; }
    .timeline { margin-top: 22px; }
    .role h3 { font-size: 24px; }
    .role-subtitle { font-size: 12px; }
    summary.role-heading { margin-inline: -10px; padding-inline: 10px 44px; }
    .disclosure-icon { right: 12px; }
    .story > p { font-size: 15px; }
    .margin-note p { font-size: 16px; }
    .personal { padding-top: 48px; }
    .interests { gap: 22px; margin-top: 24px; }
    .interests dd { font-size: 15px; max-width: 460px; }
    .contact { padding: 44px 0 36px; }
    .contact .chapter { flex-wrap: wrap; gap: 8px 24px; }
    .site-footer { padding-block: 16px 24px; }
}
@media (max-width: 360px) {
    .wrap { width: calc(100% - 40px); }
    .wordmark { font-size: 18px; }
    .location { column-gap: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .text-link:hover .link-arrow { transform: none; }
}
