/* ==========================================================================
   DESIGN TOKENS
   Portfolio for Aida Villalba Ortiz — neutral grays as the base palette,
   with a blue accent (#4472C4) reserved for the primary CTA, hover
   states, and the hero network. Set in Inter throughout.
   ========================================================================== */

:root {
  /* Color */
  --accent:        #4472C4;
  --accent-dark:   #2E528F;
  --accent-tint:   #EEF2FB;
  --accent-tint-2: #D9E2F3;

  --ink:          #111318;
  --ink-soft:     #6B7280;
  --bg:           #FFFFFF;
  --bg-soft:      #F7F8FA;
  --line:         #E5E7EB;

  /* Type */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-w: 760px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 20px;

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 3.5rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ==========================================================================
   BACKGROUND NETWORK
   Decorative GeoJSON-style network (nodes + edges), evoking a spatial
   accessibility graph. Fixed behind the entire page — visible clearly
   in the hero (very light overlay there) and faintly under the
   sections, which paint a mostly-opaque background over it so text
   stays easy to read. Nodes/edges light up individually as the cursor
   passes near them (driven by the --p custom property, set in
   script.js from the pointer's distance to each element).
   ========================================================================== */

.page-network {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.hero__network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.network-edge polyline {
  fill: none;
  stroke: var(--accent-dark);
  stroke-width: calc(0.8px + var(--p, 0) * 1.4px);
  stroke-linejoin: round;
  stroke-linecap: round;
  opacity: calc(0.16 + var(--p, 0) * 0.5);
  transition: opacity 0.15s ease, stroke-width 0.15s ease;
}
.network-node circle {
  fill: var(--accent-dark);
  opacity: calc(0.3 + var(--p, 0) * 0.5);
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(calc(1 + var(--p, 0) * 0.7));
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.network-node--hub { opacity: calc(0.5 + var(--p, 0) * 0.35); }

/* ==========================================================================
   HEADER / NAV
   ========================================================================== */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: var(--space-2) var(--space-3) 0;
  pointer-events: none; /* only the floating pill below should catch clicks */
}

.nav {
  position: relative;
  pointer-events: auto;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(33, 28, 27, 0.07);
  transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
.site-header--scrolled .nav {
  padding: 0.5rem 1.4rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 14px 34px rgba(33, 28, 27, 0.1);
}

.nav__mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.nav__links {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
}
.nav__links a {
  position: relative;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}
.nav__links a:hover,
.nav__links a.active { color: var(--ink); text-decoration: none; }
.nav__links a:hover::after,
.nav__links a.active::after { width: 100%; }
.nav__links a.active { color: var(--ink); font-weight: 700; }

.nav__right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 34px;
  height: 34px;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
}
.nav__burger span {
  display: block;
  width: 15px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.lang-toggle {
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent-dark); }

/* ==========================================================================
   HERO
   ========================================================================== */

.hero {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6.5rem var(--space-3) var(--space-4);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.4);
}

/* Soft fade at the foot of the hero so the next section's heavier
   overlay eases in instead of cutting off sharply. */
.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 90px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.94));
  z-index: 0;
  pointer-events: none;
}

/* The hero uses the same content column as every other section, so it
   reads as the first block in the page rather than a separate landing
   banner — no border-top here since the fade above already eases in. */
.hero + .section { border-top: 1px solid var(--line); }

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 540px;
}
.hero__content > * { text-shadow: 0 1px 14px var(--bg), 0 1px 2px var(--bg); }

.hero__eyebrow {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 0.85rem;
}

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.6vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.9rem;
}

.hero__intro {
  color: var(--ink-soft);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 0 1.1rem;
}

.hero__buttons {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.hero__socials {
  display: flex;
  gap: 0.6rem;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 1.05rem;
  background: #fff;
  transition: all 0.2s ease;
}
.social-icon:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  transition: all 0.2s ease;
}
.btn:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
  color: var(--accent-dark);
  text-decoration: none;
  transform: translateY(-2px);
}
.btn--primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.btn--small { font-size: 0.8rem; padding: 0.4rem 0.85rem; }

/* ==========================================================================
   SECTIONS
   ========================================================================== */

.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

.section__title {
  position: relative;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  padding-bottom: 0.6rem;
  margin: 0 0 var(--space-1);
}
.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 48px;
  height: 3px;
  border-radius: 20px;
  background: var(--ink);
}

.section__subtitle {
  color: var(--ink-soft);
  margin: 0 0 var(--space-3);
}

.group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  margin: var(--space-4) 0 var(--space-2);
}
.group-title:first-of-type { margin-top: var(--space-1); }
.group-title::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-soft);
}
.group-title--education::before {
  background: transparent;
  border: 2px solid var(--ink-soft);
}

/* ==========================================================================
   EXPERIENCE / EDUCATION — timeline
   Professional experience uses solid green markers on a plain card;
   education uses hollow markers on a soft dashed-border card, so the two
   groups stay easy to tell apart at a glance.
   ========================================================================== */

.org-list {
  position: relative;
  margin: 0 0 var(--space-3);
  padding-left: 28px;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  list-style: none;
}
.org-list::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
  border-radius: 20px;
}

.org-item {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--line);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.org-item:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(46, 82, 143, 0.14);
}

.timeline__dot {
  position: absolute;
  left: -25px;
  top: 1.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px var(--ink);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}
.org-item:hover .timeline__dot {
  transform: scale(1.2);
  background: var(--accent-dark);
  box-shadow: 0 0 0 2px var(--accent-dark);
}

.timeline__year {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 0.15rem 0.6rem;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 30px;
}

.org-item__logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: contain;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 4px;
}

.org-item__body { display: flex; flex-direction: column; min-width: 0; }

.org-item__name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 0.15rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.org-item__role { font-size: 0.98rem; font-weight: 600; margin: 0 0 0.15rem; }
.org-item__dates { font-size: 0.78rem; color: var(--ink-soft); margin: 0 0 0.4rem; }
.org-item__desc { color: var(--ink-soft); font-size: 0.92rem; margin: 0.3rem 0 0.6rem; }

/* Education variant */
.org-list--education .org-item {
  background: var(--bg-soft);
  border-style: dashed;
}
.org-list--education .org-item:hover { border-color: var(--ink-soft); box-shadow: 0 10px 24px rgba(33, 28, 27, 0.06); }
.org-list--education .timeline__dot {
  background: var(--bg-soft);
  box-shadow: 0 0 0 2px var(--ink-soft);
}
.org-list--education::before { background: var(--accent-tint-2); }
.org-list--education .timeline__year {
  background: transparent;
  border: 1px solid var(--ink-soft);
  color: var(--ink-soft);
}

/* Awards — small aesthetic sub-block inside an education .org-item */
.awards {
  margin-top: 0.7rem;
  padding-top: 0.7rem;
  border-top: 1px dashed var(--line);
}
.awards__label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #9A6B0F;
}
.awards__label i { font-size: 0.8rem; }

.awards__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.awards__item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: #FFF9EC;
  border: 1px solid #F0DDA8;
  border-radius: var(--radius-sm);
}

.awards__icon {
  flex: 0 0 auto;
  margin-top: 0.2rem;
  color: #C6941B;
  font-size: 0.9rem;
}

.awards__body { min-width: 0; }
.awards__name { font-size: 0.86rem; font-weight: 700; margin: 0; color: var(--ink); }
.awards__meta { font-size: 0.76rem; color: var(--ink-soft); margin: 0.1rem 0 0; }

.tag-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}
.tag-list li {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
}


/* ==========================================================================
   RESEARCH — filter tabs + publication cards
   ========================================================================== */

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}
.tab {
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.tab:hover { border-color: var(--accent); color: var(--accent-dark); }
.tab.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }

.biblio-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.biblio-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.biblio-card:hover {
  border-color: var(--accent);
  box-shadow: 0 14px 30px rgba(46, 82, 143, 0.12);
  transform: translateY(-3px);
}
.biblio-card.is-hidden { display: none; }

.biblio-card__link {
  display: grid;
  grid-template-columns: 190px 1fr;
  color: inherit;
  text-decoration: none;
}

.biblio-card__thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  padding: 1rem;
}
.biblio-card__thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.35s ease;
}
.biblio-card:hover .biblio-card__thumb img { transform: scale(1.04); }

.biblio-card__body { padding: 1.1rem 1.25rem 1.25rem; min-width: 0; }

.biblio-card__title { font-size: 1.02rem; font-weight: 700; margin: 0 0 0.35rem; }
.biblio-card__summary { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; margin: 0 0 0.5rem; }
.biblio-card__authors { margin: 0 0 0.2rem; color: var(--ink); font-size: 0.88rem; }
.biblio-card__authors strong { color: var(--ink); }
.biblio-card__venue {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin: 0 0 var(--space-1);
}
.biblio-card__venue .dot { margin: 0 0.1rem; }
.biblio-card__cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink);
  transition: color 0.2s ease, gap 0.2s ease;
}
.biblio-card__cta i { font-size: 0.7rem; }
.biblio-card:hover .biblio-card__cta { color: var(--accent-dark); gap: 0.5rem; }
.tag-list--venue { margin-bottom: 0; }

/* ==========================================================================
   PROJECTS
   Drop as many .project-card blocks into .projects-grid as needed — each
   one is self-contained (image, badge, title, description, tags, link).
   The grid scrolls horizontally as a carousel; the buttons in
   .projects-carousel just scroll it by one card at a time (see script.js).
   ========================================================================== */

.projects-carousel {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.projects-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 0.35rem 0.15rem 0.75rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.projects-grid::-webkit-scrollbar { display: none; }

.carousel-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.carousel-btn:hover { border-color: var(--accent); background: var(--accent-tint); color: var(--accent-dark); }

.project-card {
  flex: 0 0 min(90%, 460px);
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(46, 82, 143, 0.14);
}

.project-card__image { position: relative; overflow: hidden; background: var(--bg-soft); height: 240px; }
.project-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.project-card:hover .project-card__image img { transform: scale(1.05); }

.project-card__content {
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-card__badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.3rem 0.8rem;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  margin-bottom: 0.7rem;
}

.project-card__content h3 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin: 0 0 0.6rem; }
.project-card__content p { line-height: 1.6; color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 0.9rem; }
.project-card__content .tag-list { margin-bottom: 1rem; }

.project-card__funding {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  margin: 0 0 1rem;
}
.project-card__funding i { color: var(--accent-dark); margin-right: 0.1rem; }
.project-card__funding span:first-of-type { font-weight: 700; color: var(--ink); }

.project-card__buttons { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-top: auto; }

@media (max-width: 720px) {
  .project-card { flex-basis: 82%; }
  .carousel-btn { display: none; }
}

/* ==========================================================================
   TEACHING
   ========================================================================== */

.teaching-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.teaching-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: all 0.2s ease;
}
.teaching-item:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(46, 82, 143, 0.1);
  transform: translateY(-3px);
}

.teaching-item__icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.teaching-item__body { display: flex; flex-direction: column; min-width: 0; }

.teaching-item__heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}

.teaching-item__name { font-size: 1rem; font-weight: 700; margin: 0; }
.teaching-item__level {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.teaching-item__desc { font-size: 0.88rem; color: var(--ink-soft); margin: 0 0 0.75rem; }

.syllabus-picker__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

.syllabus-picker__row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.syllabus-picker__select {
  flex: 1 1 220px;
  min-width: 0;
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.2s ease;
}
.syllabus-picker__select:hover,
.syllabus-picker__select:focus-visible { border-color: var(--accent); }

.syllabus-picker__download { flex: 0 0 auto; white-space: nowrap; }
.syllabus-picker__download i { margin-right: 0.3rem; }

/* Degree and Master Thesis — a readable row per thesis (small cover +
   title/year/tags), rather than a cramped narrow-column grid where long
   titles used to wrap into an unreadable stack of short lines. Only the
   first 4 rows show by default (.thesis-grid--collapsed, toggled by
   script.js); "Show repository" is a separate small link on the side. */
.thesis-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.thesis-grid--collapsed .thesis-card:nth-child(n+3) { display: none; }

.thesis-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.thesis-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 24px rgba(46, 82, 143, 0.1);
  transform: translateY(-2px);
}

.thesis-card__link {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.thesis-card__thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 82px;
  overflow: hidden;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.thesis-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thesis-card__body { min-width: 0; flex: 1; }

.thesis-card__title {
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.5;
  margin: 0 0 0.3rem;
  overflow-wrap: break-word;
  white-space: normal;
}
.thesis-card__year { font-size: 0.76rem; color: var(--ink-soft); margin: 0 0 0.5rem; }
.thesis-card__body .tag-list { margin: 0; }
.thesis-card__repo { flex: 0 0 auto; }

.thesis-grid__toggle {
  display: inline-flex;
  margin-top: 1rem;
}

@media (max-width: 640px) {
  .teaching-item { grid-template-columns: 36px 1fr; padding: 1rem; }
  .teaching-item__icon { width: 36px; height: 36px; font-size: 0.95rem; }
  .thesis-card { flex-wrap: wrap; }
  .thesis-card__link { flex-basis: 100%; }
  .thesis-card__repo { margin-left: calc(64px + 1rem); }
}


/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
  text-align: center;
  padding: var(--space-3);
  color: var(--ink-soft);
  font-size: 0.8rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
}

/* ==========================================================================
   SCROLL-REVEAL ANIMATIONS
   ========================================================================== */

.hidden {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.show { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 700px) {
  .nav__burger { display: flex; }

  .nav__links {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    left: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 14px 34px rgba(33, 28, 27, 0.12);
    padding: 0.6rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.25s ease, opacity 0.2s ease;
  }
  .nav__links.is-open {
    max-height: 400px;
    opacity: 1;
    pointer-events: auto;
  }
  .nav__links li { width: 100%; }
  .nav__links a {
    display: block;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
  }
  .nav__links a:hover { background: var(--bg-soft); text-decoration: none; }
  .nav__links a::after { display: none; }
  .lang-toggle { margin: 0.3rem 0.2rem 0; align-self: flex-start; }
}

@media (max-width: 640px) {
  .hero { padding: 5.5rem var(--space-2) var(--space-3); }
  .nav { padding: 0.55rem 1rem; }
  .nav__right { gap: 0.6rem; }
  .section { padding: var(--space-3) var(--space-2); }
  .section__title { font-size: 1.3rem; }
  .hero__buttons { gap: 0.75rem; }
  .org-item { grid-template-columns: 32px 1fr; padding: 1rem; }
  .org-item__logo { width: 32px; height: 32px; }
  .biblio-card__link { grid-template-columns: 1fr; height: auto; }
  .biblio-card__thumb { height: 160px; border-right: none; border-bottom: 1px solid var(--line); }
  .biblio-card__body { height: auto; }
  .biblio-card__title,
  .biblio-card__summary { -webkit-line-clamp: unset; overflow: visible; }
  .biblio-card__venue { white-space: normal; overflow: visible; }
  .biblio-card__authors { white-space: normal; overflow: visible; text-overflow: clip; }
  .tag-list--venue { max-height: none; overflow: visible; }
  .project-card__funding { font-size: 0.78rem; }
}

@media (max-width: 460px) {
  .lang-toggle { padding: 0.2rem 0.5rem; font-size: 0.7rem; }
  .hero__name { font-size: 1.5rem; }
  .social-icon { width: 36px; height: 36px; font-size: 0.95rem; }
  .biblio-card__body { padding: 0.9rem 1rem 1.1rem; }
  .biblio-card__title { font-size: 0.95rem; }
}
