/* =========================================================
   Smart Robotics Lab — Modern Stylesheet
   Ritsumeikan University, Department of Robotics
   ========================================================= */

:root {
  color-scheme: light;
  --color-bg: #f7f9fc;
  --color-bg-alt: #ffffff;
  --color-surface: #ffffff;
  --color-text: #14202f;
  --color-text-muted: #3d4759;     /* darkened for AA+ contrast */
  --color-border: #d8dee8;
  --color-primary: #0a2540;
  --color-primary-light: #1d3a5f;
  --color-accent: #a3001e;         /* Ritsumeikan crimson (slightly deepened) */
  --color-accent-light: #d6334e;
  --color-info: #005f99;           /* darker for better contrast on white */
  --shadow-sm: 0 1px 3px rgba(10, 37, 64, 0.06), 0 1px 2px rgba(10, 37, 64, 0.04);
  --shadow-md: 0 4px 12px rgba(10, 37, 64, 0.08), 0 2px 4px rgba(10, 37, 64, 0.04);
  --shadow-lg: 0 12px 32px rgba(10, 37, 64, 0.12), 0 4px 8px rgba(10, 37, 64, 0.06);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-sans: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Kaku Gothic Pro", "Yu Gothic UI", "Yu Gothic", "YuGothic", "BIZ UDPGothic", "Meiryo UI", "メイリオ", Meiryo, "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
  --max-width: 1200px;
}

/* ---------- Reset / Base ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  /* Opt out of Windows High Contrast / forced-colors mode so the page keeps its own palette */
  forced-color-adjust: none;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Hard-pin light background so no browser setting (system dark mode, color override) can change it */
  background-color: #f7f9fc !important;
  color: #14202f !important;
  forced-color-adjust: none;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: #14202f !important;
  background-color: #f7f9fc !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  forced-color-adjust: none;
}

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

a {
  color: var(--color-info);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--color-accent); }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.4;
  color: #0a2540 !important;
  margin: 0;
}

p { margin: 0 0 1em; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main { min-height: 60vh; }

section { padding: 4rem 0; }

/* ---------- Header / Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Opaque fallback for browsers without backdrop-filter (older Firefox, etc.) */
  background: #ffffff;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition), box-shadow var(--transition);
}

/* Only apply translucent + blur where backdrop-filter actually works */
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .site-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
}

.site-header.scrolled { box-shadow: var(--shadow-sm); }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.nav__brand img { height: 40px; width: auto; }
.nav__brand-text { line-height: 1.2; }
.nav__brand-text small {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: #3d4759;
  letter-spacing: 0;
}

.nav__menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav__menu a {
  display: inline-block;
  padding: 0.6rem 1rem;
  color: #14202f;
  font-weight: 500;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  position: relative;
}
.nav__menu a::after {
  content: "";
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 0.4rem;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition);
}
.nav__menu a:hover,
.nav__menu a.active { color: var(--color-accent); }
.nav__menu a:hover::after,
.nav__menu a.active::after { transform: scaleX(1); }

.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 44px;
  height: 44px;
}
.nav__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-primary);
  margin: 5px auto;
  transition: all var(--transition);
}
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #ffffff;
    border-bottom: 1px solid #d8dee8;
    padding: 1rem;
    transform: translateY(-130%);
    transition: transform var(--transition);
    box-shadow: var(--shadow-md);
  }
  .nav__menu.open { transform: translateY(0); }
  .nav__menu a { padding: 0.9rem 1rem; }
  .nav__menu a::after { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 8rem 1.5rem 6rem;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse at top left, rgba(184, 0, 46, 0.06), transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(10, 37, 64, 0.10), transparent 50%),
    linear-gradient(180deg, #f7f9fc 0%, #edf1f8 100%);
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 0;
}

.hero__inner { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; }

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
  padding: 0.45rem 1.1rem;
  background: var(--color-accent);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(163, 0, 30, 0.25);
}

.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin: 0 0 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #0a2540 !important;
  -webkit-text-fill-color: #0a2540 !important;
  -webkit-text-stroke: 0 !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  background: none !important;
  -webkit-background-clip: border-box !important;
  background-clip: border-box !important;
  text-shadow: none !important;
}
.hero__title::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: var(--color-accent);
  margin: 1.25rem auto 0;
  border-radius: 2px;
}

.hero__subtitle {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: #14202f !important;
  max-width: 640px;
  margin: 0 auto 2rem;
  line-height: 1.85;
}

.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.75rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition);
}
.hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

/* ---------- Page header (sub pages) ---------- */
.page-header {
  padding: 5rem 1.5rem 3rem;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
#page-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 0;
}
.page-header__inner { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; }
.page-header h1 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin-bottom: 0.6rem;
  letter-spacing: 0.02em;
}
.page-header p {
  color: rgba(255, 255, 255, 0.8) !important;
  -webkit-text-fill-color: rgba(255, 255, 255, 0.8) !important;
  margin: 0;
  font-size: 1rem;
}

/* ---------- Cards ---------- */
.card {
  background: #ffffff;
  border-radius: var(--radius-md);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Section heading */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 0.6rem;
  position: relative;
  display: inline-block;
}
.section-title h2::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--color-accent);
  margin: 0.75rem auto 0;
  border-radius: 2px;
}
.section-title p {
  color: #3d4759;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ---------- Concept / News (top page) ---------- */
.concept-card {
  background: #ffffff !important;
  color: #14202f !important;
  border-left: 4px solid #a3001e;
  padding: 2rem 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  font-size: 1.05rem;
  line-height: 1.9;
  margin: 0 auto;
  max-width: 820px;
}

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.news-list li {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 1.25rem;
  background: #ffffff;
  color: #14202f;
  border: 1px solid #d8dee8;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.news-list li:hover {
  border-color: var(--color-accent);
  transform: translateX(4px);
}
.news-date {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--color-accent);
  font-variant-numeric: tabular-nums;
  min-width: 110px;
}

/* ---------- Members ---------- */
.member-group { margin-bottom: 2.5rem; }
.member-group__title {
  font-size: 1.15rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-border);
}
.member-group__title::before {
  content: "";
  width: 6px;
  height: 22px;
  background: var(--color-accent);
  border-radius: 3px;
}
.member-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.member-list li {
  padding: 0.85rem 1.1rem;
  background: #ffffff;
  color: #14202f;
  border: 1px solid #d8dee8;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: all var(--transition);
}
.member-list li:hover {
  border-color: var(--color-accent);
  background: #fdf3f5;
}

/* ---------- Research ---------- */
.research-item {
  background: #ffffff;
  color: #14202f;
  border-radius: var(--radius-md);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid #d8dee8;
}
.research-item h2 {
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.research-item__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 1rem;
  flex-shrink: 0;
}
.research-item p { line-height: 1.9; }

.figure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.figure {
  margin: 0;
  text-align: center;
}
.figure img {
  width: 100%;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.92rem;
  color: #14202f;
  font-weight: 500;
}

.video-wrap {
  display: block;
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  margin: 1.5rem auto;
  max-width: 760px;
  background: #000;
  text-decoration: none;
}
.video-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, opacity 0.3s ease;
}
.video-wrap::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 86px;
  height: 60px;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 14px;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease, background 0.25s ease;
}
.video-wrap::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 0;
  height: 0;
  border-left: 22px solid #fff;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  transform: translate(-40%, -50%);
  pointer-events: none;
}
.video-wrap:hover img { transform: scale(1.04); }
.video-wrap:hover::after { background: #cc0000; transform: translate(-50%, -50%) scale(1.08); }

.papers {
  margin-top: 1.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.papers-header {
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
}
.papers ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.papers li {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: 0.92rem;
  line-height: 1.6;
}
.papers li:first-child { border-top: 0; }

/* ---------- Lecture ---------- */
.lecture-section { margin-bottom: 3rem; }
.lecture-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  padding-left: 1rem;
  border-left: 4px solid var(--color-accent);
}
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}
.video-card {
  display: block;
  background: #ffffff;
  color: #14202f;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #d8dee8;
  transition: transform var(--transition), box-shadow var(--transition);
  text-decoration: none;
}
.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  color: #14202f;
}
.video-card:hover .video-card__play { transform: translate(-50%, -50%) scale(1.08); background: #cc0000; }
.video-card:hover .video-card__thumb img { transform: scale(1.05); }

.video-card__thumb {
  position: relative;
  padding-bottom: 56.25%;
  background: #000;
  overflow: hidden;
}
.video-card__thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.video-card__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 64px;
  height: 44px;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, background 0.25s ease;
  pointer-events: none;
}
.video-card__play::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 16px solid #fff;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
  margin-left: 4px;
}
.video-card__label {
  padding: 0.9rem 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.video-card__label::after {
  content: "YouTube ↗";
  font-size: 0.75rem;
  color: var(--color-accent);
  font-weight: 600;
}

/* ---------- Publications ---------- */
.pub-section { margin-bottom: 3rem; }
.pub-section h2 {
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.pub-section h2::before {
  content: "";
  width: 8px;
  height: 24px;
  background: var(--color-accent);
  border-radius: 2px;
}
.pub-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: pub;
}
.pub-list li {
  counter-increment: pub;
  position: relative;
  padding: 1rem 1rem 1rem 3.5rem;
  background: #ffffff;
  color: #14202f;
  border: 1px solid #d8dee8;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.65;
  transition: all var(--transition);
}
.pub-list li::before {
  content: counter(pub);
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: 28px;
  height: 28px;
  background: #f7f9fc;
  color: #0a2540;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  border: 1px solid var(--color-border);
}
.pub-list li:hover {
  border-color: var(--color-accent);
  transform: translateX(3px);
}
.pub-divider {
  text-align: center;
  margin: 3rem 0 2rem;
  color: var(--color-accent);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.9rem;
  position: relative;
}
.pub-divider::before, .pub-divider::after {
  content: "";
  display: inline-block;
  width: 60px;
  height: 1px;
  background: var(--color-border);
  vertical-align: middle;
  margin: 0 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0a2540;
  color: rgba(255, 255, 255, 0.8);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 0;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 2fr 1fr 1fr;
}
@media (max-width: 720px) {
  .footer-inner { grid-template-columns: 1fr; }
}
.footer-brand h3 {
  color: #fff;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.footer-brand p { font-size: 0.9rem; margin: 0.3rem 0; color: rgba(255, 255, 255, 0.92); }
.footer-col h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
  transition: color var(--transition);
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: var(--max-width);
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Reveal / Scroll Animations ---------- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children animation */
.reveal.visible .member-list li,
.reveal.visible .pub-list li,
.reveal.visible .news-list li {
  animation: fadeSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.reveal.visible .member-list li:nth-child(1), .reveal.visible .pub-list li:nth-child(1), .reveal.visible .news-list li:nth-child(1) { animation-delay: 0.05s; }
.reveal.visible .member-list li:nth-child(2), .reveal.visible .pub-list li:nth-child(2), .reveal.visible .news-list li:nth-child(2) { animation-delay: 0.1s; }
.reveal.visible .member-list li:nth-child(3), .reveal.visible .pub-list li:nth-child(3), .reveal.visible .news-list li:nth-child(3) { animation-delay: 0.15s; }
.reveal.visible .member-list li:nth-child(4), .reveal.visible .pub-list li:nth-child(4), .reveal.visible .news-list li:nth-child(4) { animation-delay: 0.2s; }
.reveal.visible .member-list li:nth-child(5), .reveal.visible .pub-list li:nth-child(5), .reveal.visible .news-list li:nth-child(5) { animation-delay: 0.25s; }
.reveal.visible .member-list li:nth-child(6), .reveal.visible .pub-list li:nth-child(6), .reveal.visible .news-list li:nth-child(6) { animation-delay: 0.3s; }
.reveal.visible .member-list li:nth-child(n+7) { animation-delay: 0.35s; }

/* Video cards stagger */
.video-card {
  opacity: 0;
  animation: fadeSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.reveal.visible .video-card:nth-child(1) { animation-delay: 0.1s; }
.reveal.visible .video-card:nth-child(2) { animation-delay: 0.2s; }
.reveal.visible .video-card:nth-child(3) { animation-delay: 0.3s; }
.reveal.visible .video-card:nth-child(4) { animation-delay: 0.4s; }
.reveal.visible .video-card:nth-child(5) { animation-delay: 0.5s; }
.reveal.visible .video-card:nth-child(6) { animation-delay: 0.6s; }
.reveal.visible .video-card:nth-child(7) { animation-delay: 0.7s; }
.reveal.visible .video-card:nth-child(n+8) { animation-delay: 0.75s; }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Section Title Shimmer ---------- */
.section-title h2 {
  background: linear-gradient(135deg, #0a2540 0%, #a3001e 50%, #0a2540 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0%, 100% { background-position: 0% center; }
  50% { background-position: 100% center; }
}

/* ---------- Enhanced Hover Effects ---------- */
.card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-lg);
  border-color: rgba(163, 0, 30, 0.2);
}

.concept-card {
  position: relative;
  overflow: hidden;
}
.concept-card::before {
  content: "";
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(163, 0, 30, 0.03), transparent);
  animation: conceptShine 6s ease-in-out infinite;
}
@keyframes conceptShine {
  0%, 100% { left: -50%; }
  50% { left: 100%; }
}

.news-list li {
  position: relative;
  overflow: hidden;
}
.news-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--color-accent);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.news-list li:hover::before { transform: scaleY(1); }

.member-list li {
  position: relative;
  overflow: hidden;
}
.member-list li::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(163, 0, 30, 0.04), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.member-list li:hover::after { opacity: 1; }

.pub-list li {
  position: relative;
  overflow: hidden;
}
.pub-list li::after {
  content: "";
  position: absolute;
  right: -100%; top: 0; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(163, 0, 30, 0.02));
  transition: right 0.4s ease;
}
.pub-list li:hover::after { right: 0; }

/* Video card enhanced hover */
.video-card {
  position: relative;
  overflow: hidden;
}
.video-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  transition: border-color 0.3s ease;
  pointer-events: none;
}
.video-card:hover::before {
  border-color: rgba(163, 0, 30, 0.3);
}

/* Research item hover accent */
.research-item {
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.research-item::after {
  content: "";
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.research-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(163, 0, 30, 0.15);
}
.research-item:hover::after { transform: scaleX(1); }

/* ---------- Section Separator Dots ---------- */
section + section::before {
  content: "· · ·";
  display: block;
  text-align: center;
  color: var(--color-border);
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  margin-top: -2rem;
  padding-bottom: 1rem;
}

/* ---------- Footer Enhancements ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: -50%; width: 200%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(163, 0, 30, 0.6), rgba(255, 255, 255, 0.3), rgba(163, 0, 30, 0.6), transparent);
  animation: footerLine 4s ease-in-out infinite;
}
@keyframes footerLine {
  0%, 100% { transform: translateX(-25%); }
  50% { transform: translateX(25%); }
}

.footer-col a {
  position: relative;
}
.footer-col a::after {
  content: "";
  position: absolute;
  bottom: -2px; left: 0; width: 0; height: 1px;
  background: #fff;
  transition: width 0.3s ease;
}
.footer-col a:hover::after { width: 100%; }
.footer-col a:hover { text-decoration: none; }

/* ---------- CTA Button Pulse ---------- */
.hero__cta {
  position: relative;
  overflow: hidden;
}
.hero__cta::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: var(--color-accent);
  animation: ctaPulse 2.5s ease-in-out infinite;
  z-index: -1;
}
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); opacity: 0; }
  50% { transform: scale(1.08); opacity: 0.3; }
}

/* ---------- Lecture Section Title Accent ---------- */
.lecture-section h2 {
  position: relative;
  transition: color var(--transition);
}
.lecture-section h2::after {
  content: "";
  position: absolute;
  bottom: -4px; left: 1rem; width: 0; height: 2px;
  background: var(--color-accent);
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.lecture-section:hover h2::after { width: 60%; }

/* ---------- Member Group Title Animation ---------- */
.member-group__title::before {
  transition: height 0.3s ease, background 0.3s ease;
}
.member-group:hover .member-group__title::before {
  height: 28px;
  background: var(--color-primary);
}

/* ---------- Pub Divider Animated ---------- */
.pub-divider::before, .pub-divider::after {
  transition: width 0.5s ease;
}
.pub-divider:hover::before, .pub-divider:hover::after {
  width: 100px;
}

/* ---------- Body Animation Keyframes ---------- */
@keyframes accentSlide {
  0%, 100% { background-position: 0% 0%; }
  50% { background-position: 0% 100%; }
}
@keyframes decoSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes decoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}
@keyframes borderGlow {
  0%, 100% { border-color: rgba(163, 0, 30, 0.08); }
  50% { border-color: rgba(163, 0, 30, 0.2); }
}
@keyframes numPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 0, 30, 0.15); }
  50% { box-shadow: 0 0 12px 4px rgba(163, 0, 30, 0.08); }
}

/* Visible research accent animation */
.research-item.visible .research-accent {
  opacity: 1 !important;
}

/* Research number glow */
.research-item__num {
  animation: numPulse 3s ease-in-out infinite;
}

/* Figure images — subtle zoom on hover */
.figure img {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.5s ease;
}
.figure:hover img {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(10, 37, 64, 0.12);
}

/* Papers section animated border */
.papers {
  position: relative;
  animation: borderGlow 4s ease-in-out infinite;
}

/* Video wrap enhanced hover */
.video-wrap {
  transition: transform var(--transition), box-shadow var(--transition);
}
.video-wrap:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(10, 37, 64, 0.15);
}

/* Member list — animated gradient background on group */
.member-group {
  position: relative;
  overflow: hidden;
}
.member-group::before {
  content: "";
  position: absolute;
  top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(ellipse at center, rgba(163, 0, 30, 0.02) 0%, transparent 70%);
  animation: memberGroupGlow 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes memberGroupGlow {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0; }
  50% { transform: translate(5%, 5%) scale(1.1); opacity: 1; }
}

/* Concept card — floating particles effect via gradient */
.concept-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background:
    radial-gradient(circle at 20% 30%, rgba(10, 37, 64, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 80% 70%, rgba(163, 0, 30, 0.03) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(10, 37, 64, 0.02) 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 40px 40px;
  animation: dotDrift 20s linear infinite;
  pointer-events: none;
}
@keyframes dotDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 60px 60px, -80px 80px, 40px -40px; }
}

/* News section — timeline connector */
.news-list {
  position: relative;
}
.news-list::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, transparent, var(--color-accent), var(--color-primary), transparent);
  background-size: 100% 200%;
  animation: accentSlide 4s ease-in-out infinite;
  opacity: 0.3;
  border-radius: 1px;
}

/* Lecture video grid — stagger entrance with scale */
.video-card {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
}
.video-card:hover {
  transform: translateY(-6px) scale(1.02);
}

/* Footer links subtle glow */
.footer-col li {
  position: relative;
}
.footer-col li::before {
  content: "";
  position: absolute;
  left: -8px; top: 50%; width: 3px; height: 0;
  background: var(--color-accent);
  border-radius: 2px;
  transition: height 0.3s ease, top 0.3s ease;
}
.footer-col li:hover::before {
  height: 16px;
  top: calc(50% - 8px);
}

/* Page content z-index above body canvas */
main > section {
  position: relative;
  z-index: 1;
}
.site-header { z-index: 100; }
.site-footer { z-index: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .video-card { opacity: 1; }
  .section-title h2 {
    -webkit-text-fill-color: #0a2540;
    background: none;
  }
}
