/* ============================================
   THE ANATOMY OF SCENT — Global Styles
   Dark luxury theme for perfume data visualization
   ============================================ */

:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-card-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #e8e0d4;
  --text-secondary: #9a9088;
  --text-muted: #6b6460;
  --accent-gold: #c9a96e;
  --accent-gold-light: #dfc48b;
  --accent-gold-dark: #8b7355;
  --border-subtle: rgba(201, 169, 110, 0.12);
  --border-active: rgba(201, 169, 110, 0.3);
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --section-padding: clamp(4rem, 8vw, 8rem);
  --content-width: 1200px;
  --viz-height: 70vh;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  overflow-x: hidden;
}

a {
  color: var(--accent-gold);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--accent-gold-light);
}

strong {
  color: var(--accent-gold);
  font-weight: 500;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 2.5rem;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav.visible {
  transform: translateY(0);
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent-gold);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 2rem;
}

.hero-eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(3.5rem, 10vw, 8rem);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.5s forwards;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 3rem;
  opacity: 0;
  animation: fadeInUp 1s ease 0.7s forwards;
}

.hero-scroll-indicator {
  opacity: 0;
  animation: fadeInUp 1s ease 1s forwards;
}

.hero-scroll-indicator span {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent-gold), transparent);
  margin: 0 auto;
  animation: scrollPulse 2s ease-in-out infinite;
}

/* ============================================
   STORY SECTIONS
   ============================================ */

.story-section {
  position: relative;
  padding: var(--section-padding) 0;
}

.section-intro {
  max-width: var(--content-width);
  margin: 0 auto 4rem;
  padding: 0 2.5rem;
}

.section-number {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.section-description {
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--text-secondary);
  max-width: 650px;
  line-height: 1.8;
}

/* ============================================
   SCROLLYTELLING (Scrollama Pattern)
   ============================================ */

.scrolly {
  position: relative;
  display: flex;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.scrolly-graphic {
  flex: 1;
  min-width: 0;
}

.scrolly-graphic.sticky {
  position: sticky;
  top: 10vh;
  height: var(--viz-height);
  align-self: flex-start;
}

.scrolly-steps {
  flex: 0 0 340px;
  margin-left: 3rem;
  padding: 40vh 0;
}

.step {
  padding: 2rem 2rem;
  margin-bottom: 60vh;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  opacity: 0.3;
  transition: opacity 0.5s ease, border-color 0.5s ease;
}

.step.is-active {
  opacity: 1;
  border-color: var(--border-active);
}

.step p {
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text-primary);
}

/* ============================================
   VISUALIZATION CONTAINERS
   ============================================ */

.viz-container {
  width: 100%;
  height: 100%;
  min-height: 400px;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.viz-container svg {
  width: 100%;
  height: 100%;
}

.viz-full-width {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2.5rem;
  height: auto;
  min-height: 600px;
  overflow: visible;
  background: transparent;
  border: none;
}

/* ============================================
   GEO MAP + RADAR LAYOUT
   ============================================ */

.geo-section-layout {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.geo-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  height: 500px;
}

.geo-map-container {
  flex: 1.3;
  min-width: 0;
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  overflow: hidden;
}

.geo-radar-container {
  flex: 0.7;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.geo-steps {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.geo-steps .step {
  flex: 1;
  padding: 1.5rem;
  margin-bottom: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  opacity: 0.5;
  transition: opacity 0.4s ease, border-color 0.4s ease;
  cursor: pointer;
}

.geo-steps .step.is-active {
  opacity: 1;
  border-color: var(--border-active);
}

.geo-steps .step p {
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text-primary);
}

/* ============================================
   DEEP DIVE GRID
   ============================================ */

.deep-dive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2.5rem;
}

.deep-dive-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 2rem;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.deep-dive-card:hover {
  border-color: var(--border-active);
  background: var(--bg-card-hover);
}

.deep-dive-card h3 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.card-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.deep-dive-card .viz-container {
  height: 400px;
  min-height: 400px;
  background: transparent;
  border: none;
}

/* ============================================
   TOOLTIP
   ============================================ */

.tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(17, 17, 17, 0.95);
  border: 1px solid var(--border-active);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  backdrop-filter: blur(10px);
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
  max-width: 250px;
}

.tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 0.3rem;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.15rem 0;
}

.tooltip-label {
  color: var(--text-secondary);
}

.tooltip-value {
  color: var(--text-primary);
  font-weight: 500;
}

/* ============================================
   FOOTER
   ============================================ */

.footer {
  padding: 4rem 2.5rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.footer-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--accent-gold);
  margin-bottom: 1rem;
}

.footer-credits {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.footer-data {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-data a {
  color: var(--text-secondary);
}

/* Hover hints */
.hover-hint {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.8rem;
  opacity: 0.5;
}

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

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

@keyframes scrollPulse {
  0%, 100% {
    opacity: 0.4;
    transform: scaleY(1);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.3);
  }
}

/* Section reveal animation */
.section-intro {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-intro.revealed {
  opacity: 1;
  transform: translateY(0);
}

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

@media (max-width: 900px) {
  .scrolly {
    flex-direction: column;
  }

  .scrolly-graphic {
    width: 100%;
  }

  .scrolly-graphic.sticky {
    position: relative;
    top: auto;
    height: 60vh;
    margin-bottom: 2rem;
  }

  .scrolly-steps {
    flex: 1;
    margin-left: 0;
    padding: 2rem 0;
  }

  .step {
    margin-bottom: 2rem;
  }

  .deep-dive-grid {
    grid-template-columns: 1fr;
  }

  .geo-layout {
    flex-direction: column;
  }

  .geo-radar-container {
    min-height: 300px;
  }

  .geo-steps {
    flex-direction: column;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 3rem;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* ============================================
   VIZ-SPECIFIC PLACEHOLDERS
   ============================================ */

.viz-loading {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: var(--text-muted);
  text-align: center;
}

/* D3 axis styling */
.viz-container .axis text {
  fill: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 11px;
}

.viz-container .axis line,
.viz-container .axis path {
  stroke: var(--border-subtle);
}

.viz-container .grid line {
  stroke: rgba(255, 255, 255, 0.04);
}

/* Legend */
.viz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 1rem;
  padding: 0 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
