:root {
  --bg: #0a0a0a;
  --surface: #111111;
  --line: #1f1f1f;
  --line-2: #2a2a2a;
  --text: #ededed;
  --muted: #8b8b8b;
  --dim: #5c5c5c;
  --accent: #ededed;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, monospace;
  --max: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }
img { display: block; max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.kicker, .label, .num, .stat-label, .meta, .filters, .nav, .footer, .now { font-family: var(--mono); }

/* -- nav ------------------------------------------------------------------ */

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 32px; font-size: 13px;
  background: rgba(10, 10, 10, 0.72); backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.brand { font-weight: 500; letter-spacing: .02em; }
.nav nav { display: flex; gap: 28px; color: var(--muted); }
.nav nav a { transition: color .15s; }
.nav nav a:hover { color: var(--text); }
#nav-links { display: contents; }

/* -- hero ----------------------------------------------------------------- */

.hero-shell { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-dots {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
  -webkit-mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
          mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 100%);
}
.hero {
  position: relative;
  min-height: min(calc(100vh - 64px), 860px);
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 40px; padding-bottom: 0;
}
.hero-grid {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 64px;
  align-items: center; padding-bottom: 80px;
}
.kicker::before {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--text); margin-right: 12px; vertical-align: 2px;
  box-shadow: 0 0 0 0 rgba(237, 237, 237, .5); animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(237, 237, 237, 0); } 100% { box-shadow: 0 0 0 0 rgba(237, 237, 237, 0); } }
h1 .w { display: inline-block; opacity: 0; transform: translateY(.35em); filter: blur(6px);
  animation: rise .9s cubic-bezier(.2, .7, .2, 1) forwards; animation-delay: calc(var(--i) * 70ms + 80ms); }
@keyframes rise { to { opacity: 1; transform: none; filter: none; } }
.hero-actions, .now { animation: fade 1s ease .7s both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  h1 .w, .hero-name, .hero-actions, .now { animation: none; opacity: 1; transform: none; filter: none; }
  .kicker::before { animation: none; }
}
.hero-name {
  font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.025em; line-height: 1;
  margin: 0 0 18px; animation: fade 1s ease .05s both;
}
.kicker { color: var(--muted); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 28px; }
h1 {
  font-size: clamp(44px, 7.2vw, 92px); line-height: 1.02; letter-spacing: -0.045em;
  font-weight: 500; margin: 0 0 28px;
}
h1 .soft { color: var(--dim); }
.intro { color: var(--muted); font-size: 18px; max-width: 560px; margin: 0 0 36px; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.button {
  display: inline-flex; gap: 10px; align-items: center;
  background: var(--text); color: var(--bg);
  font-size: 14px; font-weight: 500; padding: 12px 18px; border-radius: 2px;
  transition: opacity .15s;
}
.button:hover { opacity: .85; }
.link-arrow { font-family: var(--mono); font-size: 13px; color: var(--muted); transition: color .15s; }
.link-arrow:hover { color: var(--text); }
.email .link-arrow { letter-spacing: .02em; }

.now { border: 1px solid var(--line-2); background: var(--surface); font-size: 12px; }
.now-head { display: flex; justify-content: space-between; padding: 12px 16px; color: var(--dim); border-bottom: 1px solid var(--line); letter-spacing: .1em; text-transform: uppercase; }
.now-body {
  display: grid; grid-template-columns: 32px 1fr; gap: 8px; width: 100%; min-height: 150px;
  padding: 20px 16px 22px; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; cursor: pointer;
}
.now-body > span:last-child { display: flex; flex-direction: column; }
.now-num { color: var(--accent); }
.now-label { color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.now-title { font-family: var(--sans); font-size: 28px; letter-spacing: -0.02em; margin: 6px 0 4px; }
.now-line { color: var(--muted); font-size: 12px; line-height: 1.6; }
.now-mini { display: block; height: 2px; background: var(--line); margin-top: 12px; max-width: 200px; }
.now-mini i { display: block; height: 100%; background: var(--muted); }
.now-bar { height: 2px; background: var(--line); }
.now-bar i { display: block; height: 100%; width: 0; background: var(--accent); }

/* -- sections ------------------------------------------------------------- */

.section { padding-top: 96px; padding-bottom: 32px; }
.section-head {
  display: flex; gap: 16px; align-items: baseline;
  border-top: 1px solid var(--line); padding-top: 16px;
  font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.num { color: var(--dim); }
.label { color: var(--muted); }
.section-title { font-size: clamp(32px, 4.4vw, 52px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; margin: 20px 0 56px; }

/* -- experience ----------------------------------------------------------- */

.xp { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.xp li { border-bottom: 1px solid var(--line); }
.xp-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) 180px 160px 24px;
  gap: 16px; align-items: baseline; padding: 22px 4px; transition: background .15s;
}
a.xp-row:hover { background: var(--surface); }
.xp-n, .xp-dates, .xp-place, .xp-arrow { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.xp-dates { color: var(--muted); }
.xp-main { display: flex; flex-direction: column; gap: 2px; }
.xp-company { font-size: 22px; font-weight: 500; letter-spacing: -0.02em; display: flex; align-items: center; gap: 14px; }
.logo {
  position: relative; width: 44px; height: 44px; border-radius: 10px; flex: none; overflow: hidden;
  display: inline-grid; place-items: center; border: 1px solid var(--line-2);
}
.logo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 7px; }
.logo.wide img { padding: 4px; }
.logo.mono { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .02em; color: #fff; }
.logo.big { width: 76px; height: 76px; border-radius: 16px; }
.logo.big img { padding: 12px; }
.logo.big.wide img { padding: 7px; }

.xp-role { color: var(--text); font-size: 15px; }
.xp-detail { color: var(--muted); font-size: 14px; }
.sub-title { font-size: 24px; font-weight: 500; letter-spacing: -0.02em; margin: 72px 0 24px; }

/* -- case studies --------------------------------------------------------- */

.case { border: 1px solid var(--line); background: var(--surface); margin-bottom: 32px; }
.case-head {
  display: grid; grid-template-columns: 220px auto minmax(0, 1fr) auto; gap: 28px; align-items: center;
  padding: 28px 24px; border-bottom: 1px solid var(--line);
}
.case-label, .case-year { font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: .1em; text-transform: uppercase; }
.case-heading { min-width: 0; }
.case-main { display: block; }
.case-text { padding: 56px 56px 60px; }
.case-kicker { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-bottom: 6px; }
.case-title { font-size: 32px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; margin: 0; }
.case-lede {
  color: #d6d6d6; font-size: clamp(26px, 3vw, 42px); font-weight: 400; line-height: 1.18;
  letter-spacing: -0.03em; margin: 0; max-width: 940px;
}
.case-figure { margin: 0; border-top: 1px solid var(--line); background: #0d0d0d; display: flex; flex-direction: column; }
.case-figure img { width: 100%; max-height: 560px; object-fit: contain; background: #0b0b0b; }
.case-figure figcaption { font-family: var(--mono); font-size: 11px; color: var(--dim); padding: 10px 16px; border-top: 1px solid var(--line); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stat { padding: 20px 24px; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat-value { font-size: 30px; letter-spacing: -0.03em; font-weight: 500; white-space: nowrap; }
.stat-label { font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; line-height: 1.5; }

.case-cols { display: grid; grid-template-columns: 1fr 1fr 0.7fr; border-top: 1px solid var(--line); }
.case-col { padding: 22px 24px; border-right: 1px solid var(--line); font-size: 15px; color: #c9c9c9; }
.case-col:last-child { border-right: 0; }
.case-col h4 { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-family: var(--mono); font-size: 12px; border: 1px solid var(--line-2); padding: 2px 8px; color: var(--muted); }
.case-links { margin-top: 18px; display: flex; gap: 18px; }

/* -- index ---------------------------------------------------------------- */

.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; font-size: 13px; margin-bottom: 28px; }
.filter h4 { font-weight: 400; color: var(--dim); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.filter button {
  display: block; font: inherit; color: var(--muted); background: none; border: 0; padding: 1px 4px; cursor: pointer;
  margin-left: -4px;
}
.filter button:hover { color: var(--text); }
.filter button.on { background: var(--text); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tile { background: var(--bg); display: flex; flex-direction: column; transition: background .2s; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile:hover { background: var(--surface); }
.tile-img { aspect-ratio: 16 / 10; overflow: hidden; background: #0d0d0d; }
.tile-img img {
  width: 100%; height: 100%; object-fit: cover; object-position: top left;
  filter: grayscale(1) contrast(1.05) brightness(.8); transition: filter .35s, transform .35s;
}
.tile:hover .tile-img img { filter: none; transform: scale(1.02); }
.tile-img.art { display: block; color: #d6d6d6; background: #0b0b0b; border-bottom: 1px solid var(--line); transition: color .25s; }
.tile-img.art svg { width: 100%; height: 100%; display: block; }
.tile:hover .tile-img.art { color: var(--accent); }
/* A light screenshot (a white chart) is shown inverted until hovered, so it sits in the dark page. */
.tile-img.light img { filter: grayscale(1) invert(.92) brightness(.9); }
.case-figure.light img { filter: invert(.92) hue-rotate(180deg); }
.tile-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.tile-title { font-size: 19px; font-weight: 500; letter-spacing: -0.02em; }
.meta { font-size: 11px; color: var(--dim); letter-spacing: .06em; text-transform: uppercase; }
.tile-line { color: var(--muted); font-size: 14px; line-height: 1.5; }
.tile-links { margin-top: auto; padding-top: 8px; display: flex; gap: 16px; }
.empty { padding: 32px; color: var(--muted); background: var(--bg); grid-column: 1 / -1; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13px; }

/* -- open source ---------------------------------------------------------- */

.prs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.prs li { border-bottom: 1px solid var(--line); }
.prs a {
  display: grid; grid-template-columns: 40px 200px minmax(0, 1fr) 80px 90px 20px;
  gap: 16px; align-items: baseline; padding: 16px 4px; transition: background .15s;
}
.prs a:hover { background: var(--surface); }
.prs .repo { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.prs .title { font-size: 15px; }
.prs .status { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.prs .status.merged { color: var(--accent); }
.prs .status.open { color: var(--muted); }
.prs .date, .prs .n, .prs .arrow { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* -- about ---------------------------------------------------------------- */

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 32px; }
.card {
  position: relative; overflow: hidden; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 6px; padding: 26px; transition: border-color .2s;
}
.card::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, .06), transparent 70%);
}
.card:hover { border-color: #3a3a3a; }
.card:hover::before { opacity: 1; }
.card h4 { font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--dim); letter-spacing: .12em; text-transform: uppercase; margin: 0 0 18px; }
.card p { margin: 0 0 14px; color: #c9c9c9; }
.card p:last-child { margin-bottom: 0; }
.card-intro { grid-column: span 4; grid-row: span 2; display: flex; flex-direction: column; }
.card-intro .statement { font-size: clamp(28px, 3.4vw, 46px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.08; color: var(--text); margin: 0; padding-bottom: 40px; }
.card-intro .statement span { color: var(--dim); }
.card-intro .bio { max-width: 640px; font-size: 15px; line-height: 1.65; }
.card-school, .card-side { grid-column: span 2; }
.card-half { grid-column: span 3; }
.card-school { display: flex; flex-direction: column; }
.card .class-of { font-size: 18px; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; color: var(--text); margin: 0; padding-top: 22px; }
.card .school-name { font-size: clamp(30px, 3vw, 42px); font-weight: 500; letter-spacing: -0.035em; line-height: 1.05; color: var(--text); margin-bottom: 12px; }
.card .sub { color: var(--muted); font-size: 14px; }
.progress { margin-top: 22px; }
.progress-bar { height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--text); width: 0; transition: width 1.4s cubic-bezier(.2, .7, .2, 1) .2s; }
.in .progress-bar i { width: var(--w); }
.progress-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 8px; letter-spacing: .04em; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { font-family: var(--mono); font-size: 12px; color: #c9c9c9; border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 9px; transition: border-color .15s, color .15s; }
.chips span:hover { border-color: var(--muted); color: var(--text); }
.chips.dim span { color: var(--muted); }
.chips + h4 { margin-top: 22px; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; color: #c9c9c9; }
.rows li:first-child { border-top: 0; padding-top: 0; }
.rows .n, .rows .r { font-family: var(--mono); font-size: 11px; color: var(--dim); padding-top: 3px; }

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

.footer {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 120px; padding-top: 20px; padding-bottom: 40px;
  border-top: 1px solid var(--line); font-size: 12px; color: var(--dim);
  letter-spacing: .1em; text-transform: uppercase;
}
.footer nav { display: flex; gap: 24px; }
.footer a:hover { color: var(--text); }

/* -- reveal on scroll ----------------------------------------------------- */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* -- narrow screens ------------------------------------------------------- */

@media (max-width: 900px) {
  .wrap { padding: 0 20px; }
  .nav { padding: 14px 20px; }
  .nav nav a:not(.keep) { display: none; }
  .hero { min-height: auto; padding-top: 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; padding-bottom: 40px; }
  .case-main { grid-template-columns: 1fr; }
  .case-head { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
  .case-label, .case-year { display: none; }
  .case-title { font-size: 24px; }
  .case-text { padding: 28px 20px 32px; }
  .logo.big { width: 60px; height: 60px; border-radius: 13px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .case-cols { grid-template-columns: 1fr; }
  .case-col { border-right: 0; border-bottom: 1px solid var(--line); }
  .filters { grid-template-columns: 1fr 1fr; }
  .grid { grid-template-columns: 1fr; }
  .prs a { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .xp-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .xp-n, .xp-arrow { display: none; }
  .xp-company { font-size: 20px; }
  .prs .n, .prs .date, .prs .arrow { display: none; }
  .prs .title { grid-column: 1 / -1; }
  .bento { grid-template-columns: 1fr; }
  .card-intro, .card-school, .card-side, .card-half { grid-column: auto; grid-row: auto; }
        .section { padding-top: 72px; }
}
