:root {
  color-scheme: dark;
  --bg: #070b13;
  --bg-soft: #101521;
  --panel: rgba(25, 31, 43, 0.82);
  --panel-strong: rgba(25, 31, 43, 0.97);
  --line: rgba(173, 151, 103, 0.28);
  --text: #f4f0e8;
  --muted: #a9adba;
  --accent: #b89b5e;
  --accent-2: #e5d5b5;
  --success: #6f8ea8;
  --danger: #b45b5f;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.2);
  --radius: 8px;
  --topbar-bg: rgba(7, 11, 19, 0.9);
  --ghost-bg: rgba(16, 21, 33, 0.72);
  --button-text: #070b13;
  --surface-glow: rgba(184, 155, 94, 0.055);
}

body.light-mode {
  color-scheme: light;
  --bg: #faf8f3;
  --bg-soft: #eee7d8;
  --panel: rgba(255, 252, 246, 0.86);
  --panel-strong: rgba(255, 252, 246, 0.98);
  --line: rgba(117, 95, 52, 0.24);
  --text: #171b24;
  --muted: #667085;
  --accent: #8a6a2f;
  --accent-2: #3a4456;
  --success: #2f6f55;
  --danger: #9f4448;
  --shadow: 0 12px 34px rgba(46, 38, 22, 0.08);
  --topbar-bg: rgba(250, 248, 243, 0.9);
  --ghost-bg: rgba(255, 252, 246, 0.72);
  --button-text: #fffaf0;
  --surface-glow: rgba(184, 155, 94, 0.075);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 76% 4%, var(--surface-glow), transparent 22rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft) 58%, var(--bg));
  color: var(--text);
  font-family: "Inter", sans-serif;
  font-weight: 400;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.topbar {
  align-items: center;
  backdrop-filter: blur(22px);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 70px;
  padding: 10px clamp(18px, 4vw, 50px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand,
.nav-links,
.theme-toggle,
.hero-actions,
.identity-list {
  align-items: center;
  display: flex;
}

.brand {
  font-weight: 700;
  gap: 12px;
}

.brand-mark {
  background: rgba(184, 155, 94, 0.08);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  height: 48px;
  place-items: center;
  width: 48px;
}

.brand-logo {
  display: block;
  height: 36px;
  width: 36px;
}

.nav-links {
  color: var(--muted);
  gap: clamp(16px, 2.7vw, 34px);
  font-size: 0.9rem;
}

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

.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  gap: 8px;
  min-width: 82px;
  padding: 7px 11px;
}

.toggle-dot {
  background: var(--accent);
  border-radius: 999px;
  height: 10px;
  transition: transform 180ms ease;
  width: 10px;
}

body.light-mode .toggle-dot {
  transform: translateX(4px);
}

.section-shell {
  margin: 0 auto;
  max-width: 1140px;
  padding: clamp(44px, 5.5vw, 72px) clamp(18px, 4vw, 52px);
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(32px, 5vw, 64px);
  grid-template-columns: minmax(0, 1.08fr) minmax(260px, 340px);
  padding-bottom: clamp(40px, 5vw, 68px);
  padding-top: clamp(28px, 3.5vw, 46px);
}

.hero-copy {
  max-width: 640px;
  padding-top: 0;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.3rem, 4.8vw, 4rem);
  letter-spacing: 0;
  line-height: 0.98;
  margin-bottom: 20px;
}

h2 {
  font-size: clamp(1.35rem, 2.1vw, 2rem);
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 0;
}

h3 {
  line-height: 1.16;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  border: 0;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.hero-lede {
  color: var(--muted);
  font-size: clamp(1.04rem, 1.45vw, 1.2rem);
  line-height: 1.5;
  max-width: 560px;
}

.identity-list {
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
}

.identity-list span,
.identity-list a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  font-weight: 500;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.button:hover,
.theme-toggle:hover {
  transform: translateY(-1px);
}

.button.primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--button-text);
}

.pdf-button {
  align-items: center;
  gap: 11px;
}

.pdf-button small {
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  opacity: 0.74;
  padding: 4px 5px;
}

.button.ghost {
  background: var(--ghost-bg);
}

.portrait-card,
.profile-summary,
.experience-record,
.education-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
}

.portrait-card {
  box-shadow: var(--shadow);
  justify-self: end;
  margin: 0;
  max-width: 340px;
  overflow: hidden;
  width: 100%;
}

.portrait-card img {
  aspect-ratio: 4 / 5;
  display: block;
  object-fit: cover;
  object-position: center 50%;
  width: 100%;
}

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

.profile-summary {
  display: grid;
  gap: 26px;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  padding: clamp(22px, 3.2vw, 30px);
}

.profile-summary > p {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 0;
}

.summary-points {
  display: grid;
  gap: 12px;
}

.summary-points div,
.selected-scope div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

.summary-points div:last-child,
.selected-scope div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.summary-points span,
.selected-scope span,
.capability-map span,
.record-meta span,
.education-card span {
  color: var(--accent);
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.summary-points strong {
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
}

.experience-record {
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(220px, 0.38fr) minmax(0, 1fr);
  padding: clamp(22px, 3.2vw, 30px);
}

.record-meta h3 {
  font-size: clamp(1.22rem, 1.8vw, 1.55rem);
  margin-bottom: 8px;
}

.record-meta p {
  color: var(--muted);
  margin-bottom: 0;
}

.record-body ul {
  display: grid;
  gap: 11px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.record-body li {
  color: var(--muted);
  position: relative;
}

.record-body li::before {
  color: var(--accent);
  content: "/";
  margin-right: 10px;
}

.selected-scope {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 14px;
  padding: 16px 18px;
}

.selected-scope div {
  align-items: baseline;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  padding-bottom: 0;
}

.selected-scope span {
  margin-bottom: 0;
  min-width: max-content;
}

.selected-scope p,
.capability-map p,
.education-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.capability-map {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  padding: 0 clamp(20px, 3vw, 28px);
}

.capability-map article {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.42fr);
  padding: 20px 0;
}

.capability-map article:last-child {
  border-bottom: 0;
}

.capability-map small {
  color: var(--accent-2);
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1.45;
}

.education-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
}

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

.education-card {
  box-shadow: none;
  padding: clamp(20px, 3vw, 28px);
}

.education-card h3 {
  font-size: clamp(1.16rem, 1.55vw, 1.4rem);
  margin-bottom: 10px;
}

.education-card strong {
  color: var(--text);
  display: block;
  font-size: 0.98rem;
  font-weight: 600;
  margin-top: 10px;
}

.coursework {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.site-footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px 32px;
  grid-template-columns: minmax(190px, 0.65fr) minmax(0, 1.35fr);
  padding: 28px clamp(18px, 4vw, 52px) 24px;
}

.footer-identity {
  display: grid;
  gap: 4px;
}

.footer-identity strong {
  color: var(--text);
  font-size: 1.05rem;
}

.footer-identity span,
.footer-meta {
  color: var(--muted);
}

.footer-links,
.footer-meta {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  justify-content: flex-end;
}

.footer-links a {
  border-bottom: 1px solid transparent;
  color: var(--text);
  font-weight: 500;
  padding-bottom: 4px;
}

.footer-links a:hover {
  border-color: var(--accent);
  color: var(--accent-2);
}

.footer-links .cv-link {
  color: var(--accent);
}

.footer-meta {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  justify-content: space-between;
  padding-top: 14px;
}

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

  .hero,
  .section-heading,
  .profile-summary,
  .experience-record,
  .education-grid {
    grid-template-columns: 1fr;
  }

  .portrait-card {
    justify-self: start;
  }

  .capability-map article {
    gap: 8px;
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: 1fr;
  }

  .footer-links,
  .footer-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 10px;
    min-height: 64px;
  }

  .toggle-text {
    display: none;
  }

  .brand span:last-child {
    font-size: 0.94rem;
  }

  .section-shell {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 38px;
    padding-top: 38px;
  }

  .hero {
    gap: 24px;
    padding-bottom: 34px;
    padding-top: 24px;
  }

  .portrait-card {
    max-width: 300px;
  }

  h1 {
    font-size: clamp(2.3rem, 12vw, 3.2rem);
  }

  h2 {
    font-size: clamp(1.45rem, 8vw, 2.05rem);
  }

  .selected-scope div {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .profile-summary,
  .experience-record,
  .capability-map,
  .education-card {
    padding: 18px;
  }

  .profile-summary > p,
  .record-body li,
  .selected-scope p,
  .capability-map p,
  .capability-map small,
  .education-card p {
    font-size: 0.94rem;
  }

  .record-body ul {
    gap: 9px;
  }

  .capability-map article {
    padding: 16px 0;
  }

  .capability-map article:first-child {
    padding-top: 0;
  }

  .capability-map article:last-child {
    padding-bottom: 0;
  }

  .site-footer {
    gap: 12px;
    padding: 22px 16px 20px;
  }

  .footer-links,
  .footer-meta {
    gap: 8px 16px;
  }
}
