/* ═══════════════════════════════════════════════════
   BALANTEX — STYLE.CSS
   Dark futuristic theme — AI & Financial Analytics
═══════════════════════════════════════════════════ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-deep:    #020510;
  --bg-dark:    #05091a;
  --bg-mid:     #080e28;
  --accent:     #00d4ff;
  --accent2:    #7c3aed;
  --accent3:    #10b981;
  --gold:       #f59e0b;
  --red:        #ef4444;
  --text:       #e2e8f0;
  --text-muted: #64748b;
  --border:     rgba(0,212,255,.15);
  --glow:       0 0 30px rgba(0,212,255,.4);
  --glow2:      0 0 40px rgba(124,58,237,.5);
  --font-mono:  'Orbitron', monospace;
  --font-body:  'Inter', sans-serif;
}

html { scroll-behavior: smooth; overflow-x: hidden; }

body {
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  cursor: url('cursor.png') 64 64, auto;
}

/* ── PARTICLE CANVAS ── */
#particleCanvas {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ══════════════════════════════════
   NAVBAR
══════════════════════════════════ */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 3rem;
  background: rgba(2,5,16,.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: padding .3s, background .3s;
}
#navbar.scrolled { padding: .7rem 3rem; background: rgba(2,5,16,.95); }

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1.6rem; font-weight: 900;
  letter-spacing: .1em;
  color: var(--text);
}
.nav-logo span { color: var(--accent); text-shadow: var(--glow); }

.nav-links { display: flex; list-style: none; gap: 2rem; }
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: .9rem; letter-spacing: .05em;
  transition: color .3s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute; bottom: -4px; left: 0; right: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transition: transform .3s;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-cta {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: .55rem 1.4rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: .8rem; letter-spacing: .1em;
  cursor: pointer;
  transition: background .3s, box-shadow .3s;
}
.nav-cta:hover {
  background: var(--accent);
  color: var(--bg-deep);
  box-shadow: var(--glow);
}

/* ══════════════════════════════════
   HERO
══════════════════════════════════ */
#hero {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  padding: clamp(6rem, 8vh, 8rem) clamp(1.2rem, 5vw, 3rem) clamp(2rem, 4vh, 4rem);
  overflow: hidden;
  gap: clamp(1rem, 3vw, 2rem);
}

#hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(124,58,237,.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 80% 40%, rgba(0,212,255,.12) 0%, transparent 70%);
  pointer-events: none;
}

/* GLITCH */
.glitch-wrapper { overflow: hidden; }
.glitch {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: .08em;
  color: var(--text);
  line-height: 1.1;
  position: relative;
  animation: glitchAnim 4s infinite;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}
.glitch::before {
  color: var(--accent);
  animation: glitchBefore 4s infinite;
  clip-path: polygon(0 20%, 100% 20%, 100% 40%, 0 40%);
}
.glitch::after {
  color: var(--accent2);
  animation: glitchAfter 4s infinite;
  clip-path: polygon(0 60%, 100% 60%, 100% 80%, 0 80%);
}

@keyframes glitchAnim {
  0%,90%,100% { transform: none; }
  92% { transform: skewX(-2deg) translateX(-3px); }
  94% { transform: skewX(2deg) translateX(3px); }
  96% { transform: skewX(-1deg); }
}
@keyframes glitchBefore {
  0%,90%,100% { transform: none; opacity: 0; }
  92% { transform: translateX(-6px); opacity: .8; }
  96% { transform: translateX(6px); opacity: .8; }
}
@keyframes glitchAfter {
  0%,90%,100% { transform: none; opacity: 0; }
  93% { transform: translateX(6px); opacity: .8; }
  97% { transform: translateX(-6px); opacity: .8; }
}

.hero-sub {
  font-size: clamp(.95rem, 2.5vw, 1.7rem);
  font-weight: 300; color: var(--text-muted);
  margin-top: clamp(.5rem, 1.5vw, .8rem); line-height: 1.4;
}
.highlight { color: var(--accent); text-shadow: var(--glow); }

.hero-desc {
  margin: clamp(1rem, 2vh, 1.4rem) 0 clamp(1.2rem, 2vh, 2rem);
  max-width: 520px;
  line-height: 1.8;
  color: var(--text-muted);
  font-size: clamp(.85rem, 1.5vw, .95rem);
}

.hero-buttons { display: flex; gap: clamp(.7rem, 2vw, 1rem); flex-wrap: wrap; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  border: none; color: #fff;
  padding: clamp(.7rem, 1.5vw, .85rem) clamp(1.4rem, 3vw, 2rem);
  border-radius: 6px;
  font-family: var(--font-mono); font-size: clamp(.75rem, 1.5vw, .85rem); letter-spacing: .08em;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: clamp(.3rem, 1vw, .5rem);
  transition: transform .3s, box-shadow .3s;
  position: relative; overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute; inset: -2px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  z-index: -1; border-radius: 8px;
  animation: borderPulse 2s infinite;
  opacity: 0;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,212,255,.4); }
.btn-primary:hover::before { opacity: 1; }

.pulse-btn { animation: pulseBtn 2.5s infinite; }
@keyframes pulseBtn {
  0%,100% { box-shadow: 0 0 0 0 rgba(0,212,255,.4); }
  50% { box-shadow: 0 0 0 12px rgba(0,212,255,0); }
}

.btn-secondary {
  display: inline-block;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  padding: clamp(.7rem, 1.5vw, .85rem) clamp(1.4rem, 3vw, 2rem);
  border-radius: 6px;
  font-family: var(--font-mono); font-size: clamp(.75rem, 1.5vw, .85rem); letter-spacing: .08em;
  cursor: pointer;
  transition: border-color .3s, color .3s, box-shadow .3s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.btn-full { width: 100%; justify-content: center; }

/* TICKER */
.hero-ticker { margin-top: clamp(1.5rem, 3vh, 2.5rem); }
.ticker-wrap {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(0,212,255,.03);
  padding: .5rem 0;
  display: none;
}
@media (min-width: 768px) {
  .ticker-wrap { display: block; }
}
.ticker-move {
  display: flex; gap: 3rem;
  white-space: nowrap;
  animation: tickerScroll 30s linear infinite;
  font-family: var(--font-mono); font-size: .75rem; letter-spacing: .05em;
  color: var(--text-muted);
}
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ticker-item-up { color: var(--accent3); }
.ticker-item-down { color: var(--red); }

/* NEURAL NET VISUAL */
.hero-visual { display: flex; justify-content: center; align-items: center; }
.neural-net {
  width: clamp(300px, 80vw, 420px);
  height: clamp(300px, 80vw, 420px);
  position: relative;
}

/* SCROLL HINT */
.scroll-hint {
  position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
  display: none; flex-direction: column; align-items: center; gap: .4rem;
  color: var(--text-muted); font-size: .75rem; letter-spacing: .1em;
}
@media (min-width: 768px) {
  .scroll-hint { display: flex; }
}
  animation: fadeInUp 1s 2s backwards;
}
.scroll-arrow {
  width: 20px; height: 20px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  animation: scrollBounce 1.5s infinite;
}
@keyframes scrollBounce {
  0%,100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

/* ══════════════════════════════════
   SECTIONS COMMON
══════════════════════════════════ */
section { position: relative; z-index: 1; padding: 6rem 3rem; }

.section-header { text-align: center; margin-bottom: 4rem; }
.section-tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .2em;
  color: var(--accent); border: 1px solid var(--border);
  padding: .3rem .9rem; border-radius: 20px;
  margin-bottom: 1rem;
  background: rgba(0,212,255,.05);
}
.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.6rem, 3vw, 2.6rem);
  font-weight: 700; line-height: 1.2;
  margin-bottom: 1rem;
}
.section-header p { color: var(--text-muted); max-width: 600px; margin: 0 auto; line-height: 1.8; }

/* ══════════════════════════════════
   FEATURES
══════════════════════════════════ */
#features { background: var(--bg-dark); }
#features::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1200px; margin: 0 auto;
}

.feature-card {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  position: relative; overflow: hidden;
  transition: transform .4s, border-color .4s, box-shadow .4s;
  cursor: pointer;
  opacity: 0; transform: translateY(30px);
}
.feature-card.visible {
  animation: cardIn .6s forwards;
}
@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}
.feature-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: var(--glow), inset 0 0 30px rgba(0,212,255,.04);
}

.card-icon {
  width: 52px; height: 52px;
  color: var(--accent);
  margin-bottom: 1.2rem;
  stroke: currentColor;
}
.card-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; }

.feature-card h3 {
  font-family: var(--font-mono); font-size: 1rem;
  margin-bottom: .75rem; color: var(--text);
}
.feature-card p { color: var(--text-muted); line-height: 1.7; font-size: .9rem; }

.card-glow {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(0,212,255,.08) 0%, transparent 70%);
  pointer-events: none; opacity: 0;
  transition: opacity .4s;
}
.feature-card:hover .card-glow { opacity: 1; }

/* ══════════════════════════════════
   STATS
══════════════════════════════════ */
#stats {
  position: relative; overflow: hidden;
  padding: 5rem 3rem;
}
.stats-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,58,237,.15) 0%, rgba(0,212,255,.1) 100%);
}
.stats-bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(
    0deg, transparent, transparent 39px, rgba(0,212,255,.04) 39px, rgba(0,212,255,.04) 40px),
    repeating-linear-gradient(
    90deg, transparent, transparent 39px, rgba(0,212,255,.04) 39px, rgba(0,212,255,.04) 40px);
}

.stats-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem; max-width: 1000px; margin: 0 auto;
  text-align: center;
}
.stat-item { padding: 1rem; }
.stat-number {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3.3vw, 2.5rem);
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.stat-label {
  display: block;
  color: var(--text-muted);
  font-size: .85rem; letter-spacing: .1em;
  margin-top: .5rem;
  font-family: var(--font-mono);
}

/* ══════════════════════════════════
   CHART
══════════════════════════════════ */
#chart { background: var(--bg-dark); }
.chart-container {
  max-width: 1000px; margin: 0 auto 2rem;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  position: relative;
}
.chart-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.asset-name {
  font-family: var(--font-mono); font-size: 1rem;
  color: var(--text-muted); margin-right: .8rem;
}
.asset-price {
  font-family: var(--font-mono); font-size: 1.5rem;
  font-weight: 700; color: var(--text); margin-right: .6rem;
}
.asset-change { font-family: var(--font-mono); font-size: .9rem; font-weight: 600; }
.positive { color: var(--accent3); }
.negative { color: var(--red); }

.chart-controls { display: flex; gap: .5rem; }
.time-btn {
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); padding: .3rem .7rem;
  border-radius: 4px; cursor: pointer;
  font-family: var(--font-mono); font-size: .75rem;
  transition: all .25s;
}
.time-btn.active, .time-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: rgba(0,212,255,.08);
}

#priceChart {
  width: 100%; height: 260px; display: block;
  transition: filter .5s ease;
}

/* ── Chart Loading Overlay ── */
.chart-loading-overlay {
  position: absolute;
  top: 4.2rem; /* below header */
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem;
  background: rgba(5, 9, 26, .65);
  backdrop-filter: blur(2px);
  border-radius: 0 0 16px 16px;
  z-index: 5;
  transition: opacity .5s ease, visibility .5s ease;
  font-family: var(--font-mono); font-size: .8rem;
  color: var(--text-muted); letter-spacing: .05em;
}
.chart-container.loaded .chart-loading-overlay {
  opacity: 0; visibility: hidden; pointer-events: none;
}
.chart-container.loading #priceChart {
  filter: blur(8px);
}
.chart-container.loaded #priceChart {
  filter: blur(0);
}

/* Spinner */
.chart-spinner {
  width: 36px; height: 36px;
  border: 2px solid rgba(0,212,255,.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.chart-overlay-ai {
  position: absolute; top: 1.5rem; right: 1.5rem;
  top: 4.5rem;
}
.ai-signal {
  background: rgba(16,185,129,.1);
  border: 1px solid rgba(16,185,129,.3);
  border-radius: 8px;
  padding: .5rem 1rem;
  display: flex; align-items: center; gap: .6rem;
  font-size: .78rem; font-family: var(--font-mono);
  color: var(--accent3);
  flex-direction: column; text-align: center;
}
.signal-dot {
  width: 8px; height: 8px;
  border-radius: 50%; background: var(--accent3);
  animation: signalPulse 1.5s infinite;
  position: absolute; top: .6rem; left: .6rem;
}
@keyframes signalPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(16,185,129,.5); }
  50% { box-shadow: 0 0 0 5px rgba(16,185,129,0); }
}
.signal-confidence { color: var(--text-muted); font-size: .7rem; }

.market-cards {
  max-width: 1000px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}
.market-card {
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 1.2rem 1.5rem;
  display: flex; flex-direction: column; gap: .3rem;
  transition: border-color .3s, box-shadow .3s, transform .3s;
  cursor: default;
}
.market-card:hover {
  border-color: var(--accent);
  box-shadow: var(--glow);
  transform: translateY(-3px);
}
.mc-name { font-family: var(--font-mono); font-size: .75rem; color: var(--text-muted); }
.mc-price { font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; }
.mc-change { font-size: .82rem; font-family: var(--font-mono); }

/* ══════════════════════════════════
   AI BRAIN
══════════════════════════════════ */
#ai-brain {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4rem; align-items: center;
  background: var(--bg-mid);
  overflow: hidden;
}
#ai-brain::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent2), transparent);
}

.brain-left .section-tag { display: inline-block; margin-bottom: 1rem; }
.brain-left .section-title { text-align: left; font-size: clamp(1.4rem, 2.5vw, 2.2rem); }
.brain-left p { color: var(--text-muted); line-height: 1.8; margin: 1rem 0 1.5rem; }

.brain-list { list-style: none; margin-bottom: 2rem; }
.brain-list li {
  display: flex; align-items: center; gap: .8rem;
  padding: .5rem 0;
  color: var(--text-muted); font-size: .92rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  transition: color .3s;
}
.brain-list li:hover { color: var(--text); }
.list-icon { color: var(--accent); font-size: .7rem; }

.brain-right { display: flex; justify-content: center; align-items: center; }
#brainCanvas { width: 420px; height: 420px; max-width: 100%; }

/* ══════════════════════════════════
   TESTIMONIALS
══════════════════════════════════ */
#testimonials { overflow: hidden; }

.testimonials-track {
  display: flex; gap: 1.5rem;
  animation: testimonialsScroll 20s linear infinite;
  width: max-content;
}
.testimonials-track:hover { animation-play-state: paused; }
@keyframes testimonialsScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.testimonial-card {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 2rem;
  width: 380px; flex-shrink: 0;
  transition: border-color .3s, transform .3s;
}
.testimonial-card:hover { border-color: var(--accent2); transform: translateY(-4px); }

.t-quote {
  font-style: italic; color: var(--text-muted);
  line-height: 1.7; font-size: .92rem;
  margin-bottom: 1.5rem;
}
.t-quote::before { content: '"'; color: var(--accent2); font-size: 2rem; line-height: 0; vertical-align: -.4em; margin-right: .3rem; }

.t-author { display: flex; align-items: center; gap: 1rem; }
.t-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
}
.t-author strong { font-size: .9rem; }
.t-author small { color: var(--text-muted); font-size: .78rem; }

/* ══════════════════════════════════
   CONTACT
══════════════════════════════════ */
#contact {
  background: var(--bg-dark);
  position: relative; overflow: hidden;
}
.contact-inner { max-width: 700px; margin: 0 auto; position: relative; z-index: 1; }
.contact-particles { position: absolute; inset: 0; pointer-events: none; }

.contact-form { margin-top: 2rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-group { position: relative; margin-bottom: 1.2rem; }

.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1rem .6rem;
  color: var(--text);
  font-family: var(--font-body); font-size: .92rem;
  outline: none;
  transition: border-color .3s, box-shadow .3s;
  resize: none;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,212,255,.1);
}
.form-group label {
  position: absolute; top: .85rem; left: 1rem;
  color: var(--text-muted); font-size: .85rem;
  transition: all .25s; pointer-events: none;
}
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
  top: .2rem; font-size: .7rem; color: var(--accent);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: transparent; }

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
footer {
  background: var(--bg-deep);
  border-top: 1px solid var(--border);
  padding: 4rem 3rem 2rem;
}
.footer-content {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem; max-width: 1200px; margin: 0 auto 3rem;
}
.footer-brand .nav-logo { margin-bottom: .8rem; }
.footer-brand p { color: var(--text-muted); font-size: .85rem; line-height: 1.7; }
.footer-links h4 {
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .1em;
  color: var(--text); margin-bottom: 1rem;
}
.footer-links { display: flex; flex-direction: column; gap: .5rem; }
.footer-links a { color: var(--text-muted); font-size: .85rem; text-decoration: none; transition: color .3s; }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 1.5rem; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  color: var(--text-muted); font-size: .77rem;
}

/* ══════════════════════════════════
   ANIMATIONS & UTILITIES
══════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes borderPulse {
  0%,100% { opacity: 0; }
  50% { opacity: .3; }
}

/* ══════════════════════════════════
   MODAL POPUP
══════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(2, 5, 16, .85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
  cursor: pointer;
}
.modal-overlay.active {
  opacity: 1; visibility: visible;
}

.modal-box {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(90vw, 720px);
  max-height: 82vh;
  overflow-y: auto;
  position: relative;
  padding: 2.5rem 2rem;
  cursor: default;
  box-shadow: 0 0 60px rgba(0, 212, 255, .15), 0 0 120px rgba(124, 58, 237, .1);
  transform: translateY(20px);
  transition: transform .35s ease;
}
.modal-overlay.active .modal-box {
  transform: translateY(0);
}

.modal-close {
  position: absolute; top: .8rem; right: 1rem;
  background: none; border: none;
  color: var(--text-muted);
  font-size: 1.8rem; line-height: 1;
  cursor: pointer;
  transition: color .2s;
  z-index: 1;
}
.modal-close:hover { color: var(--accent); }

.modal-content {
  color: var(--text);
  font-size: .92rem; line-height: 1.8;
}
.modal-content h2 {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--accent);
  margin-bottom: 1.2rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--border);
}
.modal-content h3 {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  margin: 1.6rem 0 .6rem;
}
.modal-content p { margin-bottom: .9rem; color: var(--text-muted); }
.modal-content strong { color: var(--text); }
.modal-content ul, .modal-content ol {
  margin: .6rem 0 1rem 1.2rem;
  color: var(--text-muted);
}
.modal-content li { margin-bottom: .35rem; }
.modal-content hr {
  border: none; border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}
.modal-content em { color: var(--text-muted); font-style: italic; }
.modal-content a { color: var(--accent); text-decoration: underline; }

.modal-content table {
  width: 100%; border-collapse: collapse;
  margin: .8rem 0 1.2rem;
  font-size: .85rem;
}
.modal-content table th {
  text-align: left; padding: .5rem .7rem;
  background: rgba(0, 212, 255, .08);
  font-family: var(--font-mono); font-size: .75rem;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
}
.modal-content table td {
  padding: .4rem .7rem;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-muted);
}

/* Scrollbar within modal */
.modal-box::-webkit-scrollbar { width: 5px; }
.modal-box::-webkit-scrollbar-thumb { background: rgba(0,212,255,.3); border-radius: 3px; }

/* ══════════════════════════════════
   DEMO TOOL FORM (inside modal)
══════════════════════════════════ */
.demo-form { margin-top: 1.2rem; }
.demo-field { margin-bottom: 1.1rem; }
.demo-field label {
  display: block; font-size: .82rem; color: var(--text-muted);
  margin-bottom: .3rem; font-weight: 600;
}
.demo-field select,
.demo-field input {
  width: 100%; padding: .7rem .9rem;
  background: rgba(0, 0, 0, .35);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: .9rem;
  transition: border-color .25s;
  outline: none;
}
.demo-field select:focus,
.demo-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, .15);
}
.demo-field select option {
  background: var(--bg-mid); color: var(--text);
}
.demo-required { color: var(--red); }
.demo-hidden { display: none; }

/* Toggle row */
.demo-toggle-row {
  display: flex; align-items: center; justify-content: center;
  gap: .8rem; margin: 1.2rem 0;
}
.demo-toggle-label {
  font-size: .8rem; color: var(--text-muted);
  font-weight: 600; transition: color .25s;
}
.demo-toggle-label.active { color: var(--accent); }

/* Toggle switch */
.demo-switch {
  position: relative; display: inline-block;
  width: 50px; height: 26px;
}
.demo-switch input { opacity: 0; width: 0; height: 0; }
.demo-slider {
  position: absolute; cursor: pointer;
  inset: 0; border-radius: 26px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--border);
  transition: .3s;
}
.demo-slider::before {
  content: ''; position: absolute;
  left: 3px; bottom: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: .3s;
}
.demo-switch input:checked + .demo-slider {
  background: rgba(124, 58, 237, .25);
  border-color: var(--accent2);
}
.demo-switch input:checked + .demo-slider::before {
  transform: translateX(24px);
  background: var(--accent2);
}

.demo-submit { margin-top: .6rem; width: 100%; }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 1024px) {
  #hero { grid-template-columns: 1fr 1fr; }
  .hero-visual { width: 100%; }
  .neural-net { width: clamp(250px, 60vw, 350px); height: clamp(250px, 60vw, 350px); }
}

@media (max-width: 900px) {
  #hero { grid-template-columns: 1fr; padding-top: clamp(5rem, 7vw, 7rem); }
  .hero-visual { display: none; }
  #ai-brain { grid-template-columns: 1fr; }
  .brain-right { display: none; }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  #navbar { padding: clamp(.8rem, 2vw, 1rem) clamp(1rem, 3vw, 1.5rem); }
  .nav-links { gap: clamp(1rem, 2vw, 1.5rem); }
  section { padding: clamp(3rem, 6vw, 4rem) clamp(1rem, 3vw, 1.5rem); }
  .hero-buttons { justify-content: flex-start; }
  .btn-primary, .btn-secondary { flex: 1 1 calc(50% - .4rem); min-width: 140px; }
}

@media (max-width: 600px) {
  #navbar { padding: .7rem clamp(.8rem, 2vw, 1rem); }
  .nav-logo { font-size: 1.2rem; }
  .nav-links { display: none; gap: 0; }
  section { padding: clamp(2.5rem, 5vw, 3rem) clamp(.8rem, 2vw, 1rem); }
  .footer-content { grid-template-columns: 1fr; }
  #hero { padding-top: clamp(4.5rem, 8vh, 6rem); }
  .hero-buttons { flex-direction: column; }
  .btn-primary, .btn-secondary { flex: 1 1 100%; min-width: unset; }
}

/* ── ANIMATED FACE ── */
.mascot-face {
  position: fixed;
  top: 100px;
  right: clamp(1rem, 4vw, 3rem);
  width: 120px;
  height: 120px;
  border: 2px solid var(--border);
  box-sizing: border-box;
  background-color: var(--accent2);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(140, 110, 230, 0.5) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(31, 31, 31, 0.3) 0%, transparent 100%),
    radial-gradient(circle at 80% 80%, rgba(0, 0, 0, 0.6) 0%, transparent 70%);
  background-blend-mode: multiply;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.25);
  z-index: 5;
  cursor: pointer;
}
.mascot-eye {
  width: 15px;
  height: 25px;
  background-color: white;
  border-radius: 20px;
  position: absolute;
  transition: height 0.2s ease, transform 0.1s ease;
  box-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.mascot-eye.left { left: 25%; }
.mascot-eye.right { right: 25%; }
.mascot-eye.blink {
  height: 2px;
}
@media (max-width: 768px) {
  .mascot-face { display: none; }
}
