* {
  box-sizing: border-box;
}

html,
body,
.presentation {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  --bg: oklch(0.955 0.009 270);
  --surface: oklch(0.985 0.004 270);
  --ink: oklch(0.23 0.025 270);
  --muted: oklch(0.52 0.025 270);
  --primary: oklch(0.36 0.219 270);
  --accent: oklch(0.7 0.18 25);
  background: var(--bg);
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
}

.presentation {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

#viewer {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  cursor: pointer;
  touch-action: manipulation;
}

#slide {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.filmstrip {
  min-width: 0;
  padding: 10px 14px 8px;
  background: var(--surface);
  border-top: 1px solid oklch(0.88 0.014 270);
}

.thumbnail-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: clamp(3px, 0.65vw, 10px);
  width: 100%;
  padding: 3px 2px 6px;
  overflow: hidden;
}

.thumbnail {
  position: relative;
  min-width: 0;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 180ms ease-out, transform 180ms ease-out, box-shadow 180ms ease-out;
}

.thumbnail:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.thumbnail[aria-current="page"] {
  opacity: 1;
  box-shadow: 0 0 0 3px var(--primary);
}

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

.thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.page-number {
  position: absolute;
  left: 6px;
  bottom: 6px;
  min-width: 25px;
  padding: 3px 6px;
  border-radius: 999px;
  background: oklch(0.18 0.02 270 / 0.76);
  color: oklch(1 0 0);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.thumbnail[aria-current="page"] .page-number {
  background: var(--primary);
}

.presentation-progress {
  --progress: 10%;
  position: relative;
  width: 100%;
  height: 8px;
  margin: 3px 0 0;
  background: oklch(0.9 0.014 270);
  border-radius: 999px;
}

.progress-fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  transform: scaleX(0.1);
  transform-origin: left center;
  transition: transform 180ms cubic-bezier(0.25, 1, 0.5, 1);
}

.progress-head {
  position: absolute;
  top: 50%;
  left: var(--progress);
  width: 42px;
  height: 12px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border: 2px solid var(--surface);
  border-radius: 999px;
  box-shadow: 0 2px 6px oklch(0.26 0.06 270 / 0.28);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 180ms cubic-bezier(0.25, 1, 0.5, 1);
}

@media (max-width: 640px) {
  .filmstrip {
    padding: 7px 6px 6px;
  }

  .thumbnail-track {
    gap: 3px;
    padding-bottom: 4px;
  }

  .thumbnail {
    border-radius: 4px;
  }

  .thumbnail[aria-current="page"] {
    box-shadow: 0 0 0 2px var(--primary);
  }

  .page-number {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .thumbnail,
  .progress-fill,
  .progress-head {
    transition: none;
  }
}
