/* ==========================================================================
   Liminal Website v2 — Brain Visualization Section Styles
   ==========================================================================
   Two-column layout: interactive 3D brain canvas (left) + topic cards (right).
   Cards use monospace descriptions and cyan-glow borders.
   ========================================================================== */


/* --------------------------------------------------------------------------
   Section Layout — Two-column grid
   -------------------------------------------------------------------------- */
.consciousness-section {
  background: linear-gradient(180deg, var(--bg-mid), var(--bg-deep));
  overflow: hidden;
}

.consciousness-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}


/* --------------------------------------------------------------------------
   Consciousness Visual — Dual-view container (Inward Journey + Brain)
   -------------------------------------------------------------------------- */
.consciousness-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Section subtitle — "The Inward Journey"
   -------------------------------------------------------------------------- */
.section-subtitle-journey {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cyan-soft);
  margin-bottom: 0.25rem;
  opacity: 0.7;
}


/* --------------------------------------------------------------------------
   Inward Journey View — Atomic visualization + quote carousel
   -------------------------------------------------------------------------- */
.inward-journey-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.5s ease;
  z-index: 2;
}

.consciousness-visual.brain-active .inward-journey-view {
  opacity: 0;
  pointer-events: none;
}

/* --- Scale Label ("As Above, So Below") --- */
.scale-label {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  text-align: center;
}

.scale-text {
  font-family: 'Cinzel', serif;
  font-size: 0.75rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(92, 224, 216, 0.5);
  animation: scale-text-cycle 20s ease-in-out infinite;
}

@keyframes scale-text-cycle {
  0%, 10%  { content: 'Atomic Scale'; color: rgba(92, 224, 216, 0.5); }
  20%      { opacity: 0; }
  30%      { opacity: 1; }
  40%, 60% { color: rgba(212, 168, 83, 0.6); }
  70%      { opacity: 0; }
  80%      { opacity: 1; }
  90%, 100% { color: rgba(92, 224, 216, 0.5); }
}

/* --- Atomic Visualization --- */
.atomic-visualization {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  flex: 1;
  min-height: 0;
}

.atom-container {
  position: relative;
  width: 300px;
  height: 300px;
  /* Smooth zoom cycle: atomic (1x) → cosmic (1.5x) → atomic */
  animation: cosmic-zoom 20s ease-in-out infinite;
}

@keyframes cosmic-zoom {
  0%   { transform: scale(1); }
  15%  { transform: scale(1); }
  45%  { transform: scale(1.5); }
  55%  { transform: scale(1.5); }
  85%  { transform: scale(1); }
  100% { transform: scale(1); }
}

/* Nucleus — morphs between atom core (rose/violet) and sun (gold/orange) */
.nucleus {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, #e879a8 0%, #8b7cf6 45%, #5ce0d8 100%);
  transform: translate(-50%, -50%);
  z-index: 3;
  animation: nucleus-pulse 3s ease-in-out infinite, nucleus-morph 20s ease-in-out infinite;
}

.nucleus-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.4) 0%, rgba(92, 224, 216, 0.15) 50%, transparent 100%);
  transform: translate(-50%, -50%);
  filter: blur(12px);
  z-index: 2;
  animation: nucleus-pulse 3s ease-in-out infinite, glow-morph 20s ease-in-out infinite;
}

@keyframes nucleus-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.15); }
}

/* Nucleus color shift: atom core → golden sun → back */
@keyframes nucleus-morph {
  0%, 15% {
    background: radial-gradient(circle, #e879a8 0%, #8b7cf6 45%, #5ce0d8 100%);
    width: 40px; height: 40px;
  }
  45%, 55% {
    background: radial-gradient(circle, #ffedd5 0%, #ff8a00 40%, #d4a853 100%);
    width: 60px; height: 60px;
  }
  85%, 100% {
    background: radial-gradient(circle, #e879a8 0%, #8b7cf6 45%, #5ce0d8 100%);
    width: 40px; height: 40px;
  }
}

/* Glow shifts to warm gold during cosmic phase */
@keyframes glow-morph {
  0%, 15% {
    background: radial-gradient(circle, rgba(139, 124, 246, 0.4) 0%, rgba(92, 224, 216, 0.15) 50%, transparent 100%);
    width: 80px; height: 80px;
    filter: blur(12px);
  }
  45%, 55% {
    background: radial-gradient(circle, rgba(212, 168, 83, 0.6) 0%, rgba(255, 138, 0, 0.2) 50%, transparent 100%);
    width: 120px; height: 120px;
    filter: blur(18px);
  }
  85%, 100% {
    background: radial-gradient(circle, rgba(139, 124, 246, 0.4) 0%, rgba(92, 224, 216, 0.15) 50%, transparent 100%);
    width: 80px; height: 80px;
    filter: blur(12px);
  }
}

/* Orbits */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid transparent;
  transform-origin: center;
}

.orbit-1 {
  width: 120px;
  height: 120px;
  margin-top: -60px;
  margin-left: -60px;
  border-color: rgba(92, 224, 216, 0.25);
  animation: orbit-spin 8s linear infinite, orbit-breathe 20s ease-in-out infinite;
}

.orbit-2 {
  width: 200px;
  height: 200px;
  margin-top: -100px;
  margin-left: -100px;
  border-color: rgba(139, 124, 246, 0.2);
  animation: orbit-spin 15s linear infinite reverse, orbit-breathe 20s ease-in-out infinite;
}

.orbit-3 {
  width: 280px;
  height: 280px;
  margin-top: -140px;
  margin-left: -140px;
  border-color: rgba(232, 121, 168, 0.15);
  animation: orbit-spin 25s linear infinite, orbit-breathe 20s ease-in-out infinite;
}

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

/* Orbits expand slightly during cosmic phase, contract during atomic */
@keyframes orbit-breathe {
  0%, 15% { opacity: 0.8; }
  45%, 55% { opacity: 0.4; }
  85%, 100% { opacity: 0.8; }
}

/* Electrons */
.electron {
  position: absolute;
  border-radius: 50%;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
}

.electron-cyan {
  width: 10px;
  height: 10px;
  background: #5ce0d8;
  box-shadow: 0 0 10px #5ce0d8, 0 0 20px rgba(92, 224, 216, 0.5);
}

.electron-violet {
  width: 8px;
  height: 8px;
  top: -4px;
  background: #8b7cf6;
  box-shadow: 0 0 10px #8b7cf6, 0 0 20px rgba(139, 124, 246, 0.5);
}

.electron-cyan-2 {
  width: 9px;
  height: 9px;
  top: auto;
  bottom: -5px;
  background: #5ce0d8;
  box-shadow: 0 0 8px #5ce0d8, 0 0 16px rgba(92, 224, 216, 0.4);
}

.electron-rose {
  width: 12px;
  height: 12px;
  top: -6px;
  left: 25%;
  background: #e879a8;
  box-shadow: 0 0 12px #e879a8, 0 0 24px rgba(232, 121, 168, 0.5);
}

/* --- Quote Carousel --- */
.quote-carousel {
  text-align: center;
  max-width: 420px;
  padding: 0 1rem;
  margin-top: 0.5rem;
}

.quote-author {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cyan-soft);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  transition: opacity 0.5s ease;
}

.quote-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0;
  padding: 0;
  border: none;
  transition: opacity 0.5s ease;
}

.quote-author.fade-out,
.quote-text.fade-out {
  opacity: 0;
}

.quote-author.fade-in,
.quote-text.fade-in {
  opacity: 1;
}


/* --------------------------------------------------------------------------
   Brain View — Canvas (hidden by default, shown on topic select)
   -------------------------------------------------------------------------- */
.brain-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.consciousness-visual.brain-active #brain-view {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.brain-view canvas {
  width: 100%;
  height: 100%;
  border-radius: 16px;
}

.brain-label {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--cyan-soft);
  background: rgba(10, 11, 20, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 0.4rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.3s ease;
}


/* --------------------------------------------------------------------------
   Consciousness Tabs — Mind / Heart / Soul
   -------------------------------------------------------------------------- */
.consciousness-tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.tab-btn {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  background: rgba(10, 14, 39, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  color: var(--text-secondary);
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    background 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}

.tab-btn:hover {
  border-color: rgba(0, 212, 255, 0.5);
  color: var(--cyan-soft);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.1);
}

.tab-btn.active {
  border-color: var(--cyan);
  background: rgba(0, 212, 255, 0.1);
  color: var(--cyan);
  box-shadow:
    0 0 16px rgba(0, 212, 255, 0.2),
    0 0 32px rgba(0, 212, 255, 0.06);
}

/* Heart tab active — magenta accent */
.tab-btn.active[data-tab="heart"] {
  border-color: var(--magenta);
  background: rgba(232, 121, 168, 0.1);
  color: var(--magenta);
  box-shadow:
    0 0 16px rgba(232, 121, 168, 0.2),
    0 0 32px rgba(232, 121, 168, 0.06);
}

.tab-btn:hover[data-tab="heart"] {
  border-color: rgba(232, 121, 168, 0.5);
  color: var(--magenta);
  box-shadow: 0 0 12px rgba(232, 121, 168, 0.1);
}

/* Soul tab active — purple accent */
.tab-btn.active[data-tab="soul"] {
  border-color: var(--purple);
  background: rgba(139, 124, 246, 0.1);
  color: var(--purple);
  box-shadow:
    0 0 16px rgba(139, 124, 246, 0.2),
    0 0 32px rgba(139, 124, 246, 0.06);
}

.tab-btn:hover[data-tab="soul"] {
  border-color: rgba(139, 124, 246, 0.5);
  color: var(--purple);
  box-shadow: 0 0 12px rgba(139, 124, 246, 0.1);
}


/* --------------------------------------------------------------------------
   Tab-group visibility — hide non-active tab cards
   -------------------------------------------------------------------------- */
.topic-card[data-tab-group="heart"],
.topic-card[data-tab-group="soul"] {
  display: none;
}

/* When tabs are switched, JS toggles data-active-tab on the container.
   The visibility is handled by main.js adding/removing inline display styles. */


/* --------------------------------------------------------------------------
   Heart & Soul view canvases (same layout as brain-view)
   -------------------------------------------------------------------------- */
#heart-view,
#soul-view {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.consciousness-visual.heart-active #heart-view {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

.consciousness-visual.soul-active #soul-view {
  opacity: 1;
  pointer-events: auto;
  z-index: 3;
}

/* Hide inward journey when any visualization is active */
.consciousness-visual.heart-active .inward-journey-view,
.consciousness-visual.soul-active .inward-journey-view {
  opacity: 0;
  pointer-events: none;
}


/* --------------------------------------------------------------------------
   Topic Cards Container
   -------------------------------------------------------------------------- */
.topic-cards-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}


/* --------------------------------------------------------------------------
   Individual Topic Card
   -------------------------------------------------------------------------- */
.topic-card {
  background: rgba(10, 14, 39, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.15);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease,
    transform 0.2s ease;
}

.topic-card:hover {
  border-color: rgba(0, 212, 255, 0.5);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
  background: rgba(10, 14, 39, 0.65);
  transform: translateX(4px);
}

.topic-card.active {
  border-color: var(--cyan);
  box-shadow:
    0 0 24px rgba(0, 212, 255, 0.2),
    0 0 48px rgba(0, 212, 255, 0.08),
    inset 0 0 20px rgba(0, 212, 255, 0.03);
  background: rgba(0, 212, 255, 0.06);
}


/* --- Topic Number --- */
.topic-number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--cyan);
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.topic-card:hover .topic-number,
.topic-card.active .topic-number {
  opacity: 1;
}


/* --- Topic Title --- */
.topic-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.topic-card.active .topic-title {
  color: var(--cyan);
}


/* --- Topic Description (monospace) --- */
.topic-description {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  transition: color 0.3s ease;
}

.topic-card:hover .topic-description,
.topic-card.active .topic-description {
  color: var(--text-secondary);
}


/* --- Region Tags --- */
.topic-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.region-tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(0, 212, 255, 0.08);
  border: 1px solid rgba(0, 212, 255, 0.15);
  color: var(--cyan-soft);
  transition: all 0.3s ease;
}

.topic-card.active .region-tag {
  background: rgba(0, 212, 255, 0.15);
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--cyan);
}


/* --------------------------------------------------------------------------
   Responsive — Tablet (<=1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .consciousness-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .consciousness-visual {
    max-width: 450px;
    order: -1;
  }

  .atom-container {
    width: 240px;
    height: 240px;
  }

  .orbit-3 {
    width: 230px;
    height: 230px;
    margin-top: -115px;
    margin-left: -115px;
  }

  .topic-cards-container {
    max-width: 560px;
    margin: 0 auto;
  }
}


/* --------------------------------------------------------------------------
   Responsive — Mobile (<=768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .consciousness-tabs {
    gap: 0.35rem;
  }

  .tab-btn {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    letter-spacing: 0.08em;
  }

  .consciousness-grid {
    gap: 1.5rem;
  }

  .consciousness-visual {
    max-width: 320px;
  }

  .atom-container {
    width: 200px;
    height: 200px;
  }

  .orbit-2 {
    width: 160px;
    height: 160px;
    margin-top: -80px;
    margin-left: -80px;
  }

  .orbit-3 {
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
  }

  .quote-text {
    font-size: 0.95rem;
  }

  .topic-card {
    padding: 1rem 1.25rem;
  }

  .topic-title {
    font-size: 0.95rem;
  }

  .topic-description {
    font-size: 0.72rem;
  }

  .topic-card:hover {
    transform: none;
  }
}


/* --------------------------------------------------------------------------
   Responsive — Small Mobile (<=480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .tab-btn {
    font-size: 0.7rem;
    padding: 0.4rem 0.75rem;
    letter-spacing: 0.06em;
  }

  .consciousness-visual {
    max-width: 280px;
  }

  .atom-container {
    width: 170px;
    height: 170px;
  }

  .orbit-1 {
    width: 80px;
    height: 80px;
    margin-top: -40px;
    margin-left: -40px;
  }

  .orbit-2 {
    width: 130px;
    height: 130px;
    margin-top: -65px;
    margin-left: -65px;
  }

  .orbit-3 {
    width: 170px;
    height: 170px;
    margin-top: -85px;
    margin-left: -85px;
  }

  .quote-text {
    font-size: 0.85rem;
  }

  .quote-carousel {
    max-width: 260px;
  }

  .region-tag {
    font-size: 0.6rem;
    padding: 0.15rem 0.4rem;
  }
}
