/* ==========================================================================
   DETwal · TopG Algo — Design Tokens
   ========================================================================== */
:root {
  --bg: #080810;
  --bg-elevated: #10101B;
  --bg-elevated-2: #15151F;
  --border: #252333;
  --border-hover: #3a3350;

  --purple: #9257F5;
  --purple-light: #AD8AFF;
  --purple-dim: rgba(146, 87, 245, 0.14);

  --text-primary: #FFFFFF;
  --text-secondary: #A09DAF;
  --text-muted: #6E6B80;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --transition: 0.25s ease;
  --transition-slow: 0.5s cubic-bezier(.2,.7,.3,1);

  --max-width: 1200px;
  --header-height: 76px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--purple); color: #fff;
  padding: 10px 16px; z-index: 999;
  transition: top var(--transition);
}
.skip-link:focus { top: 0; }

:focus-visible { outline: 2px solid var(--purple-light); outline-offset: 3px; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  white-space: nowrap;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), #7B3FE4);
  color: #fff;
  box-shadow: 0 4px 20px rgba(146, 87, 245, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(146, 87, 245, 0.45); }

.btn-ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--purple-light); color: var(--purple-light); background: var(--purple-dim); }

.btn-lg { padding: 14px 28px; font-size: 0.95rem; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-height);
  display: flex; align-items: center;
  background: rgba(8, 8, 16, 0.75);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.nav-container { display: flex; align-items: center; justify-content: space-between; }

.logo-text { font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); }
.accent { color: var(--purple-light); }

.main-nav { display: flex; align-items: center; gap: 40px; }
.nav-links { display: flex; gap: 32px; }
.nav-links a {
  font-size: 0.92rem; font-weight: 500; color: var(--text-secondary);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--text-primary); }

.nav-actions { display: flex; align-items: center; gap: 12px; }

.nav-toggle {
  display: none; flex-direction: column; gap: 5px; width: 32px; height: 32px;
  align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; padding: 150px 0 130px; text-align: center; overflow: hidden; }

.hero-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }

.orb { position: absolute; border-radius: 50%; filter: blur(100px); opacity: 0.5; animation: floatGlow 11s ease-in-out infinite; }
.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, var(--purple) 0%, transparent 70%); top: -200px; left: 50%; transform: translateX(-60%); }
.orb-2 { width: 380px; height: 380px; background: radial-gradient(circle, var(--purple-light) 0%, transparent 70%); bottom: -180px; right: 8%; animation-delay: -4s; }

.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(146,87,245,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(146,87,245,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 0%, transparent 72%);
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(20px, -24px) scale(1.06); }
}

/* Chart visual */
.chart-visual {
  position: absolute;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(900px, 95%); height: 220px;
  opacity: 0.85;
}

.trend-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.trend-path {
  fill: none;
  stroke: url(#trendGradient);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  animation: drawLine 3.5s ease forwards 0.3s;
}
@keyframes drawLine { to { stroke-dashoffset: 0; } }

.candles {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; align-items: flex-end; justify-content: space-between;
  height: 140px; padding: 0 6%;
}
.candle {
  width: 10px; border-radius: 3px;
  animation: candlePulse 4s ease-in-out infinite;
  opacity: 0.8;
}
.candle.up { background: linear-gradient(180deg, var(--purple-light), var(--purple)); }
.candle.down { background: linear-gradient(180deg, #4a4160, #2b2740); }

.candle:nth-child(1) { height: 60px; animation-delay: 0s; }
.candle:nth-child(2) { height: 40px; animation-delay: 0.2s; }
.candle:nth-child(3) { height: 90px; animation-delay: 0.4s; }
.candle:nth-child(4) { height: 70px; animation-delay: 0.6s; }
.candle:nth-child(5) { height: 50px; animation-delay: 0.8s; }
.candle:nth-child(6) { height: 110px; animation-delay: 1s; }
.candle:nth-child(7) { height: 65px; animation-delay: 1.2s; }
.candle:nth-child(8) { height: 95px; animation-delay: 1.4s; }
.candle:nth-child(9) { height: 75px; animation-delay: 1.6s; }
.candle:nth-child(10) { height: 55px; animation-delay: 1.8s; }
.candle:nth-child(11) { height: 100px; animation-delay: 2s; }
.candle:nth-child(12) { height: 80px; animation-delay: 2.2s; }

@keyframes candlePulse {
  0%, 100% { transform: scaleY(1); opacity: 0.7; }
  50% { transform: scaleY(1.12); opacity: 1; }
}

.hero-content { position: relative; z-index: 1; max-width: 800px; margin: 0 auto; }

.hero-badge {
  display: inline-block; padding: 6px 16px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--purple-light); background: var(--purple-dim);
  margin-bottom: 26px;
}

.hero-title {
  font-size: clamp(2.1rem, 5.2vw, 3.6rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  margin-bottom: 22px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--purple-light), var(--purple) 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc { font-size: 1.1rem; color: var(--text-secondary); max-width: 620px; margin: 0 auto 36px; }

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Sections (generic)
   ========================================================================== */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-elevated); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-header { text-align: center; max-width: 680px; margin: 0 auto 56px; }

.section-badge {
  display: inline-block; font-size: 0.8rem; font-weight: 600; color: var(--purple-light);
  letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 14px;
}

.section-title { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; margin-bottom: 14px; }
.section-desc { color: var(--text-secondary); font-size: 1rem; }

/* ==========================================================================
   Introducing TopG Algo
   ========================================================================== */
.intro-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.intro-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.intro-card:hover { transform: translateY(-6px); border-color: var(--border-hover); box-shadow: 0 20px 50px rgba(146, 87, 245, 0.1); }

.intro-icon {
  width: 46px; height: 46px; border-radius: 12px; background: var(--purple-dim);
  color: var(--purple-light); display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.intro-icon svg { width: 22px; height: 22px; }

.intro-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 8px; }
.intro-card p { color: var(--text-secondary); font-size: 0.86rem; }

/* ==========================================================================
   Features
   ========================================================================== */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.feature-card {
  padding: 32px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--bg); transition: border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.feature-card:hover { border-color: var(--border-hover); transform: translateY(-5px); box-shadow: 0 20px 50px rgba(146,87,245,0.1); }

.feature-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  color: var(--purple-light); display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  background: var(--purple-dim);
}
.feature-icon svg { width: 24px; height: 24px; }

.feature-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--text-secondary); font-size: 0.9rem; }

/* ==========================================================================
   How It Works — Timeline
   ========================================================================== */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 28px; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-hover), transparent);
  z-index: 0;
}

.timeline-step {
  position: relative; z-index: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  text-align: center;
  transition: transform var(--transition), border-color var(--transition);
}
.timeline-step:hover { transform: translateY(-6px); border-color: var(--border-hover); }

.timeline-marker {
  width: 56px; height: 56px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1px solid var(--border-hover);
  background: var(--bg); color: var(--purple-light);
  font-weight: 700; font-size: 1rem;
}

.timeline-step h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.timeline-step p { color: var(--text-secondary); font-size: 0.88rem; }

/* ==========================================================================
   Performance & Methodology
   ========================================================================== */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.method-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
}
.method-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }

.placeholder-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}

.disclaimer-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 24px 28px;
}

.disclaimer-icon { width: 26px; height: 26px; flex-shrink: 0; color: var(--purple-light); margin-top: 2px; }

.disclaimer-box p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.7; }
.disclaimer-box strong { color: var(--text-primary); }

/* ==========================================================================
   Community / Access CTA
   ========================================================================== */
.cta-section {
  position: relative; padding: 90px 0; text-align: center;
  background: radial-gradient(ellipse at top, rgba(146,87,245,0.18), transparent 60%), var(--bg-elevated);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.cta-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.cta-desc { color: var(--text-secondary); margin-bottom: 30px; font-size: 1rem; }

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq-list { max-width: 740px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--border); }

.faq-question {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 22px 4px; font-size: 1rem; font-weight: 600; text-align: left;
  color: var(--text-primary); transition: color var(--transition);
}
.faq-question:hover { color: var(--purple-light); }

.faq-icon { position: relative; width: 18px; height: 18px; flex-shrink: 0; margin-left: 16px; }
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute; background: currentColor;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  transition: transform var(--transition);
}
.faq-icon::before { width: 14px; height: 2px; }
.faq-icon::after { width: 2px; height: 14px; }
.faq-question[aria-expanded="true"] .faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); opacity: 0; }
.faq-question[aria-expanded="true"] .faq-icon::before { transform: translate(-50%, -50%) rotate(180deg); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height var(--transition-slow); }
.faq-answer p { padding: 0 4px 22px; color: var(--text-secondary); font-size: 0.94rem; line-height: 1.7; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding-top: 70px; }

.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 50px; }

.footer-brand p { color: var(--text-secondary); font-size: 0.9rem; margin-top: 14px; max-width: 280px; }

.footer-col h4 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 18px; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: 0.9rem; color: var(--text-secondary); transition: color var(--transition); }
.footer-col a:hover { color: var(--purple-light); }

.footer-bottom { border-top: 1px solid var(--border); padding: 24px 0; }
.footer-bottom-inner { display: flex; flex-direction: column; gap: 10px; font-size: 0.82rem; color: var(--text-muted); }
.footer-disclaimer { max-width: 760px; line-height: 1.6; }

/* ==========================================================================
   Reveal Animations
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .intro-grid { grid-template-columns: repeat(3, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .timeline::before { display: none; }
}

@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .methodology-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  /* Mobile navigation opens as a full-height, independently scrollable drawer. */
  body.nav-open { overflow: hidden; }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: calc(100vh - var(--header-height));
    height: calc(100dvh - var(--header-height));
    z-index: 110;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    background: #080810;
    background: rgba(8, 8, 16, 0.995);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  }
  .main-nav.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links { flex-direction: column; gap: 0; padding: 12px 24px; }
  .nav-links a { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); }

  .nav-actions { flex-direction: column; padding: 16px 24px 24px; gap: 10px; }
  .nav-actions .btn { width: 100%; }

  .hero { padding: 110px 0 90px; }
  .chart-visual { height: 160px; }

  .intro-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

@media (max-width: 480px) {
  .section { padding: 70px 0; }
  .hero-buttons { flex-direction: column; width: 100%; }
  .hero-buttons .btn { width: 100%; }
  .cta-section { padding: 70px 0; }
  .intro-grid { grid-template-columns: 1fr; }
  .disclaimer-box { flex-direction: column; }
}


/* ==========================================================================
   Plans preview cards
   ========================================================================== */
.plan-preview-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; max-width:860px; margin:0 auto; }
.plan-preview-card { background:var(--bg); border:1px solid var(--border); border-radius:var(--radius-lg); padding:34px; display:flex; flex-direction:column; align-items:flex-start; }
.plan-preview-featured { border-color:var(--purple); box-shadow:0 18px 55px rgba(146,87,245,.12); }
.plan-preview-label { color:var(--purple-light); font-size:.78rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.plan-preview-card h3 { font-size:1.8rem; margin:10px 0; }
.plan-preview-price { font-size:1.45rem; font-weight:800; margin-bottom:14px; }
.plan-preview-price span { color:var(--text-muted); font-size:.85rem; font-weight:500; }
.plan-preview-copy { color:var(--text-secondary); min-height:54px; margin-bottom:24px; }
.plan-preview-card .btn { margin-top:auto; }
.plans-preview-note { color:var(--text-muted); text-align:center; font-size:.88rem; margin:24px auto 0; max-width:700px; }
.plans-preview-action { margin-top:26px; }
@media(max-width:900px) { .plan-preview-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:640px) { .plan-preview-grid { grid-template-columns:1fr; } .plan-preview-card { padding:26px; } }
