/* A warm, typographic portfolio, shared across home, work and writing. */
:root {
  --bg: #f5f4f0; --surface: #ebeae4; --line: #d6d6cf;
  --ink: #242722; --muted: #5c6058; --faint: #696d65;
  --accent: #b84326; --accent-strong: #96341c;
  --sans: "Manrope", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
  --w: 78rem; --ease: cubic-bezier(.2,.7,.2,1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font: 1rem/1.7 var(--sans); -webkit-font-smoothing: antialiased; }
::selection { background: #e9bfaa; color: var(--ink); }
a { color: var(--accent); text-decoration: none; transition: color .2s, background .2s; }
a:hover { color: var(--accent-strong); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
img { max-width: 100%; }
h1,h2,h3,h4 { text-wrap: balance; }
p { text-wrap: pretty; }
section,footer { scroll-margin-top: 7rem; }
.wrap { max-width: var(--w); margin: auto; padding-inline: 3rem; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 100; padding: .6rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }

/* Navigation */
.topbar { position: sticky; top: 0; z-index: 20; background: rgb(245 244 240 / 94%); backdrop-filter: blur(16px); }
.topbar__inner { max-width: var(--w); margin: auto; padding: 1.35rem 3rem; display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .75rem; color: var(--ink); }
.brand__mark { width: 2.25rem; height: 2.25rem; border-radius: 50%; object-fit: cover; filter: grayscale(1); }
.brand__name { font-size: .85rem; font-weight: 800; letter-spacing: -.03em; }
.topbar nav { display: flex; align-items: center; gap: 1.6rem; }
.topbar nav a { font-size: .75rem; font-weight: 600; color: var(--muted); padding-block: .4rem; }
.topbar nav a:hover,.topbar nav a.is-active { color: var(--ink); }
.topbar nav a.is-active { position: relative; }
.topbar nav a.is-active::after { content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.topbar nav .btn-cv { border: 1px solid var(--line); border-radius: 2rem; padding: .5rem 1rem; color: var(--ink); }
.topbar nav .btn-cv:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.nav-toggle { display: none; }

/* Intro */
.hero { padding: 3.5rem 0 4.5rem; }
.hero-eyebrow { display: flex; justify-content: space-between; gap: 1rem; font: .63rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 2.75rem; }
.location::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 .55rem 1px 0; background: var(--accent); border-radius: 50%; }
.hero h1 { font-size: clamp(3rem, 6.8vw, 5.65rem); font-weight: 600; line-height: 1.07; letter-spacing: -.065em; text-wrap: initial; }
.hero-accent { color: var(--accent); }
.hero-bottom { display: grid; grid-template-columns: 1fr 1.35fr auto; align-items: end; gap: 3rem; margin-top: 3rem; }
.role { font-size: .82rem; line-height: 1.9; font-weight: 800; }
.role span { color: var(--muted); font-size: .72rem; font-weight: 400; }
.summary { color: var(--muted); font-size: .9rem; line-height: 1.85; max-width: 28rem; }
.round-link { display: grid; place-items: center; width: 3.5rem; height: 3.5rem; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: 1.6rem; }
.round-link:hover { background: var(--ink); color: var(--bg); }

/* Work preview */
section { position: relative; padding: 4.5rem 0 4.5rem 14rem; border-top: 1px solid var(--line); }
.label { position: absolute; top: 4.7rem; left: 0; font: .65rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.label::before { content: ""; display: inline-block; width: 5px; height: 5px; background: var(--accent); margin: 0 .65rem 2px 0; }
.selected { padding: 1.5rem 0 4.5rem; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.75rem; }
.section-heading .label { position: static; }
.section-heading > a { color: var(--ink); font-size: .72rem; }
.section-heading > a span { margin-left: .8rem; }
.project-pair { display: grid; grid-template-columns: 1.18fr 1fr; gap: 1.5rem; }
.showcase { min-width: 0; color: var(--ink); }
.showcase:hover { color: var(--ink); }
.showcase-image,.agent-art { position: relative; height: clamp(16rem,28vw,22rem); overflow: hidden; }
.showcase-image { background: #dddfe1; }
.showcase-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .65s var(--ease); }
.showcase:hover .showcase-image img { transform: scale(1.035); }
.image-link { position: absolute; bottom: 1.1rem; right: 1.1rem; border-radius: 50%; width: 2.3rem; height: 2.3rem; display: grid; place-items: center; background: var(--bg); color: var(--ink); transition: background .2s, color .2s; }
.showcase:hover .image-link { background: var(--accent); color: white; }
.showcase-caption { display: flex; justify-content: space-between; gap: 1rem; padding-top: 1.1rem; }
.showcase-caption h3 { font-size: 1.3rem; line-height: 1.25; font-weight: 600; letter-spacing: -.04em; }
.showcase-caption > span { font-size: .65rem; color: var(--muted); line-height: 1.8; text-align: right; padding-top: .15rem; }
.agent-art { background: #252d27; color: #e3e7d9; isolation: isolate; }
.art-top { position: absolute; top: 1.35rem; left: 1.4rem; right: 1.4rem; display: flex; justify-content: space-between; font: .5rem var(--mono); letter-spacing: .07em; color: #b8c0b4; }
.art-bottom { position: absolute; left: 1.4rem; bottom: 1.55rem; font: .5rem var(--mono); letter-spacing: .07em; color: #b8c0b4; }
.status-dot { display: inline-block; height: 5px; width: 5px; border-radius: 50%; background: #d3df9b; margin-right: .4rem; }
.orbit { position: absolute; top: 48%; left: 50%; border: 1px solid #74856c; border-radius: 50%; width: 65%; height: 46%; }
.orbit-one { transform: translate(-50%,-50%) rotate(-35deg); }
.orbit-two { transform: translate(-50%,-50%) rotate(35deg); }
.orbit-three { transform: translate(-50%,-50%) rotate(90deg); }
.agent-core { position: absolute; left: 50%; top: 48%; transform: translate(-50%,-50%); font-size: 3.1rem; font-weight: 600; letter-spacing: -.1em; }
.agent-core span { color: #d3df9b; font-weight: 300; font-size: 1.5rem; vertical-align: top; margin-left: .2rem; }
.orbit-node { position: absolute; padding: .25rem .65rem; background: #252d27; border: 1px solid #74856c; border-radius: 2rem; font: .6rem/1.5 var(--mono); }
.node-one { top: 23%; left: 26%; }
.node-two { top: 46%; right: 13%; }
.node-three { bottom: 25%; left: 27%; }
.open-source { margin-top: 2.5rem; padding: 1.5rem 0; border-block: 1px solid var(--line); display: grid; grid-template-columns: 12.5rem 1fr auto; gap: 1.5rem; align-items: center; color: var(--ink); }
.kicker { font: .6rem/1.7 var(--mono); color: var(--accent); letter-spacing: .05em; text-transform: uppercase; }
.open-source h3 { font-size: .95rem; font-weight: 700; letter-spacing: -.02em; }
.open-source h3 span { font-weight: 400; }
.open-source p { margin-top: .2rem; font-size: .74rem; color: var(--muted); }
.source-arrow { font-size: 1.4rem; }

/* Profile */
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1.5rem; }
.stats b { display: block; font-size: clamp(1.9rem,3vw,3rem); font-weight: 600; line-height: 1.1; letter-spacing: -.055em; }
.stats span { display: block; font-size: .7rem; line-height: 1.7; margin-top: .75rem; color: var(--muted); }
.pillars { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2rem; margin-top: 3.5rem; }
.pillars h3 { font-size: .9rem; font-weight: 700; letter-spacing: -.02em; }
.pillars p { margin-top: .7rem; color: var(--muted); font-size: .82rem; }
.now { padding: 1.2rem 1.4rem; background: var(--surface); font-size: .82rem; color: var(--muted); margin-top: 2.5rem; border-left: 2px solid var(--accent); }
.now strong { color: var(--ink); }
.entry { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; padding: 1.8rem 0; }
.entry:first-of-type { padding-top: 0; }
.entry + .entry,.list-row + .list-row { border-top: 1px solid var(--line); }
.when { font: .65rem/1.8 var(--mono); color: var(--faint); padding-top: .25rem; }
.loc { display: block; margin-top: .25rem; font-family: var(--sans); }
.entry h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -.035em; }
.org { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.note { font-size: .77rem; color: var(--faint); margin-top: .7rem; }
.entry ul { margin-top: .85rem; padding-left: 1rem; }
.entry li { color: var(--muted); font-size: .9rem; margin-top: .6rem; }
.entry li::marker { color: var(--accent); }
.entry li strong { color: var(--ink); font-weight: 600; }
.subrole { margin-top: 1.5rem; border-left: 1px solid var(--line); padding-left: 1.15rem; }
.subrole h4 { font-size: .86rem; font-weight: 700; }
.dates { font: .65rem/1.7 var(--mono); color: var(--faint); margin-top: .3rem; }
.skills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2.5rem; }
.skills h3 { font-size: .8rem; color: var(--accent); margin-bottom: .65rem; }
.skills ul { list-style: none; }
.skills li { font-size: .82rem; padding: .3rem 0; color: var(--muted); }
.list-row { display: grid; grid-template-columns: 8rem 1fr; gap: 2rem; padding: 1.25rem 0; }
.list-row:first-of-type { padding-top: 0; }
.list-row h3 { font-size: .9rem; font-weight: 600; }
.list-row p { margin-top: .5rem; font-size: .8rem; color: var(--muted); }

/* Contact */
footer { border-top: 1px solid var(--line); padding: 3rem 0 2rem; font-size: .7rem; color: var(--faint); }
.outro-label { font: .65rem var(--mono); text-transform: uppercase; letter-spacing: .07em; }
.contact-title { margin: 1.5rem 0 .5rem; font-size: clamp(2.5rem,5vw,4.2rem); line-height: 1.15; font-weight: 600; letter-spacing: -.06em; color: var(--ink); }
.contact-title span { color: var(--accent); }
.outro { display: inline-block; font-size: clamp(1.25rem,3vw,2rem); letter-spacing: -.035em; margin: .5rem 0 2rem; }
footer .links { display: flex; gap: 1.5rem; margin-bottom: 2rem; }
footer .links a { color: var(--ink); font-size: .8rem; }
footer > p:last-child { border-top: 1px solid var(--line); padding-top: 1.25rem; }

/* Writing and portfolio pages */
.article { --w: 54rem; padding-top: 4.5rem; }
.article.wide { --w: 78rem; }
.article header { padding-bottom: 2.5rem; }
.article header .kicker { margin: 0 0 1.5rem; color: var(--accent); }
.page-index { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.page-index a { display: flex; align-items: center; gap: 2rem; min-height: 44px; border: 1px solid var(--line); border-radius: 2rem; padding: .6rem 1rem; font-size: .75rem; color: var(--ink); }
.page-index a span { font: .6rem var(--mono); color: var(--faint); }
.page-index a:hover { background: var(--surface); border-color: var(--muted); }
.article h1 { font-size: clamp(2.5rem,5.5vw,4.5rem); font-weight: 600; line-height: 1.1; letter-spacing: -.055em; }
.article .standfirst { margin-top: 1.5rem; color: var(--muted); font-size: 1.1rem; max-width: 40rem; }
.article-meta { font: .7rem/1.8 var(--mono); color: var(--faint); margin-top: 1.4rem; }
.article .stats { margin: 2.5rem 0 1rem; }
.article section { border-top: 0; padding: 0 0 2.5rem; }
.article h2 { font-size: 1.5rem; letter-spacing: -.035em; font-weight: 600; margin: 2.5rem 0 1rem; }
.article h3 { font-size: 1.05rem; font-weight: 700; margin: 2rem 0 .5rem; }
.article p { color: var(--muted); margin-block: 1rem; }
.article ul,.article ol { padding-left: 1.25rem; margin: 1rem 0; }
.article li { color: var(--muted); margin: .6rem 0; }
.article p strong,.article li strong { color: var(--ink); font-weight: 700; }
.article ol li::marker { color: var(--accent); }
.article blockquote { border-left: 2px solid var(--accent); padding: .6rem 0 .6rem 1.3rem; margin: 1.5rem 0; }
.article table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .82rem; }
.article th { text-align: left; font-size: .65rem; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: .65rem .8rem; border-bottom: 1px solid var(--line); }
.article td { padding: .8rem; border-bottom: 1px solid var(--line); color: var(--muted); vertical-align: top; }
.article tr.group th { padding-top: 1.5rem; color: var(--accent); }
.article td:first-child { color: var(--ink); }
.table-scroll { overflow-x: auto; }
.figure { margin: 2rem 0; padding: 1.5rem; background: #20252b; color: #c0c7d0; border-radius: 4px; }
.figure svg { display: block; width: 100%; height: auto; }
.figure figcaption { margin-top: 1rem; text-align: center; font-size: .75rem; }
.backlink { display: inline-block; margin: 2rem 0 0; font-size: .8rem; }
.article .work-era { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.work-era h2 { margin: 0; font-size: 1.5rem; }
.work-era > p { font-size: .8rem; margin-top: .3rem; }
.work-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 3rem 1.5rem; margin-top: 2rem; }
.project { min-width: 0; }
.project img { display: block; width: 100%; height: auto; border: 1px solid var(--line); }
.project .p-body { padding-top: 1rem; }
.project h3 { font-size: 1rem; margin: 0; letter-spacing: -.025em; }
.project p { margin: .35rem 0 0; font-size: .8rem; }
.project .p-award { color: var(--accent); font-size: .73rem; margin-top: .6rem; }
.work-grid .project:first-child { grid-column: 1 / -1; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise .6s var(--ease) both; }
.hero h1 { animation-delay: .08s; }
.hero-bottom { animation-delay: .16s; }
@media (max-width: 1000px) {
  section { padding-left: 0; }
  .label { position: static; margin-bottom: 2rem; }
  .section-heading .label { margin-bottom: 0; }
  .hero-bottom { gap: 2rem; }
  .open-source { grid-template-columns: 10rem 1fr auto; }
  .showcase-caption { flex-direction: column; gap: .6rem; }
  .showcase-caption > span { text-align: left; }
}
@media (max-width: 700px) {
  section,footer { scroll-margin-top: 9rem; }
  .wrap { padding-inline: 1.4rem; }
  .topbar__inner { padding: .9rem 1.4rem; gap: 1rem; flex-wrap: wrap; }
  .brand__mark { width: 1.8rem; height: 1.8rem; }
  .brand__name { font-size: .8rem; }
  .topbar nav { width: 100%; justify-content: space-between; gap: .5rem; }
  .topbar nav a { font-size: .7rem; min-height: 44px; display: inline-flex; align-items: center; }
  .topbar nav .btn-cv { padding: .3rem .75rem; }
  .topbar.nav-ready .topbar__inner { min-height: 72px; padding-block: .75rem; flex-wrap: nowrap; }
  .topbar.nav-ready .brand { gap: .65rem; }
  .topbar.nav-ready .brand__mark { width: 2rem; height: 2rem; }
  .topbar.nav-ready .nav-toggle { display: inline-flex; align-items: center; justify-content: center; gap: .75rem; min-height: 44px; padding: .5rem .85rem; background: transparent; border: 1px solid var(--line); border-radius: 2rem; color: var(--ink); font: 600 .7rem var(--sans); cursor: pointer; }
  .nav-toggle__icon { display: block; position: relative; width: 15px; height: 12px; }
  .nav-toggle__icon::before,.nav-toggle__icon::after { content: ""; position: absolute; left: 0; width: 15px; height: 1px; background: currentColor; transition: transform .2s var(--ease), top .2s var(--ease); }
  .nav-toggle__icon::before { top: 3px; }
  .nav-toggle__icon::after { top: 9px; }
  .is-menu-open .nav-toggle__icon::before { top: 6px; transform: rotate(45deg); }
  .is-menu-open .nav-toggle__icon::after { top: 6px; transform: rotate(-45deg); }
  .topbar.nav-ready nav { display: none; position: absolute; top: 100%; left: 0; right: 0; width: 100%; padding: .7rem 1.4rem 1.5rem; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 18px 24px rgb(36 39 34 / 7%); max-height: calc(100dvh - 72px); overflow-y: auto; }
  .topbar.nav-ready.is-menu-open nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
  .topbar.nav-ready nav a { min-height: 56px; padding: .65rem 0; font-size: 1.3rem; font-weight: 600; letter-spacing: -.035em; border-bottom: 1px solid var(--line); }
  .topbar.nav-ready nav a.is-active { color: var(--accent); }
  .topbar.nav-ready nav a.is-active::after { display: none; }
  .topbar.nav-ready nav .btn-cv { justify-content: space-between; min-height: 48px; margin-top: 1rem; padding: .6rem 1rem; border: 1px solid var(--ink); background: var(--ink); color: var(--bg); border-radius: 4px; font-size: .85rem; letter-spacing: 0; }
  .topbar.nav-ready nav .btn-cv:hover { background: var(--accent); border-color: var(--accent); }
  .hero { padding: 2rem 0 3rem; }
  .hero-eyebrow { font-size: .53rem; margin-bottom: 2rem; flex-direction: column; gap: .4rem; }
  .hero h1 { font-size: clamp(2.05rem,7.5vw,3.8rem); letter-spacing: -.065em; }
  .hero-bottom { grid-template-columns: 1fr auto; gap: 1.25rem; margin-top: 2rem; }
  .hero-bottom .role { grid-column: 1 / -1; }
  .hero-bottom .summary { font-size: .82rem; }
  .round-link { width: 2.8rem; height: 2.8rem; }
  section { padding-block: 3rem; }
  .selected { padding-top: 1.25rem; }
  .label { font-size: .6rem; }
  .section-heading > a { font-size: .65rem; }
  .project-pair { grid-template-columns: 1fr; gap: 2rem; }
  .showcase-image,.agent-art { height: auto; aspect-ratio: 1.4; }
  .showcase-caption { flex-direction: row; }
  .showcase-caption > span { text-align: right; }
  .showcase-caption h3 { font-size: 1.2rem; }
  .open-source { grid-template-columns: 1fr auto; gap: .6rem; }
  .open-source .kicker { grid-column: 1 / -1; }
  .open-source h3 span { display: block; margin-top: .2rem; font-size: .8rem; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2rem; }
  .pillars { grid-template-columns: 1fr; gap: 1.5rem; margin-top: 2.5rem; }
  .pillars p { margin-top: .35rem; }
  .entry,.list-row { grid-template-columns: 1fr; gap: .8rem; }
  .loc { display: inline; margin-left: .6rem; }
  .skills { gap: 1.75rem 1rem; }
  .article { padding-top: 2.5rem; }
  .article h1 { font-size: 2.6rem; }
  .article .standfirst { font-size: 1rem; }
  .work-grid { grid-template-columns: 1fr; gap: 2rem; }
  .figure { overflow-x: auto; padding: 1rem; }
  .figure svg { min-width: 640px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,*::before,*::after { animation: none !important; transition: none !important; }
}
@media print {
  :root { --bg: white; --surface: white; --ink: #111; --muted: #333; --faint: #555; }
  .topbar,.round-link,.agent-art,.image-link,.skip-link { display: none; }
  .wrap { max-width: none; padding: 0; }
  .hero { padding: 1rem 0 2rem; }
  .hero h1 { font-size: 3rem; }
  section { padding: 1.5rem 0; }
  .label { position: static; margin-bottom: 1rem; }
  .entry,.list-row,.project { break-inside: avoid; }
  .hero > * { animation: none; }
  .figure { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
