:root {
  --bg: #ffffff;
  --bg-2: #f5f7f9;
  --panel: #ffffff;
  --panel-2: #f3f5f8;
  --line: #e5e9ee;
  --line-2: #d3d9e0;
  --text: #111418;
  --muted: #5a6470;
  --faint: #8b949e;
  --accent: var(--accent-custom, #0bb5c9);
  --accent-ink: #ffffff;
  --live: #109a5c;
  --amber: #b97700;
  --blue: #1f6fd1;
  --down: #d92d3f;
  --radius: 12px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --nav-h: 56px;
  --logo-ink: #1f2328;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d10; --bg-2: #11151a; --panel: #12161b; --panel-2: #181d23; --line: #222a33; --line-2: #2e3742;
    --text: #e8edf2; --muted: #9aa5b1; --faint: #6b7682; --accent: var(--accent-custom, #2fd3e6); --accent-ink: #001417;
    --live: #2ecc85; --amber: #ffb020; --blue: #5aa9ff; --down: #ff5c6c; --logo-ink: #e8edf2;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d10; --bg-2: #11151a; --panel: #12161b; --panel-2: #181d23; --line: #222a33; --line-2: #2e3742;
  --text: #e8edf2; --muted: #9aa5b1; --faint: #6b7682; --accent: var(--accent-custom, #2fd3e6); --accent-ink: #001417;
  --live: #2ecc85; --amber: #ffb020; --blue: #5aa9ff; --down: #ff5c6c; --logo-ink: #e8edf2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration-color: color-mix(in srgb, var(--accent) 60%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; }
.mono, code { font-family: var(--mono); }
code { font-size: .88em; background: var(--panel-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.wrap { width: min(860px, 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--panel); padding: 6px 10px; }
.loading { padding: 120px 0; color: var(--muted); text-align: center; }
.cursor { animation: blink 1s steps(1) infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }
.tape { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nav-links a[hidden] { display: none; }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 20; height: var(--nav-h); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; gap: 18px; height: 100%; }
.nav-links { display: flex; gap: 20px; font-size: 14px; font-weight: 500; overflow-x: auto; scrollbar-width: none; min-width: 0; flex: 1; }
.nav-tools { display: flex; align-items: center; gap: 14px; flex-shrink: 0; margin-left: auto; }
.nav-side:empty { display: none; }
/* Desktop: full-width bar; section links centered, More and the theme toggle on the right edge. */
@media (min-width: 900px) {
  .nav .nav-inner { width: calc(100% - 48px); display: grid; grid-template-columns: 1fr auto 1fr; }
  .nav-side:empty { display: block; }
  .nav-links { justify-content: center; overflow: visible; }
  .nav-tools { justify-self: end; margin-left: 0; }
  .nav-home, .nav-side { justify-self: start; }
}
.nav-links a { text-decoration: none; white-space: nowrap; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.more-menu { position: relative; flex-shrink: 0; }
.more-btn { background: none; border: 0; cursor: pointer; font-size: 14px; font-weight: 500; color: var(--muted); padding: 6px 2px; }
.more-btn:hover, .more-btn[aria-expanded="true"] { color: var(--text); }
.more-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 180px; display: grid; padding: 6px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 12px 32px -12px rgba(0,0,0,.25); z-index: 30; }
.more-panel a { padding: 8px 10px; border-radius: 6px; text-decoration: none; font-size: 14px; color: var(--text); }
.more-panel a:hover { background: var(--panel-2); color: var(--accent); }
.icon-btn { background: none; border: 1px solid var(--line-2); border-radius: 8px; height: 32px; min-width: 32px; cursor: pointer; color: var(--muted); flex-shrink: 0; }
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* ---------- hero / about ---------- */
.hero { text-align: center; padding: 44px 0 8px; position: relative; }
.logo { display: block; margin: 0 auto 16px; width: 132px; }
.logo img, .logo svg { display: block; width: 100%; height: auto; }
.name { font-size: clamp(34px, 6vw, 48px); line-height: 1.1; letter-spacing: -.02em; margin: 0 0 6px; font-weight: 800; }
.headline { margin: 0; color: var(--muted); font-size: 18px; }
.typed { color: var(--accent); font-size: 20px; min-height: 1.6em; margin: 0 0 22px; }
.photo { width: 240px; height: 240px; border-radius: 50%; object-fit: cover; margin: 0 auto 18px; background: var(--bg-2); }
.hero-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 32px; }
.icon-link { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text); text-decoration: none; transition: color .15s, background .15s; }
.icon-link svg { width: 24px; height: 24px; }
.icon-link:hover { color: var(--accent); background: var(--panel-2); }
.bio { text-align: left; color: var(--muted); font-size: 17px; max-width: 70ch; margin: 0 auto; }
.bio p { margin: 0 0 14px; }

/* ---------- sections ---------- */
section.block { padding: 56px 0 0; position: relative; }
.sec-title { text-align: center; font-size: 30px; font-weight: 800; letter-spacing: -.015em; margin: 0 0 10px; }
.heading-line { width: 56px; height: 3px; border-radius: 3px; background: var(--accent); margin: 0 auto 28px; }

.sec-img { display: block; width: min(560px, 100%); height: auto; margin: 0 auto 24px; border-radius: var(--radius); }

/* featured project cards */
.featured { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 26px; }
.card { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: 0 8px 24px -16px color-mix(in srgb, var(--accent) 60%, transparent); }
.card .img { margin: -18px -18px 14px; aspect-ratio: 16/7; overflow: hidden; border-radius: var(--radius) var(--radius) 0 0; background: var(--bg-2); }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card h3 { margin: 0; font-size: 18px; flex: 1; min-width: 0; }
.picon { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; object-fit: cover; }
.picon.sm { width: 22px; height: 22px; border-radius: 6px; display: inline-block; vertical-align: -5px; margin-right: 8px; }
.card-top { justify-content: flex-start; }
.card p { color: var(--muted); margin: 6px 0 12px; font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tag { font: 500 11.5px var(--mono); color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 2px 8px; }
.links { display: flex; gap: 14px; margin-top: 12px; font-size: 13.5px; font-weight: 600; }
.links a { text-decoration: none; color: var(--accent); }
.status { font: 600 10.5px var(--mono); letter-spacing: .05em; padding: 2px 7px; border-radius: 5px; text-transform: uppercase; white-space: nowrap; }
.status.live { color: var(--live); background: color-mix(in srgb, var(--live) 13%, transparent); }
.status.building { color: var(--amber); background: color-mix(in srgb, var(--amber) 13%, transparent); }
.status.shipped { color: var(--blue); background: color-mix(in srgb, var(--blue) 13%, transparent); }
.status.archived { color: var(--faint); background: var(--panel-2); }

/* project list */
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 14px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line-2); background: none; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.chip .n { opacity: .65; }
.plist { border-top: 1px solid var(--line); }
.prow { border-bottom: 1px solid var(--line); }
.prow-btn { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) 48px; gap: 16px; align-items: baseline; width: 100%; padding: 12px 4px; background: none; border: 0; text-align: left; cursor: pointer; }
.prow-btn:hover .pname { color: var(--accent); }
.pname { font-weight: 600; }
.psum { color: var(--muted); font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow.open .psum { white-space: normal; }
.pyear { color: var(--faint); font-size: 12.5px; text-align: right; }
.pdetail { position: relative; padding: 0 4px 16px; color: var(--muted); font-size: 15px; }
.pdetail p { margin: 0 0 10px; }
.pdetail .meta { font-size: 12px; color: var(--faint); margin: 10px 0 0; }
.empty { text-align: center; color: var(--muted); padding: 20px; }
.more { display: flex; justify-content: center; padding: 18px 0 0; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; }
.btn:hover { border-color: var(--accent); }

/* experience */
.subsec { margin: 8px 0 14px; font-size: 13px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; text-align: center; }
.job + .subsec { margin-top: 34px; }
.job { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.job h3, .edu h3 { margin: 0; font-size: 18px; line-height: 1.35; }
.job h3 a { color: var(--accent); text-decoration: none; }
.org-logo { display: inline-block; width: 28px; height: 28px; border-radius: 7px; object-fit: contain; vertical-align: -7px; margin-right: 10px; background: #fff; }
.when { margin: 2px 0 0; color: var(--faint); font-size: 14px; }
.job ul { margin: 10px 0 0; padding-left: 18px; color: var(--muted); font-size: 15px; }
.job li { margin: 4px 0; }
.job li::marker { color: var(--accent); }

/* education */
.edu { position: relative; margin-bottom: 22px; }
.edu p { color: var(--muted); margin: 4px 0 0; }
.beyond { position: relative; color: var(--muted); margin-top: 8px; }
.video { aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; margin-top: 14px; }
.video iframe { width: 100%; height: 100%; border: 0; }

/* skills */
.skills { display: grid; gap: 22px; }
.skill-group { position: relative; }
.skill-group h3 { margin: 0 0 10px; font-size: 13px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; text-align: center; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pill { font-size: 14px; padding: 5px 12px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); }

/* footer */
footer { margin-top: 72px; border-top: 1px solid var(--line); padding: 40px 0 48px; text-align: center; color: var(--muted); font-size: 14px; }
.quote { font-size: 16px; color: var(--text); max-width: 60ch; margin: 0 auto 4px; font-style: italic; }
.quote-by { font-weight: 700; margin: 0 0 22px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; margin-bottom: 12px; }
.foot-links a { text-decoration: none; }
.copy { margin: 0; color: var(--faint); }

/* draft banner + edit affordances */
.banner { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 40; background: var(--amber); color: #1a1200; font: 700 12px var(--mono); padding: 8px 14px; border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.3); display: flex; gap: 12px; }
.banner a { color: inherit; }
.edit-fab { position: fixed; right: 16px; bottom: 16px; z-index: 40; }
.editing [data-edit] { outline: 1px dashed color-mix(in srgb, var(--amber) 70%, transparent); outline-offset: 4px; }
.edit-pen { display: none; }
.editing .edit-pen {
  display: inline-flex; position: absolute; top: -10px; right: -10px; z-index: 5; width: 24px; height: 24px; border-radius: 50%;
  align-items: center; justify-content: center; background: var(--amber); color: #1a1200; font-size: 12px; text-decoration: none;
}

/* hidden terminal (⌘K or /) */
.cmd { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .5); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 0; }
.cmd[hidden] { display: none; }
.cmd-panel { width: min(600px, 100%); background: #0e1216; color: #e8edf2; border: 1px solid #2e3742; border-radius: 12px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.cmd-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid #222a33; }
.cmd-input-row .prompt { color: #2fd3e6; font-size: 14px; }
.cmd-input-row input { flex: 1; min-width: 0; background: none; border: 0; color: inherit; font-size: 16px; outline: none; }
.cmd-out { max-height: 50vh; overflow: auto; padding: 8px 0; font-size: 13px; }
.cmd-out .row { display: flex; gap: 12px; padding: 7px 16px; cursor: pointer; }
.cmd-out .row[aria-selected="true"], .cmd-out .row:hover { background: #181d23; }
.cmd-out .row .k { color: #2fd3e6; min-width: 72px; font-weight: 700; }
.cmd-out .row .t { color: #9aa5b1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-out .msg { padding: 8px 16px; color: #9aa5b1; white-space: pre-wrap; }

@media (max-width: 680px) {
  .featured { grid-template-columns: 1fr; }
  .prow-btn { grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 12px; }
  .psum { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .photo { width: 190px; height: 190px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}
.more-panel[hidden], .more-menu[hidden] { display: none; }

/* ---------- secondary pages (food, resources, learn python…) ---------- */
.nav-home { display: inline-flex; flex-shrink: 0; }
.nav-home img { width: 44px; height: auto; }
.page { padding-block: 40px 0; }
.page-head { text-align: center; margin-bottom: 8px; }
.page-head .sec-title { font-size: clamp(28px, 5vw, 38px); }
.lede { color: var(--muted); font-size: 17px; max-width: 62ch; margin: 0 auto 28px; text-align: center; text-wrap: balance; }
.page h2 { font-size: 22px; letter-spacing: -.01em; margin: 40px 0 6px; text-wrap: balance; }
.page h2 + .heading-line { margin: 0 0 18px; width: 40px; }
.page h3 { font-size: 17px; margin: 22px 0 6px; }
.page p, .page li { color: var(--muted); }
.page a { color: var(--accent); }

.link-cards { display: grid; gap: 12px; }
.lcard { display: block; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; transition: border-color .15s, transform .15s; }
.lcard:hover { border-color: var(--accent); transform: translateY(-1px); }
.lcard h3 { margin: 0 0 4px; font-size: 17px; color: var(--text); }
.lcard h3::after { content: " ↗"; color: var(--accent); font-weight: 500; }
.lcard[href$=".html"] h3::after, .lcard[href^="#"] h3::after { content: " →"; }
.lcard p { margin: 0; font-size: 15px; color: var(--muted); }
.lcard .meta { display: block; margin-top: 6px; font: 12px var(--mono); color: var(--faint); }
.link-cards.cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.prose { max-width: 70ch; margin: 0 auto; }
.prose ul, .prose ol { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose pre { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); color: var(--text); }
.prose pre code { background: none; border: 0; padding: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 20px; }
.page table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.page th, .page td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.page th { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--faint); background: var(--panel-2); }
.page tr:last-child td { border-bottom: 0; }
.page figure { margin: 20px auto; text-align: center; }
.page figure img { margin: 0 auto; border-radius: var(--radius); }
.page figcaption { color: var(--faint); font-size: 13px; margin-top: 6px; }
.more-panel a[aria-current="page"] { color: var(--accent); }
@media (max-width: 680px) { .link-cards.cols { grid-template-columns: 1fr; } }
