/* loves.day - Art Deco Crystalline Chamber Experience */
/* Colors: #1a0a12 #f5ede4 #4a1a2e #f2d4a7 #5c1a34 #8b3a5a #3b0a1e #e8d5c4 #d4728a */

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

html {
  scroll-behavior: smooth;
}

body {
  background: #1a0a12;
  color: #f5ede4;
  font-family: "Cormorant Garamond", Georgia, serif;
  overflow: hidden;
  width: 100vw;
  height: 100vh;
}

/* Scroll Container */
#scroll-container {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  perspective: 1000px;
}

/* Chamber Base */
.chamber {
  position: relative;
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chamber-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Grain Overlay */
#grain-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Ripple Layer */
#ripple-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at center, transparent 0%, #1a0a12 70%);
  transition: opacity 0.6s ease;
}

#ripple-layer.active {
  opacity: 1;
}

/* Crystal Overlays */
.crystal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.vestibule-crystals::before,
.vestibule-crystals::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: conic-gradient(from 0deg, transparent, rgba(242,212,167,0.06), transparent, rgba(212,114,138,0.04), transparent);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.vestibule-crystals::before {
  top: -50px;
  right: -50px;
  transform: rotate(15deg);
  animation: crystal-float 12s ease-in-out infinite;
}

.vestibule-crystals::after {
  bottom: -80px;
  left: -60px;
  width: 250px;
  height: 250px;
  transform: rotate(-20deg);
  animation: crystal-float 15s ease-in-out infinite reverse;
}

.gallery-crystals::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  top: 10%;
  left: 5%;
  background: conic-gradient(from 45deg, transparent, rgba(139,58,90,0.08), transparent, rgba(242,212,167,0.05), transparent);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  animation: crystal-float 18s ease-in-out infinite;
}

.gallery-crystals::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  bottom: 5%;
  right: 8%;
  background: conic-gradient(from 120deg, transparent, rgba(212,114,138,0.06), transparent);
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
  animation: crystal-float 14s ease-in-out infinite reverse;
}

.conservatory-crystals::before {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: conic-gradient(from 0deg, transparent 0deg, rgba(242,212,167,0.03) 30deg, transparent 60deg, rgba(212,114,138,0.03) 90deg, transparent 120deg, rgba(139,58,90,0.03) 150deg, transparent 180deg, rgba(242,212,167,0.03) 210deg, transparent 240deg, rgba(212,114,138,0.03) 270deg, transparent 300deg, rgba(139,58,90,0.03) 330deg, transparent 360deg);
  clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
  animation: crystal-rotate 30s linear infinite;
}

.library-crystals::before {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  top: 15%;
  right: 10%;
  background: conic-gradient(from 60deg, transparent, rgba(242,212,167,0.05), transparent);
  clip-path: polygon(50% 0%, 80% 20%, 100% 50%, 80% 80%, 50% 100%, 20% 80%, 0% 50%, 20% 20%);
  animation: crystal-float 20s ease-in-out infinite;
}

.sanctum-crystals::before {
  content: "";
  position: absolute;
  inset: 10%;
  background: conic-gradient(from 0deg, transparent, rgba(242,212,167,0.02) 45deg, transparent 90deg, rgba(212,114,138,0.02) 135deg, transparent 180deg, rgba(242,212,167,0.02) 225deg, transparent 270deg, rgba(212,114,138,0.02) 315deg, transparent 360deg);
  clip-path: polygon(50% 0%, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0% 50%, 15% 15%);
  animation: crystal-rotate 40s linear infinite;
}

@keyframes crystal-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(3deg); }
}

@keyframes crystal-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
/* Filigree Ornaments */
.filigree {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.filigree-top-left {
  top: 20px;
  left: 20px;
  width: 200px;
  height: 200px;
  opacity: 0.6;
}

.filigree-bottom-right {
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 200px;
  opacity: 0.6;
}

.filigree-center-top {
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 60px;
}

.filigree-left-edge {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 400px;
}

.filigree-frame {
  position: absolute;
  inset: 20px;
  z-index: 3;
  pointer-events: none;
}

.filigree-frame svg {
  width: 100%;
  height: 100%;
}

/* Chamber Content */
.chamber-content {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 40px;
  max-width: 900px;
}

/* Chamber Transitions */
.chamber-transition {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 4;
  pointer-events: none;
}

/* ===================== */
/* VESTIBULE (Chamber 1) */
/* ===================== */

#vestibule {
  background: radial-gradient(ellipse at center, #3b0a1e 0%, #1a0a12 70%);
}

#vestibule .chamber-transition {
  background: linear-gradient(to bottom, transparent, #1a0a12);
}

.vestibule-diamond {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 40px;
  transform: rotate(45deg);
  animation: diamond-pulse 4s ease-in-out infinite;
}

.diamond-facet {
  position: absolute;
  width: 50%;
  height: 50%;
  transition: all 0.6s ease;
}

.facet-1 {
  top: 0;
  left: 0;
  background: linear-gradient(135deg, rgba(242,212,167,0.15), rgba(212,114,138,0.1));
  border-top: 1px solid rgba(242,212,167,0.3);
  border-left: 1px solid rgba(242,212,167,0.3);
}

.facet-2 {
  top: 0;
  right: 0;
  background: linear-gradient(225deg, rgba(242,212,167,0.1), rgba(139,58,90,0.1));
  border-top: 1px solid rgba(242,212,167,0.2);
  border-right: 1px solid rgba(212,114,138,0.2);
}

.facet-3 {
  bottom: 0;
  left: 0;
  background: linear-gradient(45deg, rgba(139,58,90,0.1), rgba(212,114,138,0.08));
  border-bottom: 1px solid rgba(212,114,138,0.2);
  border-left: 1px solid rgba(139,58,90,0.2);
}

.facet-4 {
  bottom: 0;
  right: 0;
  background: linear-gradient(315deg, rgba(212,114,138,0.12), rgba(242,212,167,0.06));
  border-bottom: 1px solid rgba(212,114,138,0.25);
  border-right: 1px solid rgba(242,212,167,0.15);
}

@keyframes diamond-pulse {
  0%, 100% { transform: rotate(45deg) scale(1); opacity: 0.9; }
  50% { transform: rotate(45deg) scale(1.05); opacity: 1; }
}

.vestibule-title {
  font-family: "Poiret One", sans-serif;
  font-size: clamp(64px, 12vw, 160px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: #f2d4a7;
  margin-bottom: 20px;
  text-shadow: 0 0 40px rgba(242,212,167,0.15);
}

.vestibule-subtitle {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(16px, 2.5vw, 24px);
  font-weight: 300;
  font-style: italic;
  color: #e8d5c4;
  letter-spacing: 0.05em;
  margin-bottom: 60px;
  opacity: 0.8;
}

.scroll-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: scroll-bounce 2s ease-in-out infinite;
}

.scroll-text {
  font-family: "Josefin Sans", sans-serif;
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #f2d4a7;
  opacity: 0.6;
}

.scroll-arrow {
  opacity: 0.5;
}

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); opacity: 1; }
  50% { transform: translateY(8px); opacity: 0.5; }
}
/* =================== */
/* GALLERY (Chamber 2) */
/* =================== */

#gallery {
  background: linear-gradient(180deg, #1a0a12 0%, #4a1a2e 50%, #1a0a12 100%);
}

#gallery .chamber-transition {
  background: linear-gradient(to bottom, transparent, #1a0a12);
}

.chamber-heading {
  font-family: "Poiret One", sans-serif;
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: #f2d4a7;
  margin-bottom: 50px;
  text-shadow: 0 0 30px rgba(242,212,167,0.1);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 700px;
  margin: 0 auto;
}

.gallery-card {
  position: relative;
  padding: 30px 24px;
  background: rgba(74,26,46,0.3);
  border: 1px solid rgba(242,212,167,0.12);
  clip-path: polygon(8% 0%, 100% 0%, 100% 92%, 92% 100%, 0% 100%, 0% 8%);
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  overflow: hidden;
}

.gallery-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(242,212,167,0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.gallery-card:hover {
  border-color: rgba(242,212,167,0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.3), inset 0 0 30px rgba(242,212,167,0.03);
}

.gallery-card:hover::before {
  opacity: 1;
}

.card-crystal {
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: conic-gradient(from 0deg, transparent, rgba(212,114,138,0.08), transparent);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  opacity: 0.5;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.gallery-card:hover .card-crystal {
  opacity: 1;
  transform: rotate(15deg) scale(1.2);
}

.card-content {
  position: relative;
  z-index: 2;
  text-align: left;
}

.card-numeral {
  font-family: "Poiret One", sans-serif;
  font-size: 14px;
  letter-spacing: 0.15em;
  color: #d4728a;
  display: block;
  margin-bottom: 8px;
}

.card-content h3 {
  font-family: "Poiret One", sans-serif;
  font-size: 22px;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #f2d4a7;
  margin-bottom: 10px;
}

.card-content p {
  font-family: "Cormorant Garamond", serif;
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: #e8d5c4;
  opacity: 0.85;
}

/* ======================== */
/* CONSERVATORY (Chamber 3) */
/* ======================== */

#conservatory {
  background: radial-gradient(ellipse at center, #5c1a34 0%, #3b0a1e 40%, #1a0a12 80%);
}

#conservatory .chamber-transition {
  background: linear-gradient(to bottom, transparent, #1a0a12);
}

.conservatory-intro {
  font-family: "Cormorant Garamond", serif;
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: #e8d5c4;
  opacity: 0.7;
  margin-bottom: 40px;
  margin-top: -30px;
}

.diamond-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 660px;
  margin: 0 auto;
}

.diamond-cell {
  position: relative;
  aspect-ratio: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diamond-shape {
  position: absolute;
  inset: 10%;
  background: linear-gradient(135deg, rgba(242,212,167,0.08), rgba(212,114,138,0.06));
  border: 1px solid rgba(242,212,167,0.15);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.diamond-cell:hover .diamond-shape {
  background: linear-gradient(135deg, rgba(242,212,167,0.2), rgba(212,114,138,0.15));
  border-color: rgba(242,212,167,0.4);
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(212,114,138,0.2);
}

.diamond-reveal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  z-index: 2;
}

.diamond-cell:hover .diamond-reveal {
  opacity: 1;
  transform: scale(1);
}

.reveal-word {
  font-family: "Poiret One", sans-serif;
  font-size: 18px;
  letter-spacing: 0.1em;
  color: #f2d4a7;
  margin-bottom: 6px;
}

.reveal-text {
  font-family: "Cormorant Garamond", serif;
  font-size: 13px;
  font-weight: 300;
  font-style: italic;
  line-height: 1.5;
  color: #e8d5c4;
  opacity: 0.8;
  text-align: center;
}
/* =================== */
/* LIBRARY (Chamber 4) */
/* =================== */

#library {
  background: linear-gradient(180deg, #1a0a12 0%, #4a1a2e 30%, #3b0a1e 70%, #1a0a12 100%);
}

#library .chamber-transition {
  background: linear-gradient(to bottom, transparent, #1a0a12);
}

.library-layout {
  position: relative;
  max-width: 650px;
  margin: 0 auto;
  min-height: 300px;
}

.library-quote {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  pointer-events: none;
}

.library-quote.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.library-quote blockquote {
  border: none;
  padding: 0;
  margin: 0 0 24px 0;
}

.library-quote blockquote p {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.7;
  color: #f5ede4;
  letter-spacing: 0.02em;
}

.quote-ornament {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.quote-ornament svg {
  width: 100px;
  height: 20px;
}

.library-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  position: absolute;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
}

.library-nav-btn {
  background: none;
  border: 1px solid rgba(242,212,167,0.2);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  background: rgba(74,26,46,0.3);
  transition: all 0.4s ease;
}

.library-nav-btn:hover {
  background: rgba(242,212,167,0.1);
  border-color: rgba(242,212,167,0.4);
}

.library-dots {
  display: flex;
  gap: 12px;
}

.library-dot {
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid rgba(242,212,167,0.3);
  background: transparent;
  transition: all 0.4s ease;
  cursor: pointer;
}

.library-dot.active {
  background: #f2d4a7;
  border-color: #f2d4a7;
  box-shadow: 0 0 10px rgba(242,212,167,0.3);
}

/* =================== */
/* SANCTUM (Chamber 5) */
/* =================== */

#sanctum {
  background: radial-gradient(ellipse at center, #4a1a2e 0%, #3b0a1e 30%, #1a0a12 70%);
}

.sanctum-crystal-ring {
  position: absolute;
  width: 500px;
  height: 500px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ring-rotate 60s linear infinite;
}

.crystal-ring-segment {
  position: absolute;
  width: 60px;
  height: 60px;
  top: 50%;
  left: 50%;
  background: linear-gradient(135deg, rgba(242,212,167,0.06), rgba(212,114,138,0.04));
  border: 1px solid rgba(242,212,167,0.08);
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  transform-origin: 0 0;
  transform: rotate(calc(var(--i) * 45deg)) translate(220px, -30px);
}

@keyframes ring-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

.sanctum-heading {
  font-family: "Poiret One", sans-serif;
  font-size: clamp(36px, 7vw, 72px);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.1;
  color: #f2d4a7;
  margin-bottom: 30px;
  text-shadow: 0 0 40px rgba(242,212,167,0.15);
  position: relative;
  z-index: 2;
}

.sanctum-text {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.8;
  color: #e8d5c4;
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.sanctum-sigil {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
  position: relative;
  z-index: 2;
  animation: sigil-pulse 5s ease-in-out infinite;
}

.sanctum-sigil svg {
  width: 120px;
  height: 120px;
}

@keyframes sigil-pulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

.sanctum-domain {
  font-family: "Josefin Sans", sans-serif;
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #8b3a5a;
  position: relative;
  z-index: 2;
}
/* ======================== */
/* NAVIGATION PIPS          */
/* ======================== */

#chamber-nav {
  position: fixed;
  right: 30px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.nav-pip {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.nav-pip:hover {
  transform: scale(1.3);
}

.pip-diamond {
  display: block;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border: 1px solid rgba(242,212,167,0.4);
  background: transparent;
  transition: all 0.4s ease;
}

.nav-pip.active .pip-diamond {
  background: #f2d4a7;
  border-color: #f2d4a7;
  box-shadow: 0 0 12px rgba(242,212,167,0.4);
}

/* ======================== */
/* CHAMBER ANIMATIONS       */
/* ======================== */

.chamber-content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 1s cubic-bezier(0.23, 1, 0.32, 1), transform 1s cubic-bezier(0.23, 1, 0.32, 1);
}

.chamber.in-view .chamber-content {
  opacity: 1;
  transform: translateY(0);
}

/* ======================== */
/* RESPONSIVE               */
/* ======================== */

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .diamond-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  #chamber-nav {
    right: 12px;
  }

  .filigree-top-left,
  .filigree-bottom-right {
    width: 120px;
    height: 120px;
  }

  .vestibule-diamond {
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
  }

  .chamber-content {
    padding: 24px 16px;
  }

  .sanctum-crystal-ring {
    width: 300px;
    height: 300px;
  }

  .crystal-ring-segment {
    width: 40px;
    height: 40px;
    transform: rotate(calc(var(--i) * 45deg)) translate(130px, -20px);
  }

  .library-nav {
    bottom: -60px;
  }
}

@media (max-width: 480px) {
  .diamond-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .reveal-text {
    font-size: 11px;
  }

  .reveal-word {
    font-size: 14px;
  }
}
/* Additional accent color */
.gallery-card .card-numeral::after {
  content: "";
  display: block;
  width: 20px;
  height: 1px;
  background: #c9a87c;
  margin-top: 4px;
  opacity: 0.5;
}
