/* ══════════════════════════════════════════════════════════════════════════
   Homepage Visual Themes & Enhancements (2026-10)
   Section identity colors, dramatic vitrine lighting, motif styling,
   animated counters, waveform visualization, breadcrumb navigation
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. SECTION IDENTITY COLORS & DIVIDERS ── */

/* Hero Section: Warm bone accent */
#main-content {
  position: relative;
  border-left: 6px solid var(--color-gold-light);
}

#main-content::before {
  content: '⬥';
  position: absolute;
  left: -16px;
  top: 20px;
  font-size: 1.2rem;
  color: var(--color-gold-light);
}

/* Observation Section: Gold divider with icon */
#constellation {
  position: relative;
  border-top: 2px dashed rgba(212, 175, 55, 0.3);
  padding-top: 3rem !important;
}

#constellation::before {
  content: '👁';
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.5rem;
  background: var(--color-paper);
  padding: 0 12px;
  z-index: 1;
}

#constellation h2::before {
  content: '◆ ';
  color: var(--color-gold-light);
  margin-right: 8px;
}

/* Architecture Section: Red/loss accent */
#deficit {
  position: relative;
  border-left: 4px solid var(--color-red);
  background: linear-gradient(90deg, rgba(255,107,107,0.05) 0%, transparent 8%) !important;
}

#deficit::before {
  content: '✕';
  position: absolute;
  left: -12px;
  top: 20px;
  font-size: 1.3rem;
  color: var(--color-red);
  font-weight: bold;
}

#deficit h2::before {
  content: '◉ ';
  color: var(--color-red);
  margin-right: 8px;
}

/* 53 Years Section: Timeline gradient */
#decades {
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(212, 175, 55, 0.1) 0%,
      rgba(233, 195, 73, 0.05) 50%,
      transparent 100%
    ) !important;
  border-top: 1px solid rgba(212, 175, 55, 0.2);
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

#decades::before {
  content: '⏱';
  position: absolute;
  left: 20px;
  top: 20px;
  font-size: 1.4rem;
}

#decades h2::before {
  content: '◈ ';
  color: var(--color-accent);
  margin-right: 8px;
}

/* Obsessions Section: Pattern theme */
#motifs {
  position: relative;
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 10px,
      rgba(212, 175, 55, 0.02) 10px,
      rgba(212, 175, 55, 0.02) 20px
    ),
    linear-gradient(180deg, rgba(14,14,16,0.6), rgba(14,14,16,0.3)) !important;
}

#motifs::before {
  content: '🔄';
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 1.4rem;
  opacity: 0.6;
}

#motifs h2::before {
  content: '◆◆ ';
  color: var(--color-accent-highlight);
  margin-right: 8px;
}

/* Juxtaposition Section: Alternating zones */
#serendipity {
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(19, 19, 21, 0.5) 0%,
      rgba(19, 19, 21, 0.2) 25%,
      rgba(19, 19, 21, 0.5) 50%,
      rgba(19, 19, 21, 0.2) 75%,
      rgba(19, 19, 21, 0.5) 100%
    ) !important;
  border-top: 2px solid rgba(212, 175, 55, 0.15);
}

#serendipity::before {
  content: '⇄';
  position: absolute;
  left: 50%;
  top: -24px;
  transform: translateX(-50%);
  font-size: 1.5rem;
  color: var(--color-accent);
  background: var(--color-paper);
  padding: 0 12px;
  z-index: 1;
}

#serendipity h2::before {
  content: '◈ ';
  color: var(--color-gold-light);
  margin-right: 8px;
}

/* ── 2. VITRINE MUSEUM DISPLAY ENHANCEMENT ── */

#master-vitrine-card {
  position: relative;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(242, 202, 80, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: box-shadow 300ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

#master-vitrine-card::before {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 4px;
  background: radial-gradient(
    ellipse 80% 50% at 50% 0%,
    rgba(242, 202, 80, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  z-index: -1;
  opacity: 0;
  transition: opacity 400ms ease;
}

#master-vitrine-card:hover::before {
  opacity: 1;
}

#master-vitrine-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 2px;
  box-shadow:
    inset 0 0 20px rgba(242, 202, 80, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  pointer-events: none;
  z-index: 2;
}

/* Depth shadow that rotates with the card */
#master-vitrine-card.interacted {
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.9),
    0 0 50px rgba(242, 202, 80, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Bloom effect when switching view modes */
#master-vitrine-img.view-raking,
#master-vitrine-img.view-verso,
#master-vitrine-img.view-uv {
  animation: vitrineBloom 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes vitrineBloom {
  0% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(242, 202, 80, 0));
  }
  50% {
    filter: brightness(1.02) drop-shadow(0 0 20px rgba(242, 202, 80, 0.4));
  }
  100% {
    filter: brightness(1) drop-shadow(0 0 0 rgba(242, 202, 80, 0));
  }
}

/* ── 3. MOTIF CARDS — COLOR-CODED ACCENT STRIPES ── */

/* Guernica Series: Burnt red/orange */
.motif-card:nth-child(1) {
  border-left: 5px solid var(--color-motif-guernica) !important;
  position: relative;
}

.motif-card:nth-child(1)::before {
  content: '🎨';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
  opacity: 0.6;
}

.motif-card:nth-child(1):hover {
  border-left-color: var(--color-motif-guernica-hover) !important;
  box-shadow: 0 8px 24px rgba(212, 87, 29, 0.2), inset 0 0 20px rgba(212, 87, 29, 0.08) !important;
}

/* Targets & Warplanes: Cool steel blue */
.motif-card:nth-child(2) {
  border-left: 5px solid var(--color-motif-warplanes) !important;
  position: relative;
}

.motif-card:nth-child(2)::before {
  content: '✈';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.3rem;
  opacity: 0.6;
}

.motif-card:nth-child(2):hover {
  border-left-color: var(--color-motif-warplanes-hover) !important;
  box-shadow: 0 8px 24px rgba(90, 122, 140, 0.2), inset 0 0 20px rgba(90, 122, 140, 0.08) !important;
}

/* Register of Loss: Soft amber/gold */
.motif-card:nth-child(3) {
  border-left: 5px solid var(--color-accent) !important;
  position: relative;
}

.motif-card:nth-child(3)::before {
  content: '📖';
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 1.2rem;
  opacity: 0.6;
}

.motif-card:nth-child(3):hover {
  border-left-color: var(--color-accent-highlight) !important;
  box-shadow: 0 8px 24px rgba(212, 175, 55, 0.2), inset 0 0 20px rgba(212, 175, 55, 0.08) !important;
}

/* Base motif card enhancement */
.motif-card {
  transition: all 200ms ease !important;
}

.motif-card:hover {
  transform: scale(1.02) !important;
  background-color: rgba(27, 27, 29, 0.9) !important;
}

/* Stagger entrance animation */
.motif-card {
  opacity: 0;
  transform: translateY(16px);
  animation: motifEnter 500ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.motif-card:nth-child(1) { animation-delay: 100ms; }
.motif-card:nth-child(2) { animation-delay: 250ms; }
.motif-card:nth-child(3) { animation-delay: 400ms; }

@keyframes motifEnter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── 4. ANIMATED COUNTER BADGES ── */

.stat-counter {
  position: relative;
  overflow: hidden;
}

.stat-counter-value {
  display: inline-block;
  font-variant-numeric: tabular-nums;
}

.stat-counter-value.counting {
  animation: counterCount 1200ms ease-out;
}

@keyframes counterCount {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Golden pulse on stat cards */
#deficit h3,
#decades h2 {
  position: relative;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.15);
}

#deficit .stat-counter,
#decades .stat-counter {
  position: relative;
}

#deficit .stat-counter::after,
#decades .stat-counter::after {
  content: '';
  position: absolute;
  inset: -4px -8px -4px -8px;
  background: linear-gradient(90deg,
    transparent,
    rgba(242, 202, 80, 0.2),
    transparent
  );
  animation: statPulse 2s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
}

.stat-counter.is-visible::after {
  animation: statPulse 2s ease-in-out 300ms infinite;
  opacity: 1;
}

@keyframes statPulse {
  0%, 100% { opacity: 0; }
  50% { opacity: 0.4; }
}

/* ── 5. WAVEFORM VISUALIZATION ENHANCEMENT ── */

#real-waveform {
  position: relative;
  background:
    linear-gradient(90deg,
      rgba(242, 202, 80, 0.05) 0%,
      rgba(233, 195, 73, 0.02) 50%,
      rgba(212, 175, 55, 0.05) 100%
    );
  border-radius: 2px;
  padding: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Frequency spectrum visualization behind waveform */
#real-waveform::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,
    var(--color-motif-guernica) 0%,
    var(--color-motif-guernica-hover) 15%,
    var(--color-accent) 30%,
    var(--color-accent-highlight) 50%,
    var(--color-motif-warplanes) 70%,
    var(--color-motif-warplanes-hover) 85%,
    var(--color-motif-guernica) 100%
  );
  opacity: 0.08;
  border-radius: 2px;
  filter: blur(12px);
  z-index: 0;
}

.wave-bar {
  position: relative;
  z-index: 1;
}

/* ── 6. LOADING STATES FOR LAZY-LOADED SECTIONS ── */

section[data-loading="true"] {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

section[data-loading="true"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(242, 202, 80, 0.1) 50%,
    transparent 100%
  );
  animation: loadingShimmer 2s ease-in-out infinite;
  z-index: 10;
  pointer-events: none;
}

@keyframes loadingShimmer {
  0%, 100% {
    transform: translateX(-100%);
  }
  50% {
    transform: translateX(100%);
  }
}

section[data-loaded="true"] {
  animation: sectionReveal 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sectionReveal {
  0% {
    opacity: 0.85;
    filter: brightness(0.98);
  }
  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

/* ── 7. BREADCRUMB NAVIGATION — "YOU ARE HERE" ── */

.breadcrumb-nav {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 40;
  background: var(--color-glass-solid);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 24px;
  padding: 8px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  backdrop-filter: blur(8px);
  display: flex;
  gap: 8px;
  align-items: center;
  opacity: 0;
  animation: breadcrumbFadeIn 400ms ease-out 300ms forwards;
  pointer-events: auto;
}

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

.breadcrumb-crumb {
  display: inline-block;
  color: rgba(242, 202, 80, 0.95);
}

.breadcrumb-crumb.active {
  color: var(--color-gold-light);
  font-weight: 600;
}

.breadcrumb-sep {
  color: rgba(212, 175, 55, 0.8);
  margin: 0 4px;
}

@media (max-width: 1024px) {
  .breadcrumb-nav {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #master-vitrine-card {
    animation: none;
  }

  #master-vitrine-img.view-raking,
  #master-vitrine-img.view-verso,
  #master-vitrine-img.view-uv {
    animation: none;
  }

  .motif-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  section[data-loading="true"]::after {
    animation: none;
  }

  .breadcrumb-nav {
    animation: none;
    opacity: 1;
  }
}

@media (prefers-color-scheme: light) {
  #main-content {
    border-left-color: var(--color-accent);
  }

  #main-content::before {
    color: var(--color-accent);
  }

  .motif-card:hover {
    background-color: rgba(244, 239, 230, 0.8) !important;
  }
}
