:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-soft: #0b1728;
  --surface: rgba(14, 28, 48, 0.78);
  --surface-strong: rgba(18, 37, 64, 0.94);
  --text: #eef6ff;
  --muted: #9fb2c8;
  --border: rgba(160, 190, 230, 0.16);
  --brand: #4ee1c1;
  --brand-2: #8b5cf6;
  --brand-3: #38bdf8;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
  --radius-lg: 32px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --max-width: 1180px;
  --header-height: 78px;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f7fbff;
  --bg-soft: #edf5ff;
  --surface: rgba(255, 255, 255, 0.82);
  --surface-strong: rgba(255, 255, 255, 0.96);
  --text: #0c1728;
  --muted: #526174;
  --border: rgba(23, 42, 70, 0.12);
  --brand: #047f73;
  --brand-2: #6d35d9;
  --brand-3: #087db6;
  --shadow: 0 24px 70px rgba(37, 63, 95, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand-2) 30%, transparent), transparent 32rem),
    radial-gradient(circle at 80% 15%, color-mix(in srgb, var(--brand-3) 24%, transparent), transparent 30rem),
    linear-gradient(135deg, var(--bg), var(--bg-soft));
  line-height: 1.65;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: linear-gradient(to bottom, #000, transparent 70%);
}

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

img {
  max-width: 100%;
  display: block;
}

button,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 999;
  padding: .75rem 1rem;
  border-radius: 999px;
  background: var(--brand);
  color: #06101f;
  font-weight: 800;
}

.skip-link:focus {
  top: 1rem;
}

#site-header {
  position: sticky;
  top: 0;
  z-index: 999;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition:
    background .25s ease,
    border-color .25s ease,
    box-shadow .25s ease;
}

.site-header.is-scrolled {
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom-color: var(--border);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
}

.nav-wrap {
  max-width: var(--max-width);
  height: var(--header-height);
  margin: 0 auto;
  padding: 0 1.35rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  min-width: max-content;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #04111e;
  font-weight: 900;
  letter-spacing: -0.08em;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 16px 35px color-mix(in srgb, var(--brand) 25%, transparent);
}

.brand-text {
  display: grid;
  line-height: 1.15;
}

.brand-text strong {
  font-size: .96rem;
}

.brand-text small {
  color: var(--muted);
  font-size: .72rem;
}

.primary-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .2rem;
}

.primary-nav a {
  padding: .55rem .72rem;
  border-radius: 999px;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.primary-nav a:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-strong) 75%, transparent);
  transform: translateY(-1px);
}

.nav-controls {
  display: flex;
  gap: .55rem;
}

.control-select {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 40px;
  padding: 0 .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

.control-select select {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.control-select option {
  color: #111827;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 2px;
  background: currentColor;
}

.page-shell {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
}

.hero-section {
  padding: 3.1rem 0 2rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(250px, .55fr);
  gap: 1.35rem;
  align-items: center;
}

.eyebrow,
.mini-label {
  margin: 0 0 .8rem;
  color: var(--brand);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.eyebrow span {
  display: inline-block;
  width: 34px;
  height: 2px;
  margin-right: .6rem;
  vertical-align: middle;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.hero-copy h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1.75rem, 4.2vw, 3.2rem);
  line-height: 1;
  letter-spacing: -.055em;
}

.hero-lead {
  max-width: 690px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(.98rem, 1.55vw, 1.12rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.35rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  padding: .68rem 1rem;
  border-radius: 999px;
  font-weight: 900;
  border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #03111d;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 18px 38px color-mix(in srgb, var(--brand) 24%, transparent);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
}

.signal-row {
  display: flex;
  flex-wrap: wrap;
  gap: .7rem;
  margin-top: 1.25rem;
}

.signal-row span {
  padding: .55rem .78rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: .86rem;
}

.signal-row strong {
  color: var(--text);
}

.profile-card {
  position: relative;
  overflow: hidden;
  padding: .85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface-strong), color-mix(in srgb, var(--surface) 65%, transparent));
  box-shadow: var(--shadow);
}

.profile-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -38% 18%;
  height: 170px;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 45%, transparent), transparent 68%);
  filter: blur(12px);
}

.profile-orbit {
  position: absolute;
  inset: 1rem;
  border: 1px dashed color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 30px;
  animation: pulse 4s ease-in-out infinite;
}

.profile-photo {
  position: relative;
  z-index: 1;
  width: min(100%, 120px);
  aspect-ratio: 1;
  margin: 1rem auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.profile-photo-cv {
  position: relative;
  z-index: 1;
  width: min(80%, 80px);
  aspect-ratio: 1;
  margin: 1rem auto;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.profile-body {
  position: relative;
  z-index: 1;
  padding: .85rem .25rem .15rem;
  text-align: center;
}

.profile-body h2 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -.04em;
}

.profile-body p:not(.mini-label) {
  margin: .35rem 0 0;
  color: var(--muted);
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .75rem;
}

.profile-tags span,
.keyword-cloud span {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .42rem .65rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.1rem;
}

.section-heading h2,
.research-strip h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3.2vw, 2.6rem);
  line-height: 1;
  letter-spacing: -.06em;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: .9rem 0 0;
}

.focus-section,
.quick-links-section {
  padding: 2.1rem 0;
}

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

.focus-card,
.quick-card,
.research-strip {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.focus-card {
  min-height: 100%;
  padding: 1.05rem;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.focus-card:hover {
  transform: translateY(-5px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  background: var(--surface-strong);
}

.icon-bubble {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #06111e;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  font-size: 1.1rem;
}

.focus-card h3 {
  margin: .8rem 0 .4rem;
  font-size: 1.08rem;
  letter-spacing: -.03em;
}

.focus-card p {
  color: var(--muted);
  margin: 0;
  font-size: .92rem;
  line-height: 1.55;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .75rem;
  color: var(--brand);
  font-weight: 900;
}

.research-strip {
  margin: 1.3rem 0;
  padding: clamp(1.25rem, 4vw, 2rem);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 1.2rem;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.research-strip::before {
  content: "";
  position: absolute;
  inset: -40% auto auto -12%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-2) 25%, transparent);
  filter: blur(20px);
}

.research-strip>* {
  position: relative;
}

.keyword-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .85rem;
}

.quick-card {
  min-height: 92px;
  padding: .85rem;
  display: grid;
  align-content: space-between;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.quick-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand-3) 45%, var(--border));
  background: var(--surface-strong);
}

.quick-card i {
  color: var(--brand);
  font-size: 1.35rem;
}

.quick-card span {
  font-weight: 900;
  letter-spacing: -.03em;
}

.site-footer {
  width: 100%;
  margin: 2rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
  box-shadow: none;
}

.footer-grid {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.1rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: -.04em;
}

.site-footer p {
  margin: .35rem 0 0;
  max-width: 650px;
  color: var(--muted);
}

.site-footer h2 {
  margin: 0 0 .7rem;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: flex-end;
}

.social-links a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  color: var(--muted);
  transition: color .2s ease, transform .2s ease, border-color .2s ease;
}

.social-links a:hover {
  color: var(--brand);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
}

.footer-bottom {
  width: min(var(--max-width), calc(100% - 2rem));
  margin: 0 auto;
  padding: .85rem 0 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .85rem;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s ease;
}

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

@keyframes pulse {
  50% {
    transform: scale(.985);
    opacity: .65;
  }
}

@media (max-width: 1180px) {
  .brand-text small {
    display: none;
  }

  .primary-nav a {
    padding-inline: .52rem;
  }

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

  .profile-card {
    max-width: 520px;
  }

  .quick-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  .nav-toggle {
    display: inline-block;
  }

  .primary-nav {
    position: fixed;
    left: 1rem;
    right: 1rem;
    top: calc(var(--header-height) + .65rem);
    margin: 0;
    padding: .8rem;
    display: grid;
    gap: .25rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface-strong);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-10px);
    transition: opacity .2s ease, transform .2s ease;
  }

  .primary-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .primary-nav a {
    padding: .85rem 1rem;
  }

  .nav-controls {
    margin-left: 0;
  }

  .focus-grid {
    grid-template-columns: 1fr;
  }

  .research-strip {
    grid-template-columns: 1fr;
  }

  .keyword-cloud {
    justify-content: flex-start;
  }

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

  .social-links {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  :root {
    --header-height: 72px;
  }

  .nav-wrap {
    padding-inline: .8rem;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

  .brand-text strong {
    font-size: .88rem;
  }

  .nav-controls {
    position: static;
    flex-direction: row;
    gap: .4rem;
    margin-left: 0;
  }

  .control-select {
    min-height: 36px;
    padding: 0 .45rem;
    box-shadow: none;
  }

  .control-select select {
    max-width: 82px;
    font-size: .78rem;
  }

  .back-to-top {
    bottom: 1rem;
  }

  .hero-section {
    padding-top: 2.1rem;
  }

  .hero-actions {
    flex-direction: column;
  }

  .btn {
    justify-content: center;
    width: 100%;
  }

  .quick-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-bottom {
    flex-direction: column;
  }

}


/* Compact homepage refinements */
.profile-card {
  max-width: 310px;
  justify-self: end;
}

.profile-tags {
  justify-content: center;
}

.hero-copy .eyebrow {
  margin-bottom: .65rem;
}

.hero-copy h1 {
  text-wrap: balance;
}

.focus-card .text-link {
  font-size: .9rem;
}

.research-strip h2 {
  max-width: 560px;
}

@media (max-width: 1040px) {
  .profile-card {
    max-width: 360px;
    justify-self: start;
  }
}

@media (max-width: 560px) {
  .profile-photo {
    width: 150px;
    border-radius: 22px;
  }

  .profile-photo-cv {
    width: 70px;
    border-radius: 22px;
  }

  .profile-card {
    max-width: 100%;
  }

  .hero-copy h1 {
    font-size: clamp(1.85rem, 11vw, 2.65rem);
  }

  .signal-row span {
    font-size: .78rem;
  }
}

/* Inner page and Teaching page layouts */
.inner-page {
  padding-top: 2.4rem;
}

.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .55fr);
  gap: 1.2rem;
  align-items: stretch;
  margin-bottom: 1rem;
}

.page-hero-copy,
.page-hero-panel,
.timeline-card,
.side-card,
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.page-hero-copy {
  padding: clamp(1.25rem, 4vw, 2.25rem);
  position: relative;
  overflow: hidden;
}

.page-hero-copy::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand-2) 24%, transparent);
  filter: blur(28px);
}

.page-hero-copy>* {
  position: relative;
}

.page-hero-copy h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(2rem, 4.6vw, 3.8rem);
  line-height: .98;
  letter-spacing: -.07em;
  text-wrap: balance;
}

.page-hero-copy p:not(.eyebrow) {
  max-width: 720px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(.98rem, 1.5vw, 1.12rem);
}

.page-hero-panel {
  padding: 1.2rem;
  display: grid;
  align-content: center;
  min-height: 100%;
  background: linear-gradient(145deg, var(--surface-strong), color-mix(in srgb, var(--surface) 68%, transparent));
}

.panel-icon {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #06111e;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.page-hero-panel h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.5rem);
  letter-spacing: -.06em;
}

.page-hero-panel p:not(.mini-label) {
  margin: .55rem 0 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin: 1rem 0 1.35rem;
}

.stat-card {
  padding: 1rem;
}

.stat-card strong {
  display: block;
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  line-height: 1;
  letter-spacing: -.05em;
  color: var(--brand);
}

.stat-card span {
  display: block;
  margin-top: .45rem;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
}

.teaching-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 1rem;
  align-items: start;
}

.teaching-year-nav button,
.teaching-year-link {
  width: 100%;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 65%, transparent);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

.teaching-year-nav button:hover,
.teaching-year-link:hover,
.teaching-year-link.is-active {
  transform: translateY(-2px);
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  background: color-mix(in srgb, var(--brand) 10%, var(--surface-strong));
}

.teaching-year-nav button i,
.teaching-year-link i {
  color: var(--brand);
}

.year-item.is-highlighted .year-content {
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  background: linear-gradient(145deg,
      color-mix(in srgb, var(--surface-strong) 92%, transparent),
      color-mix(in srgb, var(--brand) 10%, transparent));
}

.timeline-card {
  padding: clamp(1rem, 3vw, 1.45rem);
}

.compact-heading {
  margin-bottom: .8rem;
}

.compact-heading h2 {
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.year-list {
  position: relative;
  display: grid;
  gap: .85rem;
}

.year-list::before {
  content: "";
  position: absolute;
  left: 5.8rem;
  top: .5rem;
  bottom: .5rem;
  width: 1px;
  background: linear-gradient(var(--brand), color-mix(in srgb, var(--brand-2) 65%, transparent));
  opacity: .55;
}

.year-item {
  position: relative;
  display: grid;
  grid-template-columns: 7.3rem 1fr;
  gap: .9rem;
}

.year-marker {
  position: relative;
  z-index: 1;
  align-self: start;
  padding: .5rem .65rem;
  border: 1px solid color-mix(in srgb, var(--brand) 38%, var(--border));
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--brand);
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  font-weight: 800;
  text-align: center;
}

.year-content {
  padding: .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
}

.current-year .year-content {
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 92%, transparent), color-mix(in srgb, var(--brand-2) 10%, transparent));
}

.year-content h3 {
  margin: 0 0 .6rem;
  font-size: 1rem;
  letter-spacing: -.03em;
}

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: .55rem;
}

.course-list li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: .55rem;
  align-items: start;
  color: var(--text);
  font-weight: 800;
}

.course-list i {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent);
}

.course-list small {
  display: block;
  margin-top: .12rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.35;
}

.teaching-side {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: grid;
  gap: 1rem;
}

.side-card {
  padding: 1.05rem;
}

.side-card h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.08;
  letter-spacing: -.05em;
}

.side-card p:not(.mini-label) {
  color: var(--muted);
  margin: .8rem 0 0;
}

.mini-course-grid {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}

.mini-course-grid span {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .65rem .7rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 65%, transparent);
  color: var(--muted);
  font-size: .88rem;
  font-weight: 800;
}

.mini-course-grid i {
  color: var(--brand);
}

.accent-card {
  overflow: hidden;
  position: relative;
}

.accent-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  right: -70px;
  bottom: -85px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--brand) 28%, transparent);
  filter: blur(18px);
}

.accent-card>* {
  position: relative;
  z-index: 1;
}

@media (max-width: 940px) {

  .page-hero,
  .teaching-layout {
    grid-template-columns: 1fr;
  }

  .teaching-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .teaching-side {
    grid-template-columns: 1fr;
  }

  .year-list::before {
    left: .95rem;
  }

  .year-item {
    grid-template-columns: 1fr;
    padding-left: 2.45rem;
  }

  .year-marker {
    width: max-content;
  }

  .year-marker::before {
    content: "";
    position: absolute;
    left: -1.6rem;
    top: 50%;
    width: .8rem;
    height: .8rem;
    border-radius: 50%;
    background: var(--brand);
    transform: translateY(-50%);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 12%, transparent);
  }
}

@media (max-width: 520px) {
  .inner-page {
    padding-top: 1.4rem;
  }

  .page-hero-copy,
  .page-hero-panel,
  .timeline-card,
  .side-card,
  .stat-card {
    border-radius: 22px;
  }

  .stats-grid {
    gap: .65rem;
  }

  .stat-card {
    padding: .85rem;
  }

  .course-list li {
    grid-template-columns: 28px 1fr;
  }

  .course-list i {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    font-size: .8rem;
  }
}

/* Publications page */
.publications-page {
  padding-bottom: 1.2rem;
}

.publications-hero .page-hero-panel h2 {
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.publication-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 1rem;
  align-items: start;
}

.publication-main {
  display: grid;
  gap: 1rem;
}

.publication-section,
.publication-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.publication-section {
  padding: clamp(1rem, 3vw, 1.45rem);
}

.publication-year-group {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: .85rem;
  align-items: start;
  margin-top: .9rem;
}

.publication-year {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid color-mix(in srgb, var(--brand) 36%, var(--border));
  border-radius: 999px;
  background: var(--surface-strong);
  color: var(--brand);
  font-family: "JetBrains Mono", monospace;
  font-size: .82rem;
  font-weight: 900;
}

.publication-card {
  padding: 1rem;
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.publication-card+.publication-card {
  margin-top: .75rem;
}

.publication-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  background: var(--surface-strong);
}

.featured-publication,
.thesis-card {
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface-strong) 88%, transparent), color-mix(in srgb, var(--brand-2) 8%, transparent));
}

.publication-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-bottom: .65rem;
}

.pub-type,
.pub-year,
.pub-venue {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: .35rem .58rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 900;
  line-height: 1;
}

.pub-type {
  color: #06111e;
  border-color: transparent;
}

.pub-type.journal {
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
}

.pub-type.conference {
  background: linear-gradient(135deg, var(--brand-2), var(--brand-3));
  color: #fff;
}

.pub-type.thesis {
  background: linear-gradient(135deg, #facc15, var(--brand));
  color: #06111e;
}

.pub-year {
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--border));
  font-family: "JetBrains Mono", monospace;
}

.pub-venue {
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
}

.publication-card h3 {
  margin: 0;
  font-size: clamp(1.04rem, 2vw, 1.28rem);
  line-height: 1.25;
  letter-spacing: -.035em;
}

.publication-card h3 a {
  color: var(--text);
  background-image: linear-gradient(90deg, var(--brand), var(--brand-3));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 0 100%;
  transition: color .2s ease, background-size .2s ease;
}

.publication-card h3 a:hover {
  color: var(--brand);
  background-size: 100% 2px;
}

.authors,
.citation {
  margin: .55rem 0 0;
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.5;
}

.authors {
  color: color-mix(in srgb, var(--text) 72%, var(--muted));
  font-weight: 700;
}

.author-me {
  padding: .08rem .32rem;
  border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent);
  border-radius: .55rem;
  background: color-mix(in srgb, var(--brand) 18%, transparent);
  color: var(--text);
  font-weight: 900;
}

.doi-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: .7rem;
  color: var(--brand);
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  font-weight: 800;
  word-break: break-word;
}

.publication-side {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: grid;
  gap: 1rem;
}

.pub-jump-links {
  display: grid;
  gap: .6rem;
  margin-top: 1rem;
}

.pub-jump-links a {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .7rem .75rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 65%, transparent);
  color: var(--muted);
  font-size: .9rem;
  font-weight: 900;
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}

.pub-jump-links a:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
}

.pub-jump-links i,
.publication-keywords i {
  color: var(--brand);
}

@media (max-width: 980px) {
  .publication-layout {
    grid-template-columns: 1fr;
  }

  .publication-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .publication-side {
    grid-template-columns: 1fr;
  }

  .publication-year-group {
    grid-template-columns: 1fr;
  }

  .publication-year {
    position: static;
    width: max-content;
    min-height: 36px;
  }
}

@media (max-width: 520px) {

  .publication-section,
  .publication-card {
    border-radius: 22px;
  }

  .publication-card {
    padding: .9rem;
  }

  .pub-type,
  .pub-year,
  .pub-venue {
    font-size: .68rem;
  }
}

/* Publications layout fix: keep all cards in the main content column when a year has multiple papers */
.publication-year-group>.publication-card {
  grid-column: 2;
  min-width: 0;
  width: 100%;
}

.publication-card,
.publication-card h3,
.publication-card h3 a,
.publication-meta-row,
.authors,
.citation,
.doi-link {
  min-width: 0;
  overflow-wrap: anywhere;
}

.pub-venue {
  max-width: 100%;
  white-space: normal;
  line-height: 1.25;
}

.publication-card h3 a {
  display: inline;
  word-break: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 720px) {
  .publication-year-group>.publication-card {
    grid-column: 1;
  }
}

/* News timeline page */
.news-page .page-hero {
  align-items: stretch;
}

.news-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.news-timeline {
  position: relative;
  display: grid;
  gap: .9rem;
}

.news-timeline::before {
  content: "";
  position: absolute;
  left: 1.35rem;
  top: .7rem;
  bottom: .7rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--brand), color-mix(in srgb, var(--brand-2) 62%, transparent), transparent);
  opacity: .5;
}

.news-year-panel {
  position: relative;
  z-index: 1;
  border: 1px solid var(--border);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--brand) 12%, transparent), transparent 36%),
    color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.news-year-panel::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 1.4rem;
  width: .65rem;
  height: .65rem;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 16%, transparent);
  z-index: 2;
}

.news-year-button {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .95rem;
  align-items: center;
  padding: 1.05rem 1.15rem 1.05rem 2.65rem;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.news-year-button:hover .news-year-number,
.news-year-panel.is-open .news-year-number {
  color: var(--brand);
}

.news-year-button i {
  color: var(--muted);
  transition: transform .2s ease, color .2s ease;
}

.news-year-panel.is-open .news-year-button i {
  transform: rotate(180deg);
  color: var(--brand);
}

.news-year-number {
  font-family: "JetBrains Mono", monospace;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  font-weight: 900;
  letter-spacing: -.08em;
  transition: color .2s ease;
}

.news-year-summary {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.35;
}

.news-month-panel {
  border-top: 1px solid var(--border);
  padding: .4rem 1rem 1rem 2.65rem;
  animation: newsOpen .22s ease;
}

@keyframes newsOpen {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.news-month-group {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: .85rem;
  padding: .75rem 0;
}

.news-month-group+.news-month-group {
  border-top: 1px dashed var(--border);
}

.news-month {
  align-self: start;
  display: inline-flex;
  justify-content: center;
  padding: .45rem .55rem;
  border: 1px solid color-mix(in srgb, var(--brand) 34%, var(--border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}

.news-items {
  display: grid;
  gap: .65rem;
  min-width: 0;
}

.news-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: .85rem .9rem;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  min-width: 0;
}

.news-card p {
  margin: .45rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: .95rem;
  overflow-wrap: anywhere;
}

.news-card a {
  color: var(--text);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--brand) 42%, transparent);
  text-underline-offset: .18em;
}

.news-card a:hover {
  color: var(--brand);
}

.news-tag {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  width: max-content;
  max-width: 100%;
  padding: .32rem .55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  color: var(--text);
  font-family: "JetBrains Mono", monospace;
  font-size: .72rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.news-tag i {
  color: var(--brand);
}

.news-tag.publication i,
.news-tag.conference i {
  color: var(--brand);
}

.news-tag.startup i,
.news-tag.award i {
  color: var(--brand-2);
}

.news-tag.position i,
.news-tag.teaching i,
.news-tag.research i {
  color: var(--accent);
}

.news-side {
  position: sticky;
  top: calc(var(--header-height) + 1rem);
  display: grid;
  gap: 1rem;
}

.news-year-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  margin-top: 1rem;
}

.news-year-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: .55rem .65rem;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent);
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: .78rem;
  font-weight: 900;
  text-align: center;
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}

.news-year-links a:hover,
.news-year-links a.is-active {
  transform: translateY(-2px);
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 46%, var(--border));
}

@media (max-width: 980px) {
  .news-layout {
    grid-template-columns: 1fr;
  }

  .news-side {
    position: static;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .news-side {
    grid-template-columns: 1fr;
  }

  .news-month-group {
    grid-template-columns: 1fr;
    gap: .55rem;
  }

  .news-month-panel {
    padding-left: 1rem;
  }

  .news-timeline::before {
    left: .9rem;
  }

  .news-year-panel::before {
    left: .62rem;
  }

  .news-year-button {
    padding-left: 2rem;
    grid-template-columns: 1fr auto;
  }

  .news-year-summary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .news-year-panel {
    border-radius: 22px;
  }

  .news-card {
    border-radius: 18px;
    padding: .78rem;
  }

  .news-year-links {
    grid-template-columns: 1fr;
  }
}

/* ==============================
   Algorithms page
   ============================== */
.algorithms-page .page-hero-panel .panel-icon {
  margin-bottom: 1rem;
}

.algorithm-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  margin: 1.8rem 0 1.4rem;
}

.algorithm-search {
  position: relative;
}

.algorithm-search i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.algorithm-search input {
  width: 100%;
  min-height: 3.1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  box-shadow: var(--shadow-soft);
  outline: none;
}

.algorithm-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-soft);
}

.algorithm-count {
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
}

.algorithm-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.algorithm-filter {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.62rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, color 180ms ease, background 180ms ease;
}

.algorithm-filter:hover,
.algorithm-filter.is-active {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

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

.algorithm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.algorithm-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.9;
}

.algorithm-card-header {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  margin-bottom: 0.8rem;
}

.algorithm-icon {
  width: 2.7rem;
  height: 2.7rem;
  flex: 0 0 2.7rem;
  display: grid;
  place-items: center;
  border-radius: 1rem;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--border);
}

.algorithm-card h3 {
  margin: 0 0 0.25rem;
  font-size: clamp(1.05rem, 2vw, 1.28rem);
  line-height: 1.2;
}

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

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

.algorithm-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.algorithm-card p.algorithm-description {
  color: var(--muted);
  line-height: 1.65;
  margin: 0.45rem 0 1rem;
}

.algorithm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: auto 0 1.05rem;
}

.algorithm-tags span {
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 0.35rem 0.55rem;
}

.algorithm-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.algorithm-empty {
  display: none;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
  background: var(--surface);
}

.algorithm-pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1.5rem;
}

.algorithm-page-btn {
  min-width: 2.55rem;
  min-height: 2.55rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.algorithm-page-btn:hover,
.algorithm-page-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.algorithm-side-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

.algorithm-side-list a,
.algorithm-side-list button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 0.8rem 0.9rem;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.algorithm-side-list a:hover,
.algorithm-side-list button:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

@media (max-width: 900px) {
  .algorithm-grid {
    grid-template-columns: 1fr;
  }

  .algorithm-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .algorithm-card {
    padding: 1rem;
  }

  .algorithm-card-header {
    flex-direction: column;
  }
}

/* =========================
   CV / About page
   ========================= */
.cv-page .page-hero {
  align-items: stretch;
}

.cv-id-card {
  text-align: center;
}

.cv-avatar {
  width: 78px;
  height: 78px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 26px;
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: -.08em;
  color: #06101f;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  box-shadow: 0 20px 50px color-mix(in srgb, var(--brand) 24%, transparent);
}

.cv-profile-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .55rem;
  margin-top: 1.15rem;
}

.cv-profile-links a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  transition: transform .2s ease, color .2s ease, border-color .2s ease, background .2s ease;
}

.cv-profile-links a:hover {
  transform: translateY(-2px);
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand) 55%, var(--border));
  background: color-mix(in srgb, var(--brand) 12%, var(--surface-strong));
}

.cv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.cv-main,
.cv-side {
  min-width: 0;
}

.cv-side {
  position: sticky;
  top: calc(var(--header-height) + 1.2rem);
  display: grid;
  gap: 1rem;
}

.cv-section {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 82%, transparent), color-mix(in srgb, var(--surface) 86%, transparent));
  box-shadow: var(--shadow);
}

.cv-section+.cv-section {
  margin-top: 1.1rem;
}

.cv-timeline-item {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1rem;
  position: relative;
}

.cv-timeline-item+.cv-timeline-item {
  margin-top: 1rem;
}

.cv-date {
  position: relative;
  align-self: start;
  padding: .5rem .65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 9%, transparent);
  font-family: "JetBrains Mono", monospace;
  font-size: .76rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
}

.cv-card,
.education-card,
.skill-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
}

.cv-card-head {
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  margin-bottom: .85rem;
}

.cv-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #06101f;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
}

.cv-card h3,
.education-card h3,
.skill-panel h3 {
  margin: 0 0 .25rem;
  font-size: 1.02rem;
  letter-spacing: -.02em;
}

.cv-card p,
.education-card p,
.skill-panel p {
  margin: 0;
  color: var(--muted);
}

.cv-card ul {
  margin: .75rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
}

.cv-card li+li {
  margin-top: .35rem;
}

.cv-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.cv-two-col h4 {
  margin: 0 0 .45rem;
  color: var(--text);
}

.cv-place {
  margin-bottom: .4rem !important;
}

.education-grid,
.skill-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .85rem;
}

.education-card span {
  display: inline-flex;
  margin-bottom: .55rem;
  padding: .32rem .55rem;
  border-radius: 999px;
  color: var(--brand);
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  font-family: "JetBrains Mono", monospace;
  font-size: .72rem;
  font-weight: 800;
}

.skill-panel-grid {
  grid-template-columns: 1fr;
}

.skill-panel h3 {
  display: flex;
  gap: .55rem;
  align-items: center;
  margin-bottom: .8rem;
}

.skill-panel h3 i {
  color: var(--brand);
}

.chip-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.chip-cloud span {
  padding: .42rem .62rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  font-size: .86rem;
  font-weight: 700;
}

@media (max-width: 980px) {
  .cv-layout {
    grid-template-columns: 1fr;
  }

  .cv-side {
    position: static;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .cv-section {
    padding: .95rem;
    border-radius: 24px;
  }

  .cv-timeline-item {
    grid-template-columns: 1fr;
    gap: .65rem;
  }

  .cv-date {
    justify-self: start;
  }

  .cv-two-col,
  .education-grid,
  .cv-side {
    grid-template-columns: 1fr;
  }

  .cv-card,
  .education-card,
  .skill-panel {
    padding: .9rem;
    border-radius: 20px;
  }
}

/* =========================
   Contact page
   ========================= */
.contact-page {
  padding-bottom: 1.2rem;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.25rem;
}

.contact-main,
.contact-side {
  min-width: 0;
}

.contact-side {
  position: sticky;
  top: calc(var(--header-height) + 1.2rem);
  display: grid;
  gap: 1rem;
}

.contact-primary-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  padding: clamp(1rem, 3vw, 1.35rem);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--brand) 16%, transparent), transparent 36%),
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 86%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.contact-card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  color: #06101f;
  background: linear-gradient(135deg, var(--brand), var(--brand-3));
  font-size: 1.35rem;
  box-shadow: 0 18px 42px color-mix(in srgb, var(--brand) 22%, transparent);
}

.contact-card-copy {
  min-width: 0;
}

.contact-card-copy h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.15rem);
  line-height: 1.05;
  letter-spacing: -.055em;
}

.contact-card-copy p:not(.mini-label) {
  margin: .8rem 0 0;
  color: var(--muted);
}

.contact-card-copy .btn,
.contact-card-copy .primary {
  margin-top: 1rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .85rem;
  margin-top: 1rem;
}

.contact-mini-card {
  min-height: 128px;
  padding: 1rem;
  display: grid;
  align-content: space-between;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

.contact-mini-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--brand) 45%, var(--border));
  background: var(--surface-strong);
}

.contact-mini-card i {
  color: var(--brand);
  font-size: 1.45rem;
}

.contact-mini-card span {
  display: block;
  margin-top: .8rem;
  font-weight: 900;
  letter-spacing: -.03em;
}

.contact-mini-card small {
  display: block;
  margin-top: .2rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.contact-keywords {
  margin-top: 1rem;
}

@media (max-width: 980px) {
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .contact-side {
    position: static;
  }

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

@media (max-width: 620px) {
  .contact-primary-card {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .contact-card-icon {
    width: 54px;
    height: 54px;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .contact-mini-card {
    min-height: 112px;
    border-radius: 20px;
  }
}