/* 
  =========================================
  TEAHOUSE OF FEELINGS - MAIN STYLESHEET
  An Enchanting, Magical, and Premium Design
  =========================================
*/

/* -----------------------------------------
   1. DESIGN SYSTEM TOKENS & RESET
   ----------------------------------------- */
:root {
  /* Color Palette - Whimsical Sunset & Magical Twilight */
  --color-bg-deep: hsl(260, 45%, 7%);      /* Dark magical twilight violet */
  --color-bg-mid: hsl(255, 35%, 12%);      /* Mid-tone cozy evening purple */
  --color-gold: hsl(43, 96%, 56%);         /* Magical glowing amber-gold */
  --color-gold-light: hsl(45, 100%, 75%);  /* Brighter sparkle gold */
  --color-peach: hsl(24, 100%, 93%);       /* Warm comforting cream-peach */
  --color-text-light: hsl(24, 30%, 96%);   /* Soft off-white for text */
  --color-text-muted: hsl(250, 15%, 75%);  /* Semi-transparent text support */
  
  /* Glassmorphism Styles */
  --glass-bg: rgba(18, 10, 36, 0.45);
  --glass-border: rgba(251, 191, 36, 0.12);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.05);

  /* Typography */
  --font-serif-logo: 'Cinzel', serif;
  --font-serif-decorative: 'Cinzel Decorative', serif;
  --font-serif-body: 'Lora', serif;
  --font-sans: 'Outfit', sans-serif;
  --font-serif-alice: 'Alice', serif;
  --font-serif-cormorant: 'Cormorant Garamond', serif;
  --font-serif-fraunces: 'Fraunces', serif;
  --font-serif-playfair: 'Playfair Display', serif;
  --font-script-vibes: 'Great Vibes', cursive;
  --font-script-pinyon: 'Pinyon Script', cursive;
  --font-script-rochester: 'Rochester', cursive;

  /* Global Transitions */
  --transition-smooth: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  --transition-fast: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Hide standard scrollbars */
}

html::-webkit-scrollbar {
  display: none; /* Hide Chrome/Safari scrollbars */
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-deep);
  color: var(--color-text-light);
  overflow-x: hidden;
  line-height: 1.6;
  position: relative;
}

/* Master Fixed Magical Background Image */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../assets/bg.png');
  background-size: cover;
  background-position: center bottom;
  background-attachment: fixed;
  z-index: -3;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom,
    rgba(10, 5, 20, 0.45) 0%,   /* Elegant midnight top shading for header contrast */
    rgba(18, 10, 30, 0.15) 30%,  /* Lightened to keep the center landscape 100% sharp */
    rgba(251, 191, 36, 0.03) 55%, 
    rgba(10, 5, 20, 0.45) 90%    /* Grounding twilight bottom shading for text readability */
  );
  z-index: -2;
  pointer-events: none;
}

/* Dynamic glow overlays reacting to emotional transitions */
#ambient-glow-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at 50% 70%, rgba(251, 191, 36, 0), rgba(0,0,0,0));
  z-index: -1;
  pointer-events: none;
  opacity: 0.2; /* Super-delicate glow that acts as a subtle accent without any foggy look */
  transition: background 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Particle Canvas style */
#ambient-particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* -----------------------------------------
   2. HEADER & NAVIGATION (Symmetrical Split Layout)
   ----------------------------------------- */
.main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(14, 8, 30, 0.7); /* Slightly semi-transparent at the absolute top for Ghibli aesthetic */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: 
    background 0.4s ease,
    box-shadow 0.4s ease,
    border-color 0.4s ease;
}

.main-header.scrolled {
  background: rgba(14, 8, 30, 0.98); /* Highly opaque deep midnight violet on scroll to completely block underlying text */
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 15px rgba(251, 191, 36, 0.03);
  border-color: rgba(251, 191, 36, 0.18); /* Accentuated gold glowing border on scroll */
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 2rem;
  height: 90px;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  width: 40%;
}

.nav-left {
  justify-content: flex-end;
}

.nav-right {
  justify-content: flex-start;
}

.nav-link {
  font-family: var(--font-serif-logo);
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  padding: 0.5rem 0;
  transition: var(--transition-fast);
  opacity: 0.85;
  
  /* Blurry dark drop-shadow filter mapping perfectly to the text shape for absolute legibility */
  filter: drop-shadow(0 2px 6px rgba(10, 5, 20, 0.95)) drop-shadow(0 0 16px rgba(10, 5, 20, 0.6));
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold-light);
  transition: var(--transition-smooth);
  transform: translateX(-50%);
}

.nav-link:hover, .nav-link.active {
  color: var(--color-gold-light);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
  opacity: 1;
}

.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

/* Center Logo Emblem (Original Image restored) */
.nav-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 20%;
  height: 100%;
}

.logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.logo-image {
  height: 105px;
  width: 105px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 8px rgba(251, 191, 36, 0.3));
  transition: var(--transition-smooth);
  margin-top: 12px; /* Elegant overlap hanging slightly below the header bar */
  z-index: 1001;
}

.logo-link:hover .logo-image {
  transform: scale(1.06) rotate(3deg) translateY(2px);
  filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 16px rgba(251, 191, 36, 0.55));
}

/* Cart Badge Special link */
.nav-cart {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-badge {
  background-color: var(--color-gold);
  color: var(--color-bg-deep);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px var(--color-gold-light);
  margin-top: -2px;
}

/* Whimsical Circular Glass Mobile Hamburger Button */
.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: rgba(18, 10, 36, 0.45);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 1001;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.mobile-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-gold-light);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.35);
  transform: scale(1.05);
}

.mobile-toggle .bar {
  width: 18px;
  height: 2px;
  background-color: var(--color-gold-light);
  transition: var(--transition-smooth);
  border-radius: 1px;
}

/* Morphing hamburger lines animations inside open state */
.nav-container.open .mobile-toggle .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  width: 20px;
  background-color: var(--color-peach);
}

.nav-container.open .mobile-toggle .bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-container.open .mobile-toggle .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  width: 20px;
  background-color: var(--color-peach);
}

/* -----------------------------------------
   3. HERO SECTION
   ----------------------------------------- */
.hero-section {
  min-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 2rem 60px;
}

.hero-content {
  max-width: 900px;
  margin-top: 4rem;
  animation: fadeInDown 1.2s cubic-bezier(0.25, 1, 0.5, 1) both;
  background: none;
  box-shadow: none;
}

.hero-title-container {
  display: flex;
  flex-direction: column; /* Stack the welcome badge directly above the custom typography image */
  justify-content: center;
  align-items: center;
  margin-bottom: 1.5rem;
  perspective: 1000px;
  animation: fadeInUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.hero-welcome-badge {
  font-family: var(--font-serif-logo);
  font-size: clamp(1.0rem, 2.8vw, 1.6rem);
  font-weight: 600;
  letter-spacing: 0.2em; /* Majestic elegant letter spacing */
  text-transform: uppercase;
  background: linear-gradient(to right, #ffe082 0%, #fbbf24 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.95rem;
  opacity: 0.95;
  
  /* Blurry dark GPU drop-shadow silhouette hugging the exact shape of the words */
  filter: 
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.85)) 
    drop-shadow(0 0 10px rgba(10, 5, 20, 0.95)) 
    drop-shadow(0 0 20px rgba(10, 5, 20, 0.75));
  animation: floatWelcome 6s ease-in-out infinite;
}

@keyframes floatWelcome {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -5px, 0);
  }
}

.hero-title-line {
  font-family: var(--font-serif-playfair); /* Uniform crisp & clean Playfair Display serif font */
  font-weight: 700;
  text-transform: uppercase; /* Uniformed All-Caps (Caps Lock) */
  text-align: center;
  display: block;
  
  /* Solid warm gold - same color across lines, NO gradient */
  color: var(--color-gold);
  
  /* Blurry, feather-soft dark silhouettes hugging the exact shape of the words */
  filter: 
    drop-shadow(0 0 12px rgba(10, 5, 20, 0.95)) 
    drop-shadow(0 0 28px rgba(10, 5, 20, 0.85)) 
    drop-shadow(0 0 48px rgba(10, 5, 20, 0.65))
    drop-shadow(0 0 10px rgba(251, 191, 36, 0.15));
  
  /* Hardware acceleration composition layer triggers */
  will-change: transform, filter;
  transform: translate3d(0, 0, 0);
  -webkit-font-smoothing: antialiased;
  
  animation: floatTitle 6s ease-in-out infinite;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.hero-title-line:hover {
  transform: translate3d(0, -6px, 0) scale(1.02);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 20px rgba(251, 191, 36, 0.45));
  cursor: default;
}

/* Beautiful stacked typography hierarchy (3-Line Stack - Uniformed Caps Lock) */
.hero-title-line.line-1 {
  font-size: clamp(1.0rem, 2.8vw, 1.5rem);
  letter-spacing: 0.18em;
  text-indent: 0.18em; /* Shift right to center perfectly due to letter-spacing */
  margin-bottom: 0.4rem;
  opacity: 0.9;
}

.hero-title-line.line-2 {
  font-size: clamp(1.5rem, 5.2vw, 3.8rem);
  letter-spacing: 0.1em;
  text-indent: 0.1em;
  margin-bottom: 0.4rem;
}

/* Cute Magical Teacup Divider styles */
.hero-title-divider {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.25rem auto 0.75rem;
  perspective: 1000px;
  animation: floatWelcome 6s ease-in-out infinite;
}

.teacup-svg {
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.4));
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.teacup-svg:hover {
  transform: scale(1.15) rotate(-5deg);
}

/* Steaming Wisps Animation */
.steam-wisp {
  stroke-dasharray: 20;
  stroke-dashoffset: 0;
  animation: riseSteam 3s ease-in-out infinite;
  opacity: 0.7;
  transform-origin: bottom center;
}

.wisp-1 {
  animation-delay: 0s;
}
.wisp-2 {
  animation-delay: 1s;
}
.wisp-3 {
  animation-delay: 0.5s;
}

@keyframes riseSteam {
  0% {
    stroke-dashoffset: 20;
    opacity: 0;
    transform: translate3d(0, 5px, 0) scaleY(0.8);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    stroke-dashoffset: -20;
    opacity: 0;
    transform: translate3d(0, -10px, 0) scaleY(1.2);
  }
}

@keyframes floatTitle {
  0%, 100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  50% {
    transform: translate3d(0, -8px, 0) rotate(-0.2deg);
  }
}

.hero-subtitle {
  font-family: var(--font-serif-body);
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-style: italic;
  color: var(--color-peach);
  margin: 0.75rem auto 2.2rem;
  max-width: 600px;
  opacity: 0.95;
  
  /* Applying the identical high-performance, blurry dark GPU drop-shadow silhouette */
  filter: 
    drop-shadow(0 0 10px rgba(10, 5, 20, 0.95)) 
    drop-shadow(0 0 22px rgba(10, 5, 20, 0.85)) 
    drop-shadow(0 0 38px rgba(10, 5, 20, 0.65));
}

.hero-actions {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  align-items: center;
}

/* Interactive Glowing Buttons */
.btn-primary, .btn-secondary {
  font-family: var(--font-sans);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 1.1rem 2.5rem;
  border-radius: 50px;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, #d97706 100%);
  color: var(--color-bg-deep);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  border: none;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(251, 191, 36, 0.6), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  background: linear-gradient(135deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-text-light);
  border: 1px solid rgba(255, 255, 255, 0.15);
/*   backdrop-filter: blur(10px); */

}

.btn-secondary:hover {
  transform: translateY(-3px);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--color-gold);
  box-shadow: 0 8px 25px rgba(251, 191, 36, 0.15);
}

/* -----------------------------------------
   4. FEATURED BOOKS SECTION
   ----------------------------------------- */
.featured-section {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin-bottom: 0.5rem; /* snugger margin */
  padding: 0 2rem;
}

.section-title {
  font-family: var(--font-serif-logo);
  font-size: clamp(1.2rem, 3vw, 2.0rem); /* scaled down from 2.5rem */
  font-weight: 700;
  letter-spacing: 0.1em; /* Elegant wider spacing */
  text-transform: uppercase;
  white-space: nowrap; /* Keep featured books title on exactly one line under all conditions */
  background: linear-gradient(to bottom, #fff5cc 0%, #dca626 60%, #8c6209 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  
  /* Blurry, feather-soft dark silhouettes hugging the exact shape of the words for absolute legibility */
  filter: 
    drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8))
    drop-shadow(0 0 12px rgba(10, 5, 20, 0.95))
    drop-shadow(0 0 24px rgba(10, 5, 20, 0.85));
}

.section-subtitle {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-top: 0.45rem; /* Reduced space between title and subtitle for a cleaner look */
  
  /* Blurry dark GPU drop-shadow silhouette hugging the exact shape of the words for perfect reading clarity */
  filter: 
    drop-shadow(0 0 8px rgba(10, 5, 20, 0.95)) 
    drop-shadow(0 0 20px rgba(10, 5, 20, 0.85));
}

/* -----------------------------------------
   ELEGANT AGE-GROUP SELECTOR TOGGLE CONTROL
   ----------------------------------------- */
.books-age-toggle-container {
  display: inline-flex;
  background: rgba(14, 8, 30, 0.65);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 30px;
  padding: 5px;
  gap: 6px;
  margin: 1.2rem auto 2.0rem;
  z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.age-toggle-btn {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  border-radius: 25px;
  padding: 0.6rem 1.6rem;
  cursor: pointer;
  transition: 
    background 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    color 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.3s ease;
  outline: none;
  opacity: 0.65; /* slightly dimmed by default */
  text-transform: uppercase;
}

.age-toggle-btn:hover {
  opacity: 0.95;
  color: var(--color-gold-light);
}

.age-toggle-btn.active {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.28) 0%, rgba(194, 120, 3, 0.38) 100%);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: var(--color-gold-light);
  opacity: 1; /* highlighted */
  box-shadow: 
    0 4px 18px rgba(251, 191, 36, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.age-toggle-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 
    0 6px 24px rgba(251, 191, 36, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* 3D SHELF WIDGET CONTAINER */
.shelf-widget-container {
  width: 100%;
  max-width: 1400px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.shelf-outer-wrapper {
  width: 100%;
  position: relative;
  padding: 0.5rem 0; /* reduced from 2rem */
  perspective: 1200px; /* Crucial for 3D layout of the wooden shelf */
}

/* Scroll Arrows */
.scroll-arrow {
  position: absolute;
  top: 40%;
  transform: translateY(-50%);
  width: 50px; /* slightly smaller arrows */
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
/*   backdrop-filter: blur(15px); */

/*   -webkit-backdrop-filter: blur(15px); */

  color: var(--color-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.scroll-arrow:hover:not(:disabled) {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.35);
  transform: translateY(-50%) scale(1.08);
}

.scroll-arrow:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.arrow-left { left: 4%; }
.arrow-right { right: 4%; }

.books-scroller-container {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  width: 84%; /* Matches the physical wooden shelf width */
  max-width: 1100px; /* Matches the physical wooden shelf max-width */
  margin: 0 auto; /* Center it horizontally to align perfectly with the wooden shelf */
  padding: 2.2rem calc(50% - 82.5px) 4.2rem; /* responsive horizontal padding to center first/last books perfectly */
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  z-index: 3; /* Render books container completely above the wooden shelf layers */
}

@media (min-width: 1354px) {
  .books-scroller-container {
    padding-top: 2.8rem; /* ample vertical clearance for floating books on widescreen */
    padding-bottom: 5.6rem; /* elevated widescreen bottom nesting for optimal floating gap */
  }
}

.books-scroller-container::-webkit-scrollbar {
  display: none;
}

.books-track {
  display: flex;
  align-items: flex-end;
  gap: 2.2rem; /* snugger gap for beautiful close-set bookshelf library feel */
}

/* Sentinel markers */
.sentinel-left, .sentinel-right {
  width: 0;
  height: 0;
  visibility: hidden;
}

/* 3D BOOK CARDS */
.book-card {
  width: 165px; /* scaled down from 210px for ultimate space saving */
  height: 231px; /* scaled down from 294px - matches 1:1.4 aspect ratio */
  flex-shrink: 0; /* MANDATORY: Prevent cards from shrinking or stacking, keeping them horizontally locked in one line */
  scroll-snap-align: center;
  cursor: pointer;
  position: relative;
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), width 0.7s cubic-bezier(0.25, 1, 0.5, 1), translate 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0.45; /* Side books dimmed */
  transform: scale(0.8) translateZ(-50px);
  transform-origin: bottom center; /* Keep books aligned perfectly in one straight horizontal line */
  perspective: 1000px;
  
  /* Magical subtle floating animation using translate, keeping 3D transform separate */
  animation: floatBook 5s ease-in-out infinite;
  animation-delay: 0s;
}

/* Pause the gentle float animation on hover to allow smooth interactive focus */
.book-card:hover {
  animation-play-state: paused;
}

/* Stagger book float cycles for a more organic and magical behavior */
.book-card:nth-child(2n) {
  animation-delay: 1s;
}
.book-card:nth-child(3n) {
  animation-delay: 2.2s;
}
.book-card:nth-child(4n) {
  animation-delay: 3.5s;
}

@keyframes floatBook {
  0% {
    translate: 0 0;
  }
  50% {
    translate: 0 -18px; /* Gently floats 18px above the shelf */
  }
  100% {
    translate: 0 0;
  }
}

/* The actual 3D components of the book */
.book-3d-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
  transform: rotateY(-32deg); /* Default tilted perspective */
}

/* 3D Book Spine */
.book-spine {
  position: absolute;
  top: 0;
  left: 0;
  width: 18px; /* scaled down from 24px */
  height: 100%;
  background: var(--book-accent, #6366f1);
  transform: rotateY(-90deg) translateZ(9px); /* translateZ is half of spine width */
  transform-origin: left center;
  border-radius: 4px 0 0 4px;
  box-shadow: inset -6px 0 10px rgba(0, 0, 0, 0.4), 
              inset 2px 0 3px rgba(255, 255, 255, 0.2);
}

.book-spine::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 3px;
  height: 100%;
  background: rgba(0,0,0,0.25);
}

/* Book Cover Face */
.book-cover-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: translateZ(9px); /* Half of spine width */
  transform-origin: center center;
  border-radius: 0 8px 8px 0;
  box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.6), 
              inset 1px 1px 3px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.book-cover-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Center Snapped Active Book Styles */
.book-card.active {
  opacity: 1;
  transform: scale(1.1) translateZ(60px); /* Scales and pops forward in 3D, keeping its bottom edge perfectly aligned with the others */
  z-index: 5;
}

.book-card.active .book-3d-wrapper {
  transform: rotateY(0deg) translateZ(0); /* active book opens flat to face user */
}

/* Hover tilt, elevate, scale, and cast deep shadow effect */
.book-card:hover .book-3d-wrapper {
  transform: rotateY(-15deg) rotateX(8deg) translateY(-25px) scale(1.08);
}

.book-card.active:hover .book-3d-wrapper {
  transform: rotateY(5deg) rotateX(5deg) translateY(-25px) scale(1.08);
}

.book-card .book-cover-face {
  transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.6s ease;
}

.book-card:hover .book-cover-face {
  box-shadow: 15px 35px 50px rgba(0, 0, 0, 0.65), 
              0 0 30px var(--book-accent, rgba(255,255,255,0.25));
}

/* -----------------------------------------
   THE PHYSICAL CARVED WOODEN SHELF
   ----------------------------------------- */
.wooden-shelf {
  position: absolute;
  bottom: -2.8rem; /* Lowered shelf closer to the bottom to dramatically maximize the magical hovering gap */
  left: 50%;
  transform: translateX(-50%);
  width: 84%; /* Slightly smaller width for a sleeker, floating library feel */
  max-width: 1100px; /* Reduced max-width from 1300px for a more compact and elegant fit */
  z-index: 1; /* Render shelf completely behind and under the book cards */
  pointer-events: none;
}

.wooden-shelf-img {
  width: 100%;
  height: auto;
  display: block;
  /* Pre-baked high-fidelity glow on assets/shelf.png allows removing expensive CSS drop-shadow filters entirely, restoring 60fps scrolling! */
  will-change: filter, transform;
  transform: translate3d(0, 0, 0);
  
  /* Highly performant brightness-based shimmer animation (takes microseconds for GPU, preventing scroll jank!) */
  animation: shelfShimmer 8s ease-in-out infinite alternate;
}

@keyframes shelfShimmer {
  0% {
    filter: brightness(0.96);
  }
  50% {
    filter: brightness(1.04);
  }
  100% {
    filter: brightness(0.96);
  }
}

/* Radial light emission shining behind active book card */
.shelf-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 500px;
  height: 200px;
  background: radial-gradient(ellipse at center, var(--glow-color, rgba(251, 191, 36, 0.25)) 0%, transparent 70%);
  opacity: 0.75;
  mix-blend-mode: screen;
/*   filter: blur(20px); */

  transition: var(--transition-smooth);
  z-index: -1;
}

/* -----------------------------------------
   MAGICAL GOLD DUST UNDER THE SHELF
   ----------------------------------------- */
.shelf-magic-dust {
  position: absolute;
  bottom: -35px; /* Positions dust underneath the wood */
  left: 8%;
  width: 84%;
  height: 80px;
  pointer-events: none;
  z-index: 1; /* Renders just under the shelf image */
  overflow: visible;
}

.dust-spec {
  position: absolute;
  background: radial-gradient(circle, #fffef0 10%, var(--color-gold) 60%, transparent 100%);
  border-radius: 50%;
  opacity: 0;
  box-shadow: 0 0 8px var(--color-gold), 0 0 16px var(--color-gold-light);
/*   filter: blur(0.5px); */

  will-change: transform, opacity;
}

/* Individual particle configurations with staggered floating animations */
.spec-1  { width: 4px; height: 4px; left: 15%; bottom: 20%; animation: floatDust 7s infinite ease-in-out; animation-delay: 0.2s; }
.spec-2  { width: 6px; height: 6px; left: 28%; bottom: 40%; animation: floatDust 9s infinite ease-in-out; animation-delay: 1.5s; }
.spec-3  { width: 3px; height: 3px; left: 42%; bottom: 10%; animation: floatDust 6s infinite ease-in-out; animation-delay: 0.8s; }
.spec-4  { width: 5px; height: 5px; left: 55%; bottom: 30%; animation: floatDust 8s infinite ease-in-out; animation-delay: 2.2s; }
.spec-5  { width: 4px; height: 4px; left: 68%; bottom: 15%; animation: floatDust 7s infinite ease-in-out; animation-delay: 1.1s; }
.spec-6  { width: 5px; height: 5px; left: 82%; bottom: 35%; animation: floatDust 9s infinite ease-in-out; animation-delay: 0.5s; }
.spec-7  { width: 3px; height: 3px; left: 20%; bottom: 30%; animation: floatDust2 8s infinite ease-in-out; animation-delay: 3.1s; }
.spec-8  { width: 5px; height: 5px; left: 35%; bottom: 15%; animation: floatDust2 7s infinite ease-in-out; animation-delay: 0.4s; }
.spec-9  { width: 4px; height: 4px; left: 50%; bottom: 45%; animation: floatDust2 9s infinite ease-in-out; animation-delay: 1.9s; }
.spec-10 { width: 6px; height: 6px; left: 62%; bottom: 10%; animation: floatDust2 6s infinite ease-in-out; animation-delay: 2.7s; }
.spec-11 { width: 3px; height: 3px; left: 75%; bottom: 25%; animation: floatDust2 8s infinite ease-in-out; animation-delay: 0.9s; }
.spec-12 { width: 5px; height: 5px; left: 88%; bottom: 20%; animation: floatDust2 7s infinite ease-in-out; animation-delay: 1.3s; }

/* Dynamic float trajectories that drift upward and fade out */
@keyframes floatDust {
  0% {
    transform: translate3d(0, 30px, 0) scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 0.8;
  }
  60% {
    transform: translate3d(15px, -15px, 0) scale(1.1);
    opacity: 0.6;
  }
  85% {
    opacity: 0.3;
  }
  100% {
    transform: translate3d(-10px, -45px, 0) scale(0.5);
    opacity: 0;
  }
}

@keyframes floatDust2 {
  0% {
    transform: translate3d(0, 25px, 0) scale(0.5);
    opacity: 0;
  }
  25% {
    opacity: 0.9;
  }
  50% {
    transform: translate3d(-20px, -20px, 0) scale(1.2);
    opacity: 0.5;
  }
  80% {
    opacity: 0.3;
  }
  100% {
    transform: translate3d(15px, -50px, 0) scale(0.4);
    opacity: 0;
  }
}

/* -----------------------------------------
   ELEGANT GLASSMORPHIC DETAIL PANEL
   ----------------------------------------- */
.active-book-panel {
  display: none !important; /* Removed preview panel under the gliding shelf to focus 100% on the books centerpiece! */
  width: 95%;
  max-width: 360px; /* narrowed to 360px for ultimate compact fit */
  margin: 0.2rem auto 0; /* snug right up against the wooden shelf */
  position: relative;
  z-index: 10;
  animation: fadeInUp 1s ease both;
}

.panel-inner {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px; /* tighter modern corners */
  padding: 0.4rem 1.0rem; /* miniature padding */
  text-align: center;
  box-shadow: var(--glass-shadow);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.panel-inner::before {
  content: '';
  position: absolute;
  top: -150px;
  left: -150px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--glow-color, rgba(251,191,36,0.15)) 0%, transparent 70%);
  pointer-events: none;
  transition: var(--transition-smooth);
}

.book-emotion-tag {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.55rem; /* tiny miniature tag text */
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--emotion-color, var(--color-gold));
  border: 1px solid var(--emotion-color, var(--glass-border));
  padding: 0.1rem 0.4rem; /* tight miniature padding */
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 0.2rem; /* compact */
  box-shadow: 0 0 8px var(--glow-color, transparent);
  transition: var(--transition-smooth);
}

.book-detail-title {
  font-family: var(--font-serif-logo);
  font-size: 1.05rem; /* compact miniature title */
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-light);
  margin-bottom: 0.05rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.book-detail-subtitle {
  font-family: var(--font-serif-body);
  font-style: italic;
  font-weight: 400;
  font-size: 0.78rem; /* tiny subtitle */
  color: var(--color-peach);
  margin-bottom: 0.25rem; /* tiny margin */
  opacity: 0.85;
}

.book-detail-description {
  display: none !important; /* Hide description on the dashboard to draw 100% focus to the gliding books! */
}

.panel-actions {
  display: flex;
  gap: 0.4rem; /* compact actions gap */
  justify-content: center;
}

.btn-panel-primary, .btn-panel-secondary {
  font-family: var(--font-sans);
  font-size: 0.6rem; /* miniature button text */
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.8rem; /* snug miniature padding */
  border-radius: 15px; /* tight capsule buttons */
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-panel-primary {
  background: var(--emotion-gradient, linear-gradient(135deg, var(--color-gold) 0%, #d97706 100%));
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px var(--glow-color, rgba(251,191,36,0.3));
}

.btn-panel-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.15);
  box-shadow: 0 8px 25px var(--glow-color, rgba(251,191,36,0.5));
}

.btn-panel-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-light);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn-panel-secondary:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--emotion-color, var(--color-gold));
  box-shadow: 0 5px 15px rgba(255, 255, 255, 0.05);
}

/* -----------------------------------------
   5. PHILOSOPHY / ABOUT SECTION
   ----------------------------------------- */
.about-preview-section {
  padding: 120px 2rem;
  display: flex;
  justify-content: center;
  width: 100%;
}

.about-glass-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
/*   backdrop-filter: blur(20px); */

/*   -webkit-backdrop-filter: blur(20px); */

  box-shadow: var(--glass-shadow);
  border-radius: 30px;
  max-width: 1100px;
  width: 100%;
  padding: 5rem 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.about-tag {
  font-family: var(--font-sans);
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  display: inline-block;
}

.about-title {
  font-family: var(--font-serif-logo);
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 2rem;
}

.about-desc {
  font-family: var(--font-serif-body);
  font-size: 1.05rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
  line-height: 1.8;
}

.philosophy-bullets {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.bullet-item {
  display: flex;
  gap: 1.25rem;
}

.bullet-icon {
  font-size: 1.5rem;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.05);
}

.bullet-item strong {
  display: block;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.2rem;
}

.bullet-item p {
  font-family: var(--font-serif-body);
  font-size: 0.95rem;
  color: var(--color-text-muted);
}

/* About Magical Visual Ring Frame */
.circle-illustration-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.circle-image-frame {
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  border: 6px solid var(--glass-border);
  box-shadow: 0 15px 40px rgba(0,0,0,0.6), 0 0 30px rgba(251,191,36,0.15);
  z-index: 2;
  position: relative;
}

.magic-circle-back {
  position: absolute;
  top: -10px;
  left: -10px;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  border: 1px dashed rgba(251, 191, 36, 0.35);
  z-index: 1;
  animation: spin 30s linear infinite;
}

.magic-particles-ring {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  border: 1px solid rgba(251, 191, 36, 0.12);
  z-index: 1;
  animation: spinCounter 45s linear infinite;
}

/* -----------------------------------------
   6. AMBIENT AUDIO WIDGET (Bottom Left Relocation)
   ----------------------------------------- */
.ambient-audio-widget {
  position: fixed !important;
  bottom: 30px !important;
  left: 30px !important;
  z-index: 999999 !important;
}

.audio-toggle-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(14, 8, 30, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.25);
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease,
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 10px rgba(251, 191, 36, 0.05);
  z-index: 999;
}

.audio-toggle-btn:hover {
  background: rgba(22, 12, 45, 0.95);
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.4);
}

.audio-toggle-btn:active {
  transform: translateY(-2px) scale(0.98);
}

.audio-toggle-btn.playing {
  background: rgba(25, 15, 50, 0.9);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.4), inset 0 0 8px rgba(251, 191, 36, 0.15);
}

.audio-icon-wrapper {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chime-svg {
  transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  color: var(--color-gold);
  transform-origin: top center;
}

.audio-toggle-btn.playing .chime-svg {
  animation: chimeSway 2.5s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

@keyframes chimeSway {
  0% {
    transform: rotate(-6deg);
  }
  100% {
    transform: rotate(6deg);
  }
}

/* Cozy Tea Menu Controls Panel (Bottom Left Relocation) */
.audio-controls-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  top: auto;
  right: auto;
  background: rgba(18, 10, 36, 0.96);
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem;
  width: 290px;
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  z-index: 1000;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  max-height: 480px;
  overflow-y: auto;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.audio-controls-panel.hidden {
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  display: flex !important; /* Keep flex structure but hide via opacity and pointer events for transitions */
}

/* -----------------------------------------
   6. CONTACT SECTION
   ----------------------------------------- */
.contact-section {
  padding: 40px 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 5;
  min-height: 85vh; /* Center on screen elegantly */
}

.contact-glass-container {
  max-width: 800px;
  width: 100%;
  background: linear-gradient(135deg, rgba(20, 10, 38, 0.9) 0%, rgba(12, 6, 24, 0.95) 100%);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 24px;
  padding: 2.2rem 2.5rem;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 1.2s cubic-bezier(0.25, 1, 0.5, 1) both;
}

.contact-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.contact-tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold);
  display: inline-block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.contact-title {
  font-family: var(--font-serif-logo);
  font-size: clamp(1.4rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: linear-gradient(to bottom, #fff5cc 0%, #dca626 60%, #8c6209 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7));
  margin-bottom: 0.75rem;
}

.contact-desc {
  font-family: var(--font-serif-body);
  font-size: 1.05rem;
  font-style: italic;
  color: var(--color-text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.5;
  opacity: 0.9;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: left;
}

.form-group label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-gold-light);
  opacity: 0.9;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: rgba(8, 4, 18, 0.65);
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.form-group textarea {
  height: 100px;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-muted);
  opacity: 0.6;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
  background: rgba(8, 4, 18, 0.8);
}

.form-group select option {
  background-color: var(--color-bg-deep);
  color: var(--color-text-light);
  padding: 10px;
}

.form-submit-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.send-icon {
  transition: transform 0.3s ease;
}

.btn-primary:hover .send-icon {
  transform: translate(3px, -3px);
}

/* Success Overlay */
.contact-success-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(14, 8, 30, 0.96);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  z-index: 10;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.contact-success-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.success-card {
  text-align: center;
  max-width: 500px;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.contact-success-overlay:not(.hidden) .success-card {
  transform: scale(1);
}

.success-teapot {
  margin-bottom: 0.5rem;
}

.teapot-svg {
  filter: drop-shadow(0 2px 10px rgba(251, 191, 36, 0.5));
}

.success-card h3 {
  font-family: var(--font-serif-logo);
  font-size: 2rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

.success-card p {
  font-family: var(--font-serif-body);
  font-size: 1.1rem;
  color: var(--color-peach);
  line-height: 1.6;
  margin: 0;
}

.success-card strong {
  color: var(--color-gold-light);
}

#btn-success-ok {
  margin-top: 0.5rem;
}

/* -----------------------------------------
   7. FOOTER
   ----------------------------------------- */
.main-footer {
  position: relative;
  background: rgba(8, 4, 18, 0.9);
  border-top: 1px solid var(--glass-border);
  padding: 80px 2rem 40px;
  z-index: 5;
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 4.5rem;
}

.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-logo-img {
  height: 50px;
  width: 50px;
  filter: drop-shadow(0 0 5px rgba(251,191,36,0.3));
}

.footer-brand-name {
  font-family: var(--font-serif-logo);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--color-text-light);
  text-transform: uppercase;
}

.footer-tagline {
  font-family: var(--font-serif-body);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.newsletter-form-container h4 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-light);
  margin-bottom: 0.35rem;
}

.newsletter-form-container p {
  font-family: var(--font-serif-body);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.15rem;
}

.newsletter-form {
  display: flex;
  width: 100%;
  max-width: 380px;
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.02);
}

.newsletter-form input {
  flex-grow: 1;
  background: none;
  border: none;
  padding: 0.85rem 1.5rem;
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

.newsletter-form input::placeholder {
  color: rgba(255,255,255,0.25);
}

.newsletter-form button {
  background: var(--color-gold);
  color: var(--color-bg-deep);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 1.5rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.newsletter-form button:hover {
  background: var(--color-gold-light);
}

/* Links Columns */
.footer-links-col h3 {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  margin-bottom: 1.75rem;
}

.footer-links-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links-col a {
  font-family: var(--font-serif-body);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.footer-links-col a:hover {
  color: var(--color-text-light);
  padding-left: 5px;
}

.footer-divider {
  border: none;
  height: 1px;
  background: radial-gradient(circle, var(--glass-border) 0%, transparent 80%);
  margin: 3.5rem 0 2rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--color-text-muted);
  opacity: 0.7;
}

/* Social icons layout */
.footer-socials {
  display: flex;
  gap: 1.25rem;
}

.social-icon {
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.social-icon svg {
  transition: var(--transition-fast);
}

.social-icon:hover {
  border-color: var(--color-gold);
  transform: translateY(-3px);
}

.social-icon:hover svg {
  transform: scale(1.15);
}

.social-icon.youtube:hover {
  color: #ff0000;
  box-shadow: 0 0 12px rgba(255, 0, 0, 0.35);
  background: rgba(255, 0, 0, 0.05);
}

.social-icon.instagram:hover {
  color: #e1306c;
  box-shadow: 0 0 12px rgba(225, 48, 108, 0.35);
  background: rgba(225, 48, 108, 0.05);
}

.social-icon.pinterest:hover {
  color: #bd081c;
  box-shadow: 0 0 12px rgba(189, 8, 28, 0.35);
  background: rgba(189, 8, 28, 0.05);
}

.social-icon.twitter:hover {
  color: #1da1f2;
  box-shadow: 0 0 12px rgba(29, 161, 242, 0.35);
  background: rgba(29, 161, 242, 0.05);
}

/* -----------------------------------------
   8. ANIMATIONS KEYFRAMES
   ----------------------------------------- */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinCounter {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes steamRise {
  0% {
    transform: translateY(0) scaleY(0.8) scaleX(1);
    opacity: 0;
  }
  40% {
    opacity: 1;
    transform: translateY(-4px) scaleY(1.1) scaleX(0.85);
  }
  80% {
    opacity: 0.3;
    transform: translateY(-9px) scaleY(0.9) scaleX(0.7);
  }
  100% {
    transform: translateY(-12px) scaleY(0.7) scaleX(0.5);
    opacity: 0;
  }
}

/* -----------------------------------------
   9. RESPONSIVE MEDIA QUERIES
   ----------------------------------------- */
@media (max-width: 992px) {
  .nav-group {
    gap: 1.5rem;
  }
  
  .books-scroller-container {
    width: 84%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem calc(50% - 82.5px) calc(8vw + 1.5rem);
  }
  
  .about-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .about-visual-column {
    display: flex;
    justify-content: center;
  }
  
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

@media (max-width: 768px) {
  .main-header {
    height: 75px;
  }

  .nav-container {
    height: 75px;
    padding: 0.5rem 1.5rem;
  }

  /* Hamburger Menu Layout & SVG Teapot resizing */
  .mobile-toggle {
    display: flex;
  }

  .nav-logo {
    width: auto;
    margin: 0;
  }

  .logo-teapot-svg {
    width: 52px;
    height: 52px;
    margin-top: 5px;
  }

  /* Split Nav-Left and Nav-Right slide-in stacked mobile drawers */
  .nav-left, .nav-right {
    position: fixed;
    right: -100%;
    width: 100%;
    background: rgba(14, 8, 30, 0.98);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    flex-direction: column;
    align-items: center;
    transition: var(--transition-smooth);
    z-index: 99;
  }

  .nav-left {
    top: 75px;
    height: calc(50vh - 37.5px);
    justify-content: flex-end;
    gap: 1.65rem;
    padding-bottom: 1rem;
  }

  .nav-right {
    top: calc(50vh + 37.5px);
    height: calc(50vh - 37.5px);
    justify-content: flex-start;
    gap: 1.65rem;
    padding-top: 1rem;
    padding-bottom: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    overflow-y: auto;
  }

  .nav-container.open .nav-left {
    right: 0;
  }

  .nav-container.open .nav-right {
    right: 0;
  }

  .lang-selector {
    margin-top: 0.5rem;
  }

  /* Relocated outside the navigation drawer flow */

  .books-scroller-container {
    width: 84%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem calc(50% - 90px) calc(8vw + 1.5rem); /* centers mobile book covers (180px width) */
  }

  .book-card {
    width: 180px;
    height: 252px;
  }
  
  .book-spine {
    width: 20px;
    transform: rotateY(-90deg) translateZ(10px);
  }
  
  .book-cover-face {
    transform: translateZ(10px);
  }
  
  .panel-inner {
    padding: 1.1rem 1.2rem;
  }
  
  .book-detail-title {
    font-size: 1.35rem;
  }
  
  .panel-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .btn-panel-primary, .btn-panel-secondary {
    width: 100%;
  }

  .about-glass-container {
    padding: 3rem 1.75rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }

  /* Contact Mobile Styles */
  .form-row.split {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
  
  .contact-glass-container {
    padding: 2.5rem 1.5rem;
  }
}

/* =========================================
   6. DEDICATED LANDING PAGES & UTILITIES
   ========================================= */
.landing-section {
  min-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 130px 2rem 80px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.landing-header {
  text-align: center;
  margin: 0 auto 3.5rem;
  max-width: 700px;
}

.landing-tag {
  display: inline-block;
  font-family: var(--font-sans);
  color: var(--color-gold-light);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 0.75rem;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.35);
}

.landing-title {
  font-family: var(--font-serif-logo);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 1.25rem;
  color: var(--color-gold-light);
  text-shadow: 0 0 15px rgba(251, 191, 36, 0.45);
}

.landing-desc {
  font-family: var(--font-serif-body);
  font-size: 1.05rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}
/* --- LIBRARY PAGE SPECIFIC STYLES --- */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 3.5rem 2.5rem;
  width: 100%;
  padding-bottom: 2rem;
}

.library-card-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.library-book-container {
  perspective: 1000px;
  margin-bottom: -4px; /* Rest beautifully and nicely on the wooden shelf */
  cursor: pointer;
  transition: var(--transition-smooth);
  z-index: 10;
}

.library-book-container:hover {
  transform: translateY(-12px) scale(1.03);
}

.library-book-container .book-3d-wrapper {
  width: 160px;
  height: 230px;
  transform: rotateY(-18deg);
  transform-style: preserve-3d;
  box-shadow: 15px 15px 25px rgba(0, 0, 0, 0.45);
  transition: var(--transition-smooth);
}

.library-book-container:hover .book-3d-wrapper {
  transform: rotateY(-5deg);
  box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.6);
}

.library-shelf {
  width: 100%;
  max-width: 280px;
  margin-top: -2px; /* Pulls shelf up slightly to sit nicely with the book bottom */
  margin-bottom: 1.5rem;
  position: relative;
}

.library-shelf-img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

.library-shelf-glow {
  position: absolute;
  top: 0;
  left: 10%;
  width: 80%;
  height: 10px;
  background: var(--glow-color, rgba(251, 191, 36, 0.25));
  filter: blur(10px);
  pointer-events: none;
}

.library-card-details {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  width: 100%;
  text-align: center;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.library-card-wrapper:hover .library-card-details {
  border-color: rgba(251, 191, 36, 0.25);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 15px rgba(251, 191, 36, 0.08);
}

.library-card-tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--emotion-color, var(--color-gold));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.library-card-title {
  font-family: var(--font-serif-logo);
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: var(--color-text-light);
}

.library-card-desc {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.library-card-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.library-card-actions button, .library-card-actions a {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  border-radius: 8px;
}

/* --- SHOP PAGE SPECIFIC STYLES --- */
.shop-section-title {
  font-family: var(--font-serif-decorative);
  font-size: 1.75rem;
  color: var(--color-gold-light);
  margin: 3rem 0 1.5rem;
  width: 100%;
  text-align: left;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  padding-bottom: 0.5rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.25rem;
  width: 100%;
  margin-bottom: 2rem;
}

.shop-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition-smooth);
}

.shop-card:hover {
  transform: translateY(-8px);
  border-color: rgba(251, 191, 36, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.65), 0 0 20px rgba(251, 191, 36, 0.1);
}

.shop-card-image {
  height: 200px;
  width: 100%;
  background: rgba(14, 8, 30, 0.45);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.shop-card-image img {
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.5));
  transition: var(--transition-smooth);
}

.shop-card:hover .shop-card-image img {
  transform: scale(1.05) rotate(1deg);
}

.shop-card-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.shop-card-category {
  font-size: 0.7rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.shop-card-title {
  font-family: var(--font-serif-logo);
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: 0.5rem;
  transition: var(--transition-fast);
}

.shop-card-title[onclick]:hover {
  color: var(--color-gold-light);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.45);
}

.shop-card-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.shop-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.shop-card-price {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-gold-light);
}

.shop-card-btn {
  background: var(--color-gold);
  border: none;
  border-radius: 8px;
  color: hsl(260, 45%, 4%);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.shop-card-btn:hover {
  background: var(--color-gold-light);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
  transform: translateY(-2px);
}

.shop-card-btn svg {
  transition: transform 0.2s ease;
}

.shop-card-btn:hover svg {
  transform: translateX(2px);
}

/* --- RESOURCES SPECIFIC STYLES --- */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 2.5rem;
  width: 100%;
}

.resource-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: var(--transition-smooth);
}

.resource-card:hover {
  transform: translateY(-8px);
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65), 0 0 25px rgba(251, 191, 36, 0.12);
}

.resource-icon-frame {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--color-gold-light);
  box-shadow: inset 0 0 15px rgba(251, 191, 36, 0.05);
}

.resource-card-title {
  font-family: var(--font-serif-logo);
  font-size: 1.35rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.resource-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  flex-grow: 1;
}

/* --- ACCOUNT / FANTASY LEDGER SPECIFIC STYLES --- */
.account-glass-container {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 3rem;
  width: 100%;
  max-width: 520px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
  transition: height 0.4s ease;
}

.account-tabs {
  display: flex;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  margin-bottom: 2rem;
  gap: 1.5rem;
}

.account-tab-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-family: var(--font-serif-logo);
  font-size: 1.1rem;
  font-weight: 600;
  padding-bottom: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.account-tab-btn:hover {
  color: var(--color-text-light);
}

.account-tab-btn.active {
  color: var(--color-gold-light);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.account-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold-light);
}

.account-panel {
  display: none;
  animation: fadeIn 0.4s ease;
}

.account-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.account-form .form-group {
  margin-bottom: 1.5rem;
}

.account-form label {
  display: block;
  font-size: 0.8rem;
  color: var(--color-gold-light);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.account-form input {
  width: 100%;
  background: rgba(14, 8, 30, 0.5);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.account-form input:focus {
  outline: none;
  border-color: var(--color-gold-light);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

.account-checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1.25rem 0 1.75rem;
}

.account-checkbox-group input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.account-checkbox-group label {
  display: inline;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
}

/* --- CART / SHOPPING BAGGAGE SPECIFIC STYLES --- */
.cart-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 2.5rem;
  width: 100%;
  align-items: flex-start;
}

.cart-items-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.cart-empty-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
  text-align: center;
  padding: 2rem 0;
  color: var(--color-text-muted);
}

.cart-empty-message .teapot-svg {
  margin-bottom: 1.5rem;
  animation: teaWobble 4s ease-in-out infinite;
}

@keyframes teaWobble {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-5deg); }
}

.cart-empty-message h3 {
  font-family: var(--font-serif-logo);
  color: var(--color-text-light);
  font-size: 1.4rem;
  margin-bottom: 0.75rem;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cart-item-row {
  display: grid;
  grid-template-columns: 80px 1.5fr 1fr auto;
  gap: 1.25rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.1);
}

.cart-item-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-item-cover {
  height: 90px;
  background: rgba(14, 8, 30, 0.4);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.cart-item-cover img {
  height: 80%;
  object-fit: contain;
}

.cart-item-title-col h4 {
  font-family: var(--font-serif-logo);
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 0.25rem;
}

.cart-item-title-col span {
  font-size: 0.75rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cart-item-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: center;
}

.cart-item-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.05);
  color: var(--color-gold-light);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.cart-item-qty-btn:hover {
  background: var(--color-gold);
  color: hsl(260, 45%, 4%);
  border-color: var(--color-gold);
}

.cart-item-qty-val {
  width: 32px;
  text-align: center;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--color-text-light);
}

.cart-item-price-col {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cart-item-row-total {
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--color-gold-light);
  font-size: 1.05rem;
}

.cart-item-row-price {
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.cart-item-remove-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px;
  transition: var(--transition-fast);
}

.cart-item-remove-btn:hover {
  color: hsl(0, 85%, 68%);
  transform: scale(1.1);
}

.cart-summary-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.cart-summary-title {
  font-family: var(--font-serif-logo);
  font-size: 1.35rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(251, 191, 36, 0.15);
  padding-bottom: 0.75rem;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.cart-summary-row.total {
  color: var(--color-text-light);
  font-family: var(--font-serif-logo);
  font-size: 1.25rem;
  font-weight: bold;
  border-top: 1px solid rgba(251, 191, 36, 0.15);
  padding-top: 1rem;
  margin-top: 1rem;
  margin-bottom: 1.75rem;
}

.cart-summary-row.total span:last-child {
  color: var(--color-gold-light);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

/* --- OVERLAY SUCCESS CARD (Teacup anim check) --- */
.checkout-success-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 5, 20, 0.85);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.checkout-success-overlay.hidden {
  display: none !important;
}

.success-teapot {
  animation: floatTeacup 3s ease-in-out infinite;
}

@keyframes floatTeacup {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Responsive adjustments for grids & forms */
@media (max-width: 992px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .landing-section {
    padding-top: 110px;
    padding-bottom: 50px;
  }
  
  .landing-title {
    font-size: 2rem;
  }
  
  .library-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
  
  .account-glass-container {
    padding: 2rem 1.5rem;
  }
  
  .cart-items-panel {
    padding: 1.5rem 1rem;
  }
  
  .cart-item-row {
    grid-template-columns: 60px 1.2fr 1fr auto;
    gap: 0.8rem;
  }
  
  .cart-item-cover {
    height: 70px;
  }
  
  .cart-item-title-col h4 {
    font-size: 0.95rem;
  }
}

/* --- CHECKOUT FORM & LEDGER STYLES --- */
.discount-code-container {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed rgba(251, 191, 36, 0.2);
}

.discount-code-container label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.5rem;
}

.discount-input-group {
  display: flex;
  gap: 8px;
}

.discount-input-group input {
  flex-grow: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition-fast);
}

.discount-input-group input:focus {
  border-color: var(--color-gold);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

.discount-apply-btn {
  background: var(--color-gold);
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  color: #0e081e;
  font-family: var(--font-sans);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.discount-apply-btn:hover {
  background: var(--color-gold-light);
  transform: translateY(-1px);
}

.discount-status-msg {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: var(--transition-fast);
}

/* Checkout Modal Overlay */
.checkout-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 5, 20, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  padding: 2rem 1rem;
}

.checkout-modal-overlay.hidden {
  display: none !important;
}

.checkout-modal-card {
  background: rgba(18, 10, 36, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 580px;
  box-shadow: var(--glass-shadow);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.checkout-modal-card::-webkit-scrollbar {
  width: 6px;
}

.checkout-modal-card::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.2);
  border-radius: 3px;
}

.checkout-modal-tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--color-gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  margin-bottom: 0.25rem;
  display: block;
}

.checkout-modal-title {
  font-family: var(--font-serif-logo);
  font-size: 1.8rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.checkout-step-title {
  font-family: var(--font-serif-logo);
  font-size: 1.05rem;
  color: var(--color-gold-light);
  margin-bottom: 1rem;
  border-bottom: 1px dashed rgba(251, 191, 36, 0.15);
  padding-bottom: 0.5rem;
}

.checkout-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field.full-width {
  grid-column: span 2;
}

.form-field label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  font-weight: 500;
}

.form-field input, .form-field select {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-field input:focus {
  border-color: var(--color-gold);
  outline: none;
  background: rgba(255, 255, 255, 0.08);
}

/* Modal Close Button */
.modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  padding: 4px;
}

.modal-close-btn:hover {
  color: hsl(0, 85%, 68%);
  transform: scale(1.1);
}

/* Payment Tabs */
.payment-tabs {
  display: flex;
  border-radius: 8px;
  background: rgba(14, 8, 30, 0.45);
  padding: 4px;
  border: 1px solid var(--glass-border);
  margin-bottom: 1.25rem;
}

.payment-tab-btn {
  flex-grow: 1;
  border: none;
  background: none;
  color: var(--color-text-muted);
  padding: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition-fast);
}

.payment-tab-btn.active {
  background: var(--color-gold);
  color: #0e081e;
  box-shadow: 0 4px 10px rgba(251, 191, 36, 0.2);
}

.payment-section-content.hidden {
  display: none !important;
}

/* BTC Specific style */
.btc-ledger-card {
  background: rgba(251, 191, 36, 0.04);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.btc-qr-container {
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 15px rgba(251, 191, 36, 0.1);
}

.btc-instructions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btc-amount-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  font-weight: 500;
}

.btc-amount-value {
  font-family: var(--font-serif-logo);
  font-size: 1.45rem;
  color: var(--color-gold-light);
  font-weight: bold;
}

.btc-rate-caption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
}

.btc-copy-btn {
  background: none;
  border: none;
  color: var(--color-gold-light);
  font-weight: bold;
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px 6px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.btc-copy-btn:hover {
  background: rgba(251, 191, 36, 0.2);
}

@media (max-width: 580px) {
  .checkout-form-grid {
    grid-template-columns: 1fr;
  }
  .form-field.full-width {
    grid-column: span 1;
  }
}

/* Express Pay Buttons */
.express-pay-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  transition: var(--transition-fast);
}

.express-pay-btn.apple-pay {
  background: #000;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.express-pay-btn.apple-pay:hover {
  background: #151516;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.express-pay-btn.google-pay {
  background: #111314;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}

.express-pay-btn.google-pay:hover {
  background: #1b1d1f;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

/* --- WHIMSICAL GLASSMORPHIC LANGUAGE SELECTOR --- */
.lang-selector {
  position: relative;
  display: inline-block;
  font-family: var(--font-sans);
}

.lang-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  color: var(--color-text-light);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition-fast);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lang-btn:hover {
  border-color: var(--color-gold-light);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.lang-globe-icon {
  color: var(--color-gold);
  transition: var(--transition-smooth);
}

.lang-btn:hover .lang-globe-icon {
  transform: rotate(30deg);
}

.lang-chevron-icon {
  opacity: 0.7;
  transition: var(--transition-fast);
}

.lang-btn:hover .lang-chevron-icon {
  opacity: 1;
  transform: translateY(1px);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: rgba(15, 8, 30, 0.98);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65), 0 0 20px rgba(251, 191, 36, 0.08);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 130px;
  z-index: 1000;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: langFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.lang-dropdown.hidden {
  display: none;
}

.lang-dropdown button {
  background: none;
  border: none;
  color: var(--color-text-light);
  padding: 0.45rem 0.75rem;
  text-align: left;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  width: 100%;
}

.lang-dropdown button:hover {
  background: rgba(251, 191, 36, 0.16);
  color: var(--color-gold-light);
  padding-left: 0.9rem;
}

@keyframes langFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Adjustments for Mobile Nav drawer */
@media (max-width: 768px) {
  .lang-selector {
    margin: 0.25rem 0;
  }
  
  .lang-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  
  @keyframes langFadeIn {
    from {
      opacity: 0;
      transform: translate(-50%, -8px) scale(0.95);
    }
    to {
      opacity: 1;
      transform: translate(-50%, 0) scale(1);
    }
  }
}





/* --- DYNAMIC COZY STORE CONTROLS --- */
.shop-controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem auto 3rem;
  padding: 1rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  max-width: 1200px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 10;
  position: relative;
}

.shop-search-wrapper {
  position: relative;
  width: 30%;
  min-width: 220px;
}

.shop-search-wrapper input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  border-radius: 30px;
  border: 1px solid var(--glass-border);
  background: rgba(14, 8, 30, 0.6);
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition-fast);
}

.shop-search-wrapper input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.18);
  background: rgba(14, 8, 30, 0.85);
}

.shop-search-wrapper .search-icon {
  position: absolute;
  left: 0.95rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gold-light);
  opacity: 0.6;
  pointer-events: none;
  transition: var(--transition-fast);
}

.shop-search-wrapper input:focus + .search-icon {
  opacity: 1;
  color: var(--color-gold);
}

.shop-filter-tabs {
  display: flex;
  gap: 0.65rem;
  justify-content: center;
  align-items: center;
}

.filter-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: var(--color-text-muted);
  padding: 0.55rem 1.2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-light);
  border-color: rgba(251, 191, 36, 0.35);
}

.filter-tab.active {
  background: rgba(251, 191, 36, 0.15);
  color: var(--color-gold-light);
  border-color: var(--color-gold);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.25);
}

.shop-sort-wrapper select {
  background: rgba(14, 8, 30, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: var(--color-text-light);
  padding: 0.65rem 1.3rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.shop-sort-wrapper select:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
}

/* --- RATINGS & BADGES STYLES --- */
.shop-card-rating {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  margin: 0.35rem 0 0.6rem;
}

.rating-stars {
  color: var(--color-gold);
  letter-spacing: 1px;
  text-shadow: 0 0 5px rgba(251, 191, 36, 0.3);
}

.rating-count {
  color: var(--color-text-muted);
}

.stock-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
  font-family: var(--font-sans);
}

.stock-badge.in-stock {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.stock-badge.limited {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.22);
  animation: pulseStock 2s infinite;
}

@keyframes pulseStock {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.75;
  }
}

/* --- SHOP EMPTY STATE --- */
.shop-empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  max-width: 600px;
  margin: 4rem auto;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: shopFadeIn 0.4s ease;
}

.empty-state-cup {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  display: inline-block;
  animation: floatCup 3s ease-in-out infinite;
}

.shop-empty-state h3 {
  font-family: var(--font-serif-logo);
  color: var(--color-gold-light);
  margin-bottom: 0.75rem;
  font-size: 1.4rem;
}

.shop-empty-state p {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

@keyframes floatCup {
  0%, 100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-8px) rotate(5deg);
  }
}

@keyframes shopFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .shop-controls-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 1.2rem;
  }
  .shop-search-wrapper, .shop-sort-wrapper select {
    width: 100%;
  }
  .shop-filter-tabs {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}


/* --- CHECKOUT AUTH OPTIONS --- */
.checkout-auth-options {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 0.5rem;
  background: rgba(14, 8, 30, 0.4);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
}

.auth-option {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: var(--transition-fast);
  border: 1px solid transparent;
}

.auth-option input[type="radio"] {
  accent-color: var(--color-gold);
  cursor: pointer;
}

.auth-option.active {
  background: rgba(255, 255, 255, 0.05);
  color: var(--color-gold-light);
  border-color: rgba(251, 191, 36, 0.15);
}

.checkout-auth-form {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: rgba(251, 191, 36, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  animation: authSlideDown 0.3s ease;
}

.auth-form-row {
  display: flex;
  gap: 0.5rem;
}

.auth-form-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(14, 8, 30, 0.8);
  color: var(--color-text-light);
  font-size: 0.8rem;
  outline: none;
}

.auth-form-row input:focus {
  border-color: var(--color-gold);
}

.auth-submit-btn {
  background: var(--color-gold);
  border: none;
  color: #000;
  font-weight: 700;
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: var(--transition-fast);
}

.auth-submit-btn:hover {
  background: var(--color-gold-light);
  transform: translateY(-1px);
}

.auth-status-msg {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  min-height: 15px;
  font-family: var(--font-sans);
}

.auth-redirect-note {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: 0.6rem;
  line-height: 1.4;
  font-style: italic;
}

@keyframes authSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Utility Hidden Class for Interactive Wizards and Modals */
.hidden {
  display: none !important;
}

/* --- SCROLL TO TOP FLOATING BUTTON --- */
.scroll-up-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(14, 8, 30, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.25);
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 10px rgba(251, 191, 36, 0.05);
  opacity: 0;
  pointer-events: none;
  transform: translateY(15px);
  transition: 
    opacity 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.scroll-up-btn.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-up-btn:hover {
  background: rgba(22, 12, 45, 0.95);
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.4);
}

.scroll-up-btn:active {
  transform: translateY(-2px) scale(0.98);
}

.scroll-up-btn svg {
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.scroll-up-btn:hover svg {
  transform: translateY(-2px);
}

/* Responsiveness for mobile viewport */
@media (max-width: 768px) {
  .scroll-up-btn {
    bottom: 24px;
    right: 24px;
    width: 44px;
    height: 44px;
  }
  .ambient-audio-widget {
    bottom: 24px !important;
    left: 24px !important;
  }
  .audio-controls-panel {
    width: 260px !important;
    padding: 1.2rem !important;
  }
}

/* --- EXPANDED AMBIENCE & MUSIC CONSOLE STYLES --- */
.audio-controls-panel {
  background: rgba(18, 10, 36, 0.96) !important;
  border: 1.5px solid var(--glass-border);
  border-radius: 24px;
  padding: 1.5rem !important;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(251, 191, 36, 0.08) !important;
  width: 290px !important;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  z-index: 1001;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.audio-panel-header {
  border-bottom: 1px dashed rgba(251, 191, 36, 0.2);
  padding-bottom: 0.6rem;
  margin-bottom: 0.2rem;
}

.audio-panel-header h4 {
  font-family: var(--font-serif-logo);
  color: var(--color-text-light);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.15rem;
  text-transform: uppercase;
}

.audio-panel-header p {
  font-family: var(--font-sans);
  color: var(--color-text-muted);
  font-size: 0.7rem;
  font-style: italic;
}

.audio-section-title {
  font-family: var(--font-serif-logo);
  font-size: 0.75rem;
  color: var(--color-gold-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

/* Preset Scenes Grid */
.preset-scenery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0.4rem;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 10px;
  color: var(--color-text-light);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 8px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-fast);
}

.preset-btn:hover {
  background: rgba(251, 191, 36, 0.06);
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.preset-btn.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.15);
}

/* Sound Blender Slider Layouts */
.panel-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 0.6rem;
}

.panel-row-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-row-info label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.volume-val-badge {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  color: var(--color-gold);
  font-weight: bold;
}

/* Redesigned Premium Range Sliders */
.audio-controls-panel input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  margin: 6px 0;
  transition: var(--transition-fast);
}

.audio-controls-panel input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  border-radius: 2px;
}

.audio-controls-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--color-gold);
  cursor: pointer;
  margin-top: -4px;
  transition: var(--transition-fast);
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.audio-controls-panel input[type="range"]:hover::-webkit-slider-thumb {
  background: var(--color-gold-light);
  transform: scale(1.2);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.9);
}

/* Magic Melodies Styling */
.melody-choices-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 0.4rem;
}

.melody-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 10px;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: center;
}

.melody-btn:hover {
  background: rgba(251, 191, 36, 0.05);
  border-color: var(--color-gold-light);
  color: var(--color-text-light);
}

/* Magic Melodies active state shadow */
.melody-btn.active {
  background: rgba(251, 191, 36, 0.15);
  border-color: var(--color-gold);
  color: var(--color-gold-light);
  box-shadow: 0 0 8px rgba(251, 191, 36, 0.2);
}

/* --- WHIMSICAL LIBRARY BOOKSHELF PREVIEW OVERLAY --- */
.library-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 4, 16, 0.85);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.library-preview-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.library-preview-modal {
  background: rgba(18, 12, 32, 0.88);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  width: 100%;
  max-width: 1020px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.8), 0 0 40px rgba(251, 191, 36, 0.05);
  position: relative;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 2.5rem;
  padding: 2.5rem;
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: thin;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  
  /* Stable fade-in to prevent shifting coordinate issues during book cover flight */
  opacity: 0;
  transition: opacity 0.5s ease;
}

.library-preview-overlay.visible .library-preview-modal {
  opacity: 1;
}

.library-preview-modal::-webkit-scrollbar {
  width: 6px;
}

.library-preview-modal::-webkit-scrollbar-thumb {
  background: rgba(251, 191, 36, 0.2);
  border-radius: 3px;
}

/* Close Button */
.close-reading-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.15);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--color-gold-light);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.close-reading-btn:hover {
  background: rgba(251, 191, 36, 0.12);
  border-color: var(--color-gold);
  color: var(--color-gold);
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.2);
}

/* Left Page: Double open Ghibli storybook */
.open-storybook {
  background: #fdfaf2;
  border: 7px solid #5d4037;
  border-radius: 16px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), inset 0 0 40px rgba(93, 64, 55, 0.15);
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 440px;
  position: relative;
  overflow: hidden;
  color: #3e2723;
}

/* Spine shadow divider down center */
.open-storybook::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  width: 14px;
  height: 100%;
  background: linear-gradient(to right, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.05) 30%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.05) 70%, rgba(0,0,0,0.15) 100%),
              linear-gradient(to bottom, #4e342e, #3e2723);
  transform: translateX(-50%);
  z-index: 5;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
}

/* Cover Side (Left) */
.storybook-cover-side {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(93, 64, 55, 0.05);
  padding: 1.5rem;
  border-right: 1px solid rgba(62, 39, 35, 0.08);
}

.storybook-cover-side img {
  width: 100%;
  max-width: 190px;
  height: auto;
  border-radius: 8px;
  box-shadow: 5px 10px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.4s ease;
}

.storybook-cover-side img:hover {
  transform: scale(1.02) rotate(-1deg);
}

/* Reading Side (Right) */
.storybook-story-side {
  padding: 2.2rem 1.8rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

/* Parchment texture paper overlay */
.storybook-story-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 60%, rgba(93, 64, 55, 0.04) 100%);
  pointer-events: none;
  z-index: 2;
}

/* Story page text */
.parchment-page-text {
  font-family: var(--font-serif-body);
  font-size: 1.02rem;
  line-height: 1.7;
  text-align: justify;
  color: #4e342e;
  z-index: 3;
  opacity: 1;
  transform: rotateY(0deg);
  transform-origin: left center;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.parchment-page-text.turning {
  opacity: 0;
  transform: rotateY(-30deg) scale(0.96);
}

/* Big elegant Ghibli dropcap */
.parchment-page-dropcap {
  font-family: var(--font-serif-logo);
  font-size: 3.2rem;
  float: left;
  line-height: 0.82;
  padding-top: 3px;
  padding-right: 6px;
  color: var(--theme-color, #854d0e);
  font-weight: 700;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}

/* Reading Page Footer Controls */
.parchment-page-footer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(62, 39, 35, 0.12);
  padding-top: 1rem;
  z-index: 3;
  margin-top: 1.5rem;
}

.parchment-flip-btn {
  background: #795548;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  color: #fdfaf2;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.15);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.parchment-flip-btn:hover {
  background: #5d4037;
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}

.parchment-flip-btn:disabled {
  background: #d7ccc8;
  color: #a1887f;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.parchment-page-indicator-text {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: #8d6e63;
  letter-spacing: 0.05em;
}

/* Dynamic glow overlays mapping behind the book cover */
.storybook-cover-side::after {
  content: '';
  position: absolute;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, var(--theme-glow, rgba(251, 191, 36, 0.15)) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
}

/* Right Column: Info & purchase panel */
.preview-sidebar {
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(25px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0.18s;
}

.library-preview-overlay.visible .preview-sidebar {
  opacity: 1;
  transform: translateY(0);
}

.preview-sidebar-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--theme-color, var(--color-gold));
  margin-bottom: 0.6rem;
}

.preview-sidebar-tag::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--theme-color, var(--color-gold));
  margin-right: 8px;
  box-shadow: 0 0 8px var(--theme-color, var(--color-gold));
}

.preview-sidebar-title {
  font-family: var(--font-serif-logo);
  font-size: 2.1rem;
  color: var(--color-text-light);
  margin-bottom: 0.4rem;
}

.preview-sidebar-subtitle {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-bottom: 1.5rem;
}

.preview-sidebar-desc {
  font-family: var(--font-serif-body);
  font-size: 1.02rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 2rem;
}

/* Stepper & Purchase layout */
.preview-purchase-section {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 1.5rem;
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stepper-label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-light);
}

.quantity-stepper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.1);
}

.stepper-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  color: var(--color-gold-light);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.stepper-btn:hover {
  background: rgba(251, 191, 36, 0.08);
  color: var(--color-gold);
}

.stepper-btn:disabled {
  color: rgba(255, 255, 255, 0.15);
  cursor: not-allowed;
  background: transparent;
}

.stepper-val {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-light);
  width: 32px;
  text-align: center;
}

.preview-action-buttons {
  display: flex;
  gap: 1rem;
}

.btn-preview-primary {
  flex-grow: 1;
  background: linear-gradient(135deg, var(--theme-color, var(--color-gold)) 0%, #d97706 100%);
  border: none;
  border-radius: 14px;
  color: #0b0716;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3), 0 0 15px rgba(251, 191, 36, 0.15);
  text-shadow: 0 1px 0 rgba(255,255,255,0.2);
}

.btn-preview-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4), 0 0 25px rgba(251, 191, 36, 0.35);
  filter: brightness(1.08);
}

.btn-preview-primary:active {
  transform: translateY(0);
}

.btn-preview-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 14px;
  color: var(--color-gold-light);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 14px 20px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
}

.btn-preview-secondary:hover {
  background: rgba(251, 191, 36, 0.06);
  border-color: var(--color-gold);
  color: var(--color-gold);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.08);
}

/* Responsive Overrides */
@media (max-width: 950px) {
  .library-preview-modal {
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 600px;
    padding: 2rem;
  }
}

@media (max-width: 600px) {
  .library-preview-overlay {
    padding: 1rem;
  }
  .library-preview-modal {
    padding: 1.5rem;
    border-radius: 20px;
  }
  /* On very small devices, hide the left cover page to focus strictly on readable text */
  .open-storybook {
    grid-template-columns: 1fr;
    min-height: 380px;
  }
  .storybook-cover-side {
    display: none;
  }
  .open-storybook::after {
    display: none;
  }
  .storybook-story-side {
    padding: 1.5rem 1.2rem;
  }
  .parchment-page-text {
    font-size: 0.95rem;
  }
  .preview-sidebar-title {
    font-size: 1.8rem;
  }
  .preview-action-buttons {
    flex-direction: column;
    gap: 0.75rem;
  }
}


/* --- HOMEPAGE 3D BOOK-OPENING PREVIEW SHELF EFFECTS --- */

/* ========================================================
   HIGH-PERFORMANCE 3D PAGE-PEELING STPAGEFLIP ENGINE
   ======================================================== */

/* Cinematic Flying Book Cover Transition element */
/* Cinematic Flying Book Cover Transition element */
.flying-book-cover {
  position: fixed;
  z-index: 999999;
  transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  border-radius: 8px;
  overflow: hidden;
  pointer-events: none;
  background-color: transparent;
}

.flying-book-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* StPageFlip Canvas and viewport bounds */
.flipbook-wrapper-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 820px;
  height: 580px;
  margin: 0 auto;
  z-index: 10;
}

.flipbook-container {
  width: 100%;
  height: 100%;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
}

/* Navigation Arrow Overrides */
.flipbook-arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(93, 64, 55, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--color-gold-light);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.flipbook-arrow-btn:hover {
  background: var(--color-gold);
  color: #3e2723;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 15px rgba(251, 191, 36, 0.4);
}

.flipbook-arrow-btn.prev {
  left: -70px;
}

.flipbook-arrow-btn.next {
  right: -70px;
}

/* Hardcover page structures for PageFlip */
.st-page-cover {
  background: #4e342e;
  border-radius: 6px 0 0 6px;
  box-shadow: inset -10px 0 20px rgba(0,0,0,0.5);
  overflow: hidden;
}

.st-page-cover.back {
  border-radius: 0 6px 6px 0;
  box-shadow: inset 10px 0 20px rgba(0,0,0,0.5);
}

/* Realistic Ghibli interior page leaves */
.st-page-leaf {
  background: #fdfaf2;
  box-shadow: inset 5px 0 20px rgba(93, 64, 55, 0.08), inset -5px 0 20px rgba(93, 64, 55, 0.04);
  box-sizing: border-box;
  padding: 2.2rem 2rem 1.6rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

/* Tea-stained paper texture overlay */
.st-page-leaf::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, transparent 60%, rgba(93, 64, 55, 0.05) 100%);
  pointer-events: none;
  z-index: 10;
}

/* Spine shadow divider overlay inside StPageFlip spreads */
.st-page-leaf .spine-crease-overlay {
  position: absolute;
  top: 0;
  width: 30px;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

/* Left page interior spine shadow fading rightwards */
.st-page-leaf.left .spine-crease-overlay {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.03) 60%, transparent 100%);
}

/* Right page interior spine shadow fading leftwards */
.st-page-leaf.right .spine-crease-overlay {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.03) 60%, transparent 100%);
}

/* Typography styles inside the leaf pages */
.st-page-leaf h3 {
  font-family: var(--font-serif-logo);
  font-size: 1.3rem;
  color: #3e2723;
  margin-bottom: 0.6rem;
  border-bottom: 1px dashed rgba(93, 64, 55, 0.18);
  padding-bottom: 0.4rem;
}

.st-page-leaf .page-content-wrapper {
  font-family: var(--font-serif-body);
  font-size: 0.86rem;
  line-height: 1.6;
  text-align: justify;
  color: #4e342e;
  flex-grow: 1;
}

.st-page-leaf .page-indicator-footer {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: #8d6e63;
  text-align: center;
  border-top: 1px solid rgba(93, 64, 55, 0.12);
  padding-top: 0.6rem;
  margin-top: 0.6rem;
}

.st-page-leaf .page-graphics-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

/* Embedded illustrations container inside flipbook pages */
.st-page-leaf .embedded-illustration {
  width: 80%;
  max-width: 220px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  border: 4px solid #ffffff;
  transform: rotate(-1deg);
  margin-top: 1rem;
}

/* Responsive details for full-screen Ghibli flipbook modal */
@media (max-width: 992px) {
  .flipbook-arrow-btn.prev {
    left: 15px;
  }
  .flipbook-arrow-btn.next {
    right: 15px;
  }
}

@media (max-width: 768px) {
  .flipbook-wrapper-container {
    height: 480px;
  }
  .flipbook-arrow-btn {
    width: 38px;
    height: 38px;
  }
  .st-page-leaf {
    padding: 1.6rem 1.2rem 1.1rem;
  }
  .st-page-leaf h3 {
    font-size: 1.1rem;
  }
  .st-page-leaf .page-content-wrapper {
    font-size: 0.78rem;
    line-height: 1.5;
  }
}

/* --- MAGICAL MYSTICAL FOREST CABIN GATEWAY OVERLAY --- */
.shoji-gate-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999998;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  pointer-events: auto;
  transition: 
    opacity 1.6s cubic-bezier(0.25, 1, 0.3, 1),
    transform 1.8s cubic-bezier(0.25, 1, 0.3, 1);
  transform-origin: center center;
  transform: scale(1);
  background-image: 
    radial-gradient(circle at center, rgba(24, 17, 44, 0.1) 0%, rgba(8, 5, 17, 0.65) 100%),
    url('../assets/magical_gate_bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Giant Glowing Ghibli Full Moon */
.mystical-full-moon {
  position: absolute;
  top: 15%;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf2 0%, #fef9c3 40%, #fde047 80%, #ca8a04 100%);
  box-shadow: 
    0 0 60px rgba(254, 240, 138, 0.6),
    0 0 120px rgba(254, 240, 138, 0.3),
    0 0 200px rgba(251, 191, 36, 0.15);
  z-index: 0;
  pointer-events: none;
  animation: moonGlowPulse 6s infinite alternate ease-in-out;
}

@keyframes moonGlowPulse {
  0% { transform: scale(0.97); filter: brightness(0.95) drop-shadow(0 0 20px rgba(254,240,138,0.4)); }
  100% { transform: scale(1.03); filter: brightness(1.05) drop-shadow(0 0 40px rgba(254,240,138,0.7)); }
}

/* Sliding Forest & Cabin Panels (Left & Right halves - hidden for Ghibli vortex artwork) */
/* Sliding Forest & Cabin Panels re-purposed as soft Ghibli parting clouds */
.shoji-door {
  position: absolute;
  top: 0;
  width: 60vw; /* overlap in center for seamless mist blending */
  height: 100vh;
  z-index: 1;
  pointer-events: none;
  transition: transform 2.0s cubic-bezier(0.25, 1, 0.3, 1), opacity 1.8s ease;
  opacity: 0.75;
  filter: blur(15px); /* ultra-soft misty cloud edges */
}

.shoji-door.left {
  left: 0;
  background: radial-gradient(circle at 100% 50%, rgba(224, 242, 254, 0.55) 0%, rgba(14, 116, 144, 0.28) 45%, transparent 75%);
  transform-origin: left center;
}

.shoji-door.right {
  right: 0;
  background: radial-gradient(circle at 0% 50%, rgba(224, 242, 254, 0.55) 0%, rgba(14, 116, 144, 0.28) 45%, transparent 75%);
  transform-origin: right center;
}

/* Hide all children silhouettes inside doors, plus the other legacy moon/lantern layers */
.shoji-door *, .mystical-full-moon, .magical-lantern, .gate-lantern-glow {
  display: none !important;
}

/* Cinematic Ghibli cloud-parting and cosmic vortex zoom-in entry animations */
.shoji-gate-overlay.entered {
  opacity: 0;
  transform: scale(2.8); /* Cinematic zoom straight into the vortex! */
  pointer-events: none;
}

.shoji-gate-overlay.entered .shoji-door.left {
  transform: translateX(-100%) scale(1.1);
  opacity: 0;
}

.shoji-gate-overlay.entered .shoji-door.right {
  transform: translateX(100%) scale(1.1);
  opacity: 0;
}

.shoji-gate-overlay.entered .gate-content {
  opacity: 0;
  transform: scale(1.35) translateY(-20px);
  transition: opacity 1.0s ease, transform 1.6s cubic-bezier(0.25, 1, 0.3, 1);
}

.shoji-gate-overlay.entered .mystical-full-moon {
  opacity: 0;
  transform: scale(1.1);
  transition: opacity 1.2s ease, transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.shoji-gate-overlay.entered .magical-lantern {
  opacity: 0;
  transform: translateY(-50px);
  transition: all 1.0s ease;
}

/* Cozy Cabin Silhouettes Split Down the Center */
.cabin-silhouette {
  position: absolute;
  bottom: 0;
  width: 320px;
  height: 280px;
  pointer-events: none;
  z-index: 3;
}

.cabin-silhouette.left {
  right: 0; /* Flush right on left panel */
}

.cabin-silhouette.right {
  left: 0; /* Flush left on right panel */
}

/* Cabin Walls with warm wood tones and texture overlays */
.cabin-wall-left {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 220px;
  height: 170px;
  background: linear-gradient(to top, #0f091c 0%, #1c1130 100%);
  border-top-left-radius: 8px;
  border-right: 2px solid rgba(251, 191, 36, 0.15); /* center dividing seam */
  box-shadow: inset 20px 0 50px rgba(0, 0, 0, 0.6);
}

.cabin-wall-right {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 220px;
  height: 170px;
  background: linear-gradient(to top, #0f091c 0%, #1c1130 100%);
  border-top-right-radius: 8px;
  border-left: 2px solid rgba(251, 191, 36, 0.15);
  box-shadow: inset -20px 0 50px rgba(0, 0, 0, 0.6);
}

/* Rustic Cabin Sloping Roofs */
.cabin-roof-left {
  position: absolute;
  bottom: 168px;
  right: -20px;
  width: 260px;
  height: 90px;
  background: linear-gradient(135deg, #090512 0%, #170e28 100%);
  transform: skewY(-22deg);
  border-top-left-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-right: 2px solid rgba(251, 191, 36, 0.15);
}

.cabin-roof-right {
  position: absolute;
  bottom: 168px;
  left: -20px;
  width: 260px;
  height: 90px;
  background: linear-gradient(-135deg, #090512 0%, #170e28 100%);
  transform: skewY(22deg);
  border-top-right-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  border-left: 2px solid rgba(251, 191, 36, 0.15);
}

/* Chimney & Magical Steam Particles on Left Half */
.chimney {
  position: absolute;
  top: 10px;
  left: 40px;
  width: 32px;
  height: 110px;
  background: linear-gradient(to right, #090512, #1b1031);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  border-top: 4px solid #fde047;
}

.steam-particle {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: rgba(254, 240, 138, 0.35);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(254, 240, 138, 0.2);
  filter: blur(2px);
  will-change: transform, opacity;
}

.steam-particle.st-1 { animation: riseSteam 4s infinite ease-out; }
.steam-particle.st-2 { animation: riseSteam 4s infinite ease-out; animation-delay: 1s; }
.steam-particle.st-3 { animation: riseSteam 4s infinite ease-out; animation-delay: 2s; }
.steam-particle.st-4 { animation: riseSteam 4s infinite ease-out; animation-delay: 3s; }

@keyframes riseSteam {
  0% { transform: translate3d(-50%, 0, 0) scale(0.6); opacity: 0; }
  20% { opacity: 0.6; }
  100% { transform: translate3d(20px, -110px, 0) scale(2.2); opacity: 0; }
}

/* Warm, Golden Lit Cabin Windows */
.cabin-window {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 12px;
  border: 4px solid #130a21;
  background: radial-gradient(circle at center, #fef08a 0%, #eab308 70%, #854d0e 100%);
  box-shadow: 0 0 35px rgba(234, 179, 8, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
}

.cabin-window.glow-1 {
  bottom: 50px;
  right: 50px;
}

.cabin-window.glow-2 {
  bottom: 50px;
  left: 120px;
}

.window-panes {
  width: 100%;
  height: 100%;
  position: relative;
}

.window-panes::before, .window-panes::after {
  content: '';
  position: absolute;
  background: #130a21;
}

.window-panes::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  transform: translateY(-50%);
}

.window-panes::after {
  left: 50%;
  top: 0;
  height: 100%;
  width: 3px;
  transform: translateX(-50%);
}

/* Cute Rustic Cabin Door on Right Half */
.cabin-wall-right .cabin-door {
  position: absolute;
  bottom: 0;
  left: 30px;
  width: 65px;
  height: 115px;
  background: linear-gradient(to top, #060309 0%, #120a1f 100%);
  border: 3px solid #23163a;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8);
}

.door-keyhole-glow {
  position: absolute;
  top: 52%;
  right: 8px;
  width: 6px;
  height: 6px;
  background: #fde047;
  border-radius: 50%;
  box-shadow: 0 0 10px #fef08a, 0 0 20px #eab308;
  animation: keyholePulse 2s infinite alternate ease-in-out;
}

@keyframes keyholePulse {
  0% { opacity: 0.5; transform: scale(0.9); }
  100% { opacity: 1.0; transform: scale(1.1); }
}

/* Layered Mystical Forest Silhouettes */
.forest-silhouette-left {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80%;
  pointer-events: none;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: contain;
  opacity: 0.18;
  filter: drop-shadow(10px 0 20px rgba(0,0,0,0.8));
  /* Detailed spruce & oak trees SVG path background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 500'%3E%3Cpath d='M0,500 L80,500 L80,420 L120,440 L70,300 L110,320 L60,180 L90,190 L50,80 L10,80 L0,50 Z' fill='%23080512'/%3E%3Cpath d='M60,500 L160,500 L160,390 L210,410 L150,250 L190,260 L140,120 L170,130 L130,20 L100,50 Z' opacity='0.7' fill='%230b061c'/%3E%3C/svg%3E");
}

.forest-silhouette-right {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 80%;
  pointer-events: none;
  z-index: 2;
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: contain;
  opacity: 0.18;
  filter: drop-shadow(-10px 0 20px rgba(0,0,0,0.8));
  /* Detailed mirror SVG forest path */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 500'%3E%3Cpath d='M300,500 L220,500 L220,420 L180,440 L230,300 L190,320 L240,180 L210,190 L250,80 L290,80 L300,50 Z' fill='%23080512'/%3E%3Cpath d='M240,500 L140,500 L140,390 L90,410 L150,250 L110,260 L160,120 L130,130 L170,20 L200,50 Z' opacity='0.7' fill='%230b061c'/%3E%3C/svg%3E");
}

/* Wisteria Vines hanging from Moon Arch */
.hanging-wisteria {
  position: absolute;
  top: 0;
  width: 150px;
  height: 250px;
  z-index: 4;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.35;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
  animation: wisteriaSway 8s infinite alternate ease-in-out;
}

.hanging-wisteria.wisteria-left {
  left: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200'%3E%3Cpath d='M10,0 Q30,80 5,140 Q25,120 15,200' fill='none' stroke='%23a78bfa' stroke-width='2'/%3E%3Ccircle cx='5' cy='60' r='5' fill='%23ca8a04'/%3E%3Ccircle cx='18' cy='90' r='4' fill='%23a78bfa'/%3E%3Ccircle cx='8' cy='120' r='5' fill='%23c084fc'/%3E%3Ccircle cx='12' cy='150' r='4' fill='%23e9d5ff'/%3E%3C/svg%3E");
}

.hanging-wisteria.wisteria-right {
  right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200'%3E%3Cpath d='M90,0 Q70,80 95,140 Q75,120 85,200' fill='none' stroke='%23a78bfa' stroke-width='2'/%3E%3Ccircle cx='95' cy='60' r='5' fill='%23ca8a04'/%3E%3Ccircle cx='82' cy='90' r='4' fill='%23a78bfa'/%3E%3Ccircle cx='92' cy='120' r='5' fill='%23c084fc'/%3E%3Ccircle cx='88' cy='150' r='4' fill='%23e9d5ff'/%3E%3C/svg%3E");
}

@keyframes wisteriaSway {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(4deg) scaleY(1.05); }
}

/* Floating Fireflies (Pure CSS animated golden sparks) */
.fireflies-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}

.firefly {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, #fef08a 60%, transparent 100%);
  box-shadow: 0 0 12px #fef08a, 0 0 24px #eab308;
  opacity: 0;
  will-change: transform, opacity;
}

/* Sparkle trajectory configurations with staggered speeds */
.ff-1  { left: 15%; top: 40%; animation: driftFirefly 12s infinite ease-in-out; }
.ff-2  { left: 35%; top: 25%; animation: driftFirefly 16s infinite ease-in-out; animation-delay: 2s; }
.ff-3  { left: 65%; top: 30%; animation: driftFirefly 14s infinite ease-in-out; animation-delay: 4s; }
.ff-4  { left: 82%; top: 45%; animation: driftFirefly 18s infinite ease-in-out; animation-delay: 1s; }
.ff-5  { left: 22%; top: 70%; animation: driftFirefly2 15s infinite ease-in-out; animation-delay: 5s; }
.ff-6  { left: 48%; top: 60%; animation: driftFirefly2 13s infinite ease-in-out; animation-delay: 3s; }
.ff-7  { left: 75%; top: 65%; animation: driftFirefly2 17s infinite ease-in-out; animation-delay: 0.5s; }
.ff-8  { left: 10%; top: 15%; animation: driftFirefly 20s infinite ease-in-out; animation-delay: 6s; }
.ff-9  { left: 88%; top: 12%; animation: driftFirefly2 19s infinite ease-in-out; animation-delay: 2.5s; }
.ff-10 { left: 55%; top: 15%; animation: driftFirefly 15s infinite ease-in-out; animation-delay: 7s; }

@keyframes driftFirefly {
  0% { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  25% { opacity: 0.9; }
  50% { transform: translate3d(40px, -60px, 0) scale(1.1); opacity: 0.5; }
  75% { opacity: 0.8; }
  100% { transform: translate3d(-30px, -120px, 0) scale(0.6); opacity: 0; }
}

@keyframes driftFirefly2 {
  0% { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  30% { opacity: 0.95; }
  60% { transform: translate3d(-50px, -40px, 0) scale(1.2); opacity: 0.4; }
  85% { opacity: 0.7; }
  100% { transform: translate3d(20px, -100px, 0) scale(0.5); opacity: 0; }
}

/* Floating Magical Paper Lanterns (Remaining Cozy Accents) */
.magical-lantern {
  position: absolute;
  width: 48px;
  height: 64px;
  background: radial-gradient(circle at 50% 40%, rgba(253, 230, 138, 0.28) 0%, rgba(245, 158, 11, 0.1) 70%, transparent 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 20px 20px 24px 24px;
  box-shadow: 
    0 0 25px rgba(251, 191, 36, 0.18),
    inset 0 -5px 12px rgba(245, 158, 11, 0.15);
  z-index: 2;
  pointer-events: none;
}

.magical-lantern::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 8px;
  background: rgba(251, 191, 36, 0.4);
}

.magical-lantern::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  background: #d97706;
  border-radius: 50%;
}

.lantern-flame {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 14px;
  background: radial-gradient(circle, #ffffff 0%, #fcd34d 40%, #f97316 100%);
  border-radius: 50% 50% 20% 20%;
  filter: blur(0.5px);
  box-shadow: 0 0 10px #f59e0b;
  animation: flicker 1.8s infinite alternate ease-in-out;
}

.lantern-1 { left: 10%; bottom: 25%; animation: floatLantern1 12s infinite linear; }
.lantern-2 { right: 12%; top: 15%; animation: floatLantern2 15s infinite linear; }
.lantern-3 { left: 22%; top: 40%; animation: floatLantern3 18s infinite linear; }

@keyframes floatLantern1 {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
  50% { transform: translateY(-35px) rotate(4deg); opacity: 1.0; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.6; }
}

@keyframes floatLantern2 {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
  50% { transform: translateY(-45px) rotate(-6deg); opacity: 1.0; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.8; }
}

@keyframes floatLantern3 {
  0% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
  50% { transform: translateY(-30px) rotate(5deg); opacity: 1.0; }
  100% { transform: translateY(0) rotate(0deg); opacity: 0.7; }
}

@keyframes flicker {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.9; }
  50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1.0; }
  75% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.85; }
}



/* Golden Moon Gate Circle Portal Frame */
.moon-gate-circle {
  position: relative;
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 50%;
  padding: 4.5rem 3.5rem;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  box-shadow: 
    0 0 40px rgba(251, 191, 36, 0.08),
    inset 0 0 40px rgba(251, 191, 36, 0.04);
  background: rgba(18, 12, 32, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.moon-gate-circle::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 1px dashed rgba(251, 191, 36, 0.15);
  border-radius: 50%;
  pointer-events: none;
}

.moon-gate-vine {
  position: absolute;
  top: 50%;
  width: 60px;
  height: 120px;
  pointer-events: none;
  background-size: contain;
  background-repeat: no-repeat;
  opacity: 0.7;
}

.moon-gate-vine.vine-left {
  left: -35px;
  transform: translateY(-50%) rotate(-15deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200'%3E%3Cpath d='M90,10 C50,40 30,80 40,120 C50,150 70,170 90,190' fill='none' stroke='%23fbbf24' stroke-width='2'/%3E%3Ccircle cx='40' cy='60' r='4' fill='%23ffe082'/%3E%3Ccircle cx='32' cy='100' r='3' fill='%23ffe082'/%3E%3Ccircle cx='48' cy='140' r='4' fill='%23ffe082'/%3E%3C/svg%3E");
}

.moon-gate-vine.vine-right {
  right: -35px;
  transform: translateY(-50%) scaleX(-1) rotate(-15deg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 200'%3E%3Cpath d='M90,10 C50,40 30,80 40,120 C50,150 70,170 90,190' fill='none' stroke='%23fbbf24' stroke-width='2'/%3E%3Ccircle cx='40' cy='60' r='4' fill='%23ffe082'/%3E%3Ccircle cx='32' cy='100' r='3' fill='%23ffe082'/%3E%3Ccircle cx='48' cy='140' r='4' fill='%23ffe082'/%3E%3C/svg%3E");
}

.gate-content {
  position: relative;
  z-index: 3;
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

/* --- MAIN TEAHOUSE SANCTUARY CONTENT PANEL --- */
/* Lock viewport ONLY before entering the teahouse */
body:has(#teahouse-sanctuary:not(.visible)) {
  overflow: hidden !important;
  height: 100vh !important;
  width: 100vw !important;
}

/* Allow smooth scrolling once inside the sanctuary */
body:has(#teahouse-sanctuary.visible) {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
}

body:has(#teahouse-sanctuary) .featured-section {
  padding-top: 90px !important; /* offsets original 90px fixed header perfectly */
  min-height: 100vh !important; /* Forces dashboard section to fill the viewport, centering the gliding shelf on entry */
}

.teahouse-sanctuary-content {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.0s cubic-bezier(0.25, 1, 0.5, 1), transform 1.0s cubic-bezier(0.25, 1, 0.5, 1);
  transform: translateY(30px); /* Elegant fade-up enter effect */
  
  /* Pre-entry positioning fixed to viewport */
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.teahouse-sanctuary-content.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  
  /* Transition into relative flow to allow natural scrolling down to the footer */
  position: relative !important;
  height: auto !important;
  overflow: visible !important;
}

/* -----------------------------------------
   DASHBOARD SOCIAL MEDIA LINKS (BOTTOM RIGHT)
   ----------------------------------------- */
.dashboard-socials-widget {
  position: fixed !important;
  bottom: 30px !important;
  right: 95px !important; /* Positioned perfectly next to the scroll-up button to prevent layout overlap */
  display: flex !important;
  gap: 12px !important;
  z-index: 999999 !important;
}

@media (max-width: 768px) {
  .dashboard-socials-widget {
    bottom: 24px !important;
    right: 80px !important; /* Offset next to the mobile scroll-up button */
    gap: 8px !important;
  }
  .dashboard-social-btn {
    width: 40px !important;
    height: 40px !important;
  }
}

.dashboard-social-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(14, 8, 30, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.25);
  color: var(--color-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 
    background 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    color 0.3s ease,
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 10px rgba(251, 191, 36, 0.05);
}

.dashboard-social-btn:hover {
  background: rgba(22, 12, 45, 0.95);
  border-color: var(--color-gold-light);
  color: var(--color-gold-light);
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.4);
}

.dashboard-social-btn:active {
  transform: translateY(-2px) scale(0.98);
}

/* -----------------------------------------
   MOCKUP-PERFECT BORDERLESS TYPOGRAPHY FRAME
   ----------------------------------------- */
.welcome-mockup-frame {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
}

/* Freely floating typography headers */
.hero-title-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.hero-title-line.line-1 {
  font-family: var(--font-serif-logo);
  font-size: 1.4rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #ffe082;
  font-weight: 600;
  text-shadow: 
    0 2px 10px rgba(0, 0, 0, 0.95), 
    0 0 20px rgba(251, 191, 36, 0.35);
  display: block;
}

.hero-title-line.line-2 {
  font-family: var(--font-serif-logo);
  font-size: 3.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fbbf24;
  text-shadow: 
    0 3px 20px rgba(0, 0, 0, 0.98), 
    0 0 45px rgba(251, 191, 36, 0.55);
  margin-top: 0.3rem;
  display: block;
}

/* Elegant high-contrast subtitle description */
.hero-subtitle {
  font-family: var(--font-serif-body);
  font-size: 1.32rem;
  color: #fff3e0;
  line-height: 1.75;
  max-width: 720px;
  margin: 1.5rem auto 2.2rem;
  text-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.98), 
    0 0 15px rgba(0, 0, 0, 0.7);
  font-weight: 400;
}

/* -----------------------------------------
   PREMIUM GOLDEN GLOWING CAPSULE ENTER BUTTON
   ----------------------------------------- */
.capsule-button-container {
  margin-top: 1.8rem;
  position: relative;
  display: inline-block;
}

.enter-capsule-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 3.2rem;
  border-radius: 27px;
  background: linear-gradient(135deg, #fbbf24 0%, #d97706 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  color: #3e2101 !important;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
  outline: none;
  box-shadow: 
    0 12px 35px rgba(0, 0, 0, 0.55), 
    0 0 30px rgba(251, 191, 36, 0.6), 
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
  transition: 
    transform 0.4s cubic-bezier(0.25, 1, 0.5, 1),
    box-shadow 0.4s ease,
    border-color 0.4s ease,
    color 0.4s ease;
  user-select: none;
  z-index: 10;
  animation: capsuleFloat 5s infinite ease-in-out alternate;
}

.capsule-btn-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 80%);
  pointer-events: none;
  mix-blend-mode: overlay;
}

.enter-capsule-btn:hover {
  transform: scale(1.06) translateY(-4px);
  box-shadow: 
    0 18px 45px rgba(0, 0, 0, 0.65), 
    0 0 50px rgba(251, 191, 36, 0.9), 
    inset 0 2px 5px rgba(255, 255, 255, 0.6);
  border-color: #ffffff;
  color: #2b1600 !important;
}

.enter-capsule-btn:active {
  transform: scale(0.98) translateY(-2px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.45), 
    0 0 25px rgba(251, 191, 36, 0.4), 
    inset 0 1px 3px rgba(0, 0, 0, 0.4);
  box-shadow: 
    0 0 10px rgba(251, 191, 36, 0.4), 
    0 0 20px rgba(251, 191, 36, 0.2);
}

/* Orbiting Fireflies swarming the button */
.capsule-fireflies {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

.capsule-ff {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fbbf24;
  box-shadow: 0 0 12px #fde047, 0 0 4px #fff;
  pointer-events: none;
  opacity: 0;
}

.cff-1 { top: -12px; left: 18%; animation: cffOrbit1 5.5s infinite linear; }
.cff-2 { bottom: -12px; right: 22%; animation: cffOrbit2 6.5s infinite linear; }
.cff-3 { top: 25%; left: 106%; animation: cffOrbit3 5s infinite linear; }
.cff-4 { bottom: 35%; left: -6%; animation: cffOrbit4 5.2s infinite linear; }

/* Swarm acceleration on hover */
.enter-capsule-btn:hover .capsule-ff {
  animation-duration: 2.2s !important;
}

/* Swarm acceleration for background fireflies on enter button hover */
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-1  { animation-duration: 3s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-2  { animation-duration: 4s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-3  { animation-duration: 3.5s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-4  { animation-duration: 4.5s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-5  { animation-duration: 3.75s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-6  { animation-duration: 3.25s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-7  { animation-duration: 4.25s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-8  { animation-duration: 5s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-9  { animation-duration: 4.75s !important; }
.shoji-gate-overlay:has(.enter-capsule-btn:hover) .ff-10 { animation-duration: 3.75s !important; }

/* Animations specifications */
@keyframes capsuleFloat {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-7px) rotate(0.4deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes cffOrbit1 {
  0% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
  50% { transform: translate(60px, -20px) scale(1.3); opacity: 1; }
  100% { transform: translate(0, 0) scale(0.8); opacity: 0.3; }
}

@keyframes cffOrbit2 {
  0% { transform: translate(0, 0) scale(1.2); opacity: 0.9; }
  50% { transform: translate(-50px, 15px) scale(0.6); opacity: 0.2; }
  100% { transform: translate(0, 0) scale(1.2); opacity: 0.9; }
}

@keyframes cffOrbit3 {
  0% { transform: translate(0, 0) scale(0.7); opacity: 0.2; }
  50% { transform: translate(-30px, 30px) scale(1.3); opacity: 1; }
  100% { transform: translate(0, 0) scale(0.7); opacity: 0.2; }
}

@keyframes cffOrbit4 {
  0% { transform: translate(0, 0) scale(1.3); opacity: 1; }
  50% { transform: translate(40px, -25px) scale(0.5); opacity: 0.3; }
  100% { transform: translate(0, 0) scale(1.3); opacity: 1; }
}

@media (max-width: 768px) {
  .hero-title-line.line-1 {
    font-size: 1.15rem;
    letter-spacing: 0.16em;
  }
  .hero-title-line.line-2 {
    font-size: 2.5rem;
  }
  .hero-subtitle {
    font-size: 1.08rem;
    line-height: 1.6;
    margin: 1.2rem auto 1.8rem;
    padding: 0 1rem;
  }
  .enter-capsule-btn {
    height: 48px;
    padding: 0 2.4rem;
    font-size: 0.88rem;
  }
}

/* Visual hiding utility for screen readers and SEO indexing */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* ==========================================================================
   WHIMSICAL MAGICAL LIBRARY REDESIGN STYLES
   ========================================================================== */

/* Main Continuous Scroll Wrapper */
.library-landing-main {
  width: 100%;
  position: relative;
  overflow: hidden;
  padding-top: 0; /* Let emotions shelf handle the uniform 130px padding top offset directly */
}

/* TOP SECTION: OUR BOOKSHELF & EMOTIONS */
.emotions-shelf-section {
  position: relative;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  min-height: 650px;
  max-height: 980px;
  box-sizing: border-box;
  padding: 130px 2rem 1.5rem;
  background: radial-gradient(circle at 50% 30%, rgba(21, 15, 36, 0.95) 0%, rgba(12, 8, 22, 0.98) 100%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}

.emotions-shelf-section .landing-header {
  margin: 0 auto 2.5rem;
  max-width: 700px;
}

.shelf-subheader-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 0.6rem;
  text-align: left;
  padding: 0 3.5rem;
  box-sizing: border-box;
}

.shelf-subheader {
  font-family: var(--font-serif-logo);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-gold-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5), 0 0 10px rgba(251, 191, 36, 0.35);
  margin-bottom: 0.2rem;
  display: inline-block;
  border-bottom: 2px solid rgba(251, 191, 36, 0.2);
  padding-bottom: 0.2rem;
}

/* Horizontal Bookshelf Wrapper */
.emotions-bookshelf-wrapper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 3.5rem;
  box-sizing: border-box;
}

/* Horizontal Scrollports */
.emotions-books-scroller,
.toddler-books-scroller {
  display: flex;
  gap: 3.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1.2rem 1.5rem 1.8rem;
  scrollbar-width: none; /* Firefox */
  box-sizing: border-box;
}

.emotions-books-scroller::-webkit-scrollbar,
.toddler-books-scroller::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.emotions-books-scroller .library-card-wrapper,
.toddler-books-scroller .library-card-wrapper {
  flex: 0 0 calc(33.333% - 2.33rem);
  scroll-snap-align: start;
  min-width: 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

.emotions-books-scroller .library-book-container .book-3d-wrapper,
.toddler-books-scroller .library-book-container .book-3d-wrapper {
  width: 120px;
  height: 170px;
}

.emotions-books-scroller .library-shelf,
.toddler-books-scroller .library-shelf {
  width: 100%;
  max-width: 200px;
  margin-top: -2px;
  margin-bottom: 0.8rem;
  position: relative;
}

/* Frosted glass details styling overrides */
.emotions-books-scroller .library-card-details,
.toddler-books-scroller .library-card-details {
  background: rgba(18, 12, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 
    0 15px 35px rgba(0, 0, 0, 0.65), 
    inset 0 1px 1px rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 16px;
  width: 100%;
  padding: 0.8rem 1rem;
  box-sizing: border-box;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.emotions-books-scroller .library-card-tag,
.toddler-books-scroller .library-card-tag {
  display: inline-block;
  font-size: 0.68rem;
  color: var(--emotion-color, var(--color-gold));
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.emotions-books-scroller .library-card-title,
.toddler-books-scroller .library-card-title {
  font-family: var(--font-serif-logo);
  font-size: 1.05rem;
  margin-bottom: 0.25rem;
  color: var(--color-text-light);
}

.emotions-books-scroller .library-card-desc,
.toddler-books-scroller .library-card-desc {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 0.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 2.8em;
}

.emotions-books-scroller .library-card-actions,
.toddler-books-scroller .library-card-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

.emotions-books-scroller .library-card-actions button,
.emotions-books-scroller .library-card-actions a,
.toddler-books-scroller .library-card-actions button,
.toddler-books-scroller .library-card-actions a {
  padding: 0.4rem 0.8rem;
  font-size: 0.7rem;
  border-radius: 6px;
}

.emotions-books-scroller .library-card-wrapper:hover .library-card-details,
.toddler-books-scroller .library-card-wrapper:hover .library-card-details {
  border-color: var(--emotion-color, rgba(251, 191, 36, 0.2));
  box-shadow: 
    0 25px 50px rgba(0, 0, 0, 0.75), 
    0 0 25px var(--glow-color, rgba(251, 191, 36, 0.15)),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transform: translateY(-5px);
}

/* Shelf Navigation Arrow Buttons */
.shelf-arrow-btn {
  position: absolute;
  top: 36%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(38, 28, 20, 0.88);
  border: 2px solid var(--color-gold);
  color: var(--color-gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55);
}

.shelf-arrow-btn:hover:not(:disabled) {
  background: var(--color-gold);
  color: #1a0f08;
  box-shadow: 0 0 15px var(--color-gold-light);
  transform: translateY(-50%) scale(1.12);
}

.shelf-arrow-btn:active:not(:disabled) {
  transform: translateY(-50%) scale(0.98);
}

.shelf-arrow-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.2);
  background: rgba(18, 18, 18, 0.6);
  box-shadow: none;
}

.shelf-arrow-btn.prev {
  left: 0.5rem;
}

.shelf-arrow-btn.next {
  right: 0.5rem;
}

/* Ornate Shelf details */
.library-shelf-glow {
  opacity: 0.8;
  background: var(--glow-color, rgba(251, 191, 36, 0.25));
}

/* THE DIVIDER: VINE-CARVED WOODEN PLANK */
.rustic-wooden-divider {
  position: relative;
  width: 100%;
  height: 120px;
  background: linear-gradient(180deg, #442a1b 0%, #2f1b10 100%);
  border-top: 5px solid #5a3822;
  border-bottom: 5px solid #1f110a;
  box-shadow: 
    0 12px 30px rgba(0, 0, 0, 0.7), 
    inset 0 2px 4px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  overflow: visible;
  margin: 1.5rem 0;
}

.wood-carving-text {
  font-family: var(--font-serif-decorative);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--color-gold-light);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 2rem;
  z-index: 30;
  text-shadow: 
    0 -1px 0 #000, 
    0 1px 0 #5c3821, 
    0 2px 5px rgba(0, 0, 0, 0.9), 
    0 0 15px rgba(251, 191, 36, 0.5);
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.25));
}

.vine-svg {
  width: 120px;
  height: 25px;
  opacity: 0.85;
  stroke-dasharray: 200;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.4));
}

/* Ambient firefly & teacups divider layer */
.ambient-divider-particles {
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: 240px;
  pointer-events: none;
  z-index: 25;
  overflow: visible;
}

/* Drifting fireflies keyframes and particles */
.firefly {
  position: absolute;
  width: 7px;
  height: 7px;
  background: #fbbf24;
  border-radius: 50%;
  box-shadow: 
    0 0 10px #fbbf24, 
    0 0 20px #fbbf24,
    0 0 35px #fbbf24;
  opacity: 0.8;
  pointer-events: none;
}

.ff1 { top: 20px; left: 15%; animation: fireflyDrift1 8s infinite ease-in-out; }
.ff2 { bottom: 30px; left: 35%; animation: fireflyDrift2 10s infinite ease-in-out; }
.ff3 { top: 40px; right: 25%; animation: fireflyDrift1 9s infinite ease-in-out; }
.ff4 { bottom: 15px; right: 10%; animation: fireflyDrift3 11s infinite ease-in-out; }
.ff5 { top: 60px; left: 48%; animation: fireflyDrift2 7s infinite ease-in-out; }

/* Floating mini teacups particles */
.floating-teacup {
  position: absolute;
  font-size: 1.45rem;
  opacity: 0.8;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.45));
}

.tc1 { top: -20px; left: 22%; animation: teacupFloat1 7s infinite ease-in-out; }
.tc2 { bottom: -10px; right: 30%; animation: teacupFloat2 9s infinite ease-in-out; }

@keyframes fireflyDrift1 {
  0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
  50% { transform: translate(30px, -25px) scale(1.3); opacity: 0.95; }
}

@keyframes fireflyDrift2 {
  0%, 100% { transform: translate(0, 0) scale(1.2); opacity: 0.9; }
  50% { transform: translate(-40px, 35px) scale(0.8); opacity: 0.4; }
}

@keyframes fireflyDrift3 {
  0%, 100% { transform: translate(0, 0) scale(0.9); opacity: 0.5; }
  50% { transform: translate(25px, 20px) scale(1.4); opacity: 0.9; }
}

@keyframes teacupFloat1 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-15px) rotate(8deg); }
}

@keyframes teacupFloat2 {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(12px) rotate(-10deg); }
}


/* BOTTOM SECTION: COZY GARDEN FLOOR & MOSSLINGS */
.toddler-garden-section {
  position: relative;
  width: 100%;
  padding: 5rem 2rem 8rem;
  background: linear-gradient(to bottom, rgba(12, 8, 22, 0.98) 0%, rgba(16, 26, 17, 0.96) 20%, rgba(20, 34, 22, 0.98) 60%, rgba(13, 20, 14, 0.99) 100%);
  overflow: hidden;
  z-index: 10;
}

.garden-ambient-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.dappled-sunlight {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 15% 25%, rgba(251, 191, 36, 0.08) 0%, transparent 50%), 
    radial-gradient(circle at 85% 65%, rgba(217, 119, 6, 0.06) 0%, transparent 45%);
  mix-blend-mode: screen;
}

/* Beautiful organic styled stone pebbles */
.forest-pebble {
  position: absolute;
  background: linear-gradient(135deg, #7c726d 0%, #4f4642 100%);
  border-radius: 63% 37% 55% 45% / 48% 38% 62% 52%;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.5));
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.pebble-1 { bottom: 10%; left: 8%; width: 100px; height: 65px; transform: rotate(18deg); }
.pebble-2 { bottom: 15%; right: 10%; width: 120px; height: 80px; transform: rotate(-22deg); }
.pebble-3 { top: 22%; left: 4%; width: 75px; height: 50px; transform: rotate(35deg); opacity: 0.65; }
.pebble-4 { bottom: 42%; right: 3%; width: 90px; height: 58px; transform: rotate(-8deg); opacity: 0.5; }

/* organic leaves/sprouts blowing keyframes */
.garden-sprout {
  position: absolute;
  font-size: 1.4rem;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.35));
  animation: sproutWind 4.5s infinite ease-in-out;
}

.sprout-1 { bottom: 17%; left: 11%; z-index: 2; } /* Sprouting beside pebble 1 */
.sprout-2 { bottom: 23%; right: 13%; z-index: 2; animation-delay: 1.5s; }
.sprout-3 { top: 27%; left: 5%; opacity: 0.7; animation-delay: 0.8s; }

@keyframes sproutWind {
  0%, 100% { transform: rotate(0deg) skewX(0deg); }
  50% { transform: rotate(8deg) skewX(4deg); }
}


/* Toddler Bookcase Scrollwrapper */
.toddler-bookshelf-wrapper {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 3.5rem;
  box-sizing: border-box;
  z-index: 5;
}

/* Horizontal Scroller container */
.toddler-books-scroller {
  display: flex;
  gap: 3.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 1.2rem 1.5rem 1.8rem;
  scrollbar-width: none; /* Firefox */
  box-sizing: border-box;
}

.toddler-books-scroller::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.toddler-card {
  flex: 0 0 calc(33.333% - 2.33rem);
  scroll-snap-align: start;
  min-width: 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* RESPONSIVE LAYOUT OVERRIDES */
@media (max-width: 950px) {
  .emotions-books-scroller .library-card-wrapper,
  .toddler-books-scroller .library-card-wrapper {
    flex: 0 0 calc(50% - 1.75rem);
    max-width: 325px;
  }
  
  .emotions-bookshelf-wrapper,
  .toddler-bookshelf-wrapper {
    padding: 0 2.5rem;
  }
  
  .shelf-arrow-btn.prev { left: -0.2rem; }
  .shelf-arrow-btn.next { right: -0.2rem; }
}

@media (max-width: 650px) {
  .emotions-shelf-section {
    padding: 3.5rem 1rem 4rem;
  }
  
  .shelf-subheader-container {
    padding: 0 1rem;
    text-align: center;
  }
  
  .emotions-bookshelf-wrapper {
    padding: 0 1.8rem;
  }
  
  .emotions-books-scroller {
    gap: 2rem;
  }
  
  .emotions-books-scroller .library-card-wrapper {
    flex: 0 0 100%;
    max-width: 290px;
    scroll-snap-align: center;
  }
  
  .shelf-arrow-btn {
    display: none !important; /* Hide arrows on small screens, rely on swipe */
  }
  
  /* Divider adjustments */
  .rustic-wooden-divider {
    height: 90px;
  }
  
  .wood-carving-text {
    font-size: 1.15rem;
    gap: 0.5rem;
    padding: 0 1rem;
    text-align: center;
  }
  
  .vine-svg {
    display: none !important;
  }
  
  /* Bottom section mobile */
  .toddler-garden-section {
    padding: 3.5rem 1rem 5rem;
  }
  
  .toddler-bookshelf-wrapper {
    padding: 0 1.8rem;
  }
  
  .toddler-books-scroller {
    gap: 2rem;
  }
  
  .toddler-books-scroller .library-card-wrapper {
    flex: 0 0 100%;
    max-width: 290px;
    scroll-snap-align: center;
  }
  
  .forest-pebble {
    display: none !important; /* Declutter mobile view */
  }
}

/* ==========================================================================
   Cozy Masterpiece Welcome Splash Gateway Custom Overrides
   ========================================================================== */
.shoji-gate-overlay .mystical-full-moon {
  display: none !important;
}

.shoji-gate-overlay .cabin-silhouette {
  display: none !important;
}

.shoji-gate-overlay .forest-silhouette-left,
.shoji-gate-overlay .forest-silhouette-right {
  display: none !important;
}

.shoji-gate-overlay .hero-title-container {
  display: none !important;
}

.shoji-gate-overlay .hero-subtitle {
  display: none !important;
}

.shoji-gate-overlay .hanging-wisteria {
  display: none !important;
}

.shoji-gate-overlay .magical-lantern {
  display: none !important;
}

.shoji-gate-overlay .gate-lantern-glow {
  display: none !important;
}

/* Perfect alignment of entry button at the bottom of the cloud */
.shoji-gate-overlay .hero-content.gate-content {
  padding-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding-bottom: 7vh;
}

.shoji-gate-overlay .capsule-button-container {
  margin-top: 0;
}


