:root {
  color-scheme: dark;
  --bg: #101318;
  --text: #f0f2f4;
  --muted: #a8afb9;
  --line: #303640;
  --accent: #a9c9ff;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #fafafa;
  --text: #1b2028;
  --muted: #56606d;
  --line: #d9dde2;
  --accent: #245fb4;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
button { font: inherit; }
::selection { background: var(--accent); color: var(--bg); }

.page-shell { width: min(100% - 48px, 900px); margin: 0 auto; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 30px 0; border-bottom: 1px solid var(--line); }
.wordmark { font-size: 17px; font-weight: 700; letter-spacing: -.03em; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 28px; }
nav { display: flex; gap: 24px; font-size: 14px; }
.theme-toggle { display: grid; place-items: center; width: 32px; height: 32px; padding: 5px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--text); cursor: pointer; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }

main { padding: 0 0 88px; }
.intro { padding: 110px 0 105px; }
.intro-kicker { margin: 0 0 22px; color: var(--accent); font-size: 14px; font-weight: 600; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { letter-spacing: -.045em; }
h1 { max-width: 760px; margin-bottom: 24px; font-size: clamp(48px, 7vw, 76px); line-height: 1.08; font-weight: 650; }
.intro-copy { max-width: 620px; margin-bottom: 28px; color: var(--muted); font-size: 20px; line-height: 1.6; }
.intro-links { display: flex; flex-wrap: wrap; gap: 24px; font-size: 15px; font-weight: 600; }
.intro-links a, .contact-links a, .project-item a { color: var(--accent); }
.intro-links a:hover, .contact-links a:hover, .project-item a:hover { text-decoration: underline; text-underline-offset: 4px; }

section:not(.intro) { border-top: 1px solid var(--line); padding-top: 44px; }
.section-heading { margin-bottom: 38px; }
h2 { margin-bottom: 10px; font-size: 29px; font-weight: 650; }
.section-heading p { max-width: 630px; margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.current-work { padding-bottom: 72px; }
.role-meta { margin-bottom: 10px; color: var(--accent); font-size: 14px; font-weight: 600; }
h3 { margin-bottom: 14px; font-size: 23px; font-weight: 650; }
.role-description { max-width: 760px; margin-bottom: 20px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.contributions { max-width: 760px; display: grid; gap: 12px; margin: 0; padding-left: 21px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.contributions li { padding-left: 3px; }
.contributions li::marker { color: var(--accent); }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 35px; }
.project-item { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 19px 0; border-top: 1px solid var(--line); }
.project-item img { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; object-fit: cover; }
.project-item div { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.project-item strong { font-size: 15px; font-weight: 650; line-height: 1.35; }
.project-item span, .project-item a { font-size: 13px; line-height: 1.4; }
.project-item span { color: var(--muted); }
.project-item a { align-self: flex-start; }

footer { display: flex; align-items: flex-start; justify-content: space-between; gap: 30px; padding: 38px 0 50px; border-top: 1px solid var(--line); }
footer h2 { font-size: 23px; }
footer p { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.contact-links { display: flex; gap: 22px; font-size: 15px; }

@media (max-width: 650px) {
  .page-shell { width: min(100% - 36px, 900px); }
  .site-header { padding: 22px 0; }
  .header-actions { gap: 16px; }
  nav { gap: 15px; font-size: 13px; }
  .intro { padding: 82px 0 80px; }
  h1 { font-size: clamp(43px, 10vw, 62px); }
  .intro-copy { font-size: 18px; }
  .project-grid { grid-template-columns: 1fr; }
  .current-work { padding-bottom: 60px; }
  footer { flex-direction: column; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
