:root {
  --bg: #fbfbf9;
  --fg: #1a1a1a;
  --muted: #5a5a5a;
  --rule: #e4e2dc;
  --accent: #1f4ea1;
  --code-bg: #efece5;
  --max-w: 44rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111213;
    --fg: #e9e8e3;
    --muted: #9a988f;
    --rule: #2a2b2d;
    --accent: #7aa7ff;
    --code-bg: #1d1e20;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 4rem 1.5rem 3rem;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 120ms ease;
}
a:hover { border-bottom-color: var(--accent); }

code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.05em 0.35em;
  border-radius: 3px;
}

/* hero */
.hero {
  display: flex;
  gap: 1.75rem;
  align-items: flex-start;
  margin-bottom: 2.5rem;
}
.portrait {
  flex-shrink: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--rule);
}
.hero-text { min-width: 0; flex: 1; }
.hero h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.tagline {
  font-size: 1.0625rem;
  color: var(--fg);
  margin: 0 0 1rem;
  max-width: 38rem;
  line-height: 1.45;
}
.badges {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.8125rem;
}
.badges li {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
}
.badges li a {
  color: var(--muted);
  border-bottom: none;
}
.badges li a:hover { color: var(--accent); }

.contact {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--muted);
}

@media (max-width: 36rem) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }
  .portrait { width: 96px; height: 96px; }
}

/* numbers strip */
.numbers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1.25rem 0;
  margin: 0 0 3rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.numbers > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.numbers strong {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.numbers span {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 0.15rem;
}
@media (max-width: 32rem) {
  .numbers { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

/* sections */
section { margin-bottom: 2.75rem; }
section > h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--rule);
}

p { margin: 0 0 1rem; }

/* roles */
.role { margin-bottom: 1.75rem; }
.role:last-child { margin-bottom: 0; }
.role h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  margin: 0 0 0.2rem;
}
.role-team {
  font-weight: 400;
  color: var(--muted);
}
.role-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
}
.role-meta .title { font-style: italic; }
.role-meta .dates { white-space: nowrap; font-variant-numeric: tabular-nums; }
.role ul { margin: 0; padding-left: 1.1rem; }
.role li { margin-bottom: 0.45rem; }
.role li:last-child { margin-bottom: 0; }

@media (max-width: 32rem) {
  .role-meta { flex-direction: column; gap: 0.1rem; }
}

/* collapsed earlier experience */
.role-collapsed {
  margin-top: 1.5rem;
  border-top: 1px dashed var(--rule);
  padding-top: 1.25rem;
}
.role-collapsed > summary {
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--muted);
  list-style: none;
  user-select: none;
  margin-bottom: 1.25rem;
}
.role-collapsed > summary::-webkit-details-marker { display: none; }
.role-collapsed > summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform 150ms ease;
}
.role-collapsed[open] > summary::before { content: "▾ "; }
.role-collapsed > summary:hover { color: var(--fg); }
.collapsed-note {
  font-size: 0.875rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--rule);
}

/* selected work */
.works {
  list-style: none;
  padding: 0;
  margin: 0;
}
.works > li {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule);
}
.works > li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.works h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
  letter-spacing: -0.005em;
}
.works p {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}
.works p a { color: inherit; border-bottom: 1px dotted var(--muted); }
.works p a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* footer */
footer {
  margin-top: 4rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  font-size: 0.8125rem;
  color: var(--muted);
}

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