:root {
  /* Blues */
  --blue-900: #0A2342;
  --blue-700: #123A6F;
  --blue-500: #1F5AA6;
  --blue-100: #D9E6F7;

  /* Neutrals */
  --ink-900: #0F1115;
  --ink-700: #2A2F36;
  --ink-500: #4B515B;
  --ink-300: #C6CBD4;
  --paper: #F7F9FC;
  --white: #FFFFFF;

  /* Elevation */
  --elev-0: none;
  --elev-1: 0 4px 12px rgba(10, 35, 66, 0.06);
  --elev-2: 0 12px 32px rgba(10, 35, 66, 0.08);

  /* Layout */
  --max-width: 1200px;
  --outer-margin: clamp(16px, 4vw, 64px);
  --gutter: clamp(24px, 3vw, 48px);
  --section-padding: clamp(32px, 6vh, 64px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  background: var(--paper);
  color: var(--ink-900);
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

main {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  background: var(--paper);
}

section {
  margin: 0;
}

a {
  color: var(--blue-500);
  text-decoration: none;
  transition: color 0.22s var(--ease-out);
}

a:hover,
a:focus-visible {
  color: var(--blue-700);
}

a::after { content: none; }

a:not(.button) {
  position: relative;
  font-weight: 400;
}

.button::after {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.6rem;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--blue-500);
  background: var(--white);
  color: var(--blue-700);
  transition: transform 0.18s var(--ease-out), border-color 0.22s var(--ease-out), color 0.22s var(--ease-out), background-color 0.22s var(--ease-out);
  box-shadow: var(--elev-0);
}

.button:hover {
  border-color: var(--blue-500);
  background: var(--blue-100);
}

.button:active {
  transform: scale(0.98);
}

.button--ghost {
  background: transparent;
  border-color: var(--ink-300);
  color: var(--ink-700);
}

.button--ghost:hover {
  color: var(--blue-700);
  border-color: var(--blue-500);
  background: rgba(31, 90, 166, 0.08);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 10;
  background: transparent;
  backdrop-filter: blur(0px);
  transition: background-color 0.32s var(--ease-out), box-shadow 0.32s var(--ease-out), backdrop-filter 0.32s var(--ease-out);
}

.topbar__inner {
  width: min(var(--max-width), calc(100% - 2 * var(--outer-margin)));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 2vw, 32px);
  padding: clamp(16px, 2vh, 24px) 0;
}

.brand {
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 600;
  color: var(--blue-900);
  letter-spacing: -0.01em;
}

.brand::after {
  display: none;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(16px, 2vw, 32px);
}

.primary-nav__link {
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-700);
}

.primary-nav__link::after {
  bottom: -6px;
  background: var(--blue-500);
}

.topbar--solid {
  background: rgba(247, 249, 252, 0.9);
  backdrop-filter: blur(16px);
  box-shadow: var(--elev-1);
}

.dot-nav {
  position: fixed;
  top: 50%;
  right: var(--outer-margin);
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  z-index: 9;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid var(--ink-300);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.22s var(--ease-out), border-color 0.22s var(--ease-out), transform 0.22s var(--ease-out);
  position: relative;
}

.dot::after {
  content: attr(aria-label);
  position: absolute;
  right: 150%;
  top: 50%;
  transform: translateY(-50%);
  background: var(--ink-900);
  color: var(--white);
  font-size: clamp(10px, 0.8vw, 12px);
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
  white-space: nowrap;
}

.dot:hover::after,
.dot:focus-visible::after {
  opacity: 1;
  transform: translate(-4px, -50%);
}

.dot:hover,
.dot:focus-visible {
  border-color: var(--blue-500);
}

.dot.is-active {
  background: var(--blue-500);
  border-color: var(--blue-500);
  transform: scale(1.1);
}

.dot.is-active::after {
  background: var(--blue-700);
}

.slide {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-block: var(--section-padding);
  padding-inline: var(--outer-margin);
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.slide__inner {
  width: min(var(--max-width), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--gutter);
  row-gap: clamp(24px, 3vh, 40px);
  align-items: start;
}

.meta-block,
.body-block {
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 2vh, 28px);
}

.meta-block {
  grid-column: 1 / span 5;
}

.body-block {
  grid-column: 6 / -1;
}

.overline {
  font-size: clamp(12px, 1vw, 14px);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--blue-700);
  font-weight: 600;
}

h1 {
  font-size: clamp(28px, 4.2vw, 56px);
  line-height: 1.05;
  font-weight: 600;
  color: var(--blue-900);
  margin: 0;
}

.lead {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  font-weight: 400;
  color: var(--ink-700);
  max-width: 36ch;
  hyphens: auto;
}

.fact-list,
.key-points,
.experience-card__bullets,
.education-card__details,
.pill-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: clamp(8px, 1.6vh, 16px);
}

.fact-list li,
.body-text {
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--ink-700);
  max-width: 48ch;
  hyphens: auto;
}

.body-text {
  margin: 0;
}

.key-points li {
  position: relative;
  padding-left: 20px;
  font-size: clamp(14px, 1.2vw, 18px);
  color: var(--ink-900);
}

.key-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 2px;
  background: var(--blue-500);
}

.portrait {
  width: clamp(96px, 12vw, 140px);
  height: clamp(96px, 12vw, 140px);
  border-radius: 50%;
  overflow: hidden;
  align-self: flex-start;
  box-shadow: var(--elev-1);
  border: 1px solid rgba(10, 35, 66, 0.12);
  margin: 0;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.65);
}

.experience-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
}

.education-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
}

.experience-card,
.education-card,
.skills-column {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(31, 90, 166, 0.08);
  border-radius: 20px;
  padding: clamp(20px, 3vw, 28px);
  box-shadow: var(--elev-1);
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.8vh, 20px);
}

.experience-card__header,
.education-card__header {
  display: grid;
  gap: 4px;
}

.experience-card__company,
.education-card__institution {
  font-weight: 600;
  font-size: clamp(16px, 1.4vw, 20px);
  color: var(--blue-900);
  margin: 0;
}

.experience-card__meta,
.education-card__meta {
  font-size: clamp(12px, 1vw, 14px);
  color: var(--ink-500);
  margin: 0;
}

.experience-card__bullets li,
.education-card__details li {
  font-size: clamp(13px, 1.1vw, 16px);
  color: var(--ink-700);
  padding-left: 18px;
  position: relative;
}

.experience-card__bullets li::before,
.education-card__details li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 2px;
  background: var(--blue-100);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 32px);
}

.skills-column {
  gap: clamp(12px, 1.6vh, 18px);
}

.subhead {
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 600;
  color: var(--blue-700);
  margin: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-list li {
  border: 1px solid var(--ink-300);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: clamp(12px, 1vw, 14px);
  color: var(--ink-700);
  background: var(--white);
  transition: border-color 0.22s var(--ease-out), color 0.22s var(--ease-out);
}

.pill-list li:hover {
  border-color: var(--blue-500);
  color: var(--blue-700);
}

.slide {
  background: linear-gradient(160deg, rgba(10, 35, 66, 0.04) 0%, rgba(247, 249, 252, 1) 60%, rgba(217, 230, 247, 0.25) 100%);
}

#experience {
  background: linear-gradient(140deg, rgba(18, 58, 111, 0.08) 0%, rgba(247, 249, 252, 1) 55%, rgba(31, 90, 166, 0.12) 100%);
}

#education {
  background: linear-gradient(160deg, rgba(10, 35, 66, 0.05) 0%, rgba(247, 249, 252, 1) 70%, rgba(198, 203, 212, 0.2) 100%);
}

#skills {
  background: linear-gradient(160deg, rgba(31, 90, 166, 0.06) 0%, rgba(247, 249, 252, 1) 60%, rgba(10, 35, 66, 0.08) 100%);
}

.stagger > * {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.28s var(--ease-out), transform 0.28s var(--ease-out);
}

.slide.is-active .stagger > * {
  opacity: 1;
  transform: translateY(0);
}

.slide.is-active .stagger > *:nth-child(1) {
  transition-delay: 0.08s;
}

.slide.is-active .stagger > *:nth-child(2) {
  transition-delay: 0.16s;
}

.slide.is-active .stagger > *:nth-child(3) {
  transition-delay: 0.24s;
}

.slide.is-active .stagger > *:nth-child(4) {
  transition-delay: 0.32s;
}

.slide.is-active .stagger > *:nth-child(5) {
  transition-delay: 0.4s;
}

:focus-visible {
  outline: 2px solid var(--blue-500);
  outline-offset: 3px;
}

@supports (text-wrap: balance) {
  h1,
  .lead,
  .subhead {
    text-wrap: balance;
  }
}

@media (max-width: 1199px) {
  .slide__inner {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }

  .meta-block {
    grid-column: 1 / span 3;
  }

  .body-block {
    grid-column: 4 / -1;
  }

  .experience-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .education-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .primary-nav {
    display: none;
  }
}

@media (max-width: 767px) {
  html,
  body {
    overflow: auto;
  }

  main {
    scroll-snap-type: y proximity;
  }

  .topbar__inner {
    width: calc(100% - 2 * var(--outer-margin));
  }

  .button--ghost {
    display: none;
  }

  .dot-nav {
    flex-direction: row;
    top: auto;
    bottom: clamp(24px, 6vh, 48px);
    right: 50%;
    transform: translate(50%, 0);
    background: rgba(247, 249, 252, 0.9);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: var(--elev-1);
  }

  .dot::after {
    display: none;
  }

  .slide {
    padding-inline: clamp(20px, 6vw, 32px);
    align-items: flex-start;
  }

  .slide__inner {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .meta-block,
  .body-block {
    grid-column: 1 / -1;
    gap: clamp(12px, 2vh, 20px);
  }

  .meta-block {
    max-width: none;
  }

  .body-block {
    gap: clamp(16px, 2vh, 24px);
  }

  .experience-list,
  .skills-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 480px) {
  .portrait {
    display: none;
  }

  .pill-list {
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  main {
    scroll-behavior: auto !important;
  }

  .stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
