:root {
  --bg: #ffffff;
  --bg-soft: #f6f8fb;
  --panel: #ffffff;
  --line: #dfe6ef;
  --line-dark: #c7d2df;
  --text: #243142;
  --text-muted: #607086;
  --accent: #2f6fdb;
  --accent-deep: #1a3fbf;
  --accent-purple: #5b4fcf;
  --gradient-brand: linear-gradient(135deg, #2f6fdb 0%, #5b4fcf 50%, #1a3fbf 100%);
  --gradient-hero: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(47, 111, 219, 0.04) 0%, rgba(91, 79, 207, 0.02) 40%, transparent 70%);
  --gradient-section-line: linear-gradient(90deg, transparent 0%, #c7d2df 20%, #2f6fdb 50%, #c7d2df 80%, transparent 100%);
  --glow-blue: 0 0 30px rgba(47, 111, 219, 0.12);
  --shadow: 0 12px 32px rgba(37, 55, 86, 0.08);
  --shadow-lg: 0 20px 48px rgba(37, 55, 86, 0.1);
  --radius-lg: 22px;
  --radius-md: 16px;
  --nav-height: 82px;
  --runner-width: 96px;
  --runner-height: 118px;
  --runner-edge-gap: 10px;
}

/* ===== Keyframe Animations ===== */
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scaleX(1); }
  50% { opacity: 1; transform: translateX(-50%) scaleX(1.15); }
}

@keyframes subtleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes badgeGlow {
  0%, 100% { border-color: rgba(47, 111, 219, 0.15); box-shadow: 0 0 0 rgba(47, 111, 219, 0); }
  50% { border-color: rgba(47, 111, 219, 0.3); box-shadow: 0 0 20px rgba(47, 111, 219, 0.08); }
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    var(--gradient-hero),
    var(--bg);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 600px;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
}

a {
  color: inherit;
}

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

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #ebeff5;
}

.nav-inner {
  width: min(1160px, calc(100% - 2rem));
  min-height: var(--nav-height);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: "Cormorant Garamond", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-logo {
  display: block;
  flex-shrink: 0;
  width: 29px;
  height: 36px;
  object-fit: contain;
  -webkit-text-fill-color: initial;
}

.hero-logo-wrap {
  text-align: center;
  margin-bottom: 0.2rem;
  height: var(--runner-height);
  position: relative;
  overflow: hidden;
}

.hero-logo-track {
  position: absolute;
  top: 0;
  left: var(--runner-edge-gap);
  width: var(--runner-width);
  height: var(--runner-height);
  animation: runAcross 5.6s linear infinite;
}

.hero-logo-flip {
  width: 100%;
  height: 100%;
  transform-origin: center center;
  animation: runnerFlip 5.6s steps(1, end) infinite;
}

.hero-logo-runner {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 10px rgba(47, 111, 219, 0.15));
  animation: subtleFloat 0.55s ease-in-out infinite;
}

@keyframes runAcross {
  0% { left: var(--runner-edge-gap); }
  50% { left: calc(100% - var(--runner-width) - var(--runner-edge-gap)); }
  100% { left: var(--runner-edge-gap); }
}

@keyframes runnerFlip {
  0%, 49.999% { transform: scaleX(1); }
  50%, 100% { transform: scaleX(-1); }
}

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

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 1.1rem;
  height: 2px;
  margin: 0.3rem auto;
  background: var(--text);
}

.section {
  padding: 4rem 1.5rem;
}

.hero {
  padding-top: 1.5rem;
  padding-bottom: 1.2rem;
}

.hero-copy {
  text-align: center;
}

.method-name {
  display: inline-block;
  margin: 0 0 0.45rem;
  padding: 0.3rem 0.95rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(47, 111, 219, 0.1) 0%, rgba(91, 79, 207, 0.07) 100%);
  border: 1px solid rgba(47, 111, 219, 0.2);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: badgeGlow 3s ease-in-out infinite;
}

.paper-title,
.section-title {
  font-family: "Cormorant Garamond", serif;
}

.paper-title {
  margin: 0 auto;
  max-width: 1120px;
  font-size: 4.15rem;
  font-weight: 700;
  line-height: 1.03;
  letter-spacing: 0;
  background: linear-gradient(135deg, #1a3668 0%, #2f6fdb 40%, #6b5ce7 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 6s ease-in-out infinite;
  filter: drop-shadow(0 2px 4px rgba(30, 58, 138, 0.1));
  position: relative;
}

.paper-title::after {
  content: "";
  position: absolute;
  bottom: -0.6rem;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  max-width: 30%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #2f6fdb, #6b5ce7, #2f6fdb, transparent);
  animation: glowPulse 3s ease-in-out infinite;
}

.title-emphasis {
  display: inline;
  font-weight: 700;
  background: linear-gradient(135deg, #1a3fbf 0%, #2f6fdb 30%, #7c3aed 60%, #e9af0a 100%);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
  filter: drop-shadow(0 1.5px 3px rgba(30, 58, 138, 0.12));
}

.hero-summary {
  max-width: 820px;
  margin: 0.7rem auto 0;
  color: var(--text-muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.author-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.84rem;
}

.author-line sup {
  font-size: 0.68em;
  color: var(--text-muted);
}

.affiliation-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.65rem;
  margin: 0.35rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.affiliation-line sup {
  font-size: 0.7em;
  color: var(--text-muted);
}

.footnote-line {
  margin: 0.25rem 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.project-button {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 6px 16px rgba(37, 55, 86, 0.05);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.project-button:hover,
.project-button:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(47, 111, 219, 0.25);
  background: linear-gradient(135deg, #f9fbfe 0%, #f3f7fd 100%);
  box-shadow: 0 10px 24px rgba(47, 111, 219, 0.1);
}

.teaser {
  padding-top: 0.8rem;
}

.container.teaser-container {
  max-width: min(calc(100% - 3rem), 980px);
}

.image-panel {
  margin: 0;
  padding: 0.65rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.image-panel:hover {
  border-color: rgba(47, 111, 219, 0.1);
  box-shadow: var(--shadow-lg);
}

.image-panel img {
  width: 100%;
  border-radius: calc(var(--radius-lg) - 10px);
  background: #ffffff;
}

.teaser-caption,
.image-panel figcaption {
  margin: 1rem auto 0;
  max-width: 980px;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
}

.content-block {
  max-width: 920px;
  margin: 0 auto;
}

.container.framework-container {
  max-width: min(calc(100% - 3rem), 1080px);
}

.section-title {
  margin: 0;
  text-align: center;
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  position: relative;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--gradient-section-line);
}

.section-intro {
  max-width: 820px;
  margin: 1rem auto 0;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
}

.section-copy {
  margin-top: 1.4rem;
}

.section-copy p {
  color: var(--text-muted);
  line-height: 1.9;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
}

.feature-card,
.metric-card,
.framework-note {
  padding: 1.5rem;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover,
.framework-note:hover {
  transform: translateY(-3px);
  border-color: rgba(47, 111, 219, 0.15);
  box-shadow: var(--shadow-lg), var(--glow-blue);
}

.feature-card h3,
.framework-note h3 {
  margin: 0 0 0.8rem;
  font-size: 1.14rem;
}

.feature-card p,
.framework-note p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.8;
}

.framework-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: start;
  margin-top: 1.45rem;
}

.framework-image {
  padding: 0.55rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.framework-image:hover {
  border-color: rgba(47, 111, 219, 0.1);
  box-shadow: var(--shadow-lg);
}

.framework-image img {
  width: 100%;
  border-radius: calc(var(--radius-lg) - 10px);
  background: #ffffff;
}

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

.framework-note {
  padding: 0.75rem 0.9rem;
}

.framework-note h3 {
  margin-bottom: 0.55rem;
  font-size: 1rem;
}

.framework-note p {
  font-size: 0.92rem;
  line-height: 1.55;
}

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

.metric-card {
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.metric-value {
  display: block;
  color: var(--accent);
  font-size: clamp(1.8rem, 3vw, 2.25rem);
  font-weight: 700;
}

.metric-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.results-gallery {
  display: grid;
  gap: 1rem;
  margin-top: 2rem;
}

.table-block {
  margin-top: 2rem;
  padding: 1.4rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.table-title {
  margin: 0;
  text-align: center;
  font-size: 1.28rem;
}

.table-scroll {
  margin-top: 1rem;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 920px;
  font-size: 0.94rem;
}

.results-table th,
.results-table td {
  padding: 0.82rem 0.75rem;
  border-bottom: 1px solid #e7edf5;
  text-align: center;
  vertical-align: middle;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
  white-space: nowrap;
}

.results-table thead th {
  color: var(--text);
  font-weight: 700;
  background: #f7f9fc;
}

.results-table tbody tr:hover {
  background: #fbfcfe;
}

.highlight-row {
  background: linear-gradient(90deg, #eef4ff 0%, #f3f0ff 100%);
}

.highlight-row td {
  border-bottom-color: #dbe6fa;
}

.highlight-row td:first-child {
  color: var(--accent);
  font-weight: 700;
}

.table-note {
  max-width: 960px;
  margin: 1rem auto 0;
  color: var(--text-muted);
  line-height: 1.8;
  text-align: center;
}

.bibtex-block {
  margin: 1.4rem 0 0;
  padding: 1.35rem;
  overflow-x: auto;
  border-radius: var(--radius-md);
  background: var(--bg-soft);
  border: 1px solid var(--line);
}

.bibtex-block code {
  color: var(--text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.92rem;
}

.site-footer {
  padding: 0 1.5rem 2.75rem;
}

.site-footer p {
  margin: 0;
  padding-top: 1.4rem;
  text-align: center;
  color: var(--text-muted);
  border-top: 1px solid #e8edf3;
}

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

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

@media (max-width: 960px) {
  .feature-grid,
  .framework-layout,
  .metric-grid,
  .streaming-grid {
    grid-template-columns: 1fr;
  }

  .framework-notes {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  :root {
    --runner-width: 82px;
    --runner-height: 100px;
  }

  .paper-title {
    max-width: 720px;
    font-size: 3.25rem;
  }

  .nav-toggle {
    display: inline-block;
    flex-shrink: 0;
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 0.75rem);
    right: 1rem;
    left: 1rem;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    border-radius: 1rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  .nav-links.is-open {
    display: flex;
  }
}

@media (max-width: 560px) {
  :root {
    --runner-width: 68px;
    --runner-height: 84px;
  }

  .section {
    padding: 3.2rem 1rem;
  }

  .nav-inner {
    width: calc(100% - 1.25rem);
  }

  .hero {
    padding-top: 2rem;
  }

  .method-name {
    font-size: 0.68rem;
    letter-spacing: 0.06em;
  }

  .paper-title {
    max-width: 100%;
    font-size: 2.35rem;
    line-height: 1.06;
  }

  .hero-summary {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .project-button {
    justify-content: center;
  }
}

/* ===== Tab Switcher ===== */
.tab-switcher {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 2rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 55, 86, 0.05);
  transition: all 0.25s ease;
}

.tab-btn:hover {
  border-color: var(--line-dark);
  transform: translateY(-1px);
}

.tab-btn.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 6px 20px rgba(47, 111, 219, 0.25);
}

.tab-btn.is-active:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(47, 111, 219, 0.3);
}

.tab-panel[hidden] {
  display: none;
}

/* ===== Streaming Section ===== */
.sub-section-title {
  font-family: "Cormorant Garamond", serif;
  text-align: center;
  font-size: 1.6rem;
  margin: 2.5rem 0 1.25rem;
  color: var(--text);
}

.streaming-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 1.2rem;
}

.streaming-card {
  padding: 1rem;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.streaming-player {
  position: relative;
  border-radius: calc(var(--radius-lg) - 10px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.streaming-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.streaming-meta {
  margin-top: 1rem;
  padding: 0.5rem 0;
}

.instruction-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.streaming-card .instruction-chips {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.42rem;
}

.chip {
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
}

.streaming-card .chip {
  padding: 0.35rem 0.78rem;
  font-size: clamp(0.78rem, 0.86vw, 0.95rem);
}

.chip-arrow {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.streaming-card .chip-arrow {
  font-size: 0.82rem;
}

/* ===== Video Grid ===== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.video-card {
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.video-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(37, 55, 86, 0.1);
}

.video-card__player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.gallery-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0.45) 100%
  );
  pointer-events: none;
}

.video-card:not(.is-playing):hover .video-overlay,
.video-card:not(.is-playing):focus-within .video-overlay {
  opacity: 1;
  pointer-events: auto;
}

.streaming-card:not(.is-playing):hover .video-overlay,
.streaming-card:not(.is-playing):focus-within .video-overlay {
  opacity: 1;
  pointer-events: auto;
}

.play-btn {
  position: relative;
  z-index: 2;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.play-btn::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 16px solid transparent;
  border-bottom: 16px solid transparent;
  border-left: 24px solid #ffffff;
}

.play-btn::after {
  content: none;
}

.video-card.is-playing .play-btn::before,
.streaming-card.is-playing .play-btn::before {
  width: 8px;
  height: 30px;
  margin-left: 0;
  border: 0;
  background: #ffffff;
  box-shadow: 14px 0 0 #ffffff;
}

.play-btn i {
  display: none;
}

.play-btn svg,
.play-btn .svg-inline--fa {
  display: none;
}

.play-btn:hover {
  transform: scale(1.08);
}

.video-card__caption {
  padding: 0.75rem 1rem;
}

.video-card__command {
  display: block;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
  font-weight: 500;
}

/* ===== Video Gallery Responsive ===== */
@media (max-width: 960px) {
  .streaming-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .streaming-card {
    padding: 0.85rem;
  }

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

@media (max-width: 560px) {
  .streaming-grid {
    gap: 0.9rem;
  }

  .streaming-card {
    padding: 0.7rem;
  }

  .streaming-meta {
    margin-top: 0.8rem;
  }

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

  .tab-switcher {
    flex-direction: column;
    align-items: stretch;
  }

  .tab-btn {
    justify-content: center;
  }

  .instruction-chips {
    gap: 0.3rem;
  }

  .chip {
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
  }

  .chip-arrow {
    font-size: 0.7rem;
  }
}
