:root {
  --bg: #fafaf8;
  --card: #ffffff;
  --ink: #111110;
  --muted: #6b6b66;
  --line: #e6e5e0;
  --dash: #d6d5cf;
  --chip: #f2f1ed;
  --green: #2f9e5b;
  --green-ink: #1d7340;
  --amber: #c98a12;
  --violet: #7c5cd6;
  --term-bg: #0f1110;
  --term-ink: #cfe8d6;
  --serif: "Instrument Serif", Georgia, serif;
  --sans: Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --green-ink: #4cc47d; --bg: #0b0b0b; --card: #121212; --ink: #f2f2f0; --muted: #9a9a94; --line: #232322; --dash: #2c2c2a; --chip: #1b1b1a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --green-ink: #4cc47d; --bg: #0b0b0b; --card: #121212; --ink: #f2f2f0; --muted: #9a9a94; --line: #232322; --dash: #2c2c2a; --chip: #1b1b1a;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 64px; }
body { margin: 0; overflow-x: clip; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; transition: background .2s, color .2s; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
svg.fill { fill: currentColor; stroke: none; }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* dashed guide rails framing the column */
.rails { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.rails::before, .rails::after { content: ""; position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--dash); left: calc(50% - 380px); }
.rails::after { left: calc(50% + 380px); }
main, .nav { position: relative; z-index: 1; }

/* nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-in { display: flex; align-items: center; gap: 10px; height: 56px; }
.brand { font: 26px var(--serif); text-decoration: none; margin-right: auto; }
.links { display: flex; gap: 20px; margin-right: 8px; }
.links a { text-decoration: none; font-size: 14px; color: var(--muted); padding: 4px 0; border-bottom: 2px solid transparent; }
.links a:hover, .links a.on { color: var(--ink); }
.links a.on { border-color: var(--ink); font-weight: 600; }
.icon-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { border-color: var(--muted); }

/* banner */
.banner { margin-top: 14px; height: 176px; border-radius: 14px; border: 1px solid var(--line); overflow: hidden; position: relative;
  background:
    radial-gradient(circle at 18% 30%, #3dd68c55, transparent 40%),
    radial-gradient(circle at 85% 70%, #7c5cd655, transparent 45%),
    repeating-linear-gradient(0deg, #ffffff08 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, #ffffff08 0 1px, transparent 1px 22px),
    #0d0f0e; }
.banner-code { margin: 0; padding: 22px 26px; font: 12.5px/1.65 var(--mono); color: #bfe7cd; white-space: pre; overflow: hidden; }

/* profile */
.profile { display: flex; align-items: center; gap: 20px; padding: 26px 20px; }
.avatar { width: 84px; height: 84px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 6px 18px #0000001a; object-fit: cover; }
.profile > div { margin-right: auto; }
h1 { font: 44px/1 var(--serif); letter-spacing: -.5px; }
.role { margin-top: 8px; font-size: 14px; letter-spacing: .5px; min-height: 1.6em; }
.meta { font-size: 12px; color: var(--muted); }
.k-btn { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--chip); color: var(--muted); font-size: 12px; cursor: pointer; }

/* section bands with hatched gutters */
.band { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font: 400 28px/1 var(--serif); padding: 14px 20px; margin: 0 -16px; border-block: 1px solid var(--line); }
.band::before, .band::after { content: ""; position: absolute; top: -1px; bottom: -1px; width: 100vw; border-block: 1px solid var(--line);
  background: repeating-linear-gradient(-45deg, var(--line) 0 1px, transparent 1px 7px); }
.band::before { right: 100%; }
.band::after { left: 100%; }
.band a.small { text-decoration: none; color: var(--muted); }
.band a.small:hover { color: var(--ink); }
.pad { padding: 26px 4px 40px; }

.tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--chip); flex-wrap: wrap; }
.tabs button { font: 500 12.5px var(--sans); border: 0; background: none; color: var(--muted); padding: 5px 11px; border-radius: 7px; cursor: pointer; }
.tabs button.on { background: var(--ink); color: var(--bg); }

/* about */
.about { margin: 0 0 22px; padding-left: 18px; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.about li { margin-bottom: 14px; }
.about li::marker { color: var(--muted); }
.snapshot { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; background: var(--card); }
.label { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.snapshot ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; font-size: 13px; }
.snapshot li::before { content: "●"; color: var(--green); margin-right: 10px; font-size: 9px; vertical-align: 2px; }

/* contact */
.contact { display: flex; flex-wrap: wrap; gap: 10px; }
.contact a { text-decoration: none; font-size: 14px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); transition: transform .15s, border-color .15s; }
.contact a:hover { transform: translateY(-2px); border-color: var(--muted); }

/* project cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card { display: flex; flex-direction: column; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px #00000014; }
.shot { position: relative; aspect-ratio: 16/10; border-radius: 10px; border: 1px solid var(--line); overflow: hidden;
  background: repeating-linear-gradient(-45deg, var(--chip) 0 1px, transparent 1px 8px), var(--chip); }
.shot img { position: absolute; left: 18%; top: 22%; width: 90%; border-radius: 8px 0 0 0; border: 1px solid var(--line); box-shadow: 0 8px 24px #0000002a; transition: transform .3s; }
.card:hover .shot img { transform: translate(-4px, -4px); }
.term { position: absolute; left: 18%; top: 22%; right: -2px; bottom: -2px; margin: 0; padding: 14px; border-radius: 8px 0 0 0; background: var(--term-bg); color: var(--term-ink); font: 11px/1.7 var(--mono); white-space: pre; overflow: hidden; box-shadow: 0 8px 24px #0000002a; }
.pill { position: absolute; top: 10px; z-index: 1; font: 500 10.5px var(--mono); letter-spacing: .6px; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; border: 1px solid; }
.pill.live { left: 10px; color: var(--green); background: color-mix(in srgb, var(--green) 12%, var(--card)); }
.pill.cli, .pill.shipped { left: 10px; color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, var(--card)); }
.pill.badge { right: 10px; color: var(--amber); background: color-mix(in srgb, var(--amber) 12%, var(--card)); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card h3 { font: 700 19px var(--sans); }
.card > p { font-size: 14.5px; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); }
details summary { cursor: pointer; font-size: 12px; color: var(--muted); }
details ul { font-size: 13.5px; padding-left: 18px; margin: 8px 0 0; color: var(--muted); }
.card-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tags span, .chips span { font: 11.5px var(--mono); padding: 3px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--chip); }
.tags span.muted { border: 0; background: none; }
.ico { display: flex; gap: 10px; color: var(--muted); }
.ico a:hover { color: var(--ink); }

/* experience */
.jobs { list-style: none; margin: 0; padding: 0 0 0 20px; border-left: 1px solid var(--line); }
.jobs > li { position: relative; margin-bottom: 28px; }
.jobs > li::before { content: ""; position: absolute; left: -27px; top: 8px; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); }
.jobs > li:first-child::before { background: var(--green); border-color: var(--green); }
.job-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.job-head h3 { font: 600 17px var(--sans); }
.job-head .mono { font-size: 12px; }
.jobs ul { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; color: color-mix(in srgb, var(--ink) 80%, var(--muted)); }

/* open source */
.pr { padding: 18px 0; border-bottom: 1px dashed var(--line); }
.pr:first-child { padding-top: 0; }
.pr-top { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.pr-top b { color: var(--ink); font-weight: 500; }
.pr-top a { text-decoration: none; }
.pr-top a:hover { color: var(--ink); }
.merged { margin-left: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; color: var(--violet); border: 1px solid color-mix(in srgb, var(--violet) 40%, transparent); background: color-mix(in srgb, var(--violet) 10%, transparent); }
.pr h3 { font: 600 17px/1.35 var(--sans); margin: 8px 0 10px; }
.more summary { padding: 16px 0 0; }

/* stack, writing, footer */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips span { font-size: 12.5px; padding: 5px 10px; }
.post { display: block; text-decoration: none; padding: 16px 0; border-bottom: 1px dashed var(--line); }
.post h3 { font: 600 17px/1.4 var(--sans); margin-top: 4px; }
.post:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.gh-chart { width: 100%; height: auto; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.foot { text-align: center; padding-bottom: 60px; }
.foot .serif { font-size: 40px; }
.foot .mono { font-size: 12px; color: var(--muted); }

/* ⌘K */
dialog { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); box-shadow: 0 30px 60px #00000040; margin-top: 14vh; }
dialog::backdrop { background: #0006; backdrop-filter: blur(3px); }
#k-q { width: 100%; padding: 16px 18px; font-size: 14px; border: 0; border-bottom: 1px solid var(--line); background: none; color: inherit; outline: none; }
#k-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
#k-list a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; font-size: 14px; }
#k-list a:hover, #k-list a:focus, #k-list a.sel { background: var(--chip); outline: none; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (max-width: 720px) {
  .links { display: none; }
  .rails { display: none; }
  .grid { grid-template-columns: 1fr; }
        .snapshot ul { grid-template-columns: 1fr; }
  .profile { padding: 22px 4px; gap: 14px; }
  .avatar { width: 64px; height: 64px; }
  h1 { font-size: 36px; }
  .k-btn { display: none; }
  .band { margin: 0 -16px; padding: 12px 16px; font-size: 24px; }
  .banner { height: 140px; }
  .banner-code { font-size: 10.5px; padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* production polish */
.skip { position: absolute; left: 16px; top: -48px; z-index: 50; padding: 8px 14px; border-radius: 8px; background: var(--ink); color: var(--bg); text-decoration: none; font-size: 14px; }
.skip:focus { top: 12px; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 20; background: var(--green); transform-origin: 0 50%; transform: scaleX(0); }
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
.card.reveal.in:hover { transform: translateY(-3px); }
.shot img { height: auto; }

.awards { display: grid; gap: 10px; }
.award { display: grid; grid-template-columns: 128px 1fr auto; gap: 16px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.award h3 { font: 600 15.5px var(--sans); }
.award p { font-size: 13.5px; }
.rank { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.award.top .rank { color: var(--amber); }
.award.top { border-color: color-mix(in srgb, var(--amber) 35%, var(--line)); }
@media (max-width: 720px) {
  .award { grid-template-columns: 1fr; gap: 4px; }
}
.lh { list-style: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 18px; padding: 0; margin: 18px 0 14px; }
.lh li { display: grid; justify-items: center; gap: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.lh b { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 3px solid var(--green); color: var(--green-ink); font: 600 14px var(--sans); }
