/* ==========================================================================
   STORY OF MY LIFE - PINTEREST AESTHETIC DESIGN SYSTEM & MOTION GRAPHICS
   ========================================================================== */

:root {
  /* Warm, Bright & Radiant Color Palette */
  --bg-main: #FAF8F5;
  --bg-surface: #FFFFFF;
  --bg-warm: #FFF9F2;
  --bg-card: #FFFFFF;
  --bg-darkroom: #1A1412;
  
  /* Primary & Accent Accents */
  --amber: #F59E0B;
  --amber-glow: rgba(245, 158, 11, 0.4);
  --gold: #D4AF37;
  --rose: #F43F5E;
  --blush: #FB7185;
  --peach: #FF8A65;
  --purple: #8B5CF6;
  --emerald: #10B981;
  --ink: #1F1D1A;
  --ink-soft: #4B463F;
  --ink-muted: #827A71;
  --border-light: rgba(0, 0, 0, 0.07);
  --border-gold: rgba(212, 175, 55, 0.35);

  /* Shadows & Elevations */
  --shadow-pin: 0 4px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 35px -8px rgba(0, 0, 0, 0.14), 0 6px 12px -3px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 25px var(--amber-glow);

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-hand: 'Caveat', cursive;
  --font-note: 'Patrick Hand', cursive;

  /* Layout */
  --nav-height: 72px;
  --player-height: 84px;
  --container-max: 1440px;
}

/* Reset & Base Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(#ecdcc9 0.8px, transparent 0.8px),
    radial-gradient(#faeee0 0.8px, var(--bg-main) 0.8px);
  background-size: 32px 32px;
  background-position: 0 0, 16px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  padding-bottom: 40px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #F1ECE4;
}
::-webkit-scrollbar-thumb {
  background: #D8CEBE;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--amber);
}

/* ==========================================================================
   AMBIENT BACKGROUND PARTICLES & FAIRY LIGHTS
   ========================================================================== */
.ambient-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.fairy-lights-string {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 20' preserveAspectRatio='none'%3E%3Cpath d='M0 4 Q25 18 50 4 T100 4' fill='none' stroke='%23C5A059' stroke-width='1.2'/%3E%3C/svg%3E") repeat-x;
  background-size: 140px 30px;
  opacity: 0.6;
}

.fairy-bulb {
  position: absolute;
  width: 10px;
  height: 14px;
  border-radius: 50% 50% 40% 40%;
  background: #FFF3C4;
  box-shadow: 0 0 14px #FFD54F, 0 0 28px rgba(255, 213, 79, 0.6);
  animation: bulbFlicker 3s infinite alternate ease-in-out;
}

@keyframes bulbFlicker {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(0.92); }
}

/* Floating Bokeh Orbs */
.bokeh-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.18;
  animation: floatOrb 20s infinite ease-in-out alternate;
}
.bokeh-1 { top: 10%; left: -5%; width: 350px; height: 350px; background: #FFD180; animation-duration: 16s; }
.bokeh-2 { top: 40%; right: -5%; width: 420px; height: 420px; background: #FF80AB; animation-duration: 22s; }
.bokeh-3 { top: 70%; left: 10%; width: 380px; height: 380px; background: #B388FF; animation-duration: 18s; }

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ==========================================================================
   ENTRANCE GATE / CURTAIN
   ========================================================================== */
#gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: radial-gradient(circle at 50% 40%, #FFFDF9 0%, #FAF0E4 60%, #F5E5D3 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s;
}

#gate.hidden-gate {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gate-envelope {
  position: relative;
  background: #FFFFFF;
  padding: 42px 36px 36px;
  border-radius: 28px;
  box-shadow: 0 25px 60px -10px rgba(180, 130, 80, 0.25), 0 0 0 1px rgba(220, 190, 150, 0.3);
  max-width: 520px;
  width: 100%;
  border: 2px dashed rgba(212, 175, 55, 0.4);
  animation: gateFloat 4s ease-in-out infinite;
}

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

.gate-seal {
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #F59E0B, #D97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.5rem;
  box-shadow: 0 6px 16px rgba(217, 119, 6, 0.4);
}

.gate-subhead {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--peach);
  margin-bottom: 6px;
}

.gate-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 14px;
}

.gate-title span {
  background: linear-gradient(135deg, #D97706, #E11D48);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-style: italic;
}

.gate-desc {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 24px;
  line-height: 1.6;
}

.gate-music-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.btn-open-story {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #F59E0B, #E11D48);
  color: #FFFFFF;
  border: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.05rem;
  padding: 16px 36px;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(225, 29, 72, 0.35);
  transition: transform 0.25s, box-shadow 0.25s;
  overflow: hidden;
}

.btn-open-story:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 32px rgba(225, 29, 72, 0.45);
}

.btn-open-story:active {
  transform: translateY(1px);
}

/* ==========================================================================
   NAVIGATION BAR & CHAPTER PROGRESS
   ========================================================================== */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: padding 0.3s;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #F59E0B, #F43F5E);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.3rem;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

.brand-text h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.1;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Quick Navigation Pills */
.nav-chapter-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
}
.nav-chapter-pills::-webkit-scrollbar {
  display: none;
}

.chapter-nav-btn {
  white-space: nowrap;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.chapter-nav-btn:hover {
  background: #FFF7ED;
  color: #C2410C;
  border-color: #FDBA74;
  transform: translateY(-1px);
}

.chapter-nav-btn.active {
  background: linear-gradient(135deg, #1F1D1A, #3A3530);
  color: #FFFFFF;
  border-color: #1F1D1A;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-sound-pill {
  background: #FFF7ED;
  color: #C2410C;
  border: 1px solid #FFEDD5;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.25s ease;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.15);
}

.btn-sound-pill:hover {
  background: #FDBA74;
  color: #7C2D12;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-sound-pill .sound-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px #10B981;
  animation: pulseDot 1.6s infinite ease-in-out;
}

.btn-sound-pill.muted .sound-dot {
  background: #9CA3AF;
  box-shadow: none;
  animation: none;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

/* ==========================================================================
   HERO / ONE DIRECTION DARKROOM VINTAGE SHOWCASE
   ========================================================================== */
.hero-section {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 40px 24px 60px;
  text-align: center;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #FEF3C7;
  color: #92400E;
  padding: 6px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
  border: 1px solid #FDE68A;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 16px;
}

.hero-title em {
  font-family: var(--font-hand);
  font-style: normal;
  font-weight: 700;
  color: var(--peach);
  display: inline-block;
  transform: rotate(-3deg);
  font-size: 1.1em;
  margin: 0 6px;
}

.hero-lead {
  max-width: 680px;
  margin: 0 auto 32px;
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* 1D Lyrics Marquee Ticker */
.lyrics-ticker-wrap {
  max-width: 820px;
  margin: 0 auto 40px;
  background: #FFFFFF;
  border-radius: 50px;
  padding: 10px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.lyrics-badge {
  background: linear-gradient(135deg, #F59E0B, #E11D48);
  color: #FFFFFF;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lyrics-text {
  font-family: var(--font-note);
  font-size: 1.25rem;
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  text-align: left;
}

/* ==========================================================================
   THE 1D RECREATION SPOTLIGHT (THEN VS NOW SLIDER)
   ========================================================================== */
.recreation-spotlight {
  max-width: 960px;
  margin: 0 auto 60px;
  background: #FFFFFF;
  border-radius: 28px;
  padding: 32px;
  box-shadow: 0 15px 40px -10px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border-light);
  position: relative;
}

.spotlight-header {
  margin-bottom: 24px;
}
.spotlight-badge {
  font-family: var(--font-hand);
  font-size: 1.5rem;
  color: var(--rose);
}
.spotlight-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
}

.comparison-container {
  position: relative;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.14);
  user-select: none;
  touch-action: none;
  background: #1A1412;
  container-type: inline-size;
}

.comparison-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.comparison-before {
  z-index: 2;
  width: 50%;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
}

.comparison-before img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100cqw;
  min-width: 100cqw;
  max-width: none;
  object-fit: cover;
  object-position: center center;
}

.comparison-after {
  z-index: 1;
  width: 100%;
  height: 100%;
}

.comparison-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background: #FFFFFF;
  z-index: 5;
  transform: translateX(-50%);
  cursor: ew-resize;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.4);
}

.comparison-slider-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  background: #FFFFFF;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--ink);
  font-weight: 700;
}

.comparison-label {
  position: absolute;
  bottom: 16px;
  padding: 6px 14px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 3;
}
.label-before { left: 16px; }
.label-after { right: 16px; }

/* ==========================================================================
   PINTEREST FILTER TABS & VIBE SELECTOR
   ========================================================================== */
.filter-dashboard {
  max-width: var(--container-max);
  margin: 0 auto 36px;
  padding: 0 24px;
}

.filter-bar {
  background: #FFFFFF;
  padding: 16px 20px;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tab {
  background: #F4EFEB;
  border: none;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.filter-tab .tab-count {
  background: rgba(0, 0, 0, 0.08);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.filter-tab:hover {
  background: #EAE3DC;
  color: var(--ink);
  transform: translateY(-1px);
}

.filter-tab.active {
  background: var(--ink);
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(31, 29, 26, 0.2);
}

.filter-tab.active .tab-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Vibe Selector Pills */
.vibe-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.vibe-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.vibe-pill {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
}
.vibe-pill:hover, .vibe-pill.active {
  background: #FFF7ED;
  color: #C2410C;
  border-color: #FDBA74;
}

/* ==========================================================================
   CONTINUOUS TIMELINE FLOW RIBBON
   ========================================================================== */
.timeline-path-indicator {
  position: relative;
  max-width: var(--container-max);
  margin: 20px auto 40px;
  padding: 0 24px;
}

.era-banner {
  background: #FFFFFF;
  border-radius: 24px;
  padding: 30px 36px;
  margin: 60px 0 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  border-left: 6px solid var(--amber);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.era-banner[data-era="old"] { border-left-color: #E06D53; }
.era-banner[data-era="mid"] { border-left-color: #D97706; }
.era-banner[data-era="mid2"] { border-left-color: #8B5CF6; }
.era-banner[data-era="2027"] { border-left-color: #EC4899; }
.era-banner[data-era="motion"] { border-left-color: #06B6D4; }

.era-badge-tag {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
  background: #F4EFEB;
  margin-bottom: 8px;
}

.era-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.3rem);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.era-desc {
  max-width: 600px;
  color: var(--ink-soft);
  font-size: 1rem;
  margin-top: 6px;
}

.era-counter {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  color: rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   PINTEREST MASONRY GRID & POLAROID PIN CARDS
   ========================================================================== */
.pinterest-grid {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  column-count: 4;
  column-gap: 24px;
}

@media (max-width: 1200px) {
  .pinterest-grid {
    column-count: 3;
    column-gap: 20px;
  }
}
@media (max-width: 820px) {
  .pinterest-grid {
    column-count: 2;
    column-gap: 16px;
    padding: 0 16px;
  }
}
@media (max-width: 520px) {
  .pinterest-grid {
    column-count: 1;
    column-gap: 0;
    padding: 0 14px;
  }
}

/* Pin Card Styling */
.pin-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: #FFFFFF;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  transform-origin: center center;
}

.pin-card:hover {
  transform: translateY(-8px) scale(1.015);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  z-index: 10;
}

/* Washi Tape Accent on Random Pins */
.washi-tape {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 90px;
  height: 24px;
  background: rgba(254, 215, 170, 0.85);
  backdrop-filter: blur(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  z-index: 5;
  pointer-events: none;
}
.pin-card:nth-child(3n) .washi-tape {
  background: rgba(251, 207, 232, 0.85);
  transform: translateX(-50%) rotate(3deg);
}
.pin-card:nth-child(4n) .washi-tape {
  background: rgba(221, 214, 254, 0.85);
  transform: translateX(-50%) rotate(-1deg);
}

/* Push Pin */
.push-pin {
  position: absolute;
  top: 10px;
  left: 14px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #F43F5E, #9F1239);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
  z-index: 6;
}

/* Card Media Container */
.pin-media-wrap {
  position: relative;
  width: 100%;
  background: #F3EDE5;
  overflow: hidden;
}

.pin-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.pin-card:hover .pin-image {
  transform: scale(1.03);
}

/* Video Pins */
.pin-video {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.video-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Pin Quick Action Overlays */
.pin-overlay-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(-6px);
  transition: all 0.25s ease;
  z-index: 4;
}

.pin-card:hover .pin-overlay-actions {
  opacity: 1;
  transform: translateY(0);
}

.btn-pin-heart {
  background: #FFFFFF;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #E11D48;
  font-size: 1rem;
  transition: transform 0.2s;
}
.btn-pin-heart:hover {
  transform: scale(1.15);
}

/* Pin Content Body */
.pin-body {
  padding: 16px 18px 18px;
}

.pin-era-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pin-era-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
}

.pin-vibe-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  background: #F4EFEB;
  color: var(--ink-soft);
}

.pin-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  margin-bottom: 6px;
}

.pin-caption {
  font-size: 0.88rem;
  color: var(--ink-soft);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* ==========================================================================
   EXPRESSION RADAR & ATTACK BOX ON CARDS
   ========================================================================== */
.pin-expression-box {
  background: #FFF9F2;
  border: 1px solid #FFE8D1;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.expression-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #C2410C;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.expression-desc {
  font-family: var(--font-note);
  font-size: 1.05rem;
  color: #7C2D12;
  line-height: 1.3;
}

/* Interactive Attack Launcher on Card */
.pin-attack-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0, 0, 0, 0.08);
}

.btn-card-attack {
  background: linear-gradient(135deg, #FFEDD5, #FEE2E2);
  border: 1px solid #FECDD3;
  color: #BE123C;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-card-attack:hover {
  background: linear-gradient(135deg, #E11D48, #BE123C);
  color: #FFFFFF;
  border-color: #BE123C;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(190, 18, 60, 0.3);
}

.attack-stat-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* Pin Tags */
.pin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}
.pin-tag-chip {
  font-size: 0.72rem;
  color: var(--ink-muted);
  background: #F4EFEB;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ==========================================================================
   DYNAMIC ATTACK STICKER BURST (MOTION GRAPHIC POPUPS)
   ========================================================================== */
.attack-sticker-burst {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0) rotate(-15deg);
  background: #FFF176;
  color: #1A1A1A;
  border: 3px solid #000000;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 50;
  pointer-events: none;
  animation: attackPopup 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes attackPopup {
  0% { transform: translate(-50%, -50%) scale(0.2) rotate(-25deg); opacity: 0; }
  30% { transform: translate(-50%, -50%) scale(1.15) rotate(8deg); opacity: 1; }
  70% { transform: translate(-50%, -50%) scale(1) rotate(-4deg); opacity: 1; }
  100% { transform: translate(-50%, -70%) scale(0.9) rotate(0); opacity: 0; }
}

/* Shake Animation when Card is Attacked */
@keyframes attackShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-5px, 3px) rotate(-2deg); }
  40% { transform: translate(5px, -3px) rotate(2deg); }
  60% { transform: translate(-4px, -2px) rotate(-1deg); }
  80% { transform: translate(4px, 2px) rotate(1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}
.card-shaking {
  animation: attackShake 0.45s ease-in-out;
}

/* Heart Float Animation */
.floating-heart {
  position: fixed;
  font-size: 1.5rem;
  pointer-events: none;
  z-index: 999;
  animation: floatHeart 1.4s ease-out forwards;
}

@keyframes floatHeart {
  0% { transform: translateY(0) scale(0.6); opacity: 1; }
  100% { transform: translateY(-120px) scale(1.3); opacity: 0; }
}

/* ==========================================================================
   LIGHTBOX MODAL (EXPANDED INSPECTION & FULL RESOLUTION)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(18, 15, 13, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-container {
  background: #FFFFFF;
  border-radius: 28px;
  max-width: 980px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-container {
  transform: scale(1);
}

.btn-close-modal {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  font-size: 1.2rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}
.btn-close-modal:hover {
  transform: scale(1.1);
}

.modal-media-side {
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px 0 0 28px;
  overflow: hidden;
  position: relative;
  min-height: 400px;
}

.modal-img {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.modal-video {
  width: 100%;
  height: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.modal-info-side {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.modal-header-meta {
  margin-bottom: 16px;
}

.modal-era-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  background: #FFF7ED;
  color: #C2410C;
  margin-bottom: 8px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.modal-caption {
  font-size: 1rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 20px;
}

.modal-expression-box {
  background: #FFF9F2;
  border: 1px solid #FFE8D1;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 24px;
}

.modal-exp-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #C2410C;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.modal-exp-text {
  font-family: var(--font-note);
  font-size: 1.25rem;
  color: #7C2D12;
  line-height: 1.4;
}

.modal-nav-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.btn-modal-nav {
  background: #F4EFEB;
  border: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  transition: all 0.2s;
}
.btn-modal-nav:hover {
  background: var(--ink);
  color: #FFFFFF;
}

@media (max-width: 820px) {
  .modal-container {
    grid-template-columns: 1fr;
    max-height: 94vh;
  }
  .modal-media-side {
    border-radius: 28px 28px 0 0;
    max-height: 48vh;
  }
  .modal-info-side {
    padding: 24px;
  }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  text-align: center;
  padding: 60px 24px 60px;
  color: var(--ink-muted);
}
.footer-heart {
  color: #E11D48;
  font-size: 1.2rem;
}
.footer-hand {
  font-family: var(--font-hand);
  font-size: 1.8rem;
  color: var(--peach);
  margin-top: 10px;
}

/* ==========================================================================
   MOBILE NAVBAR — HAMBURGER BUTTON
   ========================================================================== */
.btn-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: #FFFFFF;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  cursor: pointer;
  padding: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
  transition: background 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}
.btn-hamburger:hover {
  background: #FFF7ED;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.15);
}
.btn-hamburger.open .ham-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.btn-hamburger.open .ham-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.btn-hamburger.open .ham-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}
.ham-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s;
}

/* ==========================================================================
   MOBILE CHAPTER DRAWER (SLIDE-UP PANEL)
   ========================================================================== */
.mobile-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.mobile-drawer.open {
  transform: translateY(0);
  pointer-events: auto;
}
.mobile-drawer-inner {
  background: #FFFFFF;
  border-radius: 28px 28px 0 0;
  padding: 8px 20px 40px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.16);
  border-top: 1px solid var(--border-light);
}
/* Pull handle */
.mobile-drawer-inner::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  background: #D8CEBE;
  border-radius: 2px;
  margin: 10px auto 18px;
}
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.mobile-drawer-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}
.btn-close-drawer {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-light);
  background: #F4EFEB;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.btn-close-drawer:hover {
  background: #EAE3DC;
}
.mobile-drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-chapter-btn {
  width: 100%;
  text-align: left;
  border-radius: 16px !important;
  padding: 14px 20px !important;
  font-size: 1rem !important;
  justify-content: flex-start !important;
  background: #F9F5F0 !important;
  border: 1px solid var(--border-light) !important;
  box-shadow: none !important;
}
.mobile-chapter-btn.active {
  background: linear-gradient(135deg, #1F1D1A, #3A3530) !important;
  color: #FFFFFF !important;
  border-color: #1F1D1A !important;
}

/* Drawer Backdrop Overlay */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 499;
  background: rgba(18, 15, 13, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.drawer-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MOBILE RESPONSIVE BREAKPOINTS — NAVBAR & LAYOUT
   ========================================================================== */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop pills */
  .btn-hamburger {
    display: flex;
  }
  .nav-chapter-pills {
    display: none;
  }

  /* Compact navbar */
  .top-navbar {
    padding: 10px 16px;
    gap: 10px;
  }

  /* Smaller brand text */
  .brand-text h2 {
    font-size: 0.95rem;
  }
  .brand-text p {
    display: none;
  }
  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  /* Compact audio button on mobile */
  .btn-sound-pill {
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  #audioBtnText::before {
    content: '🎵';
  }

  /* Hero */
  .hero-section {
    padding: 28px 16px 40px;
  }
  .hero-lead {
    font-size: 1rem;
  }

  /* Spotlight */
  .recreation-spotlight {
    margin: 0 12px 40px;
    padding: 20px 16px;
    border-radius: 20px;
  }
  .spotlight-title {
    font-size: 1.4rem;
  }

  /* Filter dashboard */
  .filter-dashboard {
    padding: 0 12px;
    margin-bottom: 24px;
  }
  .filter-bar {
    padding: 12px 14px;
    border-radius: 18px;
    gap: 12px;
  }
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .filter-tabs::-webkit-scrollbar { display: none; }
  .filter-tab {
    white-space: nowrap;
    font-size: 0.82rem;
    padding: 8px 14px;
  }
  .vibe-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .vibe-pills::-webkit-scrollbar { display: none; }
  .vibe-pill {
    white-space: nowrap;
  }

  /* Grid */
  .pinterest-grid {
    column-count: 2;
    column-gap: 12px;
    padding: 0 12px;
  }
  .pin-card {
    margin-bottom: 12px;
  }

  /* Modal full-screen on mobile */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal-container {
    border-radius: 24px 24px 0 0;
    max-height: 96vh;
    width: 100%;
    max-width: 100%;
    grid-template-columns: 1fr;
  }
  .modal-media-side {
    border-radius: 24px 24px 0 0;
    max-height: 46vh;
  }
  .modal-info-side {
    padding: 18px 20px;
  }
  .modal-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .pinterest-grid {
    column-count: 1;
    padding: 0 10px;
  }
  .hero-title {
    font-size: clamp(2rem, 9vw, 3rem);
  }
  .lyrics-ticker-wrap {
    padding: 8px 14px;
    gap: 8px;
  }
  .lyrics-text {
    font-size: 0.9rem;
  }
  .gate-envelope {
    padding: 30px 20px 24px;
  }
  .gate-title {
    font-size: clamp(1.8rem, 7vw, 2.5rem);
  }
}

/* ==========================================================================
   PERFORMANCE — FAST IMAGE & VIDEO LOADING
   ========================================================================== */

/* Prevent layout shift while images load */
.pin-media-wrap {
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, #F4EFEB 0%, #EAE3DC 100%);
}

/* GPU-accelerated rendering for image/video */
.pin-image,
.pin-video {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Use content-visibility to skip off-screen cards entirely */
.pin-card {
  content-visibility: auto;
  contain-intrinsic-size: 0 400px;
}

/* Optimise image rendering */
.pin-image {
  image-rendering: auto;
  -webkit-optimize-contrast: auto;
}

/* Smooth fade-in when images load */
.pin-image,
.modal-img {
  animation: imgFadeIn 0.35s ease both;
}
@keyframes imgFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .pin-card,
  .pin-image,
  .btn-hamburger,
  .mobile-drawer {
    transition: none !important;
    animation: none !important;
  }
}
