/* One full-viewport slide per clip; the container snaps so a swipe always
   lands on exactly one slide (scroll-snap-stop: always). 100dvh tracks the
   dynamic Safari toolbar. */
:root {
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #fff;
  font: 15px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.feed {
  height: 100dvh;
  width: 100vw;
  overflow-y: scroll;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.slide {
  position: relative;
  isolation: isolate; /* keep video/error z-indexes inside the slide */
  height: 100dvh;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  background: #000;
  display: grid;
  place-items: center;
}

.slide video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.slide__placeholder {
  color: #555;
  font-size: 13px;
}

.slide__error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.85);
}
.slide--error .slide__error { display: flex; }
.slide__error button {
  font: inherit;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
}

/* Fixed overlay chrome, kept out of the notch and home-indicator areas. */
.chrome {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  padding: calc(var(--safe-top) + 12px) calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 16px) calc(var(--safe-left) + 16px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.chrome__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.counter {
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 13px;
}
.mute {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
}
.hint {
  align-self: center;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 14px;
  transition: opacity 0.3s;
}
.hint[hidden] { display: none; }

.status {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  background: #000;
}
.status[hidden] { display: none; }
