:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --card: #171a1f;
  --text: #7d776c;
  --line: rgba(125, 119, 108, 0.45);
  --focus: #7d776c;
  font-family: "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

[hidden] {
  display: none !important;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
}

#home {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 2vh;
  padding: 4vh 4vw 3vh;
  overflow: hidden;
}

.duration {
  display: grid;
  grid-template-columns: 2.25rem auto 2.25rem;
  justify-content: center;
  align-items: center;
  gap: 0.85rem;
  min-height: 0;
}

.duration button {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 1.15rem;
  line-height: 1;
}

#duration-label {
  margin: 0;
  min-width: 4.5rem;
  text-align: center;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.picker {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  min-height: 0;
}

.scene-arrow {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 1.8rem;
  line-height: 1;
}

.scene-arrow.is-disabled {
  opacity: 0.28;
}

.scenes {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  padding: 0.4rem 0.15rem;
}

.scene-track {
  display: flex;
  gap: 1.2rem;
  width: max-content;
  transition: transform 0.25s ease;
}

.scene {
  position: relative;
  flex: 0 0 clamp(16rem, 28vw, 24rem);
  display: block;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--card);
  border: 1px solid var(--line);
}

.scene img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scene span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1.6rem 0.9rem 0.7rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
  font-size: clamp(1.15rem, 2vw, 1.85rem);
  letter-spacing: 0.08em;
  text-align: left;
}

button:focus {
  outline: none;
}

button:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 6px;
}

#player {
  position: fixed;
  inset: 0;
  background: #000;
  cursor: none;
  outline: none;
}

#player:focus,
#player:focus-visible,
#video,
#video:focus,
#video:focus-visible,
:fullscreen {
  outline: none;
  border: 0;
}

#video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

#buffer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8vh;
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  color: var(--text);
}

#exit {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  background: rgba(0, 0, 0, 0.72);
  text-align: center;
}

#exit-title {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 5rem);
  letter-spacing: 0.16em;
}

#exit-seconds {
  margin: 0;
  font-size: clamp(5rem, 14vw, 10rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

@media (max-width: 700px) {
  .scene {
    flex-basis: 78vw;
  }
}
