:root {
  --primary: #004c7a;
  --primary-light: #0071b3;
  --primary-dark: #00304d;
  --accent: #C4773B;
  --accent-light: #E8A96A;
  --bg: #ffffff;
  --bg-alt: #F0F5FA;
  --bg-hero: #004c7a;
  --text: #2D3748;
  --text-light: #718096;
  --text-on-dark: #ffffff;
  --border: #E2E8F0;
  --shadow: rgba(0,0,0,0.08);
  --radius: 10px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.7;
}

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

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 8px;
  z-index: 1000;
}
.skip-link:focus {
  top: 0;
}

/* Layout */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section--alt {
  background-color: var(--bg-alt);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.75rem;
  border-radius: 2px;
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--text-light); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Buttons */
.btn {
  display: inline-flex;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.btn:hover {
  text-decoration: none;
}
.btn--primary {
  background: var(--primary);
  color: white;
}
.btn--primary:hover {
  background: var(--primary-light);
  color: white;
}
.btn--outline {
  border: 2px solid var(--primary);
  color: var(--primary);
}
.btn--outline:hover {
  background: var(--primary);
  color: white;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: white;
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  height: 70px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
}
.nav-logo:hover {
  text-decoration: none;
}
.nav-logo span {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary);
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.nav-links a {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}
.nav-links a:hover {
  color: var(--primary);
}
.nav-links a.active {
  color: var(--primary);
  border-bottom: 2px solid var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  padding: 0.5rem;
}

/* Hero Banner (Pure Visual) */
.hero-banner {
  width: 100%;
  max-height: 340px;
  overflow: hidden;
  background-color: var(--bg-hero);
}
.hero-banner__img {
  width: 100%;
  height: 340px;
  display: block;
  object-fit: cover;
  object-position: center 48%;
}

.hero--small {
  position: relative;
  background-color: var(--primary);
  background-image: url('/img/page-header-bg.png');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  color: var(--text-on-dark);
  padding: 3rem 0 2rem;
  text-align: center;
  overflow: hidden;
}
.hero--small::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 30, 60, 0.45);
  pointer-events: none;
}
.hero--small .container {
  position: relative;
  z-index: 1;
}
.hero--small h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0,0,0,0.35);
}

/* Home Page Intro */
.intro-section {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.intro-header {
  max-width: 950px;
  margin: 0 auto 3rem;
}

.lab-title {
  color: var(--primary);
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  margin-bottom: 0.35rem;
}

.lab-affiliation {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.lab-director {
  font-size: 1rem;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.lab-description {
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.75;
  max-width: 960px;
  margin: 0 auto;
  text-align: left;
}
.lab-description p {
  margin-bottom: 1rem;
}
.lab-description p:first-child {
  font-weight: 600;
}
.lab-description p:last-child {
  margin-bottom: 0;
}
.lab-description a {
  color: var(--primary);
  text-decoration: underline;
}

/* Home Cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.home-card {
  background: #ffffff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  box-shadow: 0 2px 12px var(--shadow);
  padding: 2rem 1.5rem;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}
.home-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(13, 35, 69, 0.15);
  text-decoration: none;
  color: var(--text);
}
.home-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--bg-alt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.1rem;
  color: var(--primary);
}
.home-card__icon svg {
  stroke: var(--primary);
}
.home-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.home-card__desc {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.6;
  flex: 1;
}
.home-card__arrow {
  margin-top: 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* News Section */
.news-section {
  background-color: #ffffff;
  color: var(--text);
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.news-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}

.news-header h2 {
  color: var(--text);
  margin: 0;
  font-size: 1.85rem;
}

.news-btn {
  border-color: var(--primary);
  color: var(--primary);
}
.news-btn:hover {
  background: var(--primary);
  color: white;
}

.news-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: white;
  color: var(--primary);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}
.news-arrow:hover:not(:disabled) {
  background: var(--primary);
  color: white;
}

.news-carousel-wrapper {
  overflow: hidden;
}

.news-carousel {
  display: flex;
  gap: 1.5rem;
  transition: transform 0.4s ease;
  will-change: transform;
}

.news-carousel .news-card {
  flex: 0 0 calc((100% - 3rem) / 3);
  min-width: 0;
}

@media (max-width: 1024px) {
  .news-carousel .news-card {
    flex: 0 0 calc((100% - 1.5rem) / 2);
  }
}

@media (max-width: 640px) {
  .news-carousel .news-card {
    flex: 0 0 100%;
  }
}

.news-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: block;
  text-decoration: none;
}
.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(13, 35, 69, 0.12);
  text-decoration: none;
}

.news-card__date {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.news-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0.4rem 0;
  color: var(--text);
  line-height: 1.4;
}

.news-card__summary {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
}

.news-card__body {
  padding: 1.5rem;
}

/* People */
.team-section__title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  margin-top: 3rem;
  color: var(--text);
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2rem;
}

.person-card {
  text-align: center;
  padding: 2rem;
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.person-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.person-card__photo {
  width: 180px;
  height: 180px;
  border-radius: var(--radius);
  object-fit: cover;
  margin: 0 auto 1.25rem;
}

.person-card__name {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}

.person-card__role {
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.person-card__tagline {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-top: 0.6rem;
  line-height: 1.5;
}

.person-card__hobby {
  font-size: 0.82rem;
  color: var(--primary-light);
  margin-top: 0.4rem;
  font-style: italic;
}

/* Alumni List */
.alumni-list {
  list-style: none;
  padding: 0;
  columns: 2;
  gap: 0.5rem 3rem;
}

@media (max-width: 640px) {
  .alumni-list { columns: 1; }
}

.alumni-item {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  break-inside: avoid;
}

.alumni-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.alumni-role {
  font-size: 0.82rem;
  color: var(--text-light);
}

.alumni-now {
  font-size: 0.82rem;
  color: var(--primary);
  font-style: italic;
}

.person-card__links {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.person-card__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-alt);
  color: var(--primary);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.person-card__links a:hover {
  background: var(--primary);
  color: white;
  text-decoration: none;
}

.person-card__links a svg {
  width: 18px;
  height: 18px;
}

/* Publications */
.pub-year {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}
.pub-entry {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.pub-entry__authors {
  font-size: 0.95rem;
}
.pub-entry__title {
  font-weight: 600;
  font-size: 1.05rem;
  margin: 0.25rem 0;
  color: var(--text);
}
.pub-entry__title a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}
.pub-entry__title a:hover {
  text-decoration: underline;
}
.pub-entry__journal {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.95rem;
}
.pub-entry__links {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-light);
}
.pub-entry__links a {
  color: var(--text-light);
  text-decoration: none;
  transition: opacity 0.2s;
}
.pub-entry__links a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Resources */
.resource-block {
  display: flex;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 0;
  border-bottom: 1px solid var(--border);
}
.resource-block:last-child {
  border-bottom: none;
}
.resource-block--reverse {
  flex-direction: row-reverse;
}
.resource-block__image {
  flex: 0 0 30%;
  max-width: 280px;
  display: flex;
  justify-content: center;
}
.resource-block__image img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius);
}
.resource-block__content {
  flex: 1;
}
.resource-block__content h3 {
  font-size: 1.45rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text);
  line-height: 1.35;
}
.resource-block--full {
  flex-direction: column;
  align-items: flex-start;
}
.resource-block--full .resource-block__content {
  width: 100%;
  max-width: 100%;
}
.resource-block--wide {
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  padding-left: calc(50vw - 50% + 1.5rem);
  padding-right: calc(50vw - 50% + 1.5rem);
  max-width: 100vw;
}
.resource-block--wide .resource-block__image {
  flex: 0 0 300px;
  max-width: 300px;
}
.resource-block__content p {
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 1.25rem;
}
.resource-block__content p:last-child {
  margin-bottom: 0;
}

/* Teaching */
.teaching-block {
  margin-bottom: 2.5rem;
}
.teaching-block h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text);
}
.teaching-entry {
  padding-left: 1rem;
  margin-bottom: 0.75rem;
  border-left: 3px solid var(--primary-light);
}
.teaching-entry__year {
  font-style: italic;
  color: var(--text-light);
  font-size: 0.9rem;
}
.teaching-entry__title {
  font-weight: 600;
}
.teaching-entry__detail {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Gallery */
/* Gallery Carousel */
.gallery-carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #004c7a;
  max-height: 520px;
}
.gallery-carousel {
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}
.gallery-slide {
  min-width: 100%;
  position: relative;
}
.gallery-slide img {
  width: 100%;
  height: 480px;
  object-fit: contain;
  display: block;
}
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  padding: 1.5rem 1.5rem 1rem;
  font-size: 0.95rem;
  margin: 0;
}
.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: background 0.2s;
  z-index: 10;
}
.gallery-btn:hover {
  background: white;
}
.gallery-btn--prev { left: 1rem; }
.gallery-btn--next { right: 1rem; }

/* Footer */
.site-footer {
  background: var(--primary);
  color: var(--text-on-dark);
  padding: 1.75rem 0 1.25rem;
  border-top: none;
}
.footer-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-compact__info {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.5;
}
.footer-compact__info strong {
  color: #ffffff;
  font-weight: 600;
}
.footer-compact__links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.footer-compact__links a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s;
}
.footer-compact__links a:hover {
  color: white;
}
.footer-bottom {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
}

/* Responsive */
@media (max-width: 1024px) {
  .news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: white;
    padding: 1.5rem;
    box-shadow: 0 4px 6px var(--shadow);
    gap: 1.5rem;
  }
  .nav-links--open {
    display: flex;
  }
  
  .hero-banner {
    max-height: 220px;
    overflow: hidden;
  }
  .hero-banner__img {
    height: 220px;
    transform: scale(1.2);
    transform-origin: center 48%;
  }

  .gallery-carousel-wrapper {
    max-height: none;
  }
  .gallery-slide img {
    height: 70vw;
    min-height: 200px;
    max-height: 420px;
    object-fit: contain;
  }

  .hero--small {
    padding: 2rem 0 1.5rem;
    background-size: cover;
  }
  .hero--small h1 {
    font-size: 1.5rem;
  }
  
  .lab-title {
    font-size: 1.45rem;
    white-space: normal;
  }
  
  .news-grid {
    grid-template-columns: 1fr;
  }
  
  .resource-block, .resource-block--reverse {
    flex-direction: column;
    gap: 1.5rem;
  }
  .resource-block__image {
    max-width: 100%;
    flex: auto;
  }
  
  .footer-compact {
    flex-direction: column;
    text-align: center;
  }
}

/* Eye Tracking Tips Page */
.eye-tracking-intro {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin-bottom: 2.5rem;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
.eye-tracking-intro p {
  margin: 0 0 0.75rem;
}
.eye-tracking-intro p:last-child {
  margin-bottom: 0;
}
.tips-list {
  list-style: none;
  counter-reset: tips-counter;
  padding: 0;
  margin: 0;
}
.tips-list li {
  counter-increment: tips-counter;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
.tips-list li:last-child {
  border-bottom: none;
}
.tips-list li h4 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 0 0 0.5rem 0;
}
.tips-list li h4::before {
  content: counter(tips-counter);
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Accessibility */

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
