/* Shared colors keep both themes and accessibility settings consistent. */
:root {
  color-scheme: dark;
  --page: #050505;
  --section: #0b0a0f;
  --surface: #17151f;
  --nav: #13121a;
  --text: #f7f5fc;
  --muted: #c3bed0;
  --border: #514662;
  --accent: #b79aef;
  --accent-solid: #7051ba;
  --badge: #21192f;
  --focus: #dac5ff;
  --text-scale: 1;
  --header-height: 112px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #faf8ff;
  --section: #f1edf8;
  --surface: #ffffff;
  --nav: #ffffff;
  --text: #231934;
  --muted: #5c516d;
  --border: #b1a1c7;
  --accent: #6340a8;
  --accent-solid: #7051ba;
  --badge: #eee6fb;
  --focus: #53318f;
}
:root[data-contrast="high"] {
  --page: #000000;
  --section: #000000;
  --surface: #000000;
  --nav: #000000;
  --text: #ffffff;
  --muted: #ffffff;
  --border: #ffffff;
  --accent: #e3caff;
  --accent-solid: #e3caff;
  --badge: #000000;
  --focus: #ffff00;
}
:root[data-theme="light"][data-contrast="high"] {
  --page: #ffffff;
  --section: #ffffff;
  --surface: #ffffff;
  --nav: #ffffff;
  --text: #000000;
  --muted: #000000;
  --border: #000000;
  --accent: #45207d;
  --accent-solid: #45207d;
  --badge: #ffffff;
  --focus: #45207d;
}
html {
  font-size: calc(62.5% * var(--text-scale));
  scroll-padding-top: var(--header-height);
}
#s-home, #s-about, #s-academic, #s-teaching, #s-map, #s-research, #s-journey, #s-projects, #s-contact {
  scroll-margin-top: var(--header-height);
}
body { background: var(--page); color: var(--text); }
html[data-font="accessible"],
html[data-font="accessible"] * {
  font-family: "Atkinson Hyperlegible", Verdana, Arial, sans-serif !important;
}
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.45; }
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
[hidden] { display: none !important; }
.skip-link {
  position: fixed; top: 12px; left: 16px; z-index: 2000;
  padding: 14px 20px; border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 1.8rem;
  transform: translateY(-180%);
}
.skip-link:focus { transform: translateY(0); }
header { padding: 0 24px; }
header .grid-layout nav {
  position: relative; flex-wrap: nowrap; gap: 24px;
  padding: 14px 24px; background: var(--nav); border-color: var(--border);
}
header .grid-layout nav h1 {
  color: var(--text); font-size: 2rem; min-width: 0; line-height: 1.3;
}
header .grid-layout nav .nav-list { gap: 24px; margin-left: auto; }
header .grid-layout nav .nav-list li { margin: 0; }
header .grid-layout nav .nav-list li a {
  color: var(--text); display: inline-flex; align-items: center; min-height: 44px;
  white-space: nowrap;
}
header .grid-layout nav .nav-list li a:hover { color: var(--accent); }
.nav-tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.language-control { display: inline-flex; align-items: center; }
.language-control select {
  min-height: 44px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 1.5rem; cursor: pointer;
}
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 2.4rem; line-height: 1;
}
.icon-button:hover { background: var(--badge); color: var(--accent); }
.icon-button:focus { border: 1px solid var(--border); }
.icon-button svg { width: 23px; height: 23px; }
.moon-icon, :root[data-theme="light"] .sun-icon { display: none; }
:root[data-theme="light"] .moon-icon { display: block; }
.mobile-menu { display: none; }
.mobile-menu span {
  display: block; width: 20px; height: 2px; margin: 3px 0;
  background: currentColor; transition: transform 0.2s ease;
}
.mobile-menu.active .line1 { transform: translateY(8px) rotate(45deg); }
.mobile-menu.active .line3 { transform: translateY(-8px) rotate(-45deg); }
.accessibility-panel {
  position: fixed; top: calc(var(--header-height) + 12px); right: max(16px, calc((100vw - 1140px) / 2));
  z-index: 1000; width: min(380px, calc(100% - 32px)); padding: 24px;
  max-height: calc(100dvh - var(--header-height) - 28px); overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: 0 16px 48px #0004; font-size: 1.6rem;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-heading h2 { font-size: 2.2rem; min-width: 0; overflow-wrap: anywhere; }
.accessibility-panel > p { margin: 12px 0 24px; color: var(--muted); line-height: 1.5; }
.text-size-control > span { display: block; margin-bottom: 12px; }
.text-size-control > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-size-control button, .reset-preferences {
  min-height: 44px; padding: 10px 16px; border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); background: var(--badge); font-size: 1.6rem;
}
.preference-option { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.preference-option input { width: 22px; height: 22px; accent-color: var(--accent-solid); flex-shrink: 0; }
.reset-preferences { width: 100%; margin-top: 12px; }
#s-home .grid-layout #home {
  padding: calc(var(--header-height) + 48px) 0 64px;
  gap: 48px; min-height: 100svh;
}
#s-home .grid-layout #home #home-container-text h3,
#s-home .grid-layout #home #home-container-text .home-greeting,
#s-home .grid-layout #home #home-container-text h2,
#s-home .grid-layout #home #home-container-text p { color: var(--text); }
#s-home .grid-layout #home #home-container-text h3 b,
#s-home .grid-layout #home #home-container-text .home-greeting b { color: var(--accent); }
#s-home .grid-layout #home #home-container-text .home-greeting {
  font-family: "Raleway", sans-serif; font-size: 3.2rem; line-height: 1.4;
  font-weight: 400; margin: 0;
}
#s-home .grid-layout #home #home-container-text h2 { font-size: clamp(3.2rem, 5vw, 6.4rem); line-height: 1.2; margin-top: 12px; }
#s-home .grid-layout #home #home-container-text p { max-width: 1000px; line-height: 1.65; }
.skills-carousel { width: 100%; min-width: 0; }
#s-home .grid-layout .skills-1 { gap: 16px; }
#s-home .grid-layout .skills-1 > div { margin-bottom: 0; }
#s-home .grid-layout .skills-1 > div article.skill-featured {
  background: var(--badge); border-color: var(--accent-solid); padding: 12px 20px;
}
#s-home .grid-layout .skills-1 > div article p { color: var(--text); font-size: 2rem; white-space: nowrap; }
.skills-controls { display: none; }
#s-about, #s-projects { background: var(--section); }
#s-about, #s-projects, #s-contact { padding: 96px 24px; color: var(--text); }
#s-about, .research-section, .journey-section, #s-projects, #s-academic, #s-contact {
  min-height: 100svh;
  display: flex;
  align-items: center;
}
#s-about, .research-section, .journey-section, #s-projects, #s-academic, #s-contact {
  padding-top: calc(var(--header-height) + 24px);
}
#s-about > .grid-layout, .research-section > .grid-layout,
.journey-section > .grid-layout, #s-projects > .grid-layout,
#s-academic > .grid-layout, #s-contact > .grid-layout { width: 100%; }
#s-about .grid-layout > div {
  display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  align-items: center; gap: clamp(32px, 5vw, 64px);
}
#s-about .grid-layout > div .profile-photo {
  width: 100%; max-width: 300px; height: auto; aspect-ratio: 1;
  object-fit: cover; object-position: center; border-radius: 24px;
}
#s-about .grid-layout article { min-width: 0; }
#s-about .grid-layout h2 { font-size: clamp(3rem, 4vw, 4.8rem); line-height: 1.2; margin: 24px 0; overflow-wrap: anywhere; }
#s-about .grid-layout h2, #s-about .grid-layout p { color: var(--text); }
#s-about .grid-layout p { line-height: 1.7; }
#s-about .grid-layout p + p { margin-top: 16px; }
#s-about .grid-layout > div .profile-photo { align-self: stretch; height: 100%; min-height: 100%; aspect-ratio: auto; }
#s-about .grid-layout h3, #s-projects .grid-layout h3, #s-contact .grid-layout h3 {
  display: inline-block; padding: 10px 20px; color: var(--accent); background: var(--badge);
}
#s-projects .grid-layout > div article { background: var(--surface); border-color: var(--border); color: var(--text); }
.project-title-link { color: var(--text); }
#s-projects .grid-layout > div { margin-top: 40px; }
#s-projects .slider-wrapper { width: 100%; min-width: 0; position: relative; }
.slider-wrapper .swiper-pagination-bullet { background: var(--accent); }
.slider-wrapper .swiper-slide-button { color: var(--accent); }
#s-projects .slider-wrapper .swiper-pagination {
  position: static !important;
  inset: auto !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  width: 100% !important;
  margin-top: 24px;
  transform: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
#s-contact .grid-layout h2 { margin-bottom: 48px; }
#s-academic { background: var(--section); color: var(--text); padding: calc(var(--header-height) + 24px) 24px 96px; }
#s-academic h2, #s-contact h2 { font-size: clamp(3rem, 4vw, 4.8rem); margin-bottom: 40px; color: var(--text); }
.academic-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: clamp(32px, 6vw, 88px); align-items: start; }
.academic-copy { min-width: 0; }
.academic-copy > p:not(.section-intro) { margin-top: 20px; color: var(--muted); font-size: 1.9rem; line-height: 1.75; }
.academic-copy h3 { margin-top: 28px; color: var(--text); font-size: 1.9rem; }
.academic-interests { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 16px; }
.academic-interests li { padding: 8px 12px; border-left: 2px solid var(--accent-solid); color: var(--muted); font-size: 1.5rem; line-height: 1.4; }
.academic-links { display: flex; flex-direction: column; gap: 12px; }
.academic-links a, .contact-list a {
  display: inline-flex; align-items: center; gap: 14px; min-height: 64px;
  padding: 14px 18px; color: var(--text); background: transparent;
  border: 1px solid var(--border); border-radius: 14px;
}
.academic-links a:hover, .contact-list a:hover { border-color: var(--accent); color: var(--accent); background: var(--badge); }
.academic-links img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 auto; }
.academic-links span { font-size: 1.8rem; font-weight: 650; }
.academic-links small { display: none; }
#s-contact { padding-top: 96px; padding-bottom: 96px; }
.contact-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.contact-list a { min-height: 54px; padding: 10px 18px; border-radius: 999px; font-size: 1.7rem; font-weight: 600; }
.contact-list img { width: 28px; height: 28px; object-fit: contain; flex: 0 0 auto; }
.contact-list a:focus-visible, .academic-links a:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.teaching-section, .map-section {
  min-height: 100svh; display: flex; align-items: flex-start;
  padding: calc(var(--header-height) + 24px) 24px 96px; color: var(--text);
  scroll-margin-top: var(--header-height);
}
.teaching-section, .map-section { background: var(--page); }
.teaching-section h2, .map-section h2 {
  max-width: 900px; margin: 24px 0; color: var(--text);
  font-size: clamp(3rem, 4vw, 4.8rem); line-height: 1.2; font-weight: 500;
}
.teaching-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px; margin-top: 40px;
}
.teaching-card {
  display: flex; flex-direction: column; align-items: flex-start;
  min-width: 0; padding: 28px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface);
}
.teaching-period {
  color: var(--accent); font-size: 1.5rem; line-height: 1.5; font-weight: 600;
}
.teaching-card h3 { margin: 16px 0; color: var(--text); font-size: 2.3rem; line-height: 1.3; }
.teaching-card p { color: var(--muted); font-size: 1.7rem; line-height: 1.7; }
.teaching-institution { margin-top: auto; padding-top: 24px; color: var(--muted); font-size: 1.5rem; }
.interdisciplinary-map {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; margin-top: 40px; align-items: stretch;
}
.map-core, .map-node {
  display: flex; flex-direction: column; justify-content: center; gap: 8px;
  min-height: 128px; padding: 24px; border: 1px solid var(--border);
  border-radius: 20px; background: var(--surface);
}
.map-core { grid-column: 2; grid-row: 1 / span 2; min-height: 274px; background: var(--badge); border-color: var(--accent); text-align: center; }
.map-core strong { color: var(--accent); font-size: 2.5rem; }
.map-core span, .map-node span { color: var(--muted); font-size: 1.5rem; line-height: 1.5; }
.map-node strong { color: var(--text); font-size: 1.9rem; }
.map-node { position: relative; }
.map-node::before { content: ""; position: absolute; top: 50%; width: 18px; border-top: 1px solid var(--border); }
.map-node:nth-child(2)::before, .map-node:nth-child(4)::before { right: -19px; }
.map-node:nth-child(3)::before, .map-node:nth-child(5)::before { left: -19px; }
footer { background: var(--surface); color: var(--text); padding-inline: 20px; }
:root[data-theme="light"] .sombra, :root[data-contrast="high"] .sombra { display: none; }
:root[data-contrast="high"] .skills-1 img { filter: brightness(0) invert(1); }
:root[data-theme="light"][data-contrast="high"] .skills-1 img { filter: brightness(0); }
/* Tablet navigation has room for larger text without overlapping the tools. */
@media (max-width: 1100px) {
  header { padding: 0 20px; }
  header .grid-layout nav { margin-top: 16px; gap: 16px; border-radius: 24px; }
  header .grid-layout nav h1 { flex: 1; font-size: 2rem; }
  header .grid-layout nav .nav-list {
    display: none; position: absolute; top: calc(100% + 12px); left: 0; right: 0;
    width: auto; height: auto; max-height: calc(100dvh - var(--header-height) - 24px);
    overflow-y: auto; margin: 0; padding: 16px; gap: 4px;
    flex-direction: column; background: var(--nav); border: 1px solid var(--border);
    border-radius: 20px; visibility: visible; text-align: left;
  }
  header .grid-layout nav .nav-list.active { display: flex; transition: none; }
  header .grid-layout nav .nav-list li { opacity: 1; margin: 0; }
  header .grid-layout nav .nav-list li a { padding: 10px 16px; font-size: 2rem; width: 100%; white-space: normal; }
  .mobile-menu { display: flex; flex-direction: column; }
  #s-home { padding: 0 24px; }
  #s-home .grid-layout #home { min-height: auto; padding: calc(var(--header-height) + 48px) 0 64px; }
  #s-home .grid-layout .skills-1 {
    justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto;
    overscroll-behavior-x: contain; scroll-snap-type: x mandatory;
    scroll-padding-inline: 4px; padding: 6px 4px 16px;
    scrollbar-width: thin; scrollbar-color: var(--accent-solid) var(--badge);
  }
  #s-home .grid-layout .skills-1 > div { flex: 0 0 auto; scroll-snap-align: start; }
  #s-home .grid-layout .skills-1 > div article { padding: 12px 20px; }
  .skills-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
  .skills-controls p { font-size: 1.4rem; color: var(--muted); text-align: left; line-height: 1.5; }
  .skills-arrows { display: flex; gap: 8px; }
  #s-about .grid-layout > div { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .academic-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .academic-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .academic-links a { justify-content: center; }
  .teaching-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .interdisciplinary-map {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 12px;
  }
  .map-core { grid-column: 2; grid-row: 1 / span 2; min-height: 220px; padding: 18px; }
  .map-node { min-height: 96px; padding: 16px; }
  .map-core span, .map-node span { display: none; }
  .map-core strong { font-size: 2rem; }
  .map-node strong { font-size: 1.55rem; line-height: 1.25; }
  .map-node:nth-child(6) { grid-column: 2; grid-row: 3; }
  .map-node:nth-child(6)::before {
    top: -13px; left: 50%; width: 0; height: 12px;
    border-top: 0; border-left: 1px solid var(--border);
    transform: translateX(-50%);
  }
}
@media (max-width: 600px) {
  header { padding: 0 16px; }
  header .grid-layout nav { padding: 12px; gap: 8px; }
  header .grid-layout nav h1 { font-size: 1.6rem; }
  .nav-tools { gap: 4px; }
  .language-control select { min-height: 40px; padding-inline: 6px; font-size: 1.3rem; }
  #s-home { padding: 0 20px; }
  #s-home .grid-layout #home { padding-top: calc(var(--header-height) + 36px); gap: 32px; }
  #s-home .grid-layout #home #home-container-text h3,
  #s-home .grid-layout #home #home-container-text .home-greeting { font-size: 2rem; }
  #s-home .grid-layout #home #home-container-text h2 { font-size: 3.6rem; overflow-wrap: anywhere; }
  #s-home .grid-layout #home #home-container-text p { width: 100%; font-size: 1.8rem; }
  #s-home .grid-layout .skills-1 > div article p { font-size: 1.8rem; }
  #s-about, #s-projects, #s-contact { padding: calc(var(--header-height) + 8px) 20px 64px; }
  #s-about .grid-layout > div { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  #s-about .grid-layout > div .profile-photo { width: min(70%, 240px); height: auto; min-height: 0; aspect-ratio: 1; justify-self: center; }
  #s-about .grid-layout h2 { font-size: 3.2rem; }
  #s-about .grid-layout p { font-size: 1.8rem; }
  .academic-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .academic-links { grid-template-columns: minmax(0, 1fr); }
  .teaching-section, .map-section { padding: calc(var(--header-height) + 8px) 20px 64px; }
  .teaching-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .interdisciplinary-map { grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 8px; }
  .map-core { min-height: 170px; padding: 12px; }
  .map-node { min-height: 76px; padding: 10px; }
  .map-core strong { font-size: 1.6rem; }
  .map-node strong { font-size: 1.25rem; }
  #s-projects .grid-layout > h2, #s-contact .grid-layout h2 { font-size: 3.6rem; }
  .accessibility-panel { padding: 20px; }
  #s-academic, #s-contact { padding: calc(var(--header-height) + 8px) 20px 64px; }
}
:root[data-motion="reduce"] { scroll-behavior: auto; }
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation: none !important; transition: none !important; scroll-behavior: auto !important;
}
:root[data-motion="reduce"] .sombra,
:root[data-motion="reduce"] .swiper-wrapper,
:root[data-motion="reduce"] .skills-1 {
  transform: none !important;
}
@media (prefers-reduced-motion: reduce) {
  html, *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* About, research and trajectory share the active theme and reading settings. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
#s-about .grid-layout > div { grid-template-columns: minmax(300px, 420px) minmax(0, 1fr); }
#s-about .grid-layout > div .profile-photo { max-width: 420px; border-radius: 28px; }
.research-section, .journey-section { padding: calc(var(--header-height) + 24px) 24px 96px; color: var(--text); background: var(--page); }
.journey-section { background: var(--section); }
.section-eyebrow {
  display: inline-block; color: var(--accent); background: var(--badge);
  padding: 10px 20px; border-radius: 6px; font-size: 1.8rem; font-weight: 500;
}
.research-section h2, .journey-section h2 {
  max-width: 860px; margin: 24px 0; font-size: clamp(3rem, 4vw, 4.8rem);
  line-height: 1.2; font-weight: 500; overflow-wrap: anywhere;
}
.section-intro { max-width: 820px; font-size: 2rem; line-height: 1.7; color: var(--muted); }
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 40px; }
.research-card {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: 28px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface);
}
.research-field { color: var(--accent); font-size: 1.6rem; line-height: 1.5; font-weight: 600; }
.research-card h3 { margin: 16px 0; font-size: 2.6rem; font-weight: 600; }
.research-card p { font-size: 1.8rem; line-height: 1.7; margin-bottom: 24px; }
.research-institution { margin-top: auto; font-size: 1.5rem; color: var(--muted); letter-spacing: 0.04em; }
.trajectory-link {
  display: inline-flex; align-items: center; gap: 16px; min-height: 48px;
  margin-top: 24px; color: var(--accent); font-size: 1.8rem; line-height: 1.5;
  text-decoration: underline; text-underline-offset: 5px;
}
.journey-layout { display: grid; grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); gap: 64px; margin-top: 48px; }
.journey-layout h3 { font-size: 2.4rem; margin-bottom: 24px; }
.education-list { display: grid; gap: 20px; }
.education-list li { padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.entry-period { display: block; color: var(--accent); font-size: 1.5rem; line-height: 1.6; font-weight: 600; }
.journey-layout h4 { margin: 10px 0; font-size: 2rem; line-height: 1.5; font-weight: 600; }
.journey-layout p { color: var(--muted); font-size: 1.7rem; line-height: 1.65; }
.experience-list { border-left: 1px solid var(--border); margin-left: 6px; }
.experience-list li { position: relative; padding: 0 0 32px 28px; }
.experience-list li:last-child { padding-bottom: 0; }
.experience-list li::before {
  content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px;
  border-radius: 50%; background: var(--accent-solid); border: 2px solid var(--section);
}
@media (max-width: 1100px) {
  #s-about .grid-layout > div { grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); }
  .journey-layout { grid-template-columns: minmax(210px, 280px) minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 700px) {
  #s-about .grid-layout > div { grid-template-columns: minmax(0, 1fr); }
  #s-about .grid-layout > div .profile-photo { width: min(100%, 340px); height: auto; min-height: 0; aspect-ratio: 1; justify-self: center; }
  .research-section, .journey-section { padding: calc(var(--header-height) + 8px) 20px 64px; }
  .research-grid, .journey-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .journey-layout { gap: 40px; }
  .research-card { padding: 24px; }
  .section-intro { font-size: 1.8rem; }
}

/* Desktop composition: keep the same section flow as the deployed layout. */
@media (min-width: 1101px) {
  :root { --desktop-content-width: 1360px; }
  .grid-layout { max-width: var(--desktop-content-width); }
  header, #s-home, #s-about, #s-projects, #s-contact,
  #s-academic, .research-section, .journey-section { padding-inline: clamp(32px, 4vw, 80px); }
  header .grid-layout nav { gap: 14px; padding: 16px 24px; }
  header .grid-layout nav h1 { flex: 0 0 auto; width: max-content; min-width: max-content; white-space: nowrap; font-size: clamp(1.8rem, 1.5vw, 2.2rem); }
  header .grid-layout nav .nav-list { gap: 10px; }
  header .grid-layout nav .nav-list li a { font-size: clamp(1.6rem, 1.25vw, 1.8rem); }
  .accessibility-panel { right: max(clamp(32px, 4vw, 80px), calc((100vw - var(--desktop-content-width)) / 2)); }
  #s-home .grid-layout #home {
    justify-content: flex-start;
    padding-top: calc(var(--header-height) + clamp(40px, 5vh, 64px));
    padding-bottom: 64px;
    gap: 40px;
  }
  #s-home .grid-layout #home #home-container-text p { max-width: 1060px; }
  #s-home .grid-layout .skills-1 { gap: 16px; align-content: start; }
  #s-about .grid-layout > div { gap: clamp(40px, 5vw, 80px); }
  #s-about .grid-layout article { max-width: 820px; }
  .research-section .grid-layout {
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    column-gap: 64px; align-items: start;
  }
  .research-section .section-eyebrow { grid-column: 1 / -1; justify-self: start; }
  .research-section h2 { margin: 24px 0 0; font-size: clamp(3.6rem, 3vw, 4.8rem); }
  .research-section .section-intro { margin-top: 24px; align-self: center; }
  .research-grid, .trajectory-link { grid-column: 1 / -1; }
  .research-grid {
    display: grid;
    gap: 28px;
    overflow: visible;
  }
  .research-grid > .research-card {
    display: flex;
    visibility: visible;
    opacity: 1;
    min-width: 0;
    padding: 32px;
  }
  .research-institution { line-height: 1.6; }
  .journey-layout { grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 80px; }
  .experience-list > li { display: block; visibility: visible; opacity: 1; }
  .map-node:nth-child(6) { grid-column: 2; grid-row: 3; }
  .map-node:nth-child(6)::before {
    top: -19px; left: 50%; width: 0; height: 18px;
    border-top: 0; border-left: 1px solid var(--border);
    transform: translateX(-50%);
  }
  #s-projects .slider-wrapper {
    width: 100%; max-width: 100%; margin: 0 0 55px; overflow: hidden;
  }
}

@media (max-width: 1100px) {
  .map-node:nth-child(6) { grid-column: 2; grid-row: 3; }
}

/* Keep project navigation in dedicated side gutters on larger screens. */
@media (min-width: 769px) {
  #s-projects .slider-wrapper {
    padding-inline: 48px;
  }
  #s-projects .slider-wrapper::before,
  #s-projects .slider-wrapper::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    z-index: 4;
    background: var(--section);
    pointer-events: none;
  }
  #s-projects .slider-wrapper::before { left: 0; }
  #s-projects .slider-wrapper::after { right: 0; }
  #s-projects .slider-wrapper .swiper-slide-button {
    top: 50%;
    width: 36px;
    height: 36px;
    margin-top: -18px;
    z-index: 5;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--accent);
  }
  #s-projects .slider-wrapper .swiper-button-prev { left: 0; }
  #s-projects .slider-wrapper .swiper-button-next { right: 0; }
  #s-projects .slider-wrapper .swiper-slide-button.swiper-button-disabled {
    opacity: .35;
    pointer-events: none;
  }
}

/* Desktop: let Swiper use the real available width without clipping its first slide. */
@media (min-width: 1101px) {
  #s-projects .container.swiper,
  #s-projects .slider-wrapper,
  #s-projects .card-list {
    width: 100%;
    height: auto;
    min-height: 0;
  }
  #s-projects .slider-wrapper {
    margin-inline: 0;
    padding-inline: 56px;
    overflow: hidden;
    isolation: isolate;
  }
  #s-projects .card-list { position: relative; z-index: 1; overflow: hidden; }
  #s-projects .slider-wrapper::before,
  #s-projects .slider-wrapper::after {
    display: block;
    width: 56px;
    background: var(--section);
    z-index: 10;
  }
  #s-projects .slider-wrapper .swiper-slide-button { z-index: 11; }
}
@media (min-width: 1101px) and (max-height: 800px) {
  #s-home .grid-layout #home { gap: 28px; padding-top: calc(var(--header-height) + 28px); padding-bottom: 40px; }
  #s-home .grid-layout #home #home-container-text h2 { font-size: 5.2rem; }
}

/* Desktop safety net: never clip content when a section is opened directly. */
@media (min-width: 1101px) {
  #s-home, #s-about, #s-research, #s-journey, #s-projects, #s-academic, #s-contact,
  #s-home .grid-layout, #s-about .grid-layout, #s-research .grid-layout,
  #s-journey .grid-layout, #s-projects .grid-layout, #s-academic .grid-layout, #s-contact .grid-layout {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }
  #s-home, #s-about, #s-research, #s-journey, #s-projects, #s-academic, #s-contact {
    min-height: 100svh;
  }
  #s-home .grid-layout, #s-about .grid-layout, #s-research .grid-layout,
  #s-journey .grid-layout, #s-projects .grid-layout, #s-academic .grid-layout, #s-contact .grid-layout {
    min-height: 0;
  }
  #s-home .skills-1 { display: flex; flex-wrap: wrap; overflow: visible; }
  #s-home .skills-1 > div,
  #s-home .skills-1 > div > .skill-featured {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .research-grid { display: grid; overflow: visible; }
  .research-grid > .research-card,
  .experience-list > li { display: block !important; visibility: visible !important; opacity: 1 !important; }
  .research-grid > .research-card { display: flex !important; }
}
