:root {
  color-scheme: dark;
  --bg: #07020c;
  --ink: #fff7ec;
  --muted: rgba(255, 247, 236, 0.58);
  --dim: rgba(255, 247, 236, 0.32);
  --gold: #f6d394;
  --rose: #ee74a7;
  --rose-soft: rgba(238, 116, 167, 0.24);
  --card-width: clamp(58px, 7.2vw, 102px);
  --header-pad: clamp(20px, 3.5vw, 44px);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 111, 173, 0.08), transparent 38%),
    radial-gradient(circle at 50% 56%, rgba(239, 105, 157, 0.13), transparent 34%),
    #07020c;
  color: var(--ink);
  font-family: "Times New Roman", "Noto Serif SC", "Songti SC", serif;
}

button,
a {
  color: inherit;
}

button {
  font: inherit;
}

.shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
}

.shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 88px 88px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
  opacity: 0.42;
}

.shell::after {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 5;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(7, 2, 12, 0.72), transparent 18%, transparent 82%, rgba(7, 2, 12, 0.72)),
    linear-gradient(180deg, rgba(7, 2, 12, 0.72), transparent 22%, transparent 84%, rgba(7, 2, 12, 0.84));
}

#petal-canvas {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.grain {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px),
    linear-gradient(35deg, rgba(255, 211, 148, 0.04) 0 1px, transparent 1px 6px);
  mix-blend-mode: screen;
}

.topbar {
  position: relative;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: var(--header-pad);
  letter-spacing: 0.22em;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  text-shadow: 0 0 16px rgba(246, 211, 148, 0.26);
  pointer-events: auto;
}

.brand-mark {
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 800;
  line-height: 0.9;
  color: var(--gold);
}

.brand-subtitle {
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(8px, 0.85vw, 11px);
  font-weight: 600;
}

.status-panel {
  display: grid;
  justify-items: end;
  gap: 6px;
  color: var(--muted);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(8px, 0.85vw, 11px);
  font-weight: 700;
  text-transform: uppercase;
}

.status-panel strong {
  color: #f0a4bc;
  font-size: clamp(12px, 1.1vw, 16px);
  letter-spacing: 0.08em;
}

.stage {
  position: absolute;
  inset: 70px 0 76px;
  z-index: 2;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.aura {
  position: absolute;
  z-index: 0;
  left: 50%;
  top: 58%;
  width: min(58vw, 720px);
  height: min(24vw, 260px);
  transform: translate3d(-50%, -50%, 320px);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(236, 96, 146, 0.28), rgba(236, 96, 146, 0.08) 38%, transparent 70%);
  filter: blur(18px);
  opacity: 0.7;
  transition: width 900ms ease, height 900ms ease, opacity 900ms ease, transform 900ms ease;
}

.cards {
  position: absolute;
  inset: 0;
  z-index: 10;
  transform-style: preserve-3d;
}

.photo-card {
  position: absolute;
  left: var(--x, 50%);
  top: var(--y, 50%);
  z-index: var(--zi, 1);
  --lift: 0px;
  --hover-z: 0px;
  --hover-scale: 1;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --mx: 50%;
  --my: 50%;
  width: var(--card-width);
  aspect-ratio: 125 / 174;
  overflow: hidden;
  border: 1px solid rgba(255, 231, 196, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow:
    0 22px 40px rgba(0, 0, 0, 0.42),
    0 0 22px rgba(234, 113, 163, 0.18);
  opacity: var(--op, 1);
  transform:
    translate3d(-50%, -50%, calc(var(--z, 0px) + var(--hover-z)))
    translateY(var(--lift))
    rotateX(var(--tilt-x))
    rotateY(var(--tilt-y))
    rotate(var(--r, 0deg))
    scale(var(--s, 1))
    scale(var(--hover-scale));
  transition:
    opacity 90ms linear,
    filter 800ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease;
  will-change: transform, opacity;
  contain: layout paint style;
  backface-visibility: hidden;
  cursor: zoom-in;
  transform-style: preserve-3d;
}

.photo-card:hover,
.photo-card:focus-visible,
.photo-card.is-hovered {
  transition:
    opacity 90ms linear,
    transform 420ms cubic-bezier(0.19, 1, 0.22, 1),
    filter 260ms ease,
    border-color 260ms ease,
    box-shadow 260ms ease;
  z-index: calc(var(--zi, 1) + 160);
  --lift: -10px;
  --hover-z: 88px;
  --hover-scale: 1.06;
  border-color: rgba(255, 214, 236, 0.58);
  box-shadow:
    0 34px 54px rgba(0, 0, 0, 0.5),
    0 0 28px rgba(255, 91, 177, 0.46),
    0 0 58px rgba(255, 91, 177, 0.24);
  filter: saturate(1.12) brightness(1.08);
  outline: none;
}

.photo-card.is-viewer-source {
  opacity: 0 !important;
}

.photo-card::before {
  content: "[MOMENT]";
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.72);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.photo-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 225, 241, 0.3), transparent 24%),
    linear-gradient(180deg, rgba(7, 2, 12, 0.06), transparent 42%, rgba(7, 2, 12, 0.74)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 20% 80%, rgba(0, 0, 0, 0.16));
  transition: opacity 220ms ease;
}

.photo-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  filter: saturate(0.95) contrast(1.05);
}

.card-title {
  display: none;
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 12px;
  z-index: 2;
  overflow: hidden;
  color: rgba(255, 247, 236, 0.92);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: clamp(7px, 0.72vw, 10px);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote {
  position: absolute;
  left: 50%;
  top: var(--quote-top, 50%);
  z-index: 8;
  width: min(78vw, 820px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  text-shadow:
    0 3px 16px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(246, 211, 148, 0.34),
    0 0 46px rgba(7, 2, 12, 0.78);
  transition: top 760ms cubic-bezier(0.19, 1, 0.22, 1), transform 760ms cubic-bezier(0.19, 1, 0.22, 1), opacity 520ms ease;
}

.quote.is-blank {
  opacity: 0;
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: clamp(72px, 9vh, 108px);
  z-index: 9;
  transform: translateX(-50%);
  color: rgba(255, 221, 238, 0.82);
  font-family: "Segoe UI", "Noto Serif SC", serif;
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 700;
  letter-spacing: 0.24em;
  text-shadow:
    0 0 10px rgba(255, 108, 184, 0.96),
    0 0 24px rgba(255, 108, 184, 0.64),
    0 0 46px rgba(246, 211, 148, 0.24);
  opacity: 0;
  pointer-events: none;
  animation: hint-pulse 1.9s ease-in-out infinite;
  transition: opacity 520ms ease, transform 520ms ease;
}

.shell[data-scene="opening"] .scroll-hint,
.shell:not([data-scene]) .scroll-hint {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.shell:not([data-scene="opening"]) .scroll-hint {
  animation: none;
  opacity: 0;
  transform: translateX(-50%) translateY(14px);
}

.quote.is-animating p,
.quote.is-animating h1 {
  animation: quote-rise 780ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.quote.is-animating h1 {
  animation-delay: 90ms;
}

.quote::before {
  content: "";
  position: absolute;
  inset: -26px min(8vw, 90px);
  z-index: -1;
  background: radial-gradient(ellipse at center, rgba(7, 2, 12, 0.7), rgba(7, 2, 12, 0.32) 42%, transparent 72%);
  filter: blur(8px);
}

.quote p,
.quote h1 {
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.09em;
}

.quote p {
  color: rgba(255, 247, 236, 0.95);
  font-size: clamp(20px, 2.65vw, 38px);
  line-height: 1.15;
  text-shadow:
    0 0 5px #07020c,
    0 0 16px #07020c,
    0 0 30px rgba(246, 211, 148, 0.4);
}

.quote h1 {
  margin-top: clamp(10px, 1.4vw, 18px);
  color: var(--gold);
  font-size: clamp(28px, 3.45vw, 52px);
  line-height: 1.08;
  text-shadow:
    0 0 5px #07020c,
    0 0 18px #07020c,
    0 0 32px rgba(246, 211, 148, 0.5);
}

.glow-toggle {
  position: absolute;
  right: clamp(20px, 3.5vw, 44px);
  bottom: clamp(22px, 3vw, 38px);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 160px;
  min-height: 34px;
  justify-content: center;
  padding: 8px 14px;
  border: 1px solid rgba(255, 247, 236, 0.14);
  border-radius: 8px;
  background: rgba(10, 4, 16, 0.62);
  color: rgba(255, 247, 236, 0.72);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 250ms ease, color 250ms ease, box-shadow 250ms ease;
}

.glow-toggle span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ed759f;
  box-shadow: 0 0 12px #ed759f;
}

.glow-toggle:hover,
.glow-toggle:focus-visible {
  border-color: rgba(246, 211, 148, 0.44);
  color: var(--ink);
  outline: none;
}

.photo-viewer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: clamp(22px, 5vw, 72px);
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 91, 177, 0.18), transparent 34%),
    rgba(4, 1, 8, 0.74);
  backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 360ms ease;
}

.photo-viewer[hidden] {
  display: none;
}

.photo-viewer.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-viewer.is-closing {
  pointer-events: none;
}

.viewer-frame {
  position: relative;
  width: min(86vw, 520px);
  margin: 0;
  opacity: 1;
  filter: blur(0);
  transform: none;
  transform-origin: top left;
  will-change: transform, opacity, filter;
}

.viewer-frame img {
  display: block;
  width: 100%;
  max-height: min(78vh, 720px);
  object-fit: contain;
  border: 1px solid rgba(255, 221, 238, 0.36);
  border-radius: 16px;
  background: rgba(7, 2, 12, 0.86);
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.62),
    0 0 36px rgba(255, 91, 177, 0.42),
    0 0 100px rgba(255, 91, 177, 0.24);
}

.viewer-frame figcaption {
  display: none;
  margin-top: 14px;
  color: rgba(255, 247, 236, 0.88);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(255, 91, 177, 0.46);
}

.viewer-close {
  position: fixed;
  top: clamp(18px, 4vw, 42px);
  right: clamp(18px, 4vw, 42px);
  z-index: 31;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 221, 238, 0.28);
  border-radius: 50%;
  background: rgba(10, 4, 16, 0.72);
  color: rgba(255, 247, 236, 0.9);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 26px rgba(255, 91, 177, 0.22);
}

.viewer-close:hover,
.viewer-close:focus-visible {
  border-color: rgba(255, 221, 238, 0.68);
  outline: none;
}

.shell:not(.glow-on) .photo-card,
.shell:not(.glow-on) .aura,
.shell:not(.glow-on) .brand {
  box-shadow: none;
  text-shadow: none;
  filter: saturate(0.84);
}

.shell:not(.glow-on) .aura {
  opacity: 0.16;
}

.stage[data-scene="orbit"] .aura,
.stage[data-scene="coil"] .aura {
  width: min(54vw, 680px);
  height: min(21vw, 235px);
  transform: translate(-50%, -47%) rotate(-2deg);
}

.stage[data-scene="heart"] .aura {
  width: min(64vw, 820px);
  height: min(31vw, 330px);
  opacity: 0.48;
}

.stage[data-scene="ribbon"] .aura,
.stage[data-scene="cross"] .aura,
.stage[data-scene="cluster"] .aura,
.stage[data-scene="wave"] .aura,
.stage[data-scene="tiltWall"] .aura {
  top: 60%;
  width: min(43vw, 530px);
  height: min(22vw, 240px);
  opacity: 0.76;
}

.stage[data-scene="opening"] .aura {
  opacity: 0.18;
}

.stage[data-scene="arrival"] .aura,
.stage[data-scene="wall"] .aura {
  width: min(62vw, 780px);
  height: min(27vw, 300px);
  opacity: 0.58;
}

.stage[data-scene="feature"] .aura,
.stage[data-scene="single"] .aura {
  width: min(36vw, 460px);
  height: min(34vw, 360px);
  opacity: 0.42;
}

.progress,
.progress-bar,
.timeline-progress,
.timeline-dots,
[data-progress-bar] {
  display: none !important;
}

.stage.no-transition .photo-card,
.stage.no-transition .aura,
.shell.no-transition .quote {
  transition: none;
}

@keyframes quote-rise {
  from {
    opacity: 0;
    filter: blur(10px);
    transform: translateY(26px) scale(0.96);
    letter-spacing: 0.16em;
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
    letter-spacing: 0.09em;
  }
}

@keyframes hint-pulse {
  0%,
  100% {
    filter: blur(0);
    opacity: 0.72;
  }
  50% {
    filter: blur(0.4px);
    opacity: 1;
  }
}

@keyframes viewer-rise {
  from {
    opacity: 0;
    filter: blur(12px);
    transform: translateY(34px) scale(0.94);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  :root {
    --card-width: clamp(48px, 12.2vw, 72px);
  }

  .shell {
    min-height: 560px;
  }

  .topbar {
    padding: 18px;
    gap: 12px;
  }

  .brand-mark {
    font-size: 25px;
  }

  .brand-subtitle {
    max-width: 188px;
    letter-spacing: 0.1em;
  }

  .status-panel {
    display: none;
  }

  .stage {
    inset: 82px 0 94px;
  }

  .quote {
    width: 92vw;
  }

  .glow-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
