:root {
  color-scheme: dark;
  --fg: #eee;
  --dim: rgba(255, 255, 255, 0.35);
  --dim-bg: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #000;
  color: var(--fg);
  font-family: "Courier New", Courier, monospace;
  overscroll-behavior: none;
}

body {
  height: 100dvh;
  overflow: hidden;
}

#feed {
  height: 100dvh;
  width: 100vw;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

#feed::-webkit-scrollbar {
  display: none;
}

.haiku {
  height: 100dvh;
  width: 100vw;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.haiku video {
  display: block;
  aspect-ratio: var(--ar, 1);
  width: min(100vw, calc(90dvh * var(--ar, 1)));
  height: auto;
  background: #000;
  visibility: hidden;
}

.haiku.playing video {
  visibility: visible;
}

.haiku.ended video {
  visibility: hidden;
}

.haiku .num {
  display: flex;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  font-size: clamp(3rem, 12dvh, 8rem);
  font-variant-numeric: tabular-nums;
  color: var(--fg);
  user-select: none;
  pointer-events: none;
}

.haiku.playing .num {
  display: none;
}

.controls {
  position: fixed;
  bottom: max(1rem, env(safe-area-inset-bottom));
  right: max(1rem, env(safe-area-inset-right));
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.controls button {
  appearance: none;
  border: 0;
  background: var(--dim-bg);
  color: var(--fg);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 120ms ease, opacity 120ms ease;
  opacity: 0.6;
}

.controls button:hover,
.controls button:focus-visible {
  opacity: 1;
  outline: none;
}

#mute-toggle .unmuted-icon {
  display: none;
}

#mute-toggle[aria-pressed="true"] .muted-icon {
  display: none;
}

#mute-toggle[aria-pressed="true"] .unmuted-icon {
  display: inline;
}

#fullscreen-toggle .exit-icon {
  display: none;
}

#fullscreen-toggle[aria-pressed="true"] .enter-icon {
  display: none;
}

#fullscreen-toggle[aria-pressed="true"] .exit-icon {
  display: inline;
}

.panel {
  flex-direction: column;
  gap: 2rem;
  padding: 2rem;
  text-align: center;
}

.panel .panel-content {
  max-width: min(32rem, 90vw);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--fg);
}

.panel.intro .panel-content {
  margin-top: clamp(2rem, 8dvh, 6rem);
}

.panel h1 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 500;
}

.panel p {
  margin: 0 0 0.75rem;
}

.panel a {
  color: inherit;
}

.panel .sound-cta {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.panel .sound-cta:hover,
.panel .sound-cta:focus-visible {
  outline: none;
}
