:root {
  color-scheme: light;
  font-family: Inter, system-ui, sans-serif;
  --canvas: #fafaf9;
  background: var(--canvas);
  color: #20201e;
  --muted: #62625e;
  --section-space: clamp(3rem, 6vw, 5.5rem);
  --body-size: 1.0625rem;
  --lead-size: clamp(1.125rem, 1.7vw, 1.3125rem);
  --reading-width: 60ch;
  --accent: #3456c5;
  --border: #d4d4d0;
  --surface: #fff;
  --badge-border: #e5e5e2;
  --button-label: #fff;
  --inspire-cover: #c9252c;
  --mckesson-cover: #005a8c;
  --fig-cover: #fff;
  --fig-ink: #033838;
  --urban-cover: #e0e621;
  --urban-ink: #121211;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #121211;
  color: #fafaf9;
  --muted: #d4d4d0;
  --accent: #a8b9ff;
  --border: #62625e;
  --surface: #20201e;
  --badge-border: #333330;
  --button-label: #121211;
  --inspire-cover: #231f20;
  --mckesson-cover: #143359;
  --fig-cover: #033838;
  --fig-ink: #fff;
  --urban-cover: #000;
  --urban-ink: #e0e621;
}
* { box-sizing: border-box; }
body { margin: 0; font-size: var(--body-size); line-height: 1.6; }
html { scrollbar-gutter: stable; scroll-padding-top: 7rem; }
.wrap { width: min(100% - 3rem, 75rem); margin-inline: auto; }
a { color: inherit; text-underline-offset: 0.22em; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: fixed; z-index: 11; padding: 0.75rem; background: var(--surface); transform: translateY(-120%); }
.skip:focus { transform: none; }
.site-header, nav, .site-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.site-header a, .site-footer a, .action { display: inline-flex; align-items: center; min-height: 44px; }
nav a { text-decoration: none; }
nav a[aria-current] { color: var(--accent); text-decoration: underline; }
.hero { padding-block: var(--section-space); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2.625rem, 6vw, 4.75rem); line-height: 1.08; letter-spacing: -0.045em; font-weight: 650; text-wrap: balance; }
h2 { font-size: clamp(1.75rem, 3vw, 2.375rem); line-height: 1.2; letter-spacing: -0.03em; font-weight: 600; margin-bottom: 1.25rem; text-wrap: balance; }
h3 { font-size: clamp(1.125rem, 2vw, 1.375rem); line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; }
p { color: var(--muted); }
.intro { max-width: var(--reading-width); margin-top: 1.25rem; font-size: var(--lead-size); line-height: 1.55; }
.experience-intro { max-width: none; text-wrap: pretty; }
.experience-eyebrow {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
}
.profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.action { gap: 0.55rem; margin-top: 0.65rem; font-weight: 600; }
.projects, .roles, .tools { list-style: none; margin: 0; padding: 0; }
.projects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.roles li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.375rem clamp(1.5rem, 5vw, 4rem);
  padding-block: clamp(1.25rem, 3vw, 2rem);
  border-top: 1px solid var(--border);
}
.dates { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.job-title { color: inherit; font-size: 0.9375rem; font-weight: 500; margin-block: 0.25rem 0.5rem; }
.experience-section { margin-top: clamp(2.5rem, 6vw, 4.5rem); }
.experience-tools { margin-bottom: var(--section-space); }
.tools {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
}
.tools li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
}
.tools img { display: block; flex: none; width: 24px; height: 24px; }
@media (max-width: 64rem) {
  .tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 32rem) {
  .tools { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 21rem) {
  .tools { grid-template-columns: 1fr; }
}
:root[data-theme="dark"] .tool-logo-mono { filter: invert(1); }
.site-footer { margin-top: 3rem; padding-block: 0.75rem 1.5rem; border-top: 1px solid var(--border); }
@media (max-width: 38rem) {
  .projects, .roles li { grid-template-columns: 1fr; }
}

.site-header {
  --header-padding: clamp(1rem, 2vw, 1.5rem);
  --compact-padding: 0.625rem;
  position: sticky;
  top: 0;
  z-index: 10;
  isolation: isolate;
  justify-content: space-between;
  padding-block: var(--header-padding);
  gap: 0.75rem 1rem;
}
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--canvas);
  box-shadow: 0 0 0 100vmax var(--canvas);
  clip-path: inset(0 -100vmax);
  border-bottom: 1px solid transparent;
}
.site-header.is-scrolled::before { border-color: var(--badge-border); }
.site-header.is-compact {
  padding-block: var(--compact-padding);
  margin-bottom: calc(2 * (var(--header-padding) - var(--compact-padding)));
}
.site-header nav { gap: 1.5rem; font-size: 0.875rem; }
.external-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); gap: 0.25rem; font-size: 0.875rem; text-decoration: none; }
.external-link:hover { text-decoration: underline; }
.sun, .dark-logo { display: none; }
.theme-toggle {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { background: var(--surface); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:root[data-theme="dark"] .moon,
:root[data-theme="dark"] :is(.project--8fig, .project--urban-air) .project-logo img:first-child { display: none; }
:root[data-theme="dark"] :is(.sun, .dark-logo) { display: block; }
.home-footer > h2 { text-wrap: initial; }
.project-summary { max-width: 54ch; }
.coming-soon .projects { margin-top: clamp(1.75rem, 4vw, 3rem); gap: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 4vw, 2.5rem); }
.project { min-width: 0; }
.project-cover {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 20rem;
  padding: 2rem;
  border: 1px solid var(--cover-border, transparent);
  border-radius: 12px;
  background: var(--cover);
  color: var(--cover-ink, #fff);
}
.project-cover p { color: inherit; }
.cover-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; min-height: 3.375rem; }
.project-logo { display: block; min-width: 0; }
.project-logo img { max-width: 100%; height: auto; vertical-align: top; }
.project-status { flex: none; border-radius: 999px; border: 1px solid var(--badge-border); background: var(--surface); color: var(--muted); padding: 0.25rem 0.5rem; font-size: 0.75rem; line-height: 1.5; }
.cover-title { font-size: 2rem; line-height: 1.25; font-weight: 500; letter-spacing: -0.025em; margin-block: auto; }
.cover-detail { font-size: 0.875rem; line-height: 1.5; }
.project h3 { margin-top: 1.25rem; }
.project-summary { margin-top: 0.5rem; }
.project--inspire { --cover: var(--inspire-cover); }
.project--mckesson { --cover: var(--mckesson-cover); }
.project--8fig { --cover: var(--fig-cover); --cover-ink: var(--fig-ink); --cover-border: var(--badge-border); }
:root[data-theme="dark"] .project { --cover-border: color-mix(in srgb, var(--cover) 94%, white); }
.project--urban-air { --cover: var(--urban-cover); --cover-ink: var(--urban-ink); }
.home-footer { border-top: 1px solid var(--border); margin-top: var(--section-space); padding-block: clamp(2rem, 4vw, 3rem) var(--section-space); }
.contact-button { display: inline-flex; min-height: 48px; align-items: center; gap: 0.5rem; padding-inline: 1.5rem; margin-top: 1.5rem; border-radius: 8px; background: var(--accent); color: var(--button-label); text-decoration: none; }
.contact-button:hover { color: var(--button-label); text-decoration: underline; }
.home-footer > .footer-note { margin-top: 1.5rem; font-size: 0.75rem; }
@media (max-width: 48rem) {
  .coming-soon .projects { grid-template-columns: 1fr; }
  .site-header { column-gap: 0.5rem; }
}
@media (max-width: 23rem) {
  .project-cover { padding: 1.25rem; }
}

.header-actions { display: flex; align-items: center; gap: 1.5rem; }
.mobile-menu { display: none; }
.mobile-menu summary {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  cursor: pointer;
  list-style: none;
}
.mobile-menu summary::-webkit-details-marker { display: none; }
.mobile-menu summary:hover, .mobile-menu[open] summary { background: var(--surface); }
.mobile-menu summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.menu-icon { width: 18px; height: 14px; border-block: 2px solid currentColor; display: grid; align-items: center; }
.menu-icon::before { content: ""; height: 2px; background: currentColor; }
@media (max-width: 48rem) {
  .site-header { flex-wrap: nowrap; }
  .site-header .desktop-nav, .site-header .header-actions > .external-link { display: none; }
  .header-actions { flex: none; gap: 0.25rem; }
  .mobile-menu { display: block; position: relative; }
  .site-header .mobile-nav {
    position: absolute;
    z-index: 2;
    inset-block-start: calc(100% + 0.5rem);
    inset-inline-start: 0;
    display: grid;
    gap: 0;
    min-width: 11rem;
    padding: 0.5rem;
    border: 1px solid var(--badge-border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 8px 24px rgb(0 0 0 / 15%);
  }
  .site-header .mobile-menu:not([open]) .mobile-nav { display: none; }
  .site-header .mobile-nav a { padding-inline: 0.75rem; border-radius: 6px; }
  .site-header .mobile-nav a:hover { background: color-mix(in srgb, currentColor 8%, transparent); }
}

/* Keep the header steady while the next page comes into view. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }

  main { view-transition-name: page-content; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  /* These are destination styles: Experience is to the right of Work. */
  ::view-transition-group(page-content) {
    --page-offset: clamp(1.5rem, 6vw, 4rem);
  }

  :root:has(body.coming-soon)::view-transition-group(page-content) {
    --page-offset: calc(-1 * clamp(1.5rem, 6vw, 4rem));
  }

  ::view-transition-old(page-content) {
    animation: page-out 220ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  ::view-transition-new(page-content) {
    animation: page-in 300ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  @keyframes page-out {
    to { opacity: 0; transform: translateX(calc(-1 * var(--page-offset))); }
  }

  @keyframes page-in {
    from { opacity: 0; transform: translateX(var(--page-offset)); }
    to { opacity: 1; transform: translateX(0); }
  }

  :root.theme-ready,
  .theme-ready :is(p, small, .project-cover, .project-status, .roles li, footer, .mobile-nav) {
    transition: background-color 240ms ease, color 240ms ease, border-color 240ms ease;
  }

  .site-header { transition: padding 200ms ease, margin-bottom 200ms ease; }
  .site-header::before { transition: background-color 240ms ease, box-shadow 240ms ease, border-color 200ms ease; }

  .theme-toggle, .mobile-menu summary, .site-header nav a, .contact-button, .site-footer a {
    transition: background-color 200ms ease, color 200ms ease, transform 160ms ease;
  }

  .theme-toggle:active, .mobile-menu summary:active, .contact-button:active { transform: scale(0.96); }

  .theme-toggle img {
    transition: opacity 200ms ease, transform 240ms ease;
  }

  .mobile-menu[open] .mobile-nav { animation: menu-in 180ms ease-out both; }
  @keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } }
}

.theme-toggle .moon, .theme-toggle .sun,
:root[data-theme="dark"] .theme-toggle .moon {
  display: block;
  grid-area: 1 / 1;
}
.theme-toggle .sun, :root[data-theme="dark"] .theme-toggle .moon {
  opacity: 0;
  transform: rotate(-20deg) scale(0.8);
}
:root[data-theme="dark"] .theme-toggle .sun {
  opacity: 1;
  transform: none;
}

.roles.education li { grid-template-columns: 1fr; }
