:root {
  color-scheme: dark;
  --transition-duration: 1200ms;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #080808;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  overscroll-behavior: none;
  user-select: none;
}

.slideshow {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: #080808;
  cursor: none;
}

.frame {
  position: absolute;
  inset: -2px;
  z-index: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  background: #080808;
  transform: scale(1.001);
  backface-visibility: hidden;
  will-change: opacity, transform, filter, clip-path;
}

.frame.is-active,
.frame.is-entering {
  opacity: 1;
}

.frame.is-entering {
  z-index: 2;
}

.frame.is-leaving {
  z-index: 1;
}

.photo-backdrop,
.photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.photo-backdrop {
  inset: -5%;
  width: 110%;
  height: 110%;
  background-position: center;
  background-size: cover;
  filter: blur(28px) brightness(0.56) saturate(1.08);
  transform: scale(1.08);
}

.photo {
  z-index: 1;
  display: block;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 0 28px rgba(0, 0, 0, 0.4));
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.32)),
    radial-gradient(circle at center, transparent 55%, rgba(0, 0, 0, 0.22) 100%);
}

.watermark {
  position: fixed;
  right: max(22px, calc(env(safe-area-inset-right) + 14px));
  bottom: max(20px, calc(env(safe-area-inset-bottom) + 14px));
  z-index: 20;
  display: flex;
  align-items: baseline;
  gap: 11px;
  padding: 10px 11px 10px 13px;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, rgba(173, 222, 245, 0.95), rgba(91, 176, 220, 0.95));
  box-shadow:
    0 9px 30px rgba(24, 100, 142, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 5px rgba(19, 83, 117, 0.65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.watermark::before {
  content: "✦";
  display: grid;
  flex: 0 0 auto;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.52);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.98);
  background: rgba(255, 255, 255, 0.17);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  font-size: 0.82rem;
}

.watermark span {
  font-family: "Snell Roundhand", "Apple Chancery", "Segoe Script", cursive;
  font-size: clamp(1rem, 1.65vw, 1.34rem);
  font-weight: 700;
  letter-spacing: 0.015em;
}

.watermark time {
  padding: 7px 10px 6px;
  border-radius: 999px;
  color: #397d9f;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 9px rgba(40, 113, 149, 0.2);
  font-size: clamp(0.68rem, 1vw, 0.84rem);
  font-weight: 800;
  letter-spacing: 0.055em;
  text-shadow: none;
}

.frame.is-entering[data-transition="dissolve"] {
  animation: dissolve-in var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.frame.is-leaving[data-transition="dissolve"] {
  animation: dissolve-out var(--transition-duration) ease both;
}

.frame.is-entering[data-transition="drift-left"] {
  animation: drift-left-in var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.frame.is-leaving[data-transition="drift-left"] {
  animation: drift-left-out var(--transition-duration) ease-in-out both;
}

.frame.is-entering[data-transition="drift-right"] {
  animation: drift-right-in var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.frame.is-leaving[data-transition="drift-right"] {
  animation: drift-right-out var(--transition-duration) ease-in-out both;
}

.frame.is-entering[data-transition="reveal"] {
  animation: reveal-in var(--transition-duration) cubic-bezier(0.76, 0, 0.24, 1) both;
}

.frame.is-leaving[data-transition="reveal"] {
  animation: soften-out var(--transition-duration) ease both;
}

.frame.is-entering[data-transition="focus"] {
  animation: focus-in var(--transition-duration) cubic-bezier(0.22, 1, 0.36, 1) both;
}

.frame.is-leaving[data-transition="focus"] {
  animation: focus-out var(--transition-duration) ease both;
}

@keyframes dissolve-in {
  from { opacity: 0; transform: scale(1.08); filter: blur(9px); }
  to { opacity: 1; transform: scale(1); filter: blur(0); }
}

@keyframes dissolve-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.035); }
}

@keyframes drift-left-in {
  from { opacity: 0; transform: translate3d(7%, 0, 0) scale(1.045); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes drift-left-out {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(-4%, 0, 0) scale(1.025); }
}

@keyframes drift-right-in {
  from { opacity: 0; transform: translate3d(-7%, 0, 0) scale(1.045); }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

@keyframes drift-right-out {
  from { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 0; transform: translate3d(4%, 0, 0) scale(1.025); }
}

@keyframes reveal-in {
  from { opacity: 0.4; clip-path: inset(0 100% 0 0); transform: scale(1.025); }
  to { opacity: 1; clip-path: inset(0 0 0 0); transform: scale(1); }
}

@keyframes soften-out {
  from { opacity: 1; filter: blur(0); transform: scale(1); }
  to { opacity: 0.15; filter: blur(8px); transform: scale(1.045); }
}

@keyframes focus-in {
  from { opacity: 0; filter: blur(20px); transform: scale(1.13); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}

@keyframes focus-out {
  from { opacity: 1; filter: blur(0); transform: scale(1); }
  to { opacity: 0; filter: blur(4px); transform: scale(0.975); }
}

@media (max-width: 560px) {
  .watermark {
    right: max(12px, calc(env(safe-area-inset-right) + 8px));
    bottom: max(12px, calc(env(safe-area-inset-bottom) + 8px));
    gap: 7px;
    padding: 7px 8px 7px 9px;
  }

  .watermark::before {
    width: 23px;
    height: 23px;
    font-size: 0.7rem;
  }

  .watermark time {
    padding: 6px 8px 5px;
  }

  .photo-backdrop {
    filter: blur(22px) brightness(0.54) saturate(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition-duration: 900ms;
  }

  .frame.is-entering {
    animation-name: dissolve-in !important;
  }

  .frame.is-leaving {
    animation-name: dissolve-out !important;
  }
}
