/* ═══════════════════════════════════════════
   CYBERAXE LIFE WIKI — HUB PAGE STYLES
   AAA quality: particle hero, glass topbar,
   interactive cards, animated counters,
   featured rotator, timeline, connect
   ═══════════════════════════════════════════ */

/* ─── TOPBAR ENTRANCE ─── */
.topbar {
  opacity: 0;
  animation: fadeSlideDown 0.6s 1.2s ease forwards;
}

/* ─── HERO / INTRO ─── */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
  overflow: hidden;
}

/* Constellation canvas sits behind hero content */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero > *:not(#hero-canvas) {
  position: relative;
  z-index: 2;
}

/* Radial glow behind the title */
.hero::after {
  content: '';
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 500px;
  background: radial-gradient(ellipse,
    rgba(var(--accent-fire-rgb), 0.06) 0%,
    rgba(var(--accent-electric-rgb), 0.03) 40%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 1;
}

.hero-badge {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--accent-fire);
  margin-bottom: 14px;
  opacity: 0;
  animation: fadeSlideUp 0.6s 0.3s forwards;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.1;
  opacity: 0;
  animation: fadeSlideUp 0.8s 0.6s forwards;
}
.hero-title .hl {
  color: var(--accent-fire);
  text-shadow: 0 0 40px rgba(var(--accent-fire-rgb), 0.3);
}

.hero-subtitle {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 14px;
  letter-spacing: 1px;
  opacity: 0;
  animation: fadeSlideUp 0.6s 1s forwards;
}

.hero-typing-wrap {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-muted);
  min-height: 22px;
  opacity: 0;
  animation: fadeIn 0.4s 1.5s forwards;
}
.hero-typing-cursor {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--accent-fire);
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.7s step-end infinite;
}

.hero-listen-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 12px 28px;
  background: var(--accent-fire);
  color: #000;
  border: none;
  border-radius: 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s;
  animation: fadeSlideUp 0.8s 2.5s both;
}
.hero-listen-btn:hover {
  background: #ff9940;
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(240, 133, 45, 0.4);
}

.hero-scroll {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 2px;
  opacity: 0;
  animation: float 3s ease-in-out infinite, fadeIn 0.6s 2.5s forwards;
}

/* ─── BRANCH GRID ─── */
.branches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.branch-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 18px;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}
.branch-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-fire);
  opacity: 0;
  transition: opacity var(--transition-med);
}
/* Glow effect on hover */
.branch-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--accent-fire-rgb), 0.06), transparent 70%);
  opacity: 0;
  transition: opacity var(--transition-med);
  pointer-events: none;
}
.branch-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-fire);
  box-shadow:
    0 8px 32px rgba(var(--accent-fire-rgb), 0.08),
    0 0 0 1px rgba(var(--accent-fire-rgb), 0.1);
}
.branch-card:hover::before { opacity: 1; }
.branch-card:hover::after { opacity: 1; }

.branch-icon { font-size: 28px; margin-bottom: 8px; }
.branch-name {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.branch-tag {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.branch-domain {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--accent-electric);
  margin-top: 8px;
  opacity: 0.5;
  transition: opacity var(--transition-fast);
}
.branch-card:hover .branch-domain { opacity: 1; }

/* Hover preview */
.branch-preview {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, margin 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.branch-card:hover .branch-preview {
  max-height: 80px;
  margin-top: 10px;
  opacity: 1;
}
.branch-enter {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-fire);
  text-transform: uppercase;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.2s 0.1s, transform 0.2s 0.1s;
}
.branch-card:hover .branch-enter {
  opacity: 1;
  transform: translateX(0);
}

.branch-status {
  position: absolute;
  top: 12px; right: 12px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
  animation: livePulse 2s ease-in-out infinite;
}
.branch-status.coming {
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
}

/* Landing highlight for domain-aware arrival */
.branch-card.landing-highlight {
  border-color: var(--accent-fire);
  box-shadow: 0 0 24px rgba(var(--accent-fire-rgb), 0.12);
  animation: borderGlow 2s ease-in-out 3;
}

/* ─── IMPACT COUNTERS ─── */
.counters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 36px;
}

.counter-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-med);
  position: relative;
  overflow: hidden;
}
.counter-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent-fire);
  transform: scaleX(0);
  transition: transform var(--transition-med);
}
.counter-card:hover {
  border-color: var(--accent-fire);
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(var(--accent-fire-rgb), 0.1);
}
.counter-card:hover::before { transform: scaleX(1); }

.counter-value {
  font-family: var(--font-display);
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 900;
  color: var(--accent-fire);
  line-height: 1;
}
.counter-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.counter-click-hint {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  opacity: 0;
  margin-top: 4px;
  transition: opacity var(--transition-fast);
}
.counter-card:hover .counter-click-hint { opacity: 0.6; }

/* Animated breakdown expansion */
.counter-breakdown {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease;
  opacity: 0;
  font-size: 11px;
  text-align: left;
}
.counter-card.expanded .counter-breakdown {
  max-height: 200px;
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
  opacity: 1;
}
.counter-breakdown-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  color: var(--text-secondary);
}
.counter-breakdown-row .val {
  font-family: var(--font-mono);
  color: var(--accent-electric);
  font-weight: 600;
}

/* ─── FEATURED BRANCH ROTATOR ─── */
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 28px 20px;
  margin-top: 36px;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}
.featured-content { flex: 1; min-width: 0; }
.featured-arrow {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  transition: all var(--transition-fast);
  line-height: 1;
}
.featured-arrow:hover {
  border-color: var(--accent-fire);
  color: var(--accent-fire);
  background: rgba(var(--accent-fire-rgb), 0.08);
}
.featured-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 16px;
}
.featured-counter {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.featured-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-fire), var(--accent-electric), var(--accent-fire));
  background-size: 200% 100%;
  animation: gradientSlide 3s linear infinite;
}
@keyframes gradientSlide {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.featured-badge {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-fire);
  margin-bottom: 8px;
}
.featured-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.featured-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 600px;
}
.featured-stats {
  display: flex;
  gap: 24px;
  margin-top: 16px;
}
.featured-stat-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-fire);
}
.featured-stat-lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}
.featured-dots {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}
.featured-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.featured-dot.active {
  background: var(--accent-fire);
  box-shadow: 0 0 10px rgba(var(--accent-fire-rgb), 0.5);
  transform: scale(1.3);
}
.featured-dot:hover:not(.active) { background: var(--border-glow); }

/* Content fade transition */
.featured-content {
  animation: viewFadeIn 0.4s ease;
}

/* ─── ACTIVITY FEED ─── */
.activity-list { margin-top: 16px; }
.activity-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(30, 30, 68, 0.5);
  border-radius: 8px;
  transition: all var(--transition-fast);
  cursor: pointer;
}
.activity-item:hover {
  background: rgba(var(--accent-electric-rgb), 0.04);
  border-color: rgba(var(--accent-electric-rgb), 0.1);
  transform: translateX(4px);
}
.activity-icon { font-size: 18px; flex-shrink: 0; padding-top: 2px; }
.activity-text { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.activity-text strong { color: var(--text-primary); }
.activity-time {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-left: auto;
  white-space: nowrap;
  padding-top: 3px;
}

/* ─── TIMELINE STRIP (HORIZONTAL) ─── */
.timeline-strip {
  display: flex;
  gap: 0;
  overflow-x: auto;
  overflow-y: visible;
  padding: 60px 0 28px;
  margin-top: 24px;
  position: relative;
}
.timeline-strip::-webkit-scrollbar { height: 4px; }

.tl-stop {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 110px;
  position: relative;
  padding: 0 6px;
  cursor: pointer;
}
.tl-stop::before {
  content: '';
  position: absolute;
  top: 8px; left: 0; right: 0;
  height: 2px;
  background: var(--border);
}
.tl-marker {
  width: 16px;
  height: 16px;
  background: var(--bg-card);
  border: 2px solid var(--accent-fire);
  border-radius: 50%;
  position: relative;
  z-index: 2;
  transition: all var(--transition-med);
}
.tl-stop:hover .tl-marker {
  background: var(--accent-fire);
  box-shadow: 0 0 16px rgba(var(--accent-fire-rgb), 0.5);
  transform: scale(1.3);
}
.tl-stop-year {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-fire);
  margin-top: 8px;
}
.tl-stop-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 3px;
  line-height: 1.3;
  max-width: 90px;
  transition: color var(--transition-fast);
}
.tl-stop:hover .tl-stop-label { color: var(--text-secondary); }

/* Timeline tooltip with arrow — above markers */
.tl-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}
.tl-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border-glow);
}
.tl-stop:hover .tl-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
/* First few stops — align tooltip to left edge so it doesn't clip */
.tl-stop:first-child .tl-tooltip,
.tl-stop:nth-child(2) .tl-tooltip {
  left: 0;
  transform: translateX(0) translateY(4px);
}
.tl-stop:first-child:hover .tl-tooltip,
.tl-stop:nth-child(2):hover .tl-tooltip {
  transform: translateX(0) translateY(0);
}
.tl-stop:first-child .tl-tooltip::after,
.tl-stop:nth-child(2) .tl-tooltip::after {
  left: 20px;
  transform: none;
}
/* Last few stops — align tooltip to right edge */
.tl-stop:last-child .tl-tooltip,
.tl-stop:nth-last-child(2) .tl-tooltip {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(4px);
}
.tl-stop:last-child:hover .tl-tooltip,
.tl-stop:nth-last-child(2):hover .tl-tooltip {
  transform: translateX(0) translateY(0);
}
.tl-stop:last-child .tl-tooltip::after,
.tl-stop:nth-last-child(2) .tl-tooltip::after {
  left: auto;
  right: 20px;
  transform: none;
}

/* ─── QUICK STATS GRID ─── */
.quick-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.quick-stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-med);
}
.quick-stat-row:hover {
  border-color: var(--accent-fire);
  transform: translateX(4px);
  box-shadow: -4px 0 0 var(--accent-fire);
}
.quick-stat-icon { font-size: 20px; }
.quick-stat-name {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
}
.quick-stat-data {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── CONNECT / SOCIAL GRID ─── */
.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 36px;
}
.connect-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-med);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.connect-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent-electric);
  transform: scaleY(0);
  transition: transform var(--transition-med);
  transform-origin: bottom;
}
.connect-card:hover {
  border-color: var(--accent-electric);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(var(--accent-electric-rgb), 0.1);
}
.connect-card:hover::before { transform: scaleY(1); }
.connect-icon { font-size: 22px; margin-bottom: 6px; }
.connect-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.connect-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ─── SURPRISE ME BUTTON ─── */
.surprise-btn {
  position: fixed;
  bottom: 20px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--accent-fire);
  color: #000;
  border: none;
  cursor: pointer;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 90;
  transition: all var(--transition-med);
  box-shadow: 0 4px 16px rgba(var(--accent-fire-rgb), 0.3);
  animation: pulseGlow 3s ease-in-out infinite;
}
.surprise-btn:hover {
  transform: scale(1.15) rotate(15deg);
  box-shadow: 0 6px 28px rgba(var(--accent-fire-rgb), 0.5);
}

/* ─── SITE FOOTER ─── */
.site-footer {
  max-width: 600px;
  margin: 60px auto 0;
  text-align: center;
  padding: 40px 24px;
  border-top: 1px solid var(--border);
}
.footer-quote {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--accent-fire);
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(var(--accent-fire-rgb), 0.2);
  margin-bottom: 12px;
}
.footer-sub {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}
.footer-version {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 16px;
  opacity: 0.4;
}
.footer-pets {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  opacity: 0.5;
}

/* ─── EXPLORATION TRACKER ─── */
.explore-tracker {
  position: fixed;
  bottom: 76px; right: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-med);
}
.explore-tracker:hover {
  border-color: var(--accent-electric);
  color: var(--text-secondary);
  box-shadow: 0 0 12px rgba(var(--accent-electric-rgb), 0.1);
}

/* ─── RESPONSIVE HUB ─── */
@media (max-width: 768px) {
  .branches-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .counters-grid { grid-template-columns: repeat(2, 1fr); }
  .connect-grid { grid-template-columns: 1fr; }
  .featured-card { padding: 20px; }
  .quick-stats-grid { grid-template-columns: 1fr; }
  .timeline-strip { padding: 16px 0; }
  .explore-tracker { bottom: 12px; right: 12px; }
  .surprise-btn { bottom: 12px; right: 70px; }
}

@media (max-width: 480px) {
  .hero { padding: 60px 16px 40px; min-height: 90vh; }
  .branches-grid { grid-template-columns: 1fr; }
  .counters-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .featured-stats { flex-wrap: wrap; gap: 12px; }
}
