:root {
  color-scheme: dark;
  --bg: #11100f;
  --ink: #f4f1ec;
  --muted: rgba(244, 241, 236, 0.72);
  --panel: rgba(18, 17, 16, 0.68);
  --line: rgba(244, 241, 236, 0.18);
  --accent: #8fb6aa;
  --paper: #f5efe4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button {
  min-width: 56px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

button:hover,
button:focus-visible {
  background: rgba(255, 255, 255, 0.16);
  outline: none;
}

.stage {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 48%, #24211e 0%, #11100f 64%);
}

.slide-layer {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1200ms ease;
  overflow: hidden;
}

.slide-layer.active {
  opacity: 1;
  z-index: 2;
}

.backdrop,
.media-wrap,
.collage-wrap {
  position: absolute;
  inset: 0;
}

.backdrop {
  transform: scale(1.08);
  filter: blur(34px) saturate(0.92) brightness(0.52);
  opacity: 0.86;
}

.title-backdrop {
  transform: scale(1.12);
  filter: blur(28px) saturate(0.8) brightness(0.34);
  opacity: 0.9;
}

.backdrop img,
.backdrop video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
}

.media-wrap {
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 64px) clamp(18px, 5vw, 76px) clamp(76px, 10vh, 128px);
}

.media {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  border-radius: 3px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  object-fit: contain;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
}

.layout-landscape .media,
.layout-video .media,
.layout-portrait .media,
.layout-contain .media {
  max-width: calc(100vw - clamp(36px, 10vw, 152px));
  max-height: calc(100vh - clamp(112px, 16vh, 176px));
}

.layout-framed .media {
  max-width: min(calc(100vw - clamp(48px, 14vw, 192px)), 1040px);
  max-height: calc(100vh - clamp(128px, 18vh, 192px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #f4f1ec;
  padding: clamp(8px, 1.2vw, 16px);
  box-shadow: 0 22px 72px rgba(0, 0, 0, 0.46);
}

.layout-album {
  perspective: 1200px;
}

.layout-album .media {
  max-width: min(calc(100vw - clamp(56px, 15vw, 210px)), 980px);
  max-height: calc(100vh - clamp(138px, 20vh, 214px));
  border: clamp(10px, 1.4vw, 20px) solid var(--paper);
  border-bottom-width: clamp(18px, 2.4vw, 34px);
  background: var(--paper);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.46),
    0 2px 0 rgba(255, 255, 255, 0.35) inset;
  transform: rotate(var(--album-rotation, -1deg));
}

.ken-burns .media {
  animation: drift var(--motion-duration, 6500ms) ease-in-out forwards;
}

.collage-wrap {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.5vw, 22px);
  padding: clamp(18px, 5vw, 72px);
}

.collage-item {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 3px;
  background: #181716;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.collage-hero-left {
  grid-template-columns: 1.24fr 0.76fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.collage-hero-left .collage-item:first-child {
  grid-row: 1 / -1;
}

.collage-hero-right {
  grid-template-columns: 0.76fr 1.24fr;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}

.collage-hero-right .collage-item:first-child {
  grid-column: 2;
  grid-row: 1 / -1;
}

.collage-hero-right .collage-item:not(:first-child) {
  grid-column: 1;
}

.collage-wide-hero {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: 1.18fr 0.82fr;
}

.collage-wide-hero .collage-item:first-child {
  grid-column: 1 / -1;
}

.collage-mosaic {
  grid-template-columns: 1.05fr 0.72fr 0.9fr;
  grid-template-rows: 1fr 1fr;
}

.collage-mosaic .collage-item:first-child {
  grid-row: 1 / -1;
}

.collage-mosaic .collage-item:nth-child(4) {
  grid-column: 2 / -1;
}

.collage-album-table {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  background:
    linear-gradient(90deg, rgba(244, 239, 228, 0.06), rgba(0, 0, 0, 0.06)),
    rgba(20, 18, 15, 0.18);
}

.collage-album-table .collage-item {
  border: clamp(7px, 0.8vw, 12px) solid var(--paper);
  background: var(--paper);
}

.collage-album-table .collage-item:first-child {
  grid-column: span 2;
  transform: rotate(-1.4deg);
}

.collage-album-table .collage-item:nth-child(2) {
  grid-column: span 2;
  transform: rotate(1deg);
}

.collage-album-table .collage-item:nth-child(3) {
  grid-column: span 2;
  transform: rotate(1.5deg);
}

.collage-album-table .collage-item:nth-child(4) {
  grid-column: span 2;
  transform: rotate(-0.9deg);
}

.collage-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  animation: collageDrift var(--motion-duration, 10000ms) ease-in-out forwards;
}

.collage-item.portrait img,
.collage-item.contain img,
.collage-item.framed img,
.collage-item.album img {
  object-fit: contain;
}

.title-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: clamp(28px, 7vw, 110px);
}

.title-panel {
  max-width: min(900px, 82vw);
  text-align: center;
  color: var(--ink);
  text-shadow: 0 3px 24px rgba(0, 0, 0, 0.72);
  animation: titleArrive 7000ms ease forwards;
}

.title-panel h1 {
  margin: 0;
  font-size: clamp(48px, 8vw, 112px);
  font-weight: 520;
  line-height: 0.95;
}

.title-panel p {
  margin: clamp(16px, 2.4vw, 28px) 0 0;
  color: rgba(244, 241, 236, 0.82);
  font-size: clamp(20px, 3vw, 38px);
  line-height: 1.15;
}

.hero-backdrop {
  transform: scale(1.08);
  filter: blur(26px) saturate(1.02) brightness(0.62);
  opacity: 0.94;
}

.hero-wrap {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(330px, 0.84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(26px, 4.8vw, 90px);
  padding: clamp(42px, 6vw, 108px) clamp(38px, 7vw, 128px) clamp(92px, 11vh, 136px);
}

.hero-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(9, 9, 9, 0.66) 0%, rgba(9, 9, 9, 0.34) 34%, rgba(9, 9, 9, 0.04) 72%),
    linear-gradient(0deg, rgba(9, 9, 9, 0.48) 0%, rgba(9, 9, 9, 0) 46%);
}

.hero-copy {
  justify-self: start;
  max-width: min(690px, 42vw);
  color: var(--ink);
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.74);
  animation: heroTextArrive 8800ms ease forwards;
}

.hero-copy::before {
  content: "";
  display: block;
  width: clamp(78px, 8vw, 134px);
  height: 3px;
  margin: 0 0 clamp(18px, 2.4vw, 32px);
  background: var(--accent);
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(58px, 7vw, 126px);
  font-weight: 560;
  line-height: 0.95;
}

.hero-copy p {
  margin: clamp(16px, 2vw, 28px) 0 0;
  color: rgba(244, 241, 236, 0.86);
  font-size: clamp(22px, 2.5vw, 42px);
  line-height: 1.14;
}

.hero-photo-frame {
  justify-self: center;
  max-width: min(50vw, 760px);
  max-height: min(82vh, 940px);
  animation: heroPhotoArrive 10000ms ease forwards;
}

.hero-photo {
  display: block;
  width: auto;
  height: auto;
  max-width: min(50vw, 760px);
  max-height: min(82vh, 940px);
  border-radius: 3px;
  box-shadow: 0 30px 86px rgba(0, 0, 0, 0.52);
  object-fit: contain;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.58);
}

.controls {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto auto minmax(130px, 280px) auto auto;
  align-items: center;
  gap: 8px;
  width: min(calc(100vw - 24px), 760px);
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
  transition: opacity 220ms ease;
}

.controls.idle {
  opacity: 0.05;
}

body.kiosk {
  cursor: none;
}

body.kiosk .controls {
  display: none;
}

.progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: var(--accent);
}

.counter {
  min-width: 76px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  white-space: nowrap;
}

.error {
  display: grid;
  min-height: 100%;
  place-items: center;
  padding: 32px;
  color: var(--ink);
  text-align: center;
}

@keyframes drift {
  from {
    transform: rotate(var(--album-rotation, 0deg)) scale(1.006) translate3d(calc(var(--motion-x, 0.25%) * -1), calc(var(--motion-y, -0.18%) * -1), 0);
  }
  to {
    transform: rotate(var(--album-rotation, 0deg)) scale(var(--motion-zoom, 1.035)) translate3d(var(--motion-x, 0.25%), var(--motion-y, -0.18%), 0);
  }
}

@keyframes collageDrift {
  from {
    transform: scale(1.0);
  }
  to {
    transform: scale(1.045);
  }
}

@keyframes titleArrive {
  from {
    opacity: 0;
    transform: scale(0.985) translateY(8px);
  }
  15% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1.015) translateY(0);
  }
}

@keyframes heroPhotoArrive {
  from {
    opacity: 0;
    transform: scale(0.992) translateY(10px);
  }
  12% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1.018) translateY(0);
  }
}

@keyframes heroTextArrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  14% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 920px) {
  .hero-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: clamp(18px, 4vh, 34px);
    padding: clamp(26px, 7vw, 52px) clamp(18px, 6vw, 42px) clamp(86px, 12vh, 118px);
  }

  .hero-copy {
    grid-row: 2;
    max-width: 92vw;
  }

  .hero-photo-frame,
  .hero-photo {
    max-width: 88vw;
    max-height: 62vh;
  }
}

@media (max-width: 680px) {
  .controls {
    grid-template-columns: repeat(4, 1fr);
  }

  .progress {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .counter {
    display: none;
  }
}


.home-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 6;
  padding: 8px 11px;
  border: 1px solid rgba(244, 241, 236, 0.22);
  border-radius: 6px;
  background: rgba(18, 17, 16, 0.48);
  color: var(--ink);
  font-size: 13px;
  text-decoration: none;
  backdrop-filter: blur(12px);
  opacity: 0.54;
  transition: opacity 180ms ease, background 180ms ease;
}

.home-link:hover,
.home-link:focus-visible {
  opacity: 1;
  background: rgba(18, 17, 16, 0.78);
  outline: none;
}
