/* ============================================
   FluxDAgger Project Page
   Nerfies-style academic paper landing page
   Built on Bulma CSS framework
   ============================================ */

/* ===== Global ===== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

body {
  font-family: 'Noto Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: 52px;
}

/* ===== Scroll Progress Bar ===== */
.scroll-progress {
  position: fixed;
  top: 52px;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 100;
  background: rgba(0, 0, 0, 0.06);
}

.scroll-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3273dc, #48c78e);
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
}

.scroll-progress__label {
  position: fixed;
  top: 57px;
  right: 16px;
  z-index: 101;
  font-size: 0.7rem;
  font-weight: 600;
  color: #3273dc;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 3px 10px;
  border-radius: 0 0 6px 6px;
  border: 1px solid rgba(50, 115, 220, 0.15);
  border-top: none;
  transition: opacity 0.3s;
  opacity: 0;
  pointer-events: none;
}

.scroll-progress__label.is-visible {
  opacity: 1;
}

/* ===== Sticky Navbar ===== */
.navbar.is-fixed-top {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: none;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
  transition: background 0.3s, box-shadow 0.3s;
  min-height: 52px;
}

.navbar.is-fixed-top .navbar-brand {
  min-height: 52px;
}

.navbar.is-fixed-top .navbar-item {
  font-size: 0.85rem;
  font-weight: 500;
  color: #4a4a4a;
  padding: 0.5rem 0.9rem;
  transition: color 0.2s;
}

.navbar.is-fixed-top .navbar-item:hover {
  color: #3273dc;
  background: transparent;
}

.navbar.is-fixed-top .navbar-item.is-active {
  color: #3273dc;
}

.navbar-brand .navbar-item {
  font-weight: 700;
  font-size: 1rem;
  color: #3273dc !important;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f0f4ff 0%, #ffffff 100%);
}

.hero canvas#hero-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero .hero-body {
  position: relative;
  z-index: 1;
}

/* Animated gradient overlay */
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 30% 50%,
    rgba(50, 115, 220, 0.08) 0%,
    transparent 50%
  ),
  radial-gradient(
    ellipse at 70% 50%,
    rgba(72, 199, 142, 0.06) 0%,
    transparent 50%
  );
  animation: heroGradientShift 12s ease-in-out infinite alternate;
  z-index: 0;
}

@keyframes heroGradientShift {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-3%, 2%) scale(1.05);
  }
  100% {
    transform: translate(3%, -2%) scale(1);
  }
}

.publication-title {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 2.4rem !important;
  line-height: 1.3;
}

.publication-title .fluxdagger {
  color: #3273dc;
}

.publication-authors {
  margin-top: 0.5rem;
}

.publication-authors .author-block {
  display: inline-block;
  margin: 0 4px;
}

.publication-authors a {
  color: #3273dc;
}

.publication-authors a:hover {
  text-decoration: underline;
}

.publication-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.publication-links .link-block {
  display: inline-block;
}

.publication-links .button {
  transition: transform 0.2s, box-shadow 0.2s;
}

.publication-links .button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== Section Titles ===== */
.section .title.is-3 {
  font-family: 'Noto Serif', Georgia, serif;
  position: relative;
  padding-bottom: 12px;
}

.section .title.is-3::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background: #3273dc;
  margin: 10px auto 0;
  border-radius: 2px;
}

/* 大标题：章节主标题（如 FluxDAgger System） */
.section-title--primary {
  font-family: 'Noto Serif', Georgia, serif;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.section-title--primary::after {
  content: '';
  display: block;
  width: 72px;
  height: 4px;
  background: linear-gradient(90deg, #3273dc, #48c78e);
  margin: 14px auto 0;
  border-radius: 2px;
}

.section-title--lead {
  font-size: 0.95rem;
  color: #7a7a7a;
  max-width: 36rem;
  margin: 0.75rem auto 0;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* 小标题：同一主章节下的细节小节（如 Hardware、Sync） */
.section-heading-sub {
  text-align: center;
  margin-bottom: 1.25rem;
}

.fluxdagger-subsection {
  margin-top: 3.25rem;
  padding-top: 2.75rem;
  border-top: 1px solid rgba(50, 115, 220, 0.18);
}

/* 紧跟主标题/副标题后的首块（模型段落 + Fig.2）：无顶部分割线，略留空即可 */
.fluxdagger-subsection--after-lead {
  margin-top: 1.75rem;
  padding-top: 0;
  border-top: none;
}

.section-title--sub {
  display: inline-block;
  font-family: 'Noto Serif', Georgia, serif;
  font-weight: 600;
  color: #363636;
  margin-bottom: 0;
  text-align: center;
  max-width: 100%;
  vertical-align: top;
}

/* 短线随文字宽度，相对标题居中，而非整栏居中 */
.section-title--sub::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: #48c78e;
  margin: 10px auto 0;
  border-radius: 1px;
  opacity: 0.9;
}

/* ===== Section fade-in on scroll ===== */
.section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

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

/* ===== Demo Carousel ===== */
.demo-carousel {
  max-width: 900px;
  margin: 1.5rem auto 0;
}

.demo-carousel__frame {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.demo-carousel__viewport {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
}

.demo-carousel__viewport:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3273dc;
}

.demo-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.demo-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  position: relative;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
}

.demo-carousel__status {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #3273dc;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.demo-carousel__status.is-takeover {
  background: #48c78e;
}

.demo-carousel__video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: 12px 12px 0 0;
}

.demo-carousel__legend {
  padding: 14px 18px 16px;
  background: #fff;
  border: 1px solid rgba(50, 115, 220, 0.12);
  border-top: none;
  border-radius: 0 0 12px 12px;
}

.demo-carousel__timeline {
  position: relative;
  height: 34px;
  display: grid;
  grid-template-columns: var(--takeover) 1fr;
  border-radius: 999px;
  overflow: visible;
  background: rgba(0, 0, 0, 0.08);
}

.demo-carousel__segment {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
}

.demo-carousel__segment--before {
  background: rgba(50, 115, 220, 0.86);
  border-radius: 999px 0 0 999px;
}

.demo-carousel__segment--after {
  background: rgba(72, 199, 142, 0.9);
  border-radius: 0 999px 999px 0;
}

.demo-carousel__marker {
  position: absolute;
  left: var(--takeover);
  top: -8px;
  transform: translateX(-50%);
  min-width: 42px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fff;
  color: #1a1a2e;
  font-size: 0.7rem;
  font-weight: 800;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.2);
}

.demo-carousel__marker::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 2px;
  height: 28px;
  background: #fff;
  transform: translateX(-50%);
}

.demo-carousel__arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(50, 115, 220, 0.12);
  color: #3273dc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.demo-carousel__arrow:hover {
  background: rgba(50, 115, 220, 0.22);
  transform: scale(1.05);
}

.demo-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.demo-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
}

.demo-carousel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.demo-carousel__dot.is-active {
  background: #3273dc;
  transform: scale(1.2);
}

/* ===== Slide SVG Figures ===== */
.slide-figure img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  background: transparent;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s ease;
  cursor: zoom-in;
}

.slide-figure img:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* ===== Reward Visualize: horizontal swipe / scroll-snap carousel ===== */
.reward-carousel {
  max-width: 900px;
  margin: 1.5rem auto 0;
}

.reward-carousel__frame {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reward-carousel__viewport {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
}

.reward-carousel__viewport:focus-visible {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #3273dc;
}

.reward-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.reward-carousel__slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  position: relative;
  background: #000;
  border-radius: 12px;
}

.reward-carousel__video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: 12px;
}

.reward-carousel__slide p.has-text-weight-semibold {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 8px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: #fff;
  font-size: 0.9rem;
  text-align: center;
  border-radius: 0 0 12px 12px;
  pointer-events: none;
  z-index: 1;
}

.reward-carousel__arrow {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(50, 115, 220, 0.12);
  color: #3273dc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

.reward-carousel__arrow:hover {
  background: rgba(50, 115, 220, 0.22);
  transform: scale(1.05);
}

.reward-carousel__arrow:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.reward-carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 1rem;
}

.reward-carousel__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #ccc;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.reward-carousel__dot.is-active {
  background: #3273dc;
  transform: scale(1.2);
}

/* ===== Hardware Comparison ===== */
.comparison-box {
  padding: 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.comparison-box .tag {
  font-weight: 700;
  letter-spacing: 0.5px;
}

.comparison-box img {
  border-radius: 6px;
  border: 1px solid #e0e0e0;
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s ease;
  cursor: zoom-in;
}

.comparison-box img:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.13);
}

.comparison-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparison-arrow .icon i {
  transition: transform 0.3s;
}

.comparison-box:hover ~ .comparison-arrow .icon i,
.comparison-arrow:hover .icon i {
  transform: translateX(4px);
}

/* ===== Related Projects ===== */
.related-projects {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 1.5rem;
}

.related-project {
  display: block;
  height: 100%;
  padding: 18px;
  border: 1px solid rgba(50, 115, 220, 0.14);
  border-radius: 8px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.related-project:hover {
  color: inherit;
  transform: translateY(-2px);
  border-color: rgba(50, 115, 220, 0.34);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.1);
}

.related-project__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 0.9rem;
}

.related-project__meta .icon {
  color: #3273dc;
  font-size: 0.85rem;
}

.related-project h3 {
  margin: 0 0 0.55rem;
  color: #1a1a2e;
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
}

.related-project p {
  margin: 0;
  color: #5a5a5a;
  font-size: 0.92rem;
  line-height: 1.65;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .publication-title {
    font-size: 1.6rem !important;
  }

  .comparison-arrow {
    transform: rotate(90deg);
  }

  .slide-figure img:hover,
  .comparison-box img:hover {
    transform: scale(1.02);
  }

  .navbar-menu {
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
  }

  .related-projects {
    grid-template-columns: 1fr;
  }

  .section-title--primary.title.is-2 {
    font-size: 1.65rem !important;
  }
}
