:root {
  color-scheme: dark;
  --bg: #07080c;
  --ink: #f4efe6;
  --amber: rgba(240, 164, 90, 0.85);
  --soon: "Courier New", Courier, "Liberation Mono", ui-monospace, monospace;
  --shuimo: "Courier New", Courier, "Liberation Mono", ui-monospace, monospace;
  --studio: Courier, "Courier New", "Liberation Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

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

img { max-width: 100%; }

.defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  background: var(--bg);
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
}

.dust {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mask-image: radial-gradient(ellipse 32% 36% at 50% 40%, transparent 0 58%, #000 100%);
}

.dust span {
  position: absolute;
  width: 1.5px;
  height: 1.5px;
  border-radius: 50%;
  background: rgba(214, 156, 92, 0.55);
  opacity: 0.28;
  animation: drift 32s ease-in-out infinite alternate;
}

.dust span:nth-child(odd) {
  width: 1px;
  height: 1px;
  background: rgba(78, 138, 148, 0.5);
}

.dust span:nth-child(1) { left: 7%; top: 14%; animation-duration: 28s; }
.dust span:nth-child(2) { left: 16%; top: 76%; animation-duration: 36s; }
.dust span:nth-child(3) { left: 88%; top: 16%; animation-duration: 30s; }
.dust span:nth-child(4) { left: 93%; top: 68%; animation-duration: 34s; }
.dust span:nth-child(5) { left: 4%; top: 42%; animation-duration: 26s; }
.dust span:nth-child(6) { left: 96%; top: 44%; animation-duration: 38s; }
.dust span:nth-child(7) { left: 24%; top: 8%; animation-duration: 33s; }
.dust span:nth-child(8) { left: 76%; top: 9%; animation-duration: 29s; }
.dust span:nth-child(9) { left: 11%; top: 90%; animation-duration: 35s; }
.dust span:nth-child(10) { left: 82%; top: 88%; animation-duration: 31s; }
.dust span:nth-child(11) { left: 38%; top: 5%; animation-duration: 40s; }
.dust span:nth-child(12) { left: 64%; top: 93%; animation-duration: 27s; }
.dust span:nth-child(13) { left: 3%; top: 24%; animation-duration: 37s; }
.dust span:nth-child(14) { left: 97%; top: 28%; animation-duration: 32s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(10px, -14px, 0); }
}

.hero-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 26%;
  z-index: 1;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0));
  pointer-events: none;
}

.soon,
.credit,
.sound {
  position: absolute;
  z-index: 2;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.82), 0 10px 28px rgba(0, 0, 0, 0.45);
}

.soon {
  left: 50%;
  bottom: calc(4.6rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-family: var(--soon);
  font-weight: 400;
  font-size: clamp(1rem, 2.5vw, 1.7rem);
  letter-spacing: 0.18em;
  white-space: nowrap;
}

.credit {
  right: calc(1.05rem + env(safe-area-inset-right));
  bottom: calc(0.85rem + env(safe-area-inset-bottom));
  font-size: clamp(0.78rem, 1.7vw, 0.98rem);
  letter-spacing: 0.03em;
}

.shuimo { font-family: var(--shuimo); }
.studio { font-family: var(--studio); }

.sound {
  left: calc(0.85rem + env(safe-area-inset-left));
  bottom: calc(0.7rem + env(safe-area-inset-bottom));
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.55);
  color: rgba(244, 239, 230, 0.8);
  cursor: pointer;
}

.sound svg { width: 1rem; height: 1rem; display: block; }

@media (max-width: 700px) {
  .dust span:nth-child(n + 8) { display: none; }
}

.gallery {
  background: var(--bg);
}

.strip {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 1rem;
  padding:
    1.15rem
    calc(1rem + env(safe-area-inset-right))
    calc(1.35rem + env(safe-area-inset-bottom))
    calc(1rem + env(safe-area-inset-left));
  scrollbar-color: rgba(240, 164, 90, 0.45) transparent;
}

.slide {
  flex: 0 0 min(84vw, 920px);
  height: min(72vh, 820px);
  height: min(72dvh, 820px);
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--bg);
  scroll-snap-align: center;
  cursor: pointer;
}

.slide img,
.lightbox img,
.export-img,
.sheet img {
  filter: url("#cyrabit-film");
}

body.raw .slide img,
body.raw .lightbox img,
body.raw .export-img,
body.raw .sheet img {
  filter: none;
}

.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: var(--bg);
}

.slide:focus-visible,
.lb:focus-visible {
  outline: 1px solid var(--amber);
  outline-offset: 3px;
}

.lightbox {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100dvh;
  margin: 0;
  padding:
    calc(3.4rem + env(safe-area-inset-top))
    calc(3.2rem + env(safe-area-inset-right))
    calc(0.8rem + env(safe-area-inset-bottom))
    calc(3.2rem + env(safe-area-inset-left));
  border: 0;
  background: rgba(5, 6, 10, 0.96);
}

.lightbox::backdrop { background: rgba(0, 0, 0, 0.72); }

.lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.lb {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.72);
  color: var(--ink);
  cursor: pointer;
}

.lb svg { width: 1.15rem; height: 1.15rem; display: block; }
.lb-close { top: calc(0.7rem + env(safe-area-inset-top)); right: calc(0.7rem + env(safe-area-inset-right)); }
.lb-prev { top: 50%; left: calc(0.45rem + env(safe-area-inset-left)); transform: translateY(-50%); }
.lb-next { top: 50%; right: calc(0.45rem + env(safe-area-inset-right)); transform: translateY(-50%); }

body.lb-open { overflow: hidden; }

body.export { margin: 0; background: var(--bg); }
.export-img { display: block; width: 100vw; height: auto; background: var(--bg); }
.sheet {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  background: var(--bg);
}
.sheet img { display: block; width: 100%; height: auto; background: var(--bg); }

@media (max-width: 420px) {
  .soon { letter-spacing: 0.12em; }
  .lightbox {
    padding:
      calc(3.2rem + env(safe-area-inset-top))
      0.4rem
      calc(0.6rem + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .strip { scroll-behavior: auto; }
  .slide img,
  .lightbox img { transition: none; }
  .dust span { animation: none; opacity: 0; }
}
