/* ============================================================
   BRAIN BRIDGE ACADEMY — Shared Stylesheet
   Premium futuristic dark UI · MRI-inspired aesthetics
   ============================================================ */

:root {
  --bg-0: #03000a;
  --bg-1: #070218;
  --bg-2: #0c0524;
  --ink: #f4f1ff;
  --ink-dim: #b8b4d6;
  --ink-faint: #6c6890;
  --neon-blue: #4dd4ff;
  --neon-cyan: #6effd8;
  --neon-violet: #a86cff;
  --neon-magenta: #ff5cd0;
  --neon-amber: #ffb547;
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg-0);
  color: var(--ink);
  font-family: 'Bricolage Grotesque', system-ui, sans-serif;
  overflow-x: hidden;
  cursor: none;
}

/* Typography helpers */
.font-serif { font-family: 'Instrument Serif', 'Times New Roman', serif; font-weight: 400; }
.font-mono  { font-family: 'JetBrains Mono', monospace; }
.display    { font-family: 'Bricolage Grotesque', sans-serif; letter-spacing: -0.04em; line-height: 0.95; }
.eyebrow    { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--ink-faint); }

/* Custom cursor */
.cursor-dot, .cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999;
  border-radius: 50%; transform: translate(-50%, -50%);
  transition: width 0.25s ease, height 0.25s ease, background 0.25s ease;
  mix-blend-mode: screen;
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--neon-cyan);
  box-shadow: 0 0 12px var(--neon-cyan), 0 0 24px var(--neon-blue);
}
.cursor-ring {
  width: 38px; height: 38px;
  border: 1px solid rgba(168, 108, 255, 0.55);
  box-shadow: 0 0 24px rgba(168, 108, 255, 0.3);
  transition: transform 0.15s ease-out, width 0.25s, height 0.25s;
}
.cursor-ring.hover { width: 70px; height: 70px; border-color: var(--neon-cyan); }
@media (max-width: 768px) { body { cursor: auto; } .cursor-dot, .cursor-ring { display: none; } }

/* Background atmospherics */
.atmosphere {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(77, 212, 255, 0.10), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 40%, rgba(168, 108, 255, 0.12), transparent 60%),
    radial-gradient(ellipse 70% 50% at 10% 80%, rgba(255, 92, 208, 0.06), transparent 60%),
    var(--bg-0);
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(168, 108, 255, 0.18) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 100% 100% at 50% 50%, black 30%, transparent 80%);
}
.noise {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Gradient text */
.glow-text {
  background: linear-gradient(135deg, #fff 0%, #b8b4d6 50%, #4dd4ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.neon-text {
  background: linear-gradient(120deg, #6effd8, #4dd4ff 40%, #a86cff 75%, #ff5cd0);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Glass card */
.glass {
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.07);
  position: relative;
  overflow: hidden;
}
.glass::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.04) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform 0.9s;
}
.glass:hover::before { transform: translateX(100%); }

.glow-border { position: relative; }
.glow-border::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px;
  background: linear-gradient(135deg, rgba(77,212,255,0.5), rgba(168,108,255,0.5), rgba(255,92,208,0.3));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
  opacity: 0.4; transition: opacity 0.4s;
}
.glow-border:hover::after { opacity: 1; }

/* Buttons */
.btn-primary {
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  color: #03000a; font-weight: 600; font-size: 14px; letter-spacing: -0.01em;
  background: linear-gradient(135deg, #6effd8, #4dd4ff 50%, #a86cff);
  box-shadow: 0 0 30px rgba(77, 212, 255, 0.4), 0 0 60px rgba(168, 108, 255, 0.2), inset 0 1px 0 rgba(255,255,255,0.5);
  overflow: hidden; transition: transform 0.3s, box-shadow 0.3s;
  cursor: none;
  border: none;
  font-family: inherit;
  text-decoration: none;
}
.btn-primary::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, #fff, #6effd8);
  opacity: 0; transition: opacity 0.3s;
}
.btn-primary span { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 10px; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(77, 212, 255, 0.6), 0 0 100px rgba(168, 108, 255, 0.4); }
.btn-primary:hover::before { opacity: 0.3; }
.btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--ink); font-weight: 500; font-size: 14px; letter-spacing: -0.01em;
  backdrop-filter: blur(20px);
  transition: all 0.3s;
  cursor: none;
  font-family: inherit;
  text-decoration: none;
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); border-color: rgba(168,108,255,0.5); box-shadow: 0 0 30px rgba(168,108,255,0.2); }

/* Animations */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes float-slow { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-20px) rotate(2deg); } }
@keyframes pulse-glow { 0%,100% { opacity: 0.5; } 50% { opacity: 1; } }
@keyframes mri-sweep { 0% { transform: translateY(-100%); opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(100%); opacity: 0; } }
@keyframes rotate-slow { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes spin { to { transform: rotate(360deg); } }

.anim-float { animation: float 6s ease-in-out infinite; }
.anim-float-slow { animation: float-slow 9s ease-in-out infinite; }
.anim-pulse { animation: pulse-glow 3s ease-in-out infinite; }
.anim-rotate-slow { animation: rotate-slow 30s linear infinite; }
.animate-spin { animation: spin 0.8s linear infinite; }

/* Scroll reveal */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1s cubic-bezier(.2,.7,.2,1), transform 1s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Hero canvas */
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 50% at 50% 50%, transparent 30%, rgba(3,0,10,0.7) 70%, var(--bg-0) 100%);
}

/* Floating UI cards */
.float-card {
  position: absolute; padding: 14px 18px; border-radius: 16px;
  background: linear-gradient(145deg, rgba(20, 10, 40, 0.7), rgba(10, 5, 25, 0.5));
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(168, 108, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 24px rgba(77,212,255,0.08);
}

/* Marquee */
.marquee { display: flex; overflow: hidden; mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent); }
.marquee-track { display: flex; gap: 60px; animation: marquee 40s linear infinite; white-space: nowrap; }

/* Pricing */
.pricing-card { transition: transform 0.5s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s; }
.pricing-card:hover { transform: translateY(-12px) scale(1.01); box-shadow: 0 30px 80px rgba(168, 108, 255, 0.25), 0 0 60px rgba(77, 212, 255, 0.15); }
.pricing-card.featured { transform: scale(1.04); }
.pricing-card.featured:hover { transform: scale(1.04) translateY(-12px); }

/* MRI scan overlay */
.scan-overlay { position: relative; overflow: hidden; }
.scan-overlay::after {
  content: ''; position: absolute; left: 0; right: 0; height: 80px;
  background: linear-gradient(180deg, transparent, rgba(110, 255, 216, 0.12), transparent);
  animation: mri-sweep 5s ease-in-out infinite;
}

/* Testimonial track */
.test-track { display: flex; transition: transform 0.7s cubic-bezier(.2,.7,.2,1); }
.test-slide { flex: 0 0 100%; padding: 0 12px; }

/* Form fields */
.field {
  width: 100%; padding: 16px 18px; border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--ink); font-family: inherit; font-size: 15px;
  transition: all 0.3s;
}
.field::placeholder { color: var(--ink-faint); }
.field:focus { outline: none; border-color: rgba(77,212,255,0.5); background: rgba(77,212,255,0.04); box-shadow: 0 0 0 4px rgba(77,212,255,0.08), 0 0 30px rgba(77,212,255,0.12); }
select.field { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c6890' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 16px center; background-size: 18px; padding-right: 44px; }
select.field option { background: #0c0524; color: var(--ink); }
input.field, textarea.field { cursor: text; }
select.field { cursor: pointer; }

/* Badge */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase;
  background: rgba(168, 108, 255, 0.08); color: #d4b8ff;
  border: 1px solid rgba(168, 108, 255, 0.25);
}
.badge-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--neon-violet); box-shadow: 0 0 8px var(--neon-violet); animation: pulse-glow 2s ease-in-out infinite; }

/* Section numbers */
.section-num {
  font-family: 'Instrument Serif', serif; font-style: italic;
  font-size: 14px; color: var(--ink-faint);
}
.section-num::before { content: ''; display: inline-block; width: 40px; height: 1px; background: var(--ink-faint); margin-right: 16px; vertical-align: middle; }

/* Accent line */
.accent-line {
  height: 1px; width: 100%;
  background: linear-gradient(90deg, transparent, rgba(168,108,255,0.5), rgba(77,212,255,0.5), transparent);
}

/* Nav */
.nav-blur {
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  background: rgba(3, 0, 10, 0.5);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* Spotlight */
.spotlight { position: relative; }
.spotlight::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 50%), rgba(77, 212, 255, 0.08), transparent 40%);
  opacity: 0; transition: opacity 0.4s;
}
.spotlight:hover::before { opacity: 1; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink-dim);
}

/* Layer rows for anatomical bars */
.layer-row {
  display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 20px;
  padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.06);
}
.layer-bar {
  height: 6px; border-radius: 999px; background: rgba(255,255,255,0.05); overflow: hidden;
  position: relative;
}
.layer-bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-blue), var(--neon-violet));
  box-shadow: 0 0 10px rgba(77,212,255,0.5);
  border-radius: 999px;
}

footer { border-top: 1px solid rgba(255,255,255,0.06); }

/* Underline link */
.link-underline { position: relative; }
.link-underline::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-violet));
  transform: scaleX(0); transform-origin: left; transition: transform 0.4s;
}
.link-underline:hover::after, .link-underline.active::after { transform: scaleX(1); }
.link-underline.active { color: #fff; }

.svg-glow { filter: drop-shadow(0 0 12px rgba(77,212,255,0.4)) drop-shadow(0 0 24px rgba(168,108,255,0.2)); }

::selection { background: rgba(168, 108, 255, 0.4); color: #fff; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-0); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #a86cff, #4dd4ff); border-radius: 999px; }

/* Domain pathway cards */
.domain-card { transition: transform 0.6s cubic-bezier(.2,.7,.2,1), box-shadow 0.6s; cursor: none; text-decoration: none; }
.domain-card:hover { transform: translateY(-10px); box-shadow: 0 30px 80px rgba(168, 108, 255, 0.25); }
.domain-card .arrow { transition: transform 0.4s cubic-bezier(.2,.7,.2,1); }
.domain-card:hover .arrow { transform: translate(6px, -6px); }

/* MRI frame styling */
.mri-frame {
  position: relative;
  background: radial-gradient(ellipse at center, rgba(20, 30, 50, 0.6), rgba(3, 0, 10, 0.9));
  border: 1px solid rgba(110, 255, 216, 0.15);
  border-radius: 24px;
  overflow: hidden;
}
.mri-frame::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(110, 255, 216, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 255, 216, 0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}
.mri-corner {
  position: absolute;
  width: 24px; height: 24px;
  border: 1px solid rgba(110, 255, 216, 0.6);
}
.mri-corner.tl { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.mri-corner.tr { top: 12px; right: 12px; border-left: none; border-bottom: none; }
.mri-corner.bl { bottom: 12px; left: 12px; border-right: none; border-top: none; }
.mri-corner.br { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.mri-label {
  position: absolute;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px; letter-spacing: 0.18em;
  color: rgba(110, 255, 216, 0.7);
  text-transform: uppercase;
}

/* Star rating */
.star { color: var(--neon-amber); }

/* Code interface mockup */
.code-line { font-family: 'JetBrains Mono', monospace; font-size: 12px; line-height: 1.8; }
.code-comment { color: #6c6890; }
.code-keyword { color: #ff5cd0; }
.code-string { color: #6effd8; }
.code-fn { color: #4dd4ff; }
.code-var { color: #d4b8ff; }
.code-num { color: #ffb547; }

/* Mobile */
@media (max-width: 768px) {
  .display { letter-spacing: -0.03em; }
  .float-card { display: none; }
  .pricing-card.featured { transform: scale(1); }
}
@media (max-width: 1024px) {
  .mri-label { display: none; }
}
