:root {
  color-scheme: light;
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-soft: #e8eef0;
  --surface-warm: #f1e9df;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(29, 29, 31, 0.12);
  --green: #155e5a;
  --orange: #b14f24;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 78px;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: "DM Sans", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  letter-spacing: -0.045em;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 999px;
  color: white;
  background: var(--text);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 58px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(29, 29, 31, 0.08);
  background: rgba(245, 245, 247, 0.82);
  backdrop-filter: saturate(180%) blur(18px);
}

.wordmark {
  width: max-content;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.05em;
}

.site-nav {
  display: flex;
  gap: 28px;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--text);
}

.lang-switch {
  justify-self: end;
  display: flex;
  gap: 4px;
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.lang-btn.active {
  color: white;
  background: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: clamp(48px, 8vw, 120px);
  align-items: center;
  min-height: calc(100svh - 58px);
  max-width: 1180px;
  margin: 0 auto;
  padding: 72px 24px;
}

.eyebrow,
.chapter-number {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 8ch;
  margin-top: 24px;
  font-family: "Noto Serif SC", Georgia, serif;
  font-size: clamp(4.2rem, 9vw, 8rem);
  font-weight: 600;
  line-height: 0.92;
}

.hero-statement {
  max-width: 27ch;
  margin-top: 32px;
  font-size: clamp(1.45rem, 2.5vw, 2.15rem);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.hero-lead {
  max-width: 58ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.75;
}

.hero-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 38px;
}

.route-card {
  position: relative;
  display: flex;
  min-height: 166px;
  padding: 22px;
  overflow: hidden;
  border-radius: 24px;
  flex-direction: column;
  text-decoration: none;
  transition: transform 240ms ease, box-shadow 240ms ease;
}

.route-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.route-card-personal {
  background: var(--surface-warm);
}

.route-card-work {
  background: var(--surface-soft);
}

.route-index {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.route-card strong {
  margin-top: auto;
  font-size: 1.16rem;
}

.route-card > span:not(.route-index, .route-arrow) {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.82rem;
}

.route-arrow {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 1.35rem;
}

.hero-portrait img {
  display: block;
  width: 100%;
  max-height: 72vh;
  aspect-ratio: 4 / 5;
  border-radius: 34px;
  object-fit: cover;
  object-position: 51% center;
  box-shadow: var(--shadow);
}

.hero-portrait figcaption {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.74rem;
}

.chapter {
  padding: clamp(92px, 12vw, 180px) max(24px, calc((100vw - 1180px) / 2));
}

.chapter-personal {
  background: #101918;
  color: #f5f5f7;
}

.chapter-work {
  background: var(--bg);
}

.chapter-intro {
  max-width: 920px;
  margin-bottom: clamp(64px, 9vw, 120px);
}

.chapter-intro h2,
.contact-section h2 {
  max-width: 12ch;
  margin-top: 20px;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.98;
}

.chapter-intro > p:last-child {
  max-width: 62ch;
  margin-top: 30px;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.75;
}

.chapter-personal .chapter-intro > p:last-child,
.chapter-personal .chapter-number {
  color: rgba(245, 245, 247, 0.6);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.feature-card {
  display: flex;
  min-height: 390px;
  padding: 30px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.055);
  flex-direction: column;
}

.feature-card > span {
  color: rgba(255, 255, 255, 0.42);
  font-size: 0.76rem;
}

.feature-card h3 {
  max-width: 15ch;
  margin-top: auto;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  line-height: 1.1;
}

.feature-card p {
  margin-top: 18px;
  color: rgba(245, 245, 247, 0.62);
  line-height: 1.65;
}

.interest-panel {
  display: grid;
  grid-template-columns: 0.55fr 1.45fr;
  gap: 48px;
  margin-top: 18px;
  padding: 42px;
  border-radius: 30px;
  color: var(--text);
  background: #dce4df;
}

.interest-panel h3 {
  margin-top: 12px;
  font-size: clamp(2rem, 4vw, 3.8rem);
}

.chips {
  display: flex;
  align-content: flex-start;
  flex-wrap: wrap;
  gap: 9px;
}

.chips span {
  padding: 9px 13px;
  border: 1px solid rgba(29, 29, 31, 0.14);
  border-radius: 999px;
  color: #3f4845;
  background: rgba(255, 255, 255, 0.34);
  font-size: 0.82rem;
}

.content-section {
  padding: clamp(72px, 8vw, 112px) 0;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: grid;
  grid-template-columns: 0.45fr 1.55fr;
  align-items: start;
  gap: 40px;
  margin-bottom: 44px;
}

.section-heading h3 {
  font-size: clamp(2.1rem, 4.2vw, 4rem);
}

.education-layout {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: clamp(36px, 7vw, 100px);
}

.education-layout h4 {
  font-size: 1.2rem;
}

.meta-line,
.period,
.body-copy {
  color: var(--muted);
  line-height: 1.7;
}

.meta-line {
  margin-top: 10px;
}

.period {
  margin-top: 14px;
  font-size: 0.84rem;
  font-weight: 600;
}

.thesis-title {
  margin-top: 28px;
  line-height: 1.4;
}

.thesis-title + .body-copy {
  margin-top: 12px;
}

.coursework-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 46px;
}

.coursework-group,
.skill-group {
  padding: 22px;
  border-radius: 22px;
  background: var(--surface);
}

.coursework-group h4,
.skill-category {
  color: var(--green);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.coursework-group ul {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.7;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  padding: 26px;
  border-radius: 26px;
  background: var(--surface);
}

.card-header,
.exp-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.card-period,
.card-org,
.exp-period,
.exp-company {
  color: var(--muted);
  font-size: 0.76rem;
}

.card-title {
  margin-top: 26px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.card-tech {
  margin-top: 12px;
  color: var(--green);
  font-size: 0.8rem;
  line-height: 1.55;
}

.card-highlights,
.exp-highlights {
  margin: 18px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.card-highlights li + li,
.exp-highlights li + li {
  margin-top: 8px;
}

.card-repo {
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.experience-list {
  border-top: 1px solid var(--line);
}

.exp-item {
  display: grid;
  grid-template-columns: 0.7fr 1.3fr;
  gap: clamp(32px, 7vw, 100px);
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
}

.exp-header {
  flex-direction: column;
  justify-content: flex-start;
}

.exp-title {
  font-size: 1.2rem;
}

.exp-company {
  display: block;
  margin-top: 7px;
}

.exp-period {
  margin-top: 8px;
}

.exp-highlights {
  margin-top: 0;
}

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

.skill-group .chips {
  margin-top: 16px;
}

.contact-section {
  padding: clamp(100px, 14vw, 190px) max(24px, calc((100vw - 1180px) / 2));
  color: white;
  background: var(--green);
}

.contact-section > p:not(.eyebrow) {
  max-width: 58ch;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}

.contact-section .eyebrow {
  color: rgba(255, 255, 255, 0.58);
}

.contact-row {
  display: flex;
  gap: 28px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 52px;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 600;
}

.email-text {
  user-select: all;
  cursor: text;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.contact-row a {
  color: white;
  text-underline-offset: 5px;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px max(24px, calc((100vw - 1180px) / 2));
  color: var(--muted);
  background: #101918;
  font-size: 0.76rem;
}

.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 700ms ease, transform 700ms ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid rgba(42, 128, 120, 0.55);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr 0.72fr;
    gap: 36px;
  }

  .hero-routes,
  .feature-grid,
  .cards,
  .coursework-list {
    grid-template-columns: 1fr;
  }

  .feature-card {
    min-height: 300px;
  }

  .interest-panel,
  .education-layout,
  .exp-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  html {
    scroll-padding-top: 54px;
  }

  .site-header {
    grid-template-columns: auto 1fr auto;
    min-height: 54px;
    padding: 0 16px;
  }

  .site-nav {
    justify-content: center;
    gap: 18px;
  }

  .site-nav a {
    font-size: 0.76rem;
  }

  .lang-btn {
    padding: 6px 7px;
    font-size: 0.7rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 58px 18px 72px;
  }

  .hero h1 {
    font-size: clamp(3.7rem, 19vw, 5.7rem);
  }

  .hero-statement {
    font-size: 1.42rem;
  }

  .hero-routes {
    grid-template-columns: 1fr;
  }

  .route-card {
    min-height: 138px;
    border-radius: 22px;
  }

  .hero-portrait {
    order: -1;
  }

  .hero-portrait img {
    max-height: none;
    aspect-ratio: 4 / 4.6;
    border-radius: 26px;
  }

  .hero-portrait figcaption {
    flex-direction: column;
    gap: 4px;
  }

  .chapter {
    padding: 92px 18px;
  }

  .chapter-intro h2,
  .contact-section h2 {
    font-size: clamp(3rem, 14vw, 4.6rem);
  }

  .feature-grid {
    display: flex;
    margin-inline: -18px;
    padding: 0 18px 10px;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .feature-card {
    min-width: 84vw;
    min-height: 360px;
    border-radius: 26px;
    scroll-snap-align: center;
  }

  .interest-panel {
    gap: 30px;
    padding: 28px 22px;
    border-radius: 26px;
  }

  .section-heading {
    display: block;
  }

  .section-heading h3 {
    margin-top: 12px;
  }

  .education-layout {
    gap: 34px;
  }

  .coursework-list,
  .cards,
  .skills-grid {
    display: flex;
    margin-inline: -18px;
    padding: 0 18px 10px;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .coursework-group,
  .card,
  .skill-group {
    min-width: 84vw;
    border: 1px solid var(--line);
    scroll-snap-align: center;
  }

  .exp-item {
    gap: 22px;
    margin-bottom: 14px;
    padding: 24px;
    border: 0;
    border-radius: 24px;
    background: var(--surface);
  }

  .experience-list {
    border: 0;
  }

  .contact-section {
    padding: 96px 18px;
  }

  .contact-row {
    align-items: flex-start;
    flex-direction: column;
  }

  footer {
    padding: 28px 18px;
    flex-direction: column;
  }
}

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

  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
