/* Theme tokens: warm paper, forest ink, and a quieter dark palette. */
:root {
  --bg: #f5f3ec;
  --bg-elev: #fbfaf6;
  --text: #252c27;
  --text-muted: #616960;
  --border: #d9ddd2;
  --accent: #305e44;
  --accent-soft: #e5ebdf;
  --accent-text: #fbfaf6;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Consolas, "Liberation Mono", monospace;
  --radius: 6px;
  --wrap: 1184px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171e1b; --bg-elev: #202924; --text: #eeeee5; --text-muted: #b1b9ae;
    --border: #39433b; --accent: #bdd5a7; --accent-soft: #2c3c2d; --accent-text: #1b281d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171e1b; --bg-elev: #202924; --text: #eeeee5; --text-muted: #b1b9ae;
  --border: #39433b; --accent: #bdd5a7; --accent-soft: #2c3c2d; --accent-text: #1b281d;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font-sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 4px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
h1, h2, h3 { margin: 0; line-height: 1.13; letter-spacing: -.04em; }
p { margin: 0 0 1em; }
button { font: inherit; }
code { font: .85em var(--font-mono); background: var(--accent-soft); padding: .1em .35em; border-radius: 3px; }
.wrap { width: min(100%, var(--wrap)); margin-inline: auto; padding-inline: 40px; }
.muted { color: var(--text-muted); }
.skip { position: absolute; left: -9999px; top: 10px; z-index: 100; background: var(--accent); color: var(--accent-text); padding: 10px 16px; }
.skip:focus { left: 10px; }

/* Navigation remains usable without JavaScript; enhancement adds the mobile menu. */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; min-height: 84px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.02em; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; background: var(--text); color: var(--bg); border-radius: 50%; font: 15px var(--font-mono); letter-spacing: -.1em; }
.nav nav { margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 25px; list-style: none; padding: 0; margin: 0; font-size: 14px; }
.nav-links a { display: block; text-decoration: none; color: var(--text-muted); padding-block: 10px; }
.nav-links a:hover, .nav-links a[aria-current] { color: var(--text); }
.theme-toggle, .menu-toggle { min-height: 44px; border: 1px solid var(--border); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle { display: grid; place-items: center; width: 44px; padding: 0; flex-shrink: 0; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
.menu-toggle { display: none; padding: 0 14px; border-radius: 4px; font-size: 13px; gap: 12px; align-items: center; }

/* Introduction */
.hero { padding-top: 88px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, .85fr); gap: 70px; align-items: center; }
.eyebrow, .kicker, .card-eyebrow, .role-dates { font: 11px/1.5 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
.eyebrow-line { width: 20px; height: 1px; background: var(--accent); flex-shrink: 0; }
.hero h1 { font-size: clamp(3rem, 5.5vw, 4.8rem); font-weight: 550; line-height: 1.03; letter-spacing: -.055em; }
.hero h1 em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; color: var(--accent); letter-spacing: -.045em; }
.lede { max-width: 45ch; margin: 28px 0 16px; font-size: 19px; line-height: 1.65; }
.hero-context { color: var(--text-muted); font-size: 14px; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 25px; margin-top: 30px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 25px; min-height: 48px; padding: 11px 20px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-elev); font-weight: 550; font-size: 14px; text-decoration: none; transition: background .2s, border-color .2s; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 90%, var(--text)); color: var(--accent-text); }
.text-link { display: inline-flex; gap: 14px; align-items: center; font-size: 14px; text-decoration: none; padding-block: 12px; border-bottom: 1px solid var(--border); }
.system-map { background: #253d31; color: #f2f2e8; border-radius: 5px; padding: 25px 29px 20px; position: relative; box-shadow: 10px 10px 0 var(--accent-soft); }
.map-heading { display: flex; justify-content: space-between; padding-bottom: 23px; font: 10px var(--font-mono); text-transform: uppercase; letter-spacing: .13em; color: #c5d4bf; }
.map-node { display: flex; align-items: center; gap: 18px; }
.node-icon { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid #728976; color: #d4e4c4; font-size: 28px; border-radius: 4px; flex-shrink: 0; }
.node-index { font: 9px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: #bdd0b6; }
.map-node h2 { font-size: 21px; font-weight: 500; margin: 4px 0; letter-spacing: -.02em; }
.map-node p { margin: 0; font-size: 12px; color: #cfdbcb; }
.map-connector { display: flex; align-items: center; gap: 17px; padding: 8px 0 8px 23px; font: 13px var(--font-mono); color: #adc2a9; }
.map-connector span { height: 19px; width: 1px; background: #617c66; }
.map-footer { margin: 23px 0 0; padding-top: 14px; border-top: 1px solid #607262; color: #c7d6c1; font: 10px var(--font-mono); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 65px 0 0; padding-block: 26px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stats > div { display: flex; flex-direction: column-reverse; padding: 0 25px; border-left: 1px solid var(--border); }
.stats > div:first-child { padding-left: 0; border: 0; }
.stats dt { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.stats dd { margin: 0; font-size: 37px; line-height: 1.1; letter-spacing: -.05em; }
.stats dd span { font-size: 27px; color: var(--accent); }
.hero-bottom { display: flex; justify-content: space-between; gap: 20px; padding-block: 20px; font: 10px/1.7 var(--font-mono); color: var(--text-muted); }
.hero-bottom p { margin: 0; }
.hero-bottom p span { padding-inline: 9px; color: var(--border); }
.hero-bottom a { text-decoration: none; white-space: nowrap; }

/* Selected work */
.section { padding-top: 90px; padding-bottom: 8px; }
.section-head { margin-bottom: 35px; }
.section-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.kicker { margin: 0 0 16px; color: var(--accent); }
.section h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); font-weight: 500; }
.section-sub { color: var(--text-muted); font-size: 14px; max-width: 58ch; margin: 12px 0 0; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.project-feature { background: var(--bg-elev); border: 1px solid var(--border); border-radius: 5px; overflow: hidden; }
.project-visual { min-height: 275px; display: flex; flex-direction: column; justify-content: space-between; padding: 20px 24px; }
.visual-label, .visual-foot { font: 9px/1.5 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; }
.visual-foot { display: flex; justify-content: space-between; gap: 12px; }
.cluster-visual { background: #e5e9dc; color: #405040; background-image: linear-gradient(#68795212 1px, transparent 1px), linear-gradient(90deg, #68795212 1px, transparent 1px); background-size: 22px 22px; }
.rack-art { width: min(83%, 300px); margin: 20px auto; transform: rotate(-4deg); }
.rack-node { display: flex; align-items: center; gap: 16px; height: 44px; padding-inline: 16px; margin-top: 7px; background: #354c3d; border: 1px solid #71856f; box-shadow: 4px 4px 0 #bdc7b5; border-radius: 3px; color: #eaf0df; font: 10px var(--font-mono); }
.rack-node:nth-child(2) { margin-inline: -5px 5px; }
.rack-node span { color: #a6bba0; font-size: 9px; }
.rack-node b { font-weight: 400; }
.rack-node i { height: 5px; width: 5px; background: #ccdd9e; border-radius: 50%; margin-left: auto; }
.infinity-visual { background: #eadfcf; color: #695641; }
.infinity-orbit { display: grid; place-items: center; position: relative; width: 165px; height: 165px; margin: 5px auto; border: 1px solid #ad967a; border-radius: 50%; }
.infinity-orbit::before { content: ""; position: absolute; inset: 13px; border: 1px dashed #b59d82; border-radius: 50%; }
.infinity-symbol { font: 140px/.8 Georgia, serif; color: #846347; padding-bottom: 14px; }
.orbit-dot { position: absolute; height: 10px; width: 10px; border-radius: 50%; background: #846347; left: 23px; top: 19px; border: 3px solid #eadfcf; box-sizing: content-box; }
.project-copy { padding: 29px 30px 30px; }
.card-eyebrow { margin-bottom: 12px; font-size: 10px; }
.project-copy h3 { font-size: 26px; font-weight: 500; margin-bottom: 18px; }
.project-copy p:not(.card-eyebrow), .project-note p:not(.card-eyebrow) { color: var(--text-muted); font-size: 14px; }
.project-note { display: flex; align-items: flex-start; gap: 23px; padding: 30px 0; border-top: 1px solid var(--border); }
.project-number { font: 12px var(--font-mono); color: var(--accent); padding-top: 3px; }
.project-note h3 { font-size: 23px; font-weight: 500; margin-bottom: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; list-style: none; margin: 20px 0 0; }
.tags li { padding: 4px 8px; background: var(--accent-soft); color: var(--text-muted); border-radius: 3px; font: 10px/1.4 var(--font-mono); }

/* Experience: native disclosures keep every résumé detail accessible. */
.timeline { padding: 0; margin: 0; list-style: none; }
.role { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 35px; padding: 30px 0; border-top: 1px solid var(--border); }
.role-meta { display: flex; flex-direction: column; gap: 7px; }
.role-org { font-size: 14px; }
.role h3 { font-size: 21px; font-weight: 550; margin-bottom: 14px; }
.role h3 span { display: block; margin-top: 9px; color: var(--text-muted); font-size: 13px; font-weight: 400; letter-spacing: 0; }
.role-body > p { font-size: 14px; color: var(--text-muted); max-width: 70ch; }
.role-body ul:not(.tags) { padding-left: 18px; font-size: 14px; margin: 18px 0; }
.role-body li { margin-bottom: 9px; }
.role-body li::marker { color: var(--accent); }
summary { cursor: pointer; }
.role-details summary { font-size: 13px; color: var(--accent); width: fit-content; padding: 7px 0; }
.earlier-roles { border-top: 1px solid var(--border); }
.earlier-roles > summary { padding: 23px 0; font-size: 15px; }
.earlier-roles > summary > span:first-child { font: 11px var(--font-mono); color: var(--text-muted); margin-left: 14px; }
.details-hint { float: right; color: var(--text-muted); font-size: 12px; }
.details-hint span { margin-left: 12px; }
.earlier-roles[open] .details-hint span { display: none; }

/* Directory, toolkit, and background */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.card { position: relative; display: flex; flex-direction: column; padding: 28px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); }
.card h3 { font-size: 22px; margin: 10px 0 14px; }
.card p { font-size: 14px; color: var(--text-muted); }
.app-card { text-decoration: none; }
.app-card:hover { border-color: var(--accent); }
.app-path { font-family: var(--font-mono); overflow-wrap: anywhere; }
.app-status { align-self: flex-start; padding: 3px 7px; border: 1px solid var(--border); font: 10px var(--font-mono); text-transform: uppercase; }
.empty { grid-column: 1/-1; color: var(--text-muted); }
.skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 60px; margin: 0; }
.skills > div { border-top: 1px solid var(--border); padding: 20px 0; }
.skills dt { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.skills dd { margin: 0; color: var(--text-muted); font-size: 14px; }
.split { display: grid; grid-template-columns: 1.25fr 1fr; gap: 85px; }
.plain { padding-left: 18px; margin: 0; color: var(--text-muted); font-size: 14px; }
.plain li { margin-bottom: 14px; }
.plain strong { color: var(--text); }
.plain li::marker { color: var(--accent); }
.edu-title { font-size: 18px; margin-bottom: 6px; }
.split p:not(.kicker):not(.edu-title) { color: var(--text-muted); font-size: 14px; }

/* Blog */

.nav-links a[aria-current="page"] { color: var(--text); }

.blog-head { padding-bottom: 36px; }
.blog-head h1, .post-header h1 { font-size: clamp(2rem, 4.6vw, 3rem); margin: 0; }

.post-list { list-style: none; margin: 0; padding: 0 0 48px; }
.post-item { padding: 26px 0; border-top: 1px solid var(--border); }
.post-item:first-child { border-top: 0; padding-top: 0; }
.post-item > a { display: block; text-decoration: none; }
.post-item h2, .post-item h3 { font-size: 1.35rem; margin: 6px 0 8px; }
.post-item > a:hover h2, .post-item > a:hover h3 { color: var(--accent); }
.post-item .tags { margin-top: 12px; }
.post-meta { margin: 0; font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.post-summary { margin: 0; color: var(--text-muted); }
.draft-badge { color: var(--accent); text-transform: uppercase; }

.post { max-width: 760px; padding-top: 56px; padding-bottom: 72px; }
.post-back { margin: 0 0 20px; font-size: 15px; }
.post-back a { color: var(--text-muted); }
.post-header { margin-bottom: 36px; }
.post-header .post-meta { margin-top: 14px; }

.prose { font-size: 18px; line-height: 1.75; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol, .prose pre, .prose blockquote, .prose table { margin-bottom: 0; }
.prose h2 { font-size: 1.55rem; margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose a { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--accent); }
.prose img { max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); }
.prose blockquote { margin-left: 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--accent); color: var(--text-muted); }
.prose pre {
  overflow-x: auto; padding: 16px 18px; border-radius: 10px;
  background: var(--bg-elev); border: 1px solid var(--border); font-size: 14.5px; line-height: 1.55;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; font-weight: 600; }
.post-nav a span { font-family: var(--font-mono); font-size: 13px; font-weight: 400; color: var(--text-muted); }
.post-nav-newer { text-align: right; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav-newer { text-align: left; } }


/* Contact and footer */
.contact { margin-top: 95px; padding-top: 60px; padding-bottom: 70px; border-top: 1px solid var(--border); }
.contact h2 { font-size: clamp(2.4rem, 4.5vw, 3.8rem); margin-bottom: 24px; }
.contact > p:not(.kicker) { max-width: 50ch; color: var(--text-muted); font-size: 15px; }
.footer { border-top: 1px solid var(--border); color: var(--text-muted); font: 11px/1.6 var(--font-mono); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; padding-block: 25px; }
.footer p { margin: 0; }
.footer p span[aria-hidden] { padding-inline: 10px; }

/* Responsive layout */
@media (max-width: 980px) {
  .hero-grid { gap: 35px; }
  .hero h1 { font-size: 3.7rem; }
  .nav-links { gap: 18px; }
  .brand-name { font-size: 13px; }
  .system-map { padding: 22px; }
}
@media (max-width: 780px) {
  .wrap { padding-inline: 24px; }
  .nav-inner { min-height: 72px; gap: 12px; flex-wrap: wrap; padding-block: 12px; }
  .nav nav { order: 3; width: 100%; margin: 0; }
  .nav-links { justify-content: space-between; gap: 10px; }
  .theme-toggle { margin-left: auto; }
  .nav.is-enhanced .menu-toggle { display: inline-flex; margin-left: auto; }
  .nav.is-enhanced .theme-toggle { margin-left: 0; }
  .nav.is-enhanced nav { display: none; }
  .nav.is-enhanced.is-open nav { display: block; padding-block: 12px 3px; }
  .nav.is-enhanced .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
  .nav.is-enhanced .nav-links a { padding: 12px 8px; border-bottom: 1px solid var(--border); }
  .hero { padding-top: 55px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero h1 { font-size: clamp(2.9rem, 8vw, 4.7rem); }
  .hero-copy { max-width: 610px; }
  .system-map { max-width: 520px; width: 100%; }
  .stats { margin-top: 45px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 25px 0; }
  .stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .hero-bottom { flex-direction: column; gap: 12px; }
  .section { padding-top: 65px; }
  .section-head-row { align-items: flex-start; flex-direction: column; gap: 10px; }
  .desktop-break { display: none; }
  .project-grid { gap: 20px; }
  .project-copy { padding: 23px; }
  .project-visual { padding: 20px; min-height: 255px; }
  .role { grid-template-columns: 1fr; gap: 14px; }
  .role-meta { flex-direction: row; align-items: baseline; gap: 14px; }
  .skills { column-gap: 30px; }
  .split { gap: 35px; }
  .contact { margin-top: 65px; }
}
@media (max-width: 560px) {
  .wrap { padding-inline: 22px; }
  .brand-name { max-width: 90px; white-space: normal; line-height: 1.3; }
  .hero h1 { font-size: clamp(2.7rem, 10vw, 3.7rem); }
  .eyebrow { font-size: 9px; letter-spacing: .02em; margin-bottom: 22px; }
  .lede { font-size: 17px; }
  .cta { gap: 18px; }
  .hero-bottom { font-size: 9px; }
  .hero-bottom p span { padding-inline: 5px; }
  .stats dd { font-size: 33px; }
  .stats dt { font-size: 11px; }
  .stats > div { padding-right: 10px; padding-left: 20px; }
  .project-grid, .cards, .skills, .split { grid-template-columns: 1fr; }
  .project-grid { gap: 24px; }
  .project-note { padding-block: 25px 0; }
  .project-visual { min-height: 275px; }
  .details-hint { display: none; }
  .earlier-roles > summary > span:first-child { display: block; margin: 6px 0 0 16px; }
  .split { gap: 55px; }
  .footer-inner { flex-direction: column; gap: 8px; }
  .contact .btn { padding-inline: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
