/* =============================================
   X2A DNA — Style System v3
   Font: DM Sans | DESIGN_VARIANCE: 9 | MOTION: 8
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #160024;
  --text:        #FFFFFF;
  --text-muted:  rgba(255,255,255,0.50);
  --text-dim:    rgba(255,255,255,0.22);
  --cta:         linear-gradient(135deg, #9B5DE5, #7B2FBE);
  --font:        'DM Sans', sans-serif;
  --nav-h:       68px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  background-image: radial-gradient(ellipse 80% 55% at 50% -5%,
    rgba(70,15,110,0.45) 0%, transparent 70%);
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(155,93,229,0.35); border-radius: 2px; }

/* =============================================
   NAV
   ============================================= */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--nav-h);
  display: flex; align-items: center; padding: 0 40px;
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  background: rgba(22,0,36,0.55);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  transition: background 0.4s;
}
.nav.scrolled { background: rgba(22,0,36,0.92); }

.nav-inner { width: 100%; display: flex; align-items: center; gap: 40px; }

.nav-logo {
  text-decoration: none;
  margin-right: auto; flex-shrink: 0;
  display: flex; align-items: center;
}
.nav-logo-img {
  height: 32px;
  width: auto;
  display: block;
}

.nav-links { display: flex; align-items: center; gap: 4px; }

.nav-link {
  font-family: var(--font); font-size: 0.88rem; font-weight: 400;
  color: rgba(255,255,255,0.62); text-decoration: none;
  padding: 6px 14px; border-radius: 999px;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.07); }

.nav-pill {
  display: inline-flex; border: 1px solid rgba(255,255,255,0.4);
  border-radius: 999px; padding: 5px 16px;
  font-size: 0.88rem; color: #fff;
}

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* =============================================
   BUTTONS
   ============================================= */
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--cta); color: #fff;
  font-family: var(--font); font-weight: 600; font-size: 0.88rem;
  padding: 9px 22px; border-radius: 999px; text-decoration: none;
  transition: transform 0.25s var(--ease-spring), box-shadow 0.25s;
  box-shadow: 0 4px 22px rgba(123,47,190,0.45);
  will-change: transform; border: none; cursor: pointer;
}
.btn-cta:hover  { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 32px rgba(123,47,190,0.6); }
.btn-cta:active { transform: translateY(0) scale(0.98); }
.btn-cta--sm    { font-size: 0.8rem; padding: 7px 18px; }
.btn-cta--lg    { font-size: 1rem; padding: 14px 36px; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: rgba(255,255,255,0.65);
  font-family: var(--font); font-weight: 500; font-size: 1rem;
  padding: 13px 28px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.22); text-decoration: none;
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.05); }

.nav-search {
  background: none; border: none; color: rgba(255,255,255,0.45);
  cursor: pointer; padding: 6px; display: flex; transition: color 0.2s;
}
.nav-search:hover { color: #fff; }

/* =============================================
   HERO
   3-column grid: [domain-index | center(helix) | headline]
   ============================================= */
.hero {
  position: relative; width: 100%; min-height: 100dvh; overflow: hidden;
  display: grid;
  grid-template-columns: 250px 1fr 42%;
  grid-template-rows: 1fr;
  align-items: end;
}

.helix-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none;
}

/* Domain Index LEFT column */
.domain-index {
  grid-column: 1; grid-row: 1;
  position: relative; z-index: 10;
  display: flex; flex-direction: column; 
  height: 60vh; justify-content: space-between;
  align-self: center;
  padding-left: 48px; padding-bottom: 60px;
}

.domain-item {
  display: flex; align-items: center;
  color: var(--dc, rgba(255,255,255,0.5));
  background: none; border: none; cursor: pointer;
  padding: 0; text-align: left;
  opacity: 0; transform: translateX(-14px);
  transition: opacity 0.2s;
}
.hero.loaded .domain-item {
  animation: diIn 0.5s var(--ease-out) forwards;
}
.domain-item:nth-child(1) { animation-delay: 0.6s; }
.domain-item:nth-child(2) { animation-delay: 0.75s; }
.domain-item:nth-child(3) { animation-delay: 0.9s; }
.domain-item:nth-child(4) { animation-delay: 1.05s; }
.domain-item:nth-child(5) { animation-delay: 1.2s; }

.domain-item:hover .di-label { opacity: 1; }

@keyframes diIn { to { opacity: 1; transform: translateX(0); } }

.di-label {
  font-family: var(--font); font-weight: 600; font-size: 1.15rem;
  letter-spacing: 0.01em; color: var(--dc, rgba(255,255,255,0.5));
  white-space: nowrap; margin-right: 14px;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.domain-item:hover .di-label { opacity: 1; }

.di-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--dc, #fff);
  flex-shrink: 0;
  margin-left: 10px;   /* small gap between label and dot */
  opacity: 0.85;
}

/* Hero text RIGHT column */
.hero-content {
  grid-column: 3; grid-row: 1;
  position: relative; z-index: 10;
  padding: 0 64px 80px 20px;
  text-align: right; align-self: end;
}

.hero-headline {
  font-family: var(--font); font-weight: 800;
  font-size: clamp(2.2rem, 4.6vw, 4.2rem);
  line-height: 1.0; letter-spacing: -0.04em; color: #fff;
  margin-bottom: 24px;
  opacity: 0;
}
.hero.loaded .hero-headline {
  animation: fadeUp 0.9s var(--ease-out) 0.4s both;
}

.hero-headline em {
  font-style: normal;
  background: linear-gradient(120deg, #fff 0%, rgba(190,130,255,0.9) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Glass Pop-up (Full Screen Overlay) */
.glass-popup {
  position: absolute;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 40px;
  background: rgba(22, 0, 36, 0.25);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  animation: fadeIn 0.8s var(--ease-out) both;
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out), visibility 0.6s;
}
.glass-popup.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.05);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.glass-popup h3 {
  font-family: var(--font);
  font-weight: 600;
  font-size: 3rem;
  color: #fff;
  margin: 0;
  text-align: center;
}

/* Background blur dots — sits behind canvas and particles */
.hero-blur-dots {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  opacity: 0.35;
}

.global-dna-canvas {
  position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
  opacity: 0;
  transition: opacity 1.5s ease 0.3s;
  /* Fade strands out at top and bottom so they dissolve rather than clip */
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent  0%,
    black        11%,
    black        89%,
    transparent  100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent  0%,
    black        11%,
    black        89%,
    transparent  100%
  );
}
.global-dna-canvas.visible {
  opacity: 1;
}

.hero-sub {
  font-family: var(--font); font-size: 0.95rem; font-weight: 300;
  line-height: 1.75; color: var(--text-muted);
  animation: fadeUp 0.9s var(--ease-out) 0.6s both;
}

/* Scroll cue */
.scroll-cue {
  position: absolute; bottom: 32px; left: 50%; transform: translateX(-50%);
  z-index: 20; display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: rgba(255,255,255,0.28); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase;
  animation: scrollPulse 2.5s ease-in-out infinite; pointer-events: none;
}
.scroll-cue-line { width: 1px; height: 34px; background: linear-gradient(to bottom, rgba(255,255,255,0.35), transparent); }

@keyframes scrollPulse {
  0%, 100% { opacity: 0.35; transform: translateX(-50%) translateY(0); }
  50%       { opacity: 0.85; transform: translateX(-50%) translateY(5px); }
}

/* =============================================
   DOMAIN SECTIONS
   Left: tilted helix + 3 dot-btns
   Right: domain nav + reveal panel
   ============================================= */
.domain-section {
  position: relative; width: 100%; min-height: 100dvh;
  display: grid;
  grid-template-columns: 320px 1fr 42%;
  grid-template-rows: 1fr;
  overflow: hidden;
  background: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  opacity: 0; transition: opacity 0.7s var(--ease-out);
}
.domain-section.in-view { opacity: 1; }

/* LEFT column — domain nav (wide enough for single-line items) */
.ds-domain-nav {
  grid-column: 1;
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: calc(var(--nav-h) + 56px) 8px 80px 44px;
  gap: 20px;
  position: relative; z-index: 5;
  white-space: nowrap;
}

/* CENTER column — dots over DNA */
.ds-helix-col { grid-column: 2; position: relative; min-height: 100dvh; overflow: hidden; }

/* ---- 3-dot selector track: centred on the DNA (stage_cx = 44vw, left-col = 320px) ---- */
.dot-track {
  position: absolute;
  left: calc(38vw - 320px);   /* tracks DNA centre across viewport widths */
  top: 50%;                   /* centre vertically — full DNA body is visible here */
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 130px;                 /* tighter gap keeps all 3 dots within DNA body */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}
.dot-track.active {
  opacity: 1;
  pointer-events: auto;
}

.dot-btn {
  position: relative;
  width: 68px; height: 68px;
  background: none; border: none; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  transition: width 0.4s var(--ease-out), height 0.4s var(--ease-out);
}

/* Stagger dots onto the two strands (r ≈ minDim*0.32; strands at roughly ±120–160px from cx) */
.dot-btn:nth-child(1) { left:  100px; }   /* right strand — upper S-curve */
.dot-btn:nth-child(2) { left: -120px; }   /* left strand  — mid S-curve  */
.dot-btn:nth-child(3) { left:   80px; }   /* right strand — lower S-curve */

.dot-inner {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 3px solid rgba(255,255,255,0.45);
  transition: background 0.35s, border-color 0.35s, width 0.4s var(--ease-out), height 0.4s var(--ease-out);
  flex-shrink: 0;
}

.dot-ring {
  position: absolute; inset: -16px; border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.35s, inset 0.4s var(--ease-out);
}

/* ── Active dot: large colored badge with label inside ── */
.dot-btn.active {
  width: 148px; height: 148px;
}
.dot-btn.active .dot-inner {
  width: 138px; height: 138px;
  background: var(--dc, rgba(255,255,255,0.85));
  border-color: var(--dc, #fff);
  border-width: 0;
  transform: none;
}
.dot-btn.active .dot-ring {
  inset: -10px;
  border-color: var(--dc, rgba(255,255,255,0.35));
  opacity: 0.4;
}

.dot-btn:hover:not(.active) .dot-inner {
  background: rgba(255,255,255,0.38);
  border-color: #fff;
}

/* Tooltip — hidden by default; inside badge when active */
.dot-tooltip {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  text-align: center;
  white-space: normal;
  width: 110px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
  z-index: 2;
}
.dot-btn.active .dot-tooltip {
  opacity: 1;
}
/* Non-active hover: no tooltip shown */
.dot-btn:not(.active):hover .dot-tooltip {
  opacity: 0;
}

/* RIGHT column — reveal panel (anchored to bottom-right, below the DNA S-curve) */
.ds-content-col {
  grid-column: 3;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 80px 60px 100px 32px; gap: 36px;
  position: relative; z-index: 5;
}

.dsn-item {
  font-family: var(--font); font-weight: 400; font-size: 1.1rem;
  color: rgba(255,255,255,0.32); letter-spacing: 0.01em;
  white-space: nowrap;
  background: none; border: none; text-align: left; cursor: pointer;
  padding: 4px 0; transition: color 0.3s, opacity 0.3s;
}
.dsn-item:hover { color: rgba(255,255,255,0.65); }
.dsn-item--active { font-weight: 800; font-size: 1.15rem; color: var(--dc, #fff); opacity: 1; }
.dsn-item--past { color: rgba(255,255,255,0.3); }

/* ---- Stage Panels (overlapping) ---- */
.panels-container {
  position: relative;
  flex: 1;
}

.stage-panel {
  position: absolute; inset: 0;
  /* Push content to bottom-right, away from the DNA S-curve */
  display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: 8px;
  opacity: 0;
  /* No translateY — position must be stable to avoid layout-timing glitch */
  transition: opacity 0.5s var(--ease-out);
  pointer-events: none;
}
.stage-panel.active {
  opacity: 1; pointer-events: auto;
}

/* Slides container — all slides stacked absolutely so height never shifts */
.rp-slides { position: relative; min-height: 260px; }

.rp-slide {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; flex-direction: column; gap: 20px;
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
  pointer-events: none;
}
.rp-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.rp-headline {
  font-family: var(--font); font-weight: 800;
  font-size: clamp(2.8rem, 4.8vw, 5rem);
  line-height: 1.0; letter-spacing: -0.04em;
  color: var(--accent, #fff);
}

.rp-rule { width: 72px; height: 3px; border-radius: 2px; flex-shrink: 0; }

.rp-copy {
  font-family: var(--font); font-weight: 300; font-size: 1rem;
  line-height: 1.72; color: var(--text-muted); max-width: 46ch;
}

/* =============================================
   CTA SECTION
   ============================================= */
.cta-section {
  position: relative; min-height: 100dvh;
  display: flex; align-items: center; justify-content: flex-end;
  overflow: hidden; background: transparent;
}
.cta-content { position: relative; z-index: 10; max-width: 520px; padding: 120px 10% 120px 0; }
.cta-eyebrow { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.38); margin-bottom: 18px; }
.cta-headline { font-family: var(--font); font-weight: 800; font-size: clamp(2.8rem, 5vw, 4.2rem); line-height: 1.0; letter-spacing: -0.04em; color: #fff; margin-bottom: 44px; }
.cta-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* =============================================
   FOOTER
   ============================================= */
.footer { background: rgba(0,0,0,0.35); border-top: 1px solid rgba(255,255,255,0.07); padding: 60px 72px 28px; }
.footer-inner { display: flex; justify-content: space-between; gap: 60px; margin-bottom: 44px; flex-wrap: wrap; }
.footer-logo-link { display: inline-flex; text-decoration: none; }
.footer-logo-img { height: 36px; width: auto; display: block; }
.footer-links { display: flex; gap: 56px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col h4 { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.3); margin-bottom: 4px; }
.footer-col a { font-size: 0.9rem; color: rgba(255,255,255,0.5); text-decoration: none; transition: color 0.2s; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.07); padding-top: 22px; display: flex; justify-content: space-between; align-items: center; font-size: 0.78rem; color: rgba(255,255,255,0.28); }
.footer-legal { display: flex; gap: 22px; }
.footer-legal a { color: rgba(255,255,255,0.28); text-decoration: none; transition: color 0.2s; }
.footer-legal a:hover { color: rgba(255,255,255,0.65); }

/* =============================================
   SCROLL TO TOP
   ============================================= */
.scroll-top-btn {
  position: fixed;
  bottom: 40px; right: 40px;
  width: 50px; height: 50px;
  border-radius: 50%;
  background: var(--cta);
  color: #fff;
  border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out), box-shadow 0.3s;
  box-shadow: 0 4px 12px rgba(123,47,190,0.4);
  pointer-events: none;
}
.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.scroll-top-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(123,47,190,0.6);
}

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Grain — fixed, no scroll cost */
body::after {
  content: ''; position: fixed; inset: 0; z-index: 500; pointer-events: none; opacity: 0.018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .domain-index { display: none; }
  .hero-content { grid-column: 1; padding: 0 28px 72px; text-align: left; }
  .domain-section { grid-template-columns: 1fr; grid-template-rows: auto; }
  .ds-domain-nav { grid-column: 1; padding: 32px 24px 0; flex-direction: row; flex-wrap: wrap; gap: 8px; white-space: normal; }
  .ds-helix-col { grid-column: 1; min-height: 50vh; height: 50vh; }
  .ds-content-col { grid-column: 1; padding: 40px 28px 60px; justify-content: flex-start; }
  
  /* Reset and scale down dots for mobile, arrange horizontally at bottom */
  .dot-track { 
    top: auto; 
    bottom: 30px; 
    left: 50%;
    transform: translateX(-50%); 
    flex-direction: row; 
    gap: 36px; 
  }
  .dot-btn { width: 56px; height: 56px; }
  .dot-btn:nth-child(2), .dot-btn:nth-child(3) { left: 0; }
  
  .dot-inner { width: 32px; height: 32px; border-width: 3px; }
  .dot-ring { inset: -14px; border-width: 3px; }
  
  /* Move tooltips to hover above the dots instead of right side */
  .dot-tooltip {
    left: 50%; top: auto; bottom: calc(100% + 24px);
    transform: translateX(-50%) translateY(10px);
    font-size: 1.35rem;
    text-align: center;
  }
  .dot-btn:hover .dot-tooltip,
  .dot-btn.active .dot-tooltip {
    transform: translateX(-50%) translateY(0);
  }

  .nav { padding: 0 24px; }
  .nav-links { display: none; }
  .footer { padding: 48px 28px 24px; }
  .footer-inner { flex-direction: column; }
  .cta-content { padding: 80px 28px; }
  .cta-section { justify-content: center; }
  .cta-actions { justify-content: center; }

  .scroll-top-btn {
    width: 44px; height: 44px;
    bottom: 24px; right: 24px;
  }
}
