/* ==========================================================================
   Site design system
   Tokens (light + dark), one header, one footer, one page header and two
   content widths shared by every page. Loaded after the theme CSS.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-raised: #ffffff;
  --ink: #0e1726;
  --text: #36414d;
  --muted: #66717d;
  --faint: #98a1ab;
  --line: #e6e9ed;
  --line-strong: #d3d8de;
  --accent: #0d7a72;
  --accent-ink: #0a6059;
  --accent-soft: #e5f2f0;
  --on-accent: #ffffff;
  --header-bg: rgba(255, 255, 255, 0.86);
  --grid-dot: #d5dae0;
  --primary-bg: #0e1726;
  --primary-fg: #ffffff;
  --primary-hover: #26313f;
  --term-bg: #0d1219;
  --term-fg: #c9d4de;
  --term-dim: #66768a;
  --term-key: #5fd3c4;
  --term-str: #e6c27a;
  --shadow: 0 1px 2px rgba(14, 23, 38, 0.04), 0 8px 24px rgba(14, 23, 38, 0.06);

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display: "Space Grotesk", var(--sans);
  --grid-line: rgba(14, 23, 38, 0.045);
  --glow: rgba(13, 122, 114, 0.06);

  --wrap: 1080px;
  --read: 700px;
  --gutter: 24px;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --grid-line: rgba(140, 200, 220, 0.045);
    --glow: rgba(60, 198, 181, 0.075);
    --bg: #0a0e13;
    --bg-soft: #11161d;
    --bg-raised: #131a22;
    --ink: #e9eef3;
    --text: #c0c9d2;
    --muted: #8994a0;
    --faint: #5d6874;
    --line: #1d252f;
    --line-strong: #2a3440;
    --accent: #3cc6b5;
    --accent-ink: #6ad8ca;
    --accent-soft: rgba(60, 198, 181, 0.12);
    --on-accent: #06201d;
    --header-bg: rgba(10, 14, 19, 0.82);
    --grid-dot: #1f2832;
    --primary-bg: #e9eef3;
    --primary-fg: #0a0e13;
    --primary-hover: #c9d2db;
    --term-bg: #0d1219;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --grid-line: rgba(140, 200, 220, 0.045);
  --glow: rgba(60, 198, 181, 0.075);
  --bg: #0a0e13;
  --bg-soft: #11161d;
  --bg-raised: #131a22;
  --ink: #e9eef3;
  --text: #c0c9d2;
  --muted: #8994a0;
  --faint: #5d6874;
  --line: #1d252f;
  --line-strong: #2a3440;
  --accent: #3cc6b5;
  --accent-ink: #6ad8ca;
  --accent-soft: rgba(60, 198, 181, 0.12);
  --on-accent: #06201d;
  --header-bg: rgba(10, 14, 19, 0.82);
  --grid-dot: #1f2832;
  --primary-bg: #e9eef3;
  --primary-fg: #0a0e13;
  --primary-hover: #c9d2db;
  --term-bg: #0d1219;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* ---------- Base (overrides the Minimal Mistakes theme) ---------- */

html {
  font-size: 16px;
  background: var(--bg);
}

body {
  margin: 0 !important; /* the theme's sticky-footer script sets margin-bottom */
  padding: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.25;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--accent); }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--accent-soft); color: var(--ink); }

code, kbd, pre, samp, tt { font-family: var(--mono); }
.mono { font-family: var(--mono); }
hr { border: 0; border-top: 1px solid var(--line); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* ---------- Layout ---------- */

#main.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 64px var(--gutter) 96px;
  flex: 1 0 auto;
  animation: none;
}
#main.wrap--read { max-width: calc(var(--read) + 2 * var(--gutter)); }

.wrap .page,
.wrap .archive {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
}

.section { margin-top: 96px; }
.section:first-child { margin-top: 0; }

/* ---------- Site header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__mark { width: 20px; height: 20px; color: var(--accent); flex: none; }
.brand__name { font-weight: 600; letter-spacing: -0.01em; }
.brand__tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--faint);
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  padding: 6px 11px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--bg-soft); }
.site-nav a[aria-current="page"] { color: var(--ink); background: var(--bg-soft); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
.theme-toggle svg { width: 16px; height: 16px; }
.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; }
}

/* ---------- Site footer ---------- */

.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
}
.site-footer__inner {
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 28px var(--gutter) 36px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 32px;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); }
.site-footer__build { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }

/* ---------- Shared components ---------- */

.eyebrow {
  margin: 0 0 14px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.eyebrow .idx { color: var(--accent); }

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  vertical-align: 1px;
}

/* page header: the same on every page */
.ph { margin-bottom: 48px; }
.ph__title {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 2.75rem);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.ph__lead {
  margin: 18px 0 0;
  max-width: 640px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--muted);
}
.ph__meta { margin: 18px 0 0; font-family: var(--mono); font-size: 0.78rem; color: var(--faint); }

.section-head { margin-bottom: 32px; }
.section-head h2 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}
.section-head .section-intro { margin: 10px 0 0; max-width: 620px; color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.button,
a.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
.button:hover { border-color: var(--ink); color: var(--ink); background: var(--bg); }
.button--primary,
a.button--primary {
  background: var(--primary-bg);
  border-color: var(--primary-bg);
  color: var(--primary-fg);
}
.button--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-fg); }
.button i { font-size: 0.9em; opacity: 0.85; }

.tag-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.tag-list li {
  margin: 0;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-soft);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text);
}

.card {
  display: block;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}
a.card:hover { border-color: var(--line-strong); color: inherit; transform: translateY(-1px); }
.card h3 { margin: 0 0 8px; font-size: 1.02rem; font-weight: 600; }
.card p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.card .card__meta { margin-top: 14px; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.card .card__more { margin-top: 14px; font-size: 0.86rem; font-weight: 500; color: var(--accent-ink); }
.card p.eyebrow { margin-bottom: 8px; font-size: 0.7rem; color: var(--accent-ink); }

/* terminal block */
.term {
  display: block; /* the theme makes every <figure> a flex row */
  margin: 0;
  border-radius: 12px;
  background: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.75;
  overflow: hidden;
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .term { border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .term { border: 1px solid var(--line); } }
.term__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--term-dim);
  font-size: 0.7rem;
}
.term__bar i { width: 9px; height: 9px; border-radius: 50%; background: #2a333e; }
.term__bar span { margin-left: 8px; }
.term__body { margin: 0; padding: 14px 18px 16px; overflow-x: auto; white-space: pre; background: none; color: inherit; font: inherit; border: 0; }
.term .p { color: var(--term-key); }
.term .k { color: var(--term-key); }
.term .s { color: var(--term-str); }
.term .c { color: var(--term-dim); }
.term a { color: inherit; text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.25); }
.term a:hover { color: #fff; }
.cursor {
  display: inline-block;
  width: 0.55em;
  height: 1.05em;
  margin-left: 2px;
  background: var(--term-key);
  vertical-align: -0.18em;
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

/* ---------- Prose (posts, story) ---------- */

.prose { font-size: 1.0625rem; line-height: 1.75; color: var(--text); overflow-wrap: break-word; }
.prose p, .prose li { overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.2em; }
.prose h2 { margin: 2.4em 0 0.7em; padding: 0; border: 0; font-size: 1.45rem; font-weight: 650; }
.prose h3 { margin: 2em 0 0.5em; font-size: 1.15rem; font-weight: 600; }
.prose h4 { margin: 1.6em 0 0.4em; font-size: 1rem; font-weight: 600; }
.prose li { margin-bottom: 0.4em; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose img { max-width: 100%; height: auto; border-radius: 8px; }
.prose img[align="right"] { float: right; width: 240px; margin: 6px 0 20px 32px; border: 1px solid var(--line); }
.prose blockquote { margin: 1.6em 0; padding: 2px 0 2px 20px; border-left: 2px solid var(--accent); color: var(--muted); font-style: normal; }
.prose hr { margin: 2.4em 0; }
.prose code { padding: 0.12em 0.36em; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--line); font-size: 0.86em; color: var(--ink); }
.prose pre { padding: 16px 18px; overflow-x: auto; border: 0; border-radius: 8px; background: var(--term-bg); color: var(--term-fg); font-size: 0.85rem; }
.prose pre code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; }
/* the theme wraps code blocks in a light box with a label tab: remove both */
.prose div.highlighter-rouge,
.prose figure.highlight { margin: 0 0 1.4em; padding: 0; border: 0; background: none; }
.prose div.highlighter-rouge::before,
.prose figure.highlight::before { display: none; }
.prose .highlight pre { margin: 0; font-size: 0.8rem; line-height: 1.7; }
.prose table { font-size: 0.92rem; border-color: var(--line); }
.prose th, .prose td { border-color: var(--line); }
.prose th { background: var(--bg-soft); color: var(--ink); }
.prose .MathJax_Display { overflow-x: auto; overflow-y: hidden; }

/* post footer */
.post-foot { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.post-nav a {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.4;
}
.post-nav a:hover { border-color: var(--line-strong); }
.post-nav a span {
  display: block;
  margin-bottom: 4px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.post-nav .post-nav__next { grid-column: 2; text-align: right; }
.page__taxonomy { margin-bottom: 20px; font-size: 0.85rem; }

/* ---------- Archive lists (blog, portfolio) ---------- */

.archive__subtitle {
  margin: 48px 0 4px;
  padding: 0;
  border: 0;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--faint);
}
.archive > .archive__subtitle:first-child { margin-top: 0; }
.entry {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 4px 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.entry--nodate { grid-template-columns: 1fr; }
.entry__date { padding-top: 3px; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); white-space: nowrap; }
.entry__title { margin: 0 0 6px; font-size: 1.06rem; font-weight: 600; line-height: 1.4; }
.entry__title a { color: var(--ink); text-decoration: none; }
.entry__title a:hover { color: var(--accent-ink); }
.entry__excerpt {
  margin: 0;
  font-size: 0.93rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.entry__cite { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }

/* blog: Medium article cards */
.blog-links { display: flex; flex-wrap: wrap; gap: 10px; margin: -16px 0 56px; }
.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 16px; }
.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-raised);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
}
.post-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.post-card__media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.post-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.post-card:hover .post-card__media img { transform: scale(1.03); }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 18px 22px 20px; }
.post-card__meta { margin: 0 0 8px; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.post-card h3 { margin: 0; font-size: 1.05rem; font-weight: 600; line-height: 1.4; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--accent-ink); }
.post-card p:not(.post-card__meta) { margin: 8px 0 0; font-size: 0.9rem; line-height: 1.6; color: var(--muted); }
.post-card__more { margin-top: auto; padding-top: 14px; font-size: 0.85rem; font-weight: 500; color: var(--accent-ink); text-decoration: none; }
.post-card__more:hover { text-decoration: underline; }
.archive-notes { max-width: var(--read); }

/* ==========================================================================
   Home
   ========================================================================== */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 72px;
  align-items: center;
}
.hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 5.4vw, 3.6rem);
  font-weight: 650;
  letter-spacing: -0.035em;
  line-height: 1.04;
}
.hero__role { margin: 16px 0 0; font-size: 1.2rem; font-weight: 500; color: var(--ink); }
.hero__lead { margin: 16px 0 0; max-width: 580px; font-size: 1.04rem; color: var(--muted); }

.hero__photo { position: relative; display: block; margin: 0; }
.hero__frame { position: relative; }
.hero__photo img {
  display: block;
  pointer-events: none; /* fixed portrait: no drag, no click */
  -webkit-user-drag: none;
  user-select: none;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 30%;
  border-radius: 6px;
}
/* a detector's bounding box around the portrait */
.bbox {
  position: absolute;
  inset: -9px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  opacity: 0.75;
  pointer-events: none;
}
.bbox::before {
  content: attr(data-label);
  position: absolute;
  top: -1px;
  left: -1px;
  transform: translateY(-100%);
  padding: 2px 7px;
  border-radius: 4px 4px 0 0;
  background: var(--accent);
  color: var(--on-accent);
  font-family: var(--mono);
  font-size: 0.66rem;
  white-space: nowrap;
}
.bbox i {
  /* corner ticks */
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--accent);
  border-style: solid;
}
.bbox i:nth-child(1) { right: -4px; top: -4px; border-width: 2px 2px 0 0; }
.bbox i:nth-child(2) { left: -4px; bottom: -4px; border-width: 0 0 2px 2px; }
.bbox i:nth-child(3) { right: -4px; bottom: -4px; border-width: 0 2px 2px 0; }
.hero__photo figcaption {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--faint);
  text-align: right;
}

.status-term { margin-top: 64px; }

/* impact metrics */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.metric { padding: 22px 24px; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric strong {
  display: block;
  font-family: var(--mono);
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.metric span { display: block; margin-top: 6px; font-size: 0.86rem; color: var(--muted); }

/* experience rows */
.rows { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rows > li {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 4px 24px;
  margin: 0;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.rows__when { padding-top: 2px; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.rows h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.rows h3 span { color: var(--muted); font-weight: 400; }
.rows p { margin: 4px 0 0; font-size: 0.93rem; color: var(--muted); }
.more-link { margin: 18px 0 0; }

/* project grid */
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card--feature {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 48px;
  align-items: center;
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-raised), var(--bg-raised)) padding-box,
    linear-gradient(120deg, var(--accent), var(--line-strong) 45%) border-box;
}
.card--feature .progress-mini { min-width: 210px; }
.progress-mini__label { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.7rem; color: var(--muted); }
.progress-mini__label--gap { margin-top: 10px; }
.progress-mini__bar { position: relative; height: 4px; margin-top: 8px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress-mini__bar span { position: absolute; inset: 0 auto 0 0; border-radius: 2px; background: var(--accent); }

/* publication */
.pub {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 4px 16px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
}
.pub__idx { font-family: var(--mono); font-size: 0.85rem; color: var(--accent); }
.pub h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.pub p { margin: 6px 0 0; font-size: 0.9rem; color: var(--muted); }
.pub .pub__venue { font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }

/* skills */
.skills { margin: 0; border-top: 1px solid var(--line); }
.skills > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 8px 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.skills dt { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.skills dd { margin: 0; }

.edu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.edu .card h3 { margin-bottom: 4px; }
.edu .card__meta { margin-top: 8px; }

/* contact */
.contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    radial-gradient(circle, var(--grid-dot) 1px, transparent 1.3px) 0 0 / 18px 18px,
    var(--bg-soft);
}
.contact h2 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 650; letter-spacing: -0.02em; }
.contact p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.contact .actions { margin-top: 0; }
.contact .mono { margin-top: 4px; font-size: 0.74rem; color: var(--faint); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; }
  .hero__photo { order: -1; width: 172px; margin-top: 22px; }
  .hero__photo figcaption { display: none; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metric:nth-child(3) { border-left: 0; }
  .metric:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .card--feature { grid-template-columns: 1fr; }
  .skills > div { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --gutter: 16px; }
  #main.wrap { padding-top: 40px; padding-bottom: 72px; }
  .site-header__inner { height: auto; padding-top: 10px; padding-bottom: 8px; flex-wrap: wrap; gap: 6px 12px; }
  .site-nav { order: 3; width: 100%; margin-left: -11px; overflow-x: auto; }
  .brand__tag { display: none; }
  .section { margin-top: 72px; }
  .metrics { grid-template-columns: 1fr; }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }
  .rows > li { grid-template-columns: 1fr; }
  .grid-2, .edu, .post-grid { grid-template-columns: 1fr; }
  .entry { grid-template-columns: 1fr; }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav .post-nav__next { grid-column: auto; }
  .prose img[align="right"] { float: none; display: block; width: 100%; max-width: 320px; margin: 0 0 24px; }
  .pub { grid-template-columns: 1fr; }
  .contact { padding: 28px 24px; }
  .term { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .site-header, .site-footer, .actions, .theme-toggle { display: none; }
}

/* ==========================================================================
   Geek layer: page grid, cursor glow, code-style labels, live panels
   ========================================================================== */

/* engineering grid behind every page, fading towards the bottom of the viewport */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: center top;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.35) 60%, transparent 100%);
}
/* soft glow that follows the pointer (set by site.js) */
.glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, -20%), var(--glow), transparent 65%);
}

/* nav as paths */
.site-nav a { font-family: var(--mono); font-size: 0.8rem; font-weight: 400; letter-spacing: -0.01em; }
.site-nav a::before { content: "./"; content: "./" / ""; color: var(--faint); }
.site-nav a[aria-current="page"] { color: var(--accent-ink); }
.brand__name { font-family: var(--display); font-size: 1.02rem; }

/* section labels as code comments */
.section-head .eyebrow { text-transform: lowercase; letter-spacing: 0.02em; }
.section-head .eyebrow::before { content: "// "; color: var(--faint); }
.section-head h2 { font-size: 1.75rem; letter-spacing: -0.03em; }
.ph__title, .hero__title, .tr-hero__title { font-family: var(--display); letter-spacing: -0.045em; }

/* typing line in the hero */
.typer {
  margin: 14px 0 0;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--muted);
}
.typer__prompt { color: var(--accent); }
.typer__key { color: var(--text); }
.typer__word { color: var(--accent-ink); }
.cursor-bar {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -0.2em;
  animation: blink 1.05s steps(2, start) infinite;
}
.hero__role { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.02em; }

/* dashboard: live point cloud + status terminal */
.dash {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 72px;
}
.dash .term { display: flex; flex-direction: column; align-items: stretch; }
.dash .term__body { flex: 1; }
.term__bar .term__stat { margin-left: auto; color: var(--term-dim); }
.term__bar b { color: var(--term-key); font-weight: 400; }
.scan { position: relative; flex: 1; min-height: 300px; }
.scan canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scan__hud {
  position: absolute;
  left: 14px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 4px;
  background: rgba(13, 18, 25, 0.8);
  color: var(--term-dim);
  font-size: 0.66rem;
  line-height: 1.6;
  pointer-events: none;
}
.scan__hud span { color: var(--term-key); }
.term .line { display: block; }
.term.is-typing .line { visibility: hidden; }
.term.is-typing .line.is-shown { visibility: visible; }

/* experience as a git log */
.gitlog-cmd { margin: 0 0 18px; font-family: var(--mono); font-size: 0.75rem; color: var(--faint); }
.gitlog-cmd b { color: var(--accent); font-weight: 400; }
.gitlog { position: relative; margin: 0; padding: 0; list-style: none; }
.gitlog > li { position: relative; margin: 0; padding: 0 0 30px 40px; }
.gitlog > li::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: -6px;
  width: 2px;
  background: var(--line-strong);
}
.gitlog > li:last-child::before { bottom: auto; height: 12px; }
.gitlog > li::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 4px;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}
.gitlog > li.is-head::after { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.gitlog__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-family: var(--mono); font-size: 0.72rem; color: var(--faint); }
.gitlog__meta code { padding: 0; border: 0; background: none; color: var(--term-str); font-size: inherit; }
:root[data-theme="light"] .gitlog__meta code { color: #9a6b12; }
.gitlog__ref { padding: 0 7px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent-ink); }
.gitlog h3 { margin: 6px 0 0; font-size: 1.05rem; font-weight: 600; }
.gitlog h3 span { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 0.95rem; }
.gitlog p { margin: 4px 0 0; max-width: 720px; font-size: 0.93rem; color: var(--muted); }

/* hover glow on cards */
a.card:hover, .post-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card__idx { display: block; margin-bottom: 10px; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }

/* live clock in the footer */
.utc { color: var(--accent-ink); }

/* easter egg: Konami code */
.egg-bot {
  position: fixed;
  z-index: 100;
  bottom: 18px;
  left: -80px;
  width: 64px;
  pointer-events: none;
  animation: egg-drive 5s linear forwards;
}
@keyframes egg-drive { to { transform: translateX(calc(100vw + 160px)); } }
.egg-toast {
  position: fixed;
  z-index: 101;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--mono);
  font-size: 0.8rem;
  box-shadow: var(--shadow);
}
.egg-toast b { color: var(--term-key); font-weight: 400; }

@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .scan { min-height: 240px; }
}
@media (max-width: 640px) {
  .gitlog > li { padding-left: 32px; }
  .site-nav a { padding: 6px 8px; }
}
@media (hover: none) { .glow { display: none; } }
