:root {
  --bg: #faf8f3;
  --surface: #f4f1e8;
  --surface-2: #fffdf8;
  --logo-bg: #ffffff;
  --text: #1f1e2c;
  --text-2: #2c2b3a;
  --text-3: #3c3a4a;
  --muted: #5d5a6c;
  --muted-2: #4b4858;
  --faint: #6b6878;
  --faint-2: #8a8696;
  --accent: #4a4490;
  --rule: #1f1e2c;
  --line: #e6e1d4;
  --line-soft: #ece7da;
  --pill-border: #d9d3c4;
  --chip-bg: #1f1e2c;
  --chip-text: #fff7ea;
  --header-bg: rgba(250, 248, 243, 0.92);
  --hero-image: url("/assets/design/hero-photo.png");
  --hero-pos: center 30%;
  --hero-scrim: linear-gradient(90deg, rgba(244, 234, 222, 0.84) 0%, rgba(244, 234, 222, 0.56) 34%, rgba(244, 234, 222, 0.14) 54%, rgba(244, 234, 222, 0) 70%);
}

html[data-theme="dark"] {
  --bg: #131019;
  --surface: #0e0c14;
  --surface-2: #17131f;
  --logo-bg: #f3f0e9;
  --text: #f4f1ea;
  --text-2: #e6e2d8;
  --text-3: #d2cde0;
  --muted: #a39eb2;
  --muted-2: #b3aec0;
  --faint: #948fa6;
  --faint-2: #807b93;
  --accent: #b6aef0;
  --rule: #4a4659;
  --line: #2b2836;
  --line-soft: #24222e;
  --pill-border: #3a3746;
  --chip-bg: #f4f1ea;
  --chip-text: #131019;
  --header-bg: rgba(19, 16, 25, 0.94);
  --hero-image: url("/assets/design/hero-photo-dark.png");
  --hero-pos: center 28.6%;
  --hero-scrim: linear-gradient(90deg, rgba(19, 16, 25, 0.93) 0%, rgba(19, 16, 25, 0.7) 34%, rgba(19, 16, 25, 0.3) 56%, rgba(19, 16, 25, 0) 74%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Literata", Georgia, serif;
  font-size: 16px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: #e2dcf4;
}

html[data-theme="dark"] ::selection {
  background: #3a3550;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

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

p,
ul,
ol,
li {
  font-size: 1rem;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.16;
}

h1 {
  font-size: clamp(2.5rem, 7vw, 3.35rem);
  font-weight: 700;
}

h2 {
  font-size: 26px;
  font-weight: 600;
}

h3 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.35;
}

main,
footer {
  width: 100%;
}

main:not(.home-main) {
  max-width: 880px;
  margin: 0 auto;
  padding: 64px 32px 96px;
}

body > footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

body > footer .footer-text,
body > footer p {
  max-width: 880px;
  margin: 0 auto;
  padding: 28px 32px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  max-width: 1060px;
  height: 64px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand,
nav a,
.inline-nav,
.breadcrumbs,
.article-meta,
.subtitle,
.links-row,
.xp-meta,
.pub-meta,
.footer-text,
.contact-list {
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.site-brand {
  color: var(--muted-2);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover,
nav a:hover {
  color: var(--accent);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  row-gap: 8px;
}

nav a {
  color: var(--muted-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-toggle,
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle:hover,
.lang-toggle:hover {
  background: var(--line-soft);
  color: var(--text);
}

body > .theme-toggle,
body > .lang-toggle {
  position: fixed;
  top: 18px;
  z-index: 50;
  background: var(--bg);
}

body > .theme-toggle {
  right: 18px;
}

body > .lang-toggle {
  right: 62px;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

.lang-toggle {
  padding: 0 13px;
}

.hero {
  position: relative;
  min-height: 560px;
  margin-top: -64px;
  padding-top: 64px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background-image: var(--hero-image);
  background-position: var(--hero-pos);
  background-size: cover;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-scrim);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1060px;
  margin: 0 auto;
  padding: 44px 32px;
}

.hero__content {
  max-width: 560px;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
}

.hero h1 {
  max-width: 600px;
  font-weight: 600;
}

.hero__lead {
  max-width: 470px;
  margin: 16px 0 0;
  color: var(--text-3);
  font-size: 18px;
  line-height: 1.6;
}

.hero__actions,
.hero__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px 22px;
}

.hero__actions {
  margin-top: 24px;
}

.hero__links {
  margin-top: 22px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.button-primary {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.button-primary:hover {
  color: var(--chip-text);
  opacity: 0.86;
}

.text-link-strong {
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--text);
  padding-bottom: 2px;
}

.section {
  max-width: 1060px;
  margin: 0 auto;
  padding: 56px 32px 0;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.section-heading {
  margin-bottom: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
}

.bio-stack {
  display: grid;
  gap: 16px;
  color: var(--text-2);
}

.bio,
.section-note,
.desc,
.card p,
.article-body p,
.article-body li {
  color: var(--muted);
}

.bio {
  margin: 0 0 16px;
}

.bio-stack .bio {
  margin: 0;
}

.xp-entry {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
}

.xp-entry:first-of-type {
  padding-top: 0;
}

.xp-entry:last-child {
  border-bottom: 0;
}

.xp-logo {
  flex: none;
  width: 36px;
  height: 36px;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--logo-bg);
  object-fit: contain;
  padding: 4px;
}

.xp-body strong,
.entry strong,
.pub-item strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
}

.xp-meta {
  margin: 4px 0 6px;
  color: var(--faint-2);
  font-size: 13px;
  font-weight: 500;
}

.desc,
.pub-item p,
.card p,
.article-body p,
.article-body li {
  margin: 0;
}

.edu-heading {
  margin-top: 48px;
}

.edu-entry {
  padding-bottom: 0;
  border-bottom: 0;
}

.edu-stage + .edu-stage {
  margin-top: 14px;
}

.edu-stage .desc {
  margin-top: 4px;
}

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

.mini-card,
.card {
  padding: 18px 0;
  border-top: 1px solid var(--line-soft);
}

.mini-card p,
.section-note {
  margin: 8px 0 0;
}

.section-note {
  max-width: 720px;
}

.card-grid {
  display: grid;
}

.card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 22px;
}

.card:first-child {
  border-top-color: var(--rule);
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover {
  color: var(--accent);
}

.pub-meta {
  color: var(--faint-2);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.pub-year {
  color: var(--faint-2);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  padding-top: 5px;
}

.pub-list,
.contact-list,
.article-list,
.article-body ul {
  margin: 0;
  padding-left: 20px;
}

.contact-list {
  color: var(--muted);
}

.inline-nav,
.breadcrumbs,
.article-meta,
.footer-text,
.links-row,
.subtitle {
  color: var(--faint);
  font-size: 14px;
  line-height: 1.7;
}

.subtitle {
  margin: 14px 0 0;
  font-size: 17px;
}

.links-row {
  margin: 14px 0 0;
}

.article-byline {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--text-2);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.article-links {
  margin: 8px 0 0;
  color: var(--faint);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.7;
}

.article-links a {
  text-underline-offset: 2px;
}

.article-links .sep {
  color: var(--faint-2);
  margin: 0 9px;
}

.article-header {
  margin: 34px 0 24px;
  padding-top: 24px;
  border-top: 2px solid var(--rule);
}

.article-title {
  max-width: 760px;
  margin-top: 10px;
  font-size: clamp(2rem, 5vw, 2.9rem);
}

.article-lead {
  max-width: 760px;
  margin: 18px 0 0;
  color: var(--text-2);
  font-size: 18px;
  line-height: 1.7;
}

.article-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--pill-border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.meta-pill .pill-icon {
  width: 14px;
  height: 14px;
  flex: none;
  color: var(--accent);
}

.meta-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface);
}

.article-body {
  display: grid;
  gap: 18px;
}

.article-body ul {
  display: grid;
  gap: 8px;
  padding: 18px 20px 18px 38px;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

hr.major {
  margin: 24px 0 0;
  border-top: 2px solid var(--rule);
}

.profile-photo {
  display: none;
}

@media (max-width: 860px) {
  .site-header__inner {
    height: auto;
    min-height: 64px;
    padding-top: 12px;
    padding-bottom: 12px;
    align-items: flex-start;
  }

  .header-actions {
    gap: 10px;
  }

  .site-header nav {
    display: none;
  }

  .hero {
    min-height: 520px;
    --hero-pos: 62% 30%;
  }

  html[data-theme="dark"] .hero {
    --hero-pos: 62% 28.6%;
  }

  .split-grid,
  .education-grid,
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 38px;
  }
}

@media (max-width: 620px) {
  main:not(.home-main) {
    padding: 44px 20px 72px;
  }

  body > footer .footer-text,
  body > footer p,
  .site-header__inner,
  .hero__inner,
  .section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    min-height: 600px;
    align-items: flex-end;
    --hero-pos: 68% 30%;
  }

  html[data-theme="dark"] .hero {
    --hero-pos: 68% 28.6%;
  }

  .hero__inner {
    padding-bottom: 42px;
  }

  .card {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pub-year {
    padding-top: 0;
  }

  .header-row {
    display: block;
  }

  .header-row nav {
    margin-top: 14px;
  }

  body > .theme-toggle {
    top: 12px;
    right: 12px;
  }

  body > .lang-toggle {
    top: 12px;
    right: 56px;
  }

  h1 {
    font-size: 2.45rem;
  }
}
