:root {
  --ink: oklch(0.26 0.025 225);
  --ink-2: oklch(0.36 0.022 225);
  --muted: oklch(0.47 0.02 225);
  --teal: oklch(0.48 0.09 190);
  --teal-light: oklch(0.84 0.09 185);
  --paper: oklch(0.982 0.006 190);
  --mint: oklch(0.95 0.02 185);
  --mist: oklch(0.955 0.008 225);
  --night: oklch(0.27 0.035 215);
  --line: oklch(0.26 0.025 225 / 0.12);
  --serif: 'Spectral', Georgia, serif;
  --sans: 'Manrope', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--ink); }
a:hover { color: var(--teal); }

/* Shell: vertical rail + main column */
.shell { display: flex; align-items: stretch; min-height: 100vh; }
.rail {
  width: 88px; flex: none; display: flex; flex-direction: column; align-items: center;
  padding: 30px 0; border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100vh;
}
.monogram {
  width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--paper);
  display: flex; align-items: center; justify-content: center;
  font: 400 18px/1 var(--serif); letter-spacing: 0.02em; text-decoration: none;
}
.monogram:hover { color: var(--paper); background: var(--teal); }
.rail nav { display: flex; flex-direction: column; align-items: center; gap: 34px; margin-top: 72px; }
.rail nav a {
  writing-mode: vertical-rl; transform: rotate(180deg);
  display: flex; align-items: center; gap: 12px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.rail nav a:hover { color: var(--teal); }
.rail nav a[aria-current="page"] { color: var(--ink); }
.rail nav a[aria-current="page"]::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--teal);
}

main { flex: 1; min-width: 0; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 6vw, 88px); }

.topbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 34px 0; font-size: 15px;
}
.topbar .who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }
.topbar .who b { font-weight: 800; }
.topbar .who span { color: var(--muted); }
.topbar .actions { display: flex; align-items: center; gap: 24px; font-size: 14px; font-weight: 700; }
.topbar .actions a { text-decoration: none; }
.pill-btn {
  padding: 10px 18px; border-radius: 999px; border: 1px solid var(--ink); text-decoration: none;
}
.pill-btn:hover { background: var(--ink); color: var(--paper); }

/* Type */
.eyebrow { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); }
.display { margin: 22px 0 0; max-width: 860px; font: 300 clamp(40px, 6vw, 64px)/1.05 var(--serif); letter-spacing: -0.025em; text-wrap: balance; }
.display em, .hero h1 em { font-style: italic; color: var(--teal); }
.page-head { padding: 40px 0 56px; }

/* Home */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 56px; padding: 32px 0 96px; }
.hero > div { flex: 1 1 420px; min-width: 0; }
.hero h1 { margin: 24px 0 0; font: 300 clamp(40px, 6vw, 72px)/1.04 var(--serif); letter-spacing: -0.025em; text-wrap: balance; }
.hero img { width: 360px; max-width: 100%; aspect-ratio: 4/5; object-fit: cover; flex: none; border-radius: 180px 180px 28px 28px; }

.split { display: flex; flex-wrap: wrap; gap: 24px 64px; padding: 88px 0; border-top: 1px solid var(--line); }
.split > .eyebrow { flex: 0 0 200px; padding-top: 12px; }
.split > div:last-child { flex: 1 1 420px; min-width: 0; }
.lede { margin: 0; font: 300 clamp(24px, 3vw, 34px)/1.32 var(--serif); letter-spacing: -0.01em; text-wrap: pretty; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px 40px; margin-top: 36px; font-size: 16px; line-height: 1.75; color: var(--ink-2); }
.cols p { margin: 0; }

.explore { padding: 88px 0; border-top: 1px solid var(--line); }
.explore-grid { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 36px; }
.explore-grid .stack { flex: 1 1 220px; display: flex; flex-direction: column; gap: 20px; }
.card-link {
  display: flex; flex-direction: column; gap: 10px; padding: 28px 28px 30px; border-radius: 24px;
  background: var(--mint); color: var(--ink); text-decoration: none; flex: 1;
  transition: background .2s, color .2s;
}
.card-link:hover { background: var(--ink); color: var(--paper); }
.card-link .num { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--teal); }
.card-link:hover .num { color: var(--teal-light); }
.card-link .title { font: 400 32px/1.1 var(--serif); }
.card-link .sub { font-size: 15px; font-weight: 600; }

.arm-box {
  flex: 2 1 360px; min-height: 440px; border-radius: 32px; padding: 20px 20px 14px;
  background:
    linear-gradient(oklch(0.26 0.025 225 / 0.05) 1px, transparent 1px),
    linear-gradient(90deg, oklch(0.26 0.025 225 / 0.05) 1px, transparent 1px),
    var(--mist);
  background-size: 24px 24px, 24px 24px, auto;
  position: relative; touch-action: none; cursor: crosshair;
}
.arm-box svg { width: 100%; height: 100%; min-height: 400px; display: block; overflow: visible; }
.arm-hint {
  position: absolute; left: 24px; top: 20px; font-size: 12px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

/* Shared bits */
.tag { padding: 6px 12px; border-radius: 999px; border: 1px solid oklch(0.26 0.025 225 / 0.18); font-size: 12px; font-weight: 700; color: var(--ink-2); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 12px 20px; border-radius: 999px; background: var(--mint); font-size: 16px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.placeholder {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: repeating-linear-gradient(135deg, oklch(0.26 0.025 225 / 0.06) 0 1px, transparent 1px 10px), oklch(0.94 0.012 200);
  font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

/* Projects */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 40px; }
.filters button {
  font: 700 14px var(--sans); padding: 10px 19px; border-radius: 999px; cursor: pointer;
  border: 1px solid oklch(0.26 0.025 225 / 0.25); background: transparent; color: var(--ink);
}
.filters button:hover { border-color: var(--teal); color: var(--teal); }
.filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.feature { padding: 14px; border-radius: 32px; background: var(--mint); }
.feature-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 14px; }
.feature-img { height: 470px; border-radius: 22px; overflow: hidden; background: #fff; }
.feature-img img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 28px; }
.feature-body { display: flex; flex-direction: column; gap: 16px; padding: 28px 28px 20px; }
.feature-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--teal); }
.badge { padding: 5px 10px; border-radius: 999px; background: var(--teal); color: var(--paper); }
.feature h2 { margin: 0; font: 300 clamp(40px, 5vw, 52px)/1.02 var(--serif); letter-spacing: -0.025em; }
.feature .tagline { font: italic 400 21px/1.35 var(--serif); color: var(--ink-2); }
.feature p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.feature .tags { margin-top: auto; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.stat { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px; border-radius: 18px; background: var(--paper); }
.stat b { font: 300 36px/1 var(--serif); letter-spacing: -0.02em; color: var(--teal); }
.stat span { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.versions { margin-top: 14px; padding: 22px 24px 18px; border-radius: 22px; background: #fff; }
.versions-head { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.versions img { display: block; width: 100%; margin-top: 12px; }

.section-label { margin-top: 72px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 24px; }
.project { display: flex; flex-direction: column; padding: 12px 12px 28px; border-radius: 26px; background: var(--mist); }
.project[hidden] { display: none; }
.project .media { height: 250px; border-radius: 16px; overflow: hidden; background: #fff; }
.project .media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.project .media img.contain { object-fit: contain; padding: 14px; }
.project .media .placeholder { height: 100%; }
.project .body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 24px 16px 0; }
.project h3 { margin: 0; font: 400 30px/1.12 var(--serif); letter-spacing: -0.015em; }
.project p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.result { margin-top: 4px; padding: 14px 16px; border-radius: 12px; background: var(--paper); font-size: 14px; font-weight: 700; line-height: 1.5; }
.project .tags { margin-top: auto; padding-top: 8px; }

/* Skills */
.row { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px 56px; padding: 56px 0; border-top: 1px solid var(--line); }
.row > .eyebrow { padding-top: 6px; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 10px; padding: 26px 28px 28px; border-radius: 22px; background: var(--mint); }
.tool h3 { margin: 0; font: 400 30px/1.1 var(--serif); }
.tool p { margin: 0; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.std { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 16px; align-items: baseline; padding: 18px 0; border-bottom: 1px solid var(--line); }
.std:first-child { border-top: 1px solid var(--line); }
.std b { font: 400 24px/1.2 var(--serif); }
.std span { font-size: 16px; color: var(--ink-2); }
.cert { display: flex; align-items: center; gap: 24px; padding: 28px 32px; border-radius: 24px; background: var(--night); color: var(--paper); }
.cert .seal { width: 64px; height: 64px; flex: none; border-radius: 50%; border: 1.5px solid var(--teal-light); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; letter-spacing: 0.06em; color: var(--teal-light); }
.cert h3 { margin: 0; font: 400 28px/1.15 var(--serif); }
.cert div > span { display: block; margin-top: 6px; font-size: 15px; color: oklch(0.82 0.02 200); }

/* Leadership */
.lead { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; padding: 52px 56px; border-radius: 32px; background: var(--night); color: var(--paper); }
.lead .eyebrow { color: var(--teal-light); }
.lead h2 { margin: 18px 0 0; font: 300 clamp(34px, 4vw, 48px)/1.05 var(--serif); letter-spacing: -0.02em; }
.lead p { margin: 20px 0 0; font-size: 16px; line-height: 1.7; color: oklch(0.86 0.015 200); }
.lead ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid oklch(0.97 0.006 190 / 0.18); }
.lead li { padding: 16px 0; border-bottom: 1px solid oklch(0.97 0.006 190 / 0.18); font-size: 16px; line-height: 1.55; }
.awards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
.award { display: flex; flex-direction: column; gap: 12px; padding: 28px 26px; border-radius: 22px; background: var(--mint); }
.award b { font: 300 40px/1 var(--serif); letter-spacing: -0.02em; color: var(--teal); }
.award strong { font-size: 16px; line-height: 1.35; }
.award span { font-size: 14px; color: var(--muted); }
.extra { display: flex; flex-direction: column; padding: 12px 12px 26px; border-radius: 26px; background: var(--mist); }
.extra .placeholder { height: 240px; border-radius: 16px; }
.extra h3 { margin: 22px 14px 0; font: 400 28px/1.15 var(--serif); }
.extra div:last-child { margin: 8px 14px 0; font-size: 15px; color: var(--ink-2); }

/* Resume */
.resume { max-width: 860px; }
.resume section { padding: 40px 0; border-top: 1px solid var(--line); }
.resume h2 { margin: 0 0 20px; }
.job { margin-top: 28px; }
.job:first-of-type { margin-top: 0; }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.job-head h3 { margin: 0; font: 400 24px/1.25 var(--serif); }
.job-head span { font-size: 14px; font-weight: 700; color: var(--muted); }
.job .where { margin-top: 4px; font-size: 15px; color: var(--teal); font-weight: 700; }
.resume ul { margin: 12px 0 0; padding-left: 20px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.resume ul li + li { margin-top: 4px; }
.resume dl { margin: 0; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 12px 24px; font-size: 15px; line-height: 1.6; }
.resume dt { font-weight: 700; }
.resume dd { margin: 0; color: var(--ink-2); }
.resume .summary { font: 300 clamp(20px, 2.4vw, 26px)/1.4 var(--serif); margin: 0; }

/* Personal */
.coming { margin: 8px 0 0; min-height: 320px; border-radius: 32px; }

/* Footer */
.site-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px;
  margin-top: 88px; padding: 28px 0 36px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.site-foot a { color: inherit; text-decoration: none; }
.site-foot a:hover { color: var(--teal); }
.site-foot .contact { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* Mobile: rail becomes a top bar */
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .rail {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 10;
    flex-direction: row; gap: 16px; padding: 12px 16px; background: var(--paper);
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .monogram { width: 38px; height: 38px; font-size: 15px; flex: none; }
  .rail nav { flex-direction: row; gap: 18px; margin: 0; overflow-x: auto; scrollbar-width: none; }
  .rail nav a { writing-mode: horizontal-tb; transform: none; white-space: nowrap; font-size: 11px; }
  .topbar { padding: 20px 0; }
  .topbar .actions { display: none; }
  .hero { gap: 32px; padding-bottom: 56px; }
  .hero img { width: 100%; }
  .split, .explore { padding: 56px 0; }
  .split > .eyebrow { flex-basis: 100%; }
  .feature-top, .grid-2, .tool-grid, .lead { grid-template-columns: minmax(0, 1fr); }
  .feature-img { height: 300px; }
  .feature-body { padding: 16px 8px 8px; }
  .stats, .awards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lead { padding: 32px 24px; gap: 28px; }
  .row { grid-template-columns: minmax(0, 1fr); padding: 40px 0; }
  .std, .resume dl { grid-template-columns: minmax(0, 1fr); }
  .arm-box { min-height: 360px; }
  .arm-box svg { min-height: 320px; }
}

@media print {
  .rail, .topbar .actions, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .resume section { padding: 16px 0; break-inside: avoid-page; }
}
