:root {
  --nav-bg: rgba(20, 28, 42, 0.48);
  --nav-border: rgba(255, 255, 255, 0.28);
  --nav-idle: rgba(255, 255, 255, 0.78);
  --nav-active: #ffffff;
  --focus: #f7d34c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0d1320;
  color: #ffffff;
  font-family: "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}

button,
video {
  font: inherit;
}

.deck {
  width: 100vw;
  height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.slide {
  position: relative;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100svh;
  min-height: 100svh;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #0d1320;
}

.slide > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  background: #0d1320;
}

.demo-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000000;
}

.slide-nav {
  position: fixed;
  top: 50%;
  right: max(16px, env(safe-area-inset-right));
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 8px;
  border: 1px solid var(--nav-border);
  border-radius: 999px;
  background: var(--nav-bg);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  transform: translateY(-50%);
}

.nav-dot {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: var(--nav-idle);
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.nav-dot span {
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.nav-dot:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.06);
}

.nav-dot:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.nav-dot.is-active {
  border-color: rgba(255, 255, 255, 0.95);
  background: var(--nav-active);
  color: #152037;
}

@media (max-width: 900px) {
  .slide-nav {
    right: max(8px, env(safe-area-inset-right));
    gap: 6px;
    padding: 8px 6px;
  }

  .nav-dot {
    width: 26px;
    height: 26px;
  }

  .nav-dot span {
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .slide-nav {
    top: auto;
    right: 50%;
    bottom: max(12px, env(safe-area-inset-bottom));
    flex-direction: row;
    max-width: min(92vw, 420px);
    overflow-x: auto;
    border-radius: 999px;
    transform: translateX(50%);
    scrollbar-width: none;
  }

  .slide-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-dot {
    flex: 0 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deck {
    scroll-behavior: auto;
  }

  .nav-dot {
    transition: none;
  }
}
