/* ==========================================================================
   BIOLOGY DNA ULTIMATE MOTION DESIGN — STYLING SYSTEM
   ========================================================================== */

:root {
  --bg-deep: #030712;
  --neon-lime: #ccff00;
  --neon-lime-glow: rgba(204, 255, 0, 0.45);
  --neon-pink: #ff007f;
  --neon-pink-glow: rgba(255, 0, 127, 0.45);
  --cyan: #00f0ff;
  --cyan-glow: rgba(0, 240, 255, 0.4);
  
  --glass-card: rgba(10, 20, 38, 0.88);
  --glass-border: rgba(255, 255, 255, 0.12);

  --font-sans: 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-display: 'Syne', var(--font-sans);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-deep);
  color: #f8fafc;
  font-family: var(--font-sans);
}

#motion-viewport {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 40%, #0a1836 0%, var(--bg-deep) 90%);
}

/* Three.js Canvas Stage */
#webgl-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* SVG Flowchart Layer */
#svg-arrows-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* ==========================================================================
   ACTOR-CURSOR PRESENTER (Bezier Motion + Wave Emoji + Pulse)
   ========================================================================== */
.actor-cursor-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translate(-50%, -50%);
  transition: transform 0.08s ease-out;
}

.cursor-pointer {
  filter: drop-shadow(0 0 10px var(--neon-lime-glow));
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cursor-pointer.clicking {
  transform: scale(0.75) rotate(-15deg);
}

.cursor-hand {
  font-size: 28px;
  animation: wave-hand 1.2s infinite ease-in-out;
}

@keyframes wave-hand {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(25deg); }
}

.cursor-label {
  background: rgba(3, 7, 18, 0.92);
  border: 1px solid var(--neon-lime);
  color: var(--neon-lime);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  box-shadow: 0 0 14px var(--neon-lime-glow);
  white-space: nowrap;
}

.cursor-click-ripple {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--neon-lime);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  pointer-events: none;
}

.cursor-click-ripple.pulse {
  animation: ripple-anim 0.5s ease-out forwards;
}

@keyframes ripple-anim {
  0% { transform: scale(0.2); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ==========================================================================
   TOP HUD TELEMETRY
   ========================================================================== */
#hud-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  z-index: 15;
  padding: 0 36px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(to bottom, rgba(3, 7, 18, 0.95), transparent);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: var(--cyan);
}

.hud-chapter-pill {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--neon-lime-glow);
  padding: 6px 18px;
  border-radius: 999px;
  box-shadow: 0 0 16px var(--neon-lime-glow);
}

.hud-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #94a3b8;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  background: var(--neon-lime);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--neon-lime);
  animation: pulse-dot-anim 1.8s infinite;
}

@keyframes pulse-dot-anim {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
}

/* ==========================================================================
   KINETIC STAGE CONTENT & TYPOGRAPHY
   ========================================================================== */
#motion-stage {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 84px 48px 84px 48px;
  pointer-events: none;
}

.story-area {
  max-width: 860px;
  pointer-events: auto;
}

.k-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-lime);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  text-shadow: 0 0 12px var(--neon-lime-glow);
}

.k-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.8vw, 56px);
  font-weight: 800;
  line-height: 1.12;
  color: #ffffff;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
  text-shadow: 0 10px 35px rgba(0, 0, 0, 0.9);
}

.k-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  animation: anim-word-pop 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes anim-word-pop {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.k-desc {
  font-size: clamp(15px, 1.8vw, 18px);
  color: #94a3b8;
  line-height: 1.65;
  max-width: 760px;
}

/* Layer Cutout Text Effect */
.layer-cutout-container {
  position: relative;
  display: inline-block;
  margin-top: 20px;
}

.cutout-image {
  max-width: 300px;
  border-radius: 16px;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
}

.cutout-behind-text {
  position: absolute;
  top: 25%;
  left: 55%;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 900;
  color: var(--neon-lime);
  text-shadow: 0 0 30px var(--neon-lime-glow);
  white-space: nowrap;
  animation: slide-behind 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slide-behind {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* DNA Interactive Base Pair Panel */
.base-pair-panel {
  background: rgba(8, 16, 32, 0.92);
  border: 1px solid var(--cyan-glow);
  border-radius: 20px;
  padding: 22px 28px;
  margin-top: 20px;
  backdrop-filter: blur(24px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px var(--cyan-glow);
  pointer-events: auto;
  max-width: 680px;
}

.bp-title {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--neon-lime);
  margin-bottom: 14px;
  letter-spacing: 0.08em;
}

.bp-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.bp-btn {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.a-base { background: rgba(0, 240, 255, 0.15); color: var(--cyan); border-color: var(--cyan); }
.t-base { background: rgba(204, 255, 0, 0.15); color: var(--neon-lime); border-color: var(--neon-lime); }
.g-base { background: rgba(255, 0, 127, 0.15); color: var(--neon-pink); border-color: var(--neon-pink); }
.c-base { background: rgba(168, 85, 247, 0.15); color: var(--purple); border-color: var(--purple); }

.bp-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 20px currentColor;
}

.bp-link { font-size: 20px; color: #64748b; }

.bp-feedback-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #94a3b8;
  margin-top: 8px;
  text-align: center;
}

.cards-grid-3d {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.motion-card-3d {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(20px);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateY(24px);
  opacity: 0;
  animation: anim-card-reveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.motion-card-3d:hover {
  border-color: var(--neon-lime);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 18px 45px var(--neon-lime-glow);
}

@keyframes anim-card-reveal {
  to { transform: translateY(0); opacity: 1; }
}

.c-icon { font-size: 26px; margin-bottom: 8px; display: inline-block; }
.c-head { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 6px; }
.c-desc { font-size: 13.5px; color: #94a3b8; line-height: 1.5; }

/* ==========================================================================
   NEON "SUBSCRIBE" MASTER PAUSE BUTTON (Exact User Sample Image Match)
   ========================================================================== */
#hud-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 64px;
  z-index: 15;
  padding: 0 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: linear-gradient(to top, rgba(3, 7, 18, 0.98), transparent);
  border-top: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.neon-subscribe-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #ccff00;
  color: #111827;
  border: none;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(204, 255, 0, 0.8), inset 0 0 8px rgba(255, 255, 255, 0.6);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.neon-subscribe-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px rgba(204, 255, 0, 1), 0 0 50px rgba(204, 255, 0, 0.5);
}

.neon-heart {
  background: #ff007f;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 0 16px rgba(255, 0, 127, 0.9);
  animation: heart-beat 1.4s infinite ease-in-out;
}

@keyframes heart-beat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.master-scrubber-wrap {
  flex: 1;
  max-width: 680px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #64748b;
}

.track { flex: 1; height: 6px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; cursor: pointer; }
.fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--neon-lime), var(--cyan)); box-shadow: 0 0 14px var(--neon-lime); }

.nav-controls { display: flex; gap: 8px; }
.icon-btn { background: rgba(15, 23, 42, 0.7); border: 1px solid var(--glass-border); color: #94a3b8; width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s; }
.icon-btn:hover { color: var(--neon-lime); border-color: var(--neon-lime); }

/* Start Curtain Overlay */
.curtain-overlay {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 100;
  background: rgba(3, 7, 18, 0.95); backdrop-filter: blur(32px);
  display: flex; align-items: center; justify-content: center; padding: 24px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.curtain-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.curtain-card { max-width: 660px; background: rgba(10, 20, 38, 0.94); border: 1px solid var(--neon-lime); border-radius: 28px; padding: 44px; text-align: center; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 60px var(--neon-lime-glow); }
.badge { display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--neon-lime); border: 1px solid var(--neon-lime-glow); padding: 4px 14px; border-radius: 999px; margin-bottom: 18px; }
.title { font-family: var(--font-display); font-size: clamp(26px, 4.4vw, 42px); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 14px; }
.sub { font-size: 15px; color: #94a3b8; line-height: 1.6; margin-bottom: 28px; }
.btn-hero-start { width: 100%; background: linear-gradient(135deg, var(--neon-lime) 0%, var(--cyan) 100%); border: none; color: #02040a; font-family: var(--font-display); font-weight: 800; font-size: 16px; padding: 18px; border-radius: 14px; cursor: pointer; box-shadow: 0 6px 30px var(--neon-lime-glow); transition: all 0.3s; }
.btn-hero-start:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(204, 255, 0, 0.6); }
.hint { font-family: var(--font-mono); font-size: 11px; color: #64748b; margin-top: 16px; }

.hidden { display: none !important; }
