* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1a0a14 0%, #0a0008 70%);
  font-family: 'Georgia', 'Noto Serif SC', serif;
  color: #fff;
}

#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.intro-video-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  overflow: hidden;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 70%);
  transition: opacity 1.5s ease;
}

.intro-video-wrap video {
  width: 30vw;
  height: auto;
  display: block;
  object-fit: cover;
}

.intro-video-wrap.hidden {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none;
}

.header-left .brand {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 8px;
  color: #fff;
}

.header-left .subtitle {
  font-size: 10px;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.header-right {
  text-align: right;
}

.header-right .valley-label {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.6);
  display: block;
}

.header-right .progress {
  font-size: 14px;
  color: #d4a853;
  margin-top: 4px;
  display: block;
}

/* Album book stage */
.album-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 2000px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.album-stage.visible {
  opacity: 1;
  pointer-events: all;
}

.album-stage.hidden {
  opacity: 0;
  pointer-events: none;
}

.album-book {
  position: relative;
  width: 580px;
  height: 420px;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
  transition: transform 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.album-book.tilted {
  transform: rotateX(45deg);
}

.album-book.closing {
  transform: rotateX(45deg) scale(0.9);
}

/* Front cover - two-panel open from center */
.album-cover-left, .album-cover-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: linear-gradient(145deg, #7a5c4a, #4a2e20, #6b4a38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
  transform-style: preserve-3d;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.album-cover-left {
  left: 0;
  border-radius: 10px 0 0 10px;
  transform-origin: left center;
}

.album-cover-right {
  right: 0;
  border-radius: 0 10px 10px 0;
  transform-origin: right center;
}

.album-cover-left::before, .album-cover-right::before {
  content: '';
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  bottom: 16px;
  border: 1px solid rgba(212, 168, 83, 0.3);
  border-radius: 2px;
  pointer-events: none;
}

.album-cover-left::after, .album-cover-right::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.05) 0%, transparent 50%);
  pointer-events: none;
}

.album-cover-left .cover-title-top,
.album-cover-right .cover-title-top {
  font-size: 52px;
  font-weight: 400;
  color: rgba(232, 200, 160, 0.9);
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.album-cover-left .cover-title-bottom,
.album-cover-right .cover-title-bottom {
  font-size: 52px;
  font-weight: 400;
  color: rgba(232, 200, 160, 0.9);
  font-family: 'Dancing Script', 'Brush Script MT', cursive;
  font-style: italic;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  margin-top: 2px;
}

/* Left half shows "Love", right half shows "Story" */
.album-cover-left .cover-title-bottom {
  display: none;
}
.album-cover-right .cover-title-top {
  display: none;
}

.album-cover-left.open {
  transform: rotateY(-170deg);
}

.album-cover-right.open {
  transform: rotateY(170deg);
}

.album-book.closing .album-cover-left {
  transform: rotateY(0deg);
}

.album-book.closing .album-cover-right {
  transform: rotateY(0deg);
}

/* Inner pages base */
.album-base-left, .album-base-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  background: #2a2020;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-base-left {
  left: 0;
  border-radius: 6px 0 0 6px;
  border-right: 1px solid rgba(80, 50, 30, 0.5);
}

.album-base-right {
  right: 0;
  border-radius: 0 6px 6px 0;
  transform-style: preserve-3d;
}

.album-base-left img, .album-base-right img {
  width: 85%;
  height: 80%;
  object-fit: cover;
  border-radius: 3px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* Flipping pages */
.album-pages {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}

.album-leaf {
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  height: 100%;
  transform-origin: left center;
  transform-style: preserve-3d;
  transform: rotateY(0deg);
}


.album-leaf .leaf-front,
.album-leaf .leaf-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.album-leaf .leaf-front {
  background: #2a2020;
  border-radius: 0 6px 6px 0;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

.album-leaf .leaf-back {
  background: #2a2020;
  transform: rotateY(180deg);
  border-radius: 6px 0 0 6px;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.album-leaf img {
  width: 85%;
  height: 80%;
  object-fit: cover;
  border-radius: 3px;
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
}

/* Book thickness - bottom edge */
.album-book::after {
  content: '';
  position: absolute;
  bottom: -16px;
  left: 4px;
  right: 4px;
  height: 16px;
  background: linear-gradient(180deg, #e8ddd0, #c8b8a0, #a89880, #c8b8a0, #e8ddd0);
  border-radius: 0 0 3px 3px;
  transform: rotateX(-90deg);
  transform-origin: top center;
}

/* Book thickness - left spine */
.album-book::before {
  content: '';
  position: absolute;
  left: -16px;
  top: 2px;
  width: 16px;
  height: calc(100% - 4px);
  background: linear-gradient(90deg, #5a3c2c, #7a5844, #5a3c2c);
  border-radius: 4px 0 0 4px;
  transform: rotateY(90deg);
  transform-origin: right center;
}

/* Main stage - single screen */
.main-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.main-stage.visible {
  opacity: 1;
}

.photo-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 10;
  pointer-events: none;
  width: 60%;
}

.valley-title {
  font-size: 38px;
  font-weight: 300;
  color: #fff;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 80px rgba(0, 0, 0, 0.7);
  margin-bottom: 12px;
}

.valley-subtitle {
  font-size: 34px;
  font-weight: 300;
  color: #d4a853;
  text-shadow: 0 0 40px rgba(0, 0, 0, 0.9), 0 0 80px rgba(0, 0, 0, 0.7);
}

/* Photo cards */
.photo-card {
  position: absolute;
  width: 200px;
  height: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(20, 12, 18, 0.92);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: grab;
  transition: left 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), top 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.3s ease, opacity 0.6s ease, border 0.3s ease;
  transform-style: preserve-3d;
  will-change: transform, left, top;
  contain: layout style;
  user-select: none;
  display: flex;
  flex-direction: column;
  opacity: 0;
}

.photo-card.show {
  opacity: 1;
}

.photo-card:hover {
  box-shadow:
    0 0 15px rgba(212, 168, 83, 0.6),
    0 0 30px rgba(212, 168, 83, 0.4),
    0 0 60px rgba(212, 168, 83, 0.2),
    0 0 90px rgba(180, 100, 60, 0.15),
    inset 0 0 20px rgba(212, 168, 83, 0.1);
  z-index: 50 !important;
  transform: scale(1.08) !important;
  border: 1px solid rgba(212, 168, 83, 0.5);
}

.photo-card:active {
  cursor: grabbing;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.3);
}

.card-label {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: rgba(255, 255, 255, 0.5);
  font-family: monospace;
}

.card-index {
  font-size: 9px;
  color: rgba(212, 168, 83, 0.7);
  font-weight: 500;
}

.card-img-wrap {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.card-footer {
  padding: 8px 10px 6px;
  background: rgba(0, 0, 0, 0.4);
}

.card-theme-text {
  display: block;
  font-size: 9px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.card-memory {
  display: block;
  font-size: 7px;
  letter-spacing: 1.5px;
  color: rgba(212, 168, 83, 0.5);
  font-family: monospace;
}

.photo-card.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1015, #2a1525);
  border: 1px dashed rgba(212, 168, 83, 0.3);
}

.photo-card.placeholder::after {
  content: '\2665';
  font-size: 28px;
  color: rgba(212, 168, 83, 0.3);
}

/* Music control */
.music-ctrl {
  position: fixed;
  bottom: 24px;
  right: 180px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.3s;
}

.music-ctrl:hover {
  border-color: rgba(212, 168, 83, 0.5);
}

.music-icon {
  font-size: 16px;
  color: #d4a853;
  animation: musicPulse 1s ease-in-out infinite;
}

.music-ctrl.paused .music-icon {
  animation: none;
  opacity: 0.4;
}

@keyframes musicPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
}

/* Glow toggle */
.glow-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.3s;
}

.glow-toggle:hover {
  border-color: rgba(212, 168, 83, 0.5);
}

.glow-toggle .glow-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4a853;
  opacity: 0.5;
}

.glow-toggle.active .glow-dot {
  opacity: 1;
  box-shadow: 0 0 8px #d4a853;
}

/* Photo modal */
.photo-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.photo-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
}

.modal-content-wrap {
  position: fixed;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: top 0.8s cubic-bezier(0.23, 1, 0.32, 1), left 0.8s cubic-bezier(0.23, 1, 0.32, 1), width 0.8s cubic-bezier(0.23, 1, 0.32, 1), height 0.8s cubic-bezier(0.23, 1, 0.32, 1), transform 0.8s cubic-bezier(0.23, 1, 0.32, 1);
}

.modal-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  border-radius: 12px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.8);
  object-fit: contain;
}

.modal-info {
  margin-top: 24px;
  text-align: center;
  max-width: 500px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease 0.5s, transform 0.8s ease 0.5s;
}

.photo-modal.active .modal-info {
  opacity: 1;
  transform: translateY(0);
}

.modal-theme {
  font-size: 20px;
  font-weight: 300;
  color: #d4a853;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.modal-text {
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.8);
  white-space: pre-wrap;
}

.modal-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 24px;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  z-index: 2;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
}


/* Lyrics bar */
.lyrics-bar {
  position: fixed;
  bottom: 55px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  text-align: center;
  pointer-events: none;
  width: 80%;
}

.lyrics-text {
  font-size: 24px;
  color: rgba(212, 168, 83, 0.85);
  letter-spacing: 2px;
  text-shadow: 0 0 20px rgba(212, 168, 83, 0.3), 0 0 40px rgba(0, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  transform: translateY(5px);
  font-family: 'Georgia', 'Noto Serif SC', serif;
  font-style: italic;
  display: inline-block;
}

.lyrics-text.show {
  opacity: 1;
  transform: translateY(0);
}

/* Skip to end button */
.skip-end-btn {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 20px;
  background: rgba(10, 5, 10, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  font-size: 9px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  z-index: 100;
  transition: color 0.3s, border-color 0.3s;
}

.skip-end-btn:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(212, 168, 83, 0.3);
}

.no-photos-msg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  letter-spacing: 3px;
}
