:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --text: #1b2430;
  --muted: #5b6675;
  --line: #e2e5ea;
  --accent: #2f5fa7;
  --accent-ink: #ffffff;
  --tag: #edf1f8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #171e28;
    --text: #e8ecf2;
    --muted: #9aa6b6;
    --line: #263040;
    --accent: #6ea0e6;
    --accent-ink: #0f141b;
    --tag: #202a38;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
section.wrap { padding-top: 64px; padding-bottom: 8px; }

/* nav */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top nav { display: flex; justify-content: space-between; align-items: center; height: 56px; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.top ul { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; }
.top ul a { color: var(--muted); text-decoration: none; font-size: 15px; }
.top ul a:hover { color: var(--text); }

/* hero */
.hero { display: grid; grid-template-columns: 1fr 300px; gap: 48px; align-items: center; padding-top: 72px; padding-bottom: 24px; }
.eyebrow { color: var(--accent); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: 13px; margin: 0 0 12px; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 20px; letter-spacing: -.02em; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 28px; }
.portrait { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); }

.cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.btn { display: inline-block; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: 15px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding-top: 40px; }
.stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.stats strong { display: block; font-size: 26px; letter-spacing: -.01em; }
.stats span { color: var(--muted); font-size: 14px; line-height: 1.4; display: block; margin-top: 4px; }

/* sections */
h2 { font-size: 28px; letter-spacing: -.01em; margin: 0 0 8px; }
h3 { font-size: 18px; margin: 0 0 8px; }
.section-intro { color: var(--muted); margin: 0 0 24px; }
.more { color: var(--muted); font-size: 15px; margin-top: 24px; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; }
.card.wide { grid-column: 1 / -1; }
.insight { margin-top: 16px; }
.card .links { margin: 12px 0 0; font-size: 15px; font-weight: 600; }
.card code { font-size: .9em; background: var(--tag); padding: 1px 5px; border-radius: 4px; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 15.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.tags span { background: var(--tag); color: var(--text); font-size: 12.5px; padding: 3px 10px; border-radius: 99px; }

.gallery { margin-top: 24px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 12px; }
.shot { all: unset; box-sizing: border-box; cursor: zoom-in; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: block; }
.shot:hover, .shot:focus-visible { border-color: var(--accent); }
.shot img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: contain; background: var(--tag); border-bottom: 1px solid var(--line); }
.shots.big { grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); }
.shots.big .shot img { aspect-ratio: 1 / 1; }
.shot span { display: block; padding: 10px 14px; font-size: 14px; font-weight: 600; }

.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; color: #fff; }
.lightbox::backdrop { background: rgba(5, 8, 12, .88); }
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox figure { margin: 0; display: grid; gap: 12px; justify-items: center; max-height: 100vh; padding: 24px 0; }
.lightbox figure img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 8px; }
.lightbox figcaption { text-align: center; max-width: 720px; font-size: 14px; color: #c8d0dc; }
.lightbox figcaption strong { display: block; color: #fff; font-size: 16px; margin-bottom: 2px; }
.lb-nav, .lb-close { background: none; border: 0; color: #fff; font-size: 40px; line-height: 1; cursor: pointer; padding: 12px; opacity: .8; }
.lb-nav:hover, .lb-close:hover { opacity: 1; }
.lb-close { position: absolute; top: 8px; right: 12px; font-size: 36px; z-index: 1; }
@media (max-width: 760px) { .lightbox[open] { grid-template-columns: 40px 1fr 40px; } .lb-nav { font-size: 30px; padding: 4px; } }

.activity { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px; overflow-x: auto; }
.activity h3 span { color: var(--muted); font-weight: 400; font-size: 15px; }
.heatmap { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; width: max-content; }
.heatmap i, .legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.l0 { background: var(--tag); }
.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--tag)); }
.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--tag)); }
.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--tag)); }
.l4 { background: var(--accent); }
.legend { color: var(--muted); font-size: 13px; margin: 14px 0 0; }
.legend i { margin: 0 1px; vertical-align: -1px; }

.timeline { list-style: none; margin: 24px 0 0; padding: 0 0 0 20px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 28px 20px; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: 7px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 3px solid var(--bg); }
.timeline p { margin: 0; color: var(--muted); font-size: 15.5px; }
.timeline .when { color: var(--accent); font-weight: 600; font-size: 13.5px; }
.timeline .where { color: var(--text); margin-bottom: 6px; }
.timeline h3 { margin-bottom: 2px; }

.creds { margin: 8px 0 0; display: grid; gap: 14px; }
.creds div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.creds dt { font-weight: 600; }
.creds dd { margin: 0; color: var(--muted); }
@media (max-width: 760px) { .creds div { grid-template-columns: 1fr; gap: 4px; } }

.skills { margin: 20px 0 0; display: grid; gap: 14px; }
.skills div { display: grid; grid-template-columns: 200px 1fr; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.skills dt { font-weight: 600; }
.skills dd { margin: 0; color: var(--muted); }

.flow { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 7), 1fr); gap: 10px; counter-reset: step; }
.flow li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px 14px; counter-increment: step; }
.flow li::before { content: counter(step); display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.flow li:not(:last-child)::after { content: "\2192"; position: absolute; right: -9px; top: 14px; color: var(--muted); font-size: 14px; z-index: 1; }
.flow-title { margin: 28px 0 2px; font-size: 18px; }
.flow-sub { margin: 0; color: var(--muted); font-size: 15px; }
.flow li.gate { border: 2px dashed var(--accent); background: var(--tag); }
.flow li.gate em { display: inline-block; margin-top: 8px; padding: 1px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-style: normal; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.flow b { display: block; font-size: 14px; margin-bottom: 4px; }
.flow span { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.flow code, .live code { font-size: .92em; }
.live { margin-top: 20px; background: var(--surface); border: 1px solid var(--accent); border-radius: 12px; padding: 20px 22px; }
.live h3 { margin: 0 0 12px; }
.live dl { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.live dt { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.live dd { margin: 2px 0 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.live-note { margin: 14px 0 0; color: var(--muted); font-size: 13.5px; }
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } .flow li:not(:last-child)::after { content: "\2193"; right: auto; left: 20px; top: auto; bottom: -13px; } }

.contact { padding-bottom: 48px; }
.contact p { color: var(--muted); }
.contact .cta { margin: 20px 0; }
.loc { font-size: 14px; }

footer { color: var(--muted); font-size: 14px; padding-top: 24px; padding-bottom: 40px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 40px; }
  .portrait { max-width: 240px; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .skills div { grid-template-columns: 1fr; gap: 4px; }
  .top nav { gap: 16px; }
  .brand { flex: none; }
  .top ul { gap: 16px; overflow-x: auto; min-width: 0; scrollbar-width: none; white-space: nowrap; }
  .top ul::-webkit-scrollbar { display: none; }
}

.stack { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 28px; padding-bottom: 0; }
.stack span { background: var(--tag); color: var(--text); font-size: 13.5px; font-weight: 500; padding: 5px 12px; border-radius: 99px; }
.stack a { font-size: 14px; font-weight: 600; margin-left: 4px; }
