:root {
  --bg: #fff;
  --surface: #f5f5f7;
  --ink: #1d1d1f;
  --ink-2: #515154;
  --ink-3: #6e6e73;
  --rule: #d2d2d7;
  --dark: #1d1d1f;
  --dark-ink: #f5f5f7;
  --dark-ink-2: #a1a1a6;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(20px, 4vw, 48px);
  --section-gap: clamp(80px, 11vw, 150px);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: #000; }
::selection { background: var(--rule); }
h1, h2, h3, p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 12px var(--gutter);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 rgba(0, 0, 0, 0.12);
}
.brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.brand-name { font-size: 17px; font-weight: 600; letter-spacing: -0.022em; white-space: nowrap; }
.brand-role { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 13px; flex-wrap: wrap; }
.nav a { color: var(--ink-3); transition: color 0.2s ease; }
.nav a:hover { color: var(--ink); }

/* buttons */
.pill {
  display: inline-block;
  color: #fff;
  background: var(--dark);
  border-radius: 980px;
  font-weight: 500;
  transition: transform 0.3s var(--ease), background 0.2s ease;
}
.pill:hover { background: #3a3a3c; color: #fff; }
.pill:active { transform: scale(0.97); }
.pill-sm { padding: 7px 15px; }
.nav a.pill { color: #fff; }
.nav a.pill:hover { color: #fff; }
.pill-lg { font-size: 16px; padding: 13px 24px; }
.link-arrow { font-size: 16px; font-weight: 500; transition: opacity 0.2s ease; }
.link-arrow:hover { opacity: 0.6; }

/* hero */
.hero {
  padding-top: clamp(56px, 8vw, 112px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(36px, 5vw, 80px);
  align-items: start;
}
.hero > * { min-width: 0; }
.eyebrow { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.hero .eyebrow { margin-bottom: 22px; }
h1 {
  font-size: clamp(40px, 5.2vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 16ch;
  text-wrap: balance;
  animation: riseIn 1s var(--ease) both;
}
.lede { margin-top: 28px; font-size: 19px; line-height: 1.5; letter-spacing: -0.005em; color: var(--ink-2); max-width: 52ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 34px; }
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 30px; font-size: 14px; }
.hero-links a { color: var(--ink-3); transition: color 0.2s ease; }
.hero-links a:hover { color: var(--ink); }

/* glance card */
.glance {
  border-radius: 28px;
  background: var(--dark);
  color: var(--dark-ink);
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.35);
  padding: 8px 0;
}
.glance-title { padding: 22px 28px 12px; font-size: 13px; font-weight: 500; color: var(--dark-ink-2); }
.glance-body { padding: 0 28px 26px; }
.kv {
  display: grid;
  grid-template-columns: minmax(80px, 100px) minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-top: 1px solid var(--rule);
}
.kv dt { font-size: 14px; color: var(--ink-3); }
.kv dd { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink); }
.glance .kv { border-color: rgba(255, 255, 255, 0.12); }
.glance .kv dt { color: var(--dark-ink-2); }
.glance .kv dd { color: var(--dark-ink); }
dl { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 18px 0 0; margin: 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.12); }
.chips li { font-size: 12.5px; border-radius: 980px; padding: 6px 12px; color: var(--dark-ink); background: rgba(255, 255, 255, 0.1); }

/* sections */
.section { padding-top: var(--section-gap); }
.section-head { display: flex; flex-direction: column; gap: 8px; }
.section-head.spaced { padding-bottom: clamp(28px, 4vw, 44px); }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 600; }
.section-sub { font-size: 19px; color: var(--ink-3); }

/* projects */
.cards { display: flex; flex-direction: column; gap: 20px; }
.card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(28px, 4vw, 64px);
  background: var(--surface);
  border-radius: 28px;
  padding: clamp(28px, 4vw, 56px);
}
.card > * { min-width: 0; }
h3 { font-size: clamp(30px, 3.4vw, 46px); letter-spacing: -0.03em; line-height: 1.08; font-weight: 600; margin-top: 6px; }
.logo { display: block; width: 64px; height: 64px; border-radius: 14px; margin-bottom: 18px; object-fit: cover; }
.card-blurb { margin-top: 18px; font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 48ch; text-wrap: pretty; }
.card .link-arrow { display: inline-block; margin-top: 24px; }

/* experience */
.roles { list-style: none; margin: 0; padding: clamp(32px, 4vw, 52px) 0 0; }
.role {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  gap: 8px clamp(20px, 4vw, 56px);
  border-top: 1px solid var(--rule);
  padding: 24px 0;
}
.role-dates { font-size: 14px; color: var(--ink-3); padding-top: 3px; }
.role-title { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; }
.role-sub { margin-top: 2px; font-size: 15px; color: var(--ink-3); }
.role-list { margin: 12px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
.role-list li { margin-bottom: 6px; }
@media (max-width: 640px) { .role { grid-template-columns: 1fr; } }

/* principles */
.principles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: clamp(28px, 4vw, 56px);
  padding-top: clamp(32px, 4vw, 52px);
  list-style: none;
  margin-bottom: 0;
  margin-left: 0;
  margin-right: 0;
  padding-left: 0;
  padding-right: 0;
}
.principle { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--rule); padding-top: 20px; }
.principle-n { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.principle-title { font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 600; text-wrap: balance; }
.principle-body { font-size: 16px; line-height: 1.55; color: var(--ink-2); text-wrap: pretty; }

/* open source */
.oss {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(28px, 4vw, 72px);
  padding-top: clamp(32px, 4vw, 52px);
}
.oss > * { min-width: 0; }
.oss-title { margin-top: 6px; font-size: clamp(24px, 2.6vw, 34px); letter-spacing: -0.025em; font-weight: 600; }
.oss-blurb { margin-top: 16px; font-size: 17px; line-height: 1.55; color: var(--ink-2); max-width: 46ch; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 28px 0 0; padding: 0; list-style: none; }
.stat { display: flex; flex-direction: column; gap: 2px; padding-top: 16px; border-top: 1px solid var(--rule); }
.stat-n { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.stat-label { font-size: 13px; color: var(--ink-3); }
.repos { display: flex; flex-direction: column; }
.repo { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--rule); padding: 22px 0; }
.repo-name { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; }
.repo-stack { font-size: 14px; color: var(--ink-3); }
.repo-blurb { margin-top: 4px; font-size: 16px; line-height: 1.55; color: var(--ink-2); }
a.repo:hover .repo-name { text-decoration: underline; text-underline-offset: 3px; }

/* cta */
.cta {
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: 28px;
  padding: clamp(36px, 6vw, 80px);
  display: flex;
  flex-wrap: wrap;
  gap: 28px 40px;
  align-items: center;
  justify-content: space-between;
}
.cta-title { font-size: clamp(28px, 3.4vw, 46px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; max-width: 18ch; text-wrap: balance; }
.cta-body { margin-top: 16px; font-size: 17px; line-height: 1.55; color: var(--dark-ink-2); max-width: 50ch; }
.cta .pill { color: var(--dark); background: var(--dark-ink); font-size: 16px; padding: 14px 26px; white-space: nowrap; }
.cta .pill:hover { background: #fff; color: var(--dark); }

/* footer */
.site-footer {
  padding-top: clamp(48px, 6vw, 88px);
  padding-bottom: 48px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-3);
}
.site-footer a { color: var(--ink-3); }

/* reveal */
@keyframes riseIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.js [data-reveal] { opacity: 0; }
.js [data-reveal].is-in { animation: riseIn 0.9s var(--ease) both; }

@media (max-width: 560px) {
  .brand-role { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  h1 { animation: none; }
  .js [data-reveal] { opacity: 1; animation: none !important; }
  a, .pill { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .site-header { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
