:root {
  --mono: ui-monospace, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --header-height: 72px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 20px); }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
::selection { background: var(--accent); color: var(--page); }
.accent { color: var(--accent); }
.skip-link {
  position: fixed;
  inset: 12px auto auto 12px;
  padding: 12px 18px;
  border-radius: 8px;
  background: var(--surface);
  z-index: 20;
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.header-inner, main, .site-footer {
  width: calc(100% - var(--gutter) - var(--gutter));
  max-width: 1160px;
  margin-inline: auto;
}
.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: color-mix(in srgb, var(--page) 90%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: calc(var(--header-height) - 1px);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.wordmark, .site-footer p { color: light-dark(#000, var(--ink)); }
.wordmark {
  justify-self: start;
  display: grid;
  place-items: center;
  width: clamp(72px, 6vw, 82px);
  height: 44px;
}
.wordmark svg { display: block; width: 100%; }
.site-nav {
  position: relative;
  display: flex;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.site-nav::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: var(--nav-indicator-width, 0);
  border-radius: 999px;
  background: var(--accent-soft);
  opacity: 0;
  transform: translateX(var(--nav-indicator-x, 0));
  transition: transform 180ms ease, width 180ms ease, opacity 180ms ease;
}
.site-nav:has([aria-current="location"])::before { opacity: 1; }
.site-nav a {
  position: relative;
  z-index: 1;
  padding: 7px 15px;
  border-radius: inherit;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
  transition: color 160ms ease;
}
.site-nav a:hover { background: var(--soft); color: var(--ink); }
.site-nav a[aria-current="location"] { color: var(--accent); }
.header-actions { display: flex; align-items: center; justify-self: end; gap: 16px; }
.text-link, .site-footer a { font-size: .85rem; font-weight: 650; }
.text-link:hover, .site-footer a:hover { color: var(--accent); }
.site-footer a span { margin-inline-start: 4px; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent);
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.theme-toggle:hover { background: var(--accent-soft); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .sun-icon, .theme-toggle[aria-pressed="true"] .moon-icon { display: none; }
.theme-toggle[aria-pressed="true"] .sun-icon { display: block; }
.scroll-progress {
  position: absolute;
  inset: auto 0 -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(var(--reading-progress, 0));
  transform-origin: left center;
  pointer-events: none;
}

.hero {
  text-align: center;
  margin-top: clamp(14px, 2.5vw, 28px);
  padding: clamp(38px, 5vw, 62px) 18px clamp(34px, 4vw, 52px);
}
.eyebrow, .company, .timeline-date {
  font-family: var(--mono);
}
.eyebrow, .company {
  text-transform: uppercase;
  letter-spacing: .12em;
}
.portrait-wrap {
  position: relative;
  width: clamp(128px, 18vw, 164px);
  aspect-ratio: 1;
  margin: 0 auto clamp(26px, 3.5vw, 38px);
}
.portrait-wrap::before { content: ""; position: absolute; inset: -7px; border: 1px solid var(--accent); border-radius: 50%; }
.portrait {
  display: block;
  width: 100%;
  height: 100%;
  border: 3px solid var(--surface);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 14px var(--portrait-shadow);
}
.eyebrow { margin: 0 0 16px; color: var(--muted); font-size: .71rem; font-weight: 600; }
.hero .eyebrow { color: var(--accent); }
h1, h2, h3 { margin: 0; }
h1, h2 { text-wrap: balance; }
h1 {
  font-size: clamp(2.5rem, 7.3vw, 5.75rem);
  font-weight: 780;
  line-height: 1;
  letter-spacing: -.075em;
}
.hero-role {
  width: 100%;
  max-width: min(100%, 38rem);
  margin: 20px auto 0;
  font-size: clamp(.97rem, 2.05vw, 1.24rem);
  font-weight: 600;
  text-wrap: balance;
}
.hero-summary {
  max-width: 32rem;
  margin: 12px auto 0;
  color: var(--muted);
  font-size: clamp(.95rem, 1.7vw, 1.04rem);
  line-height: 1.65;
  text-wrap: balance;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 28px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 46px;
  padding: 10px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: .87rem;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}
.button:hover { transform: translateY(-2px); box-shadow: 0 7px 20px var(--accent-shadow); }
.button span { font-size: 1.14rem; line-height: 1; }
.hero-actions .button-secondary { min-height: auto; padding: 8px 0; border: 0; background: transparent; color: var(--ink); }
.button-secondary span { color: var(--accent); }
.hero-actions .button-secondary:hover { color: var(--accent); box-shadow: none; }

.section {
  padding-block: clamp(45px, 7vw, 86px);
  padding-inline: clamp(0px, 2vw, 28px);
}
.section + .section { border-top: 1px solid var(--line); }
.section-number { margin-inline-end: 8px; color: var(--accent); }
h2 {
  font-size: clamp(2rem, 4.7vw, 3.55rem);
  line-height: 1.04;
  font-weight: 740;
  letter-spacing: -.06em;
}
h3 { font-weight: 700; line-height: 1.25; letter-spacing: -.028em; }
.about {
  display: grid;
  grid-template-columns: .9fr 1fr;
  gap: clamp(28px, 7vw, 98px);
}
.about h2 { max-width: 14ch; }
.about-copy > p, .section-intro {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}
.about-copy { max-width: 58ch; }
.about-copy > p { max-width: 100%; margin: 0 0 16px; overflow-wrap: anywhere; }
.about-lead { color: var(--ink); font-size: 1.08em; font-weight: 600; }
.section-intro { margin: 14px 0 0; text-wrap: pretty; }

.skills-grid, .current-role-card {
  border: 1px solid var(--line);
  border-radius: 18px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 30px;
  overflow: hidden;
  background: var(--line);
}
.skill-card, .current-role-card {
  padding: clamp(18px, 3vw, 32px);
  background: var(--surface);
}
.card-heading { display: flex; align-items: center; gap: 13px; }
.card-icon {
  width: 46px;
  height: 46px;
  flex: none;
  padding: 11px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.card-heading h3 { font-size: clamp(1.12rem, 2.2vw, 1.4rem); }
.skill-tags {
  --skill-dot-gap: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--skill-dot-gap);
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}
.skill-tags li {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--skill-dot-gap);
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.5;
}
.skill-tags li::before {
  content: "";
  width: 4px;
  height: 4px;
  flex: none;
  margin-block-start: calc(.5lh - 2px);
  border-radius: 50%;
  background: var(--accent);
}
.skill-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0 0;
}
.skill-tools-label {
  color: var(--muted);
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.skill-tool {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: .75rem;
  line-height: 1.35;
}

.experience {
  --timeline-rail-width: 24px;
  --timeline-date-width: clamp(8.5rem, 17vw, 12rem);
}
.experience-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px 24px;
}
.text-link { display: inline-flex; gap: 10px; justify-self: end; text-decoration: underline; text-underline-offset: 4px; }
.timeline {
  --timeline-rail-center: 6.5px;
  --timeline-marker-size: 16px;
  position: relative;
  list-style: none;
  padding: 0;
  padding-inline-start: var(--timeline-rail-width);
  margin: 28px 0 0;
}
.timeline::before {
  content: "";
  position: absolute;
  inset-block: 8px;
  inset-inline-start: calc(var(--timeline-rail-center) - .5px);
  width: 1px;
  background: color-mix(in srgb, var(--accent) 42%, var(--line));
}
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--timeline-date-width) minmax(0, 1fr);
  gap: 18px;
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: 20px;
  inset-inline-start: calc(var(--timeline-rail-center) - var(--timeline-rail-width) - var(--timeline-marker-size) / 2);
  box-sizing: border-box;
  width: var(--timeline-marker-size);
  height: var(--timeline-marker-size);
  border: 3px solid color-mix(in srgb, var(--accent) 32%, var(--line));
  border-radius: 50%;
  background: var(--page);
}
.timeline-item.current::before {
  --marker-halo: light-dark(var(--accent-soft), color-mix(in srgb, var(--accent) 25%, var(--page)));
  top: 5px;
  border-color: #fff;
  background: var(--accent-base);
  box-shadow: 0 0 0 4px var(--marker-halo);
}
.timeline-item.current:not(:last-child) {
  margin-block-end: clamp(24px, 3vw, 36px);
}
.timeline-date { padding-top: 4px; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.timeline-date time { white-space: nowrap; }
.timeline-item.current .timeline-date { color: var(--ink); font-weight: 650; }
.timeline-present {
  display: inline-block;
  padding-inline: .25em;
  border-radius: 4px;
  color: var(--accent);
  background: var(--accent-soft);
}
.timeline-content { min-width: 0; }
.company { margin: 0 0 7px; color: var(--accent); font-size: .71rem; font-weight: 600; }
.timeline-content > p:last-child { max-width: 75ch; margin: 15px 0 0; color: var(--muted); font-size: .92rem; line-height: 1.62; }
.timeline-item:not(.current) {
  padding-block: 15px;
  border-top: 1px solid var(--line);
}
.timeline-item:not(.current) .timeline-content {
  display: grid;
  grid-template-columns: minmax(155px, .75fr) minmax(0, 1.5fr);
  gap: 8px 22px;
  align-items: start;
}
.timeline-role { grid-column: 1; }
.timeline-item:not(.current) .company { margin-bottom: 4px; font-size: .65rem; }
.timeline-item:not(.current) .timeline-content h3 { font-size: .98rem; }
.timeline-item:not(.current) .timeline-content > p:last-child { grid-column: 2; grid-row: 1; margin: 0; font-size: .86rem; line-height: 1.55; }

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 22px;
  padding: 21px 0 28px;
  border-top: 1px solid var(--line);
  font-size: .82rem;
}
.site-footer p { margin: 0; font-weight: 750; }

@media (max-width: 620px) {
  :root { --header-height: 58px; }
  .header-inner { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px; }
  .theme-toggle { width: 36px; height: 36px; }
  .site-nav { gap: 0; padding: 3px; }
  .site-nav a { padding: 7px 5px; font-size: .72rem; white-space: nowrap; }
  .wordmark { width: clamp(52px, 18vw, 68px); }
  .hero { padding-inline: 8px; }
  h1 { font-size: clamp(1.8rem, 8vw, 2.2rem); letter-spacing: -.075em; }
  .hero-role { max-width: min(100%, 20rem); margin-top: 15px; }
  .hero-actions { margin-top: 22px; }
  .about, .skills-grid { grid-template-columns: 1fr; }
  .about { gap: 20px; }
  .about-copy { min-width: 0; }
  .about h2 { max-width: 23ch; }
  .experience { --timeline-date-width: 1fr; }
  .experience-header { grid-template-columns: minmax(0, 1fr); }
  .timeline-item { grid-template-columns: 1fr; gap: 7px; padding-block: 16px; }
  .timeline-item.current { gap: 9px; padding-block: 0; }
  .timeline-item:not(.current) .timeline-content { grid-template-columns: 1fr; gap: 7px; }
  .timeline-item:not(.current) .timeline-content > p:last-child { grid-column: 1; grid-row: auto; }
  .timeline-date { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 0 7px; }
}

@keyframes hero-arrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes current-role-pulse {
  from {
    box-shadow: 0 0 0 4px var(--marker-halo), 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent);
  }
  to {
    box-shadow: 0 0 0 4px var(--marker-halo), 0 0 0 10px transparent;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .timeline-item.current.pulse-marker::before { animation: current-role-pulse 1.6s ease-out 2; }
  .portrait-wrap, .hero .eyebrow, #hero-title, .hero-role, .hero-summary, .hero-actions {
    animation: hero-arrive 260ms ease both;
  }
  .hero .eyebrow { animation-delay: 35ms; }
  #hero-title { animation-delay: 65ms; }
  .hero-role { animation-delay: 95ms; }
  .hero-summary { animation-delay: 125ms; }
  .hero-actions { animation-delay: 155ms; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-nav::before, .site-nav a, .theme-toggle, .button { transition: none; }
}
