/* ============================================================
   BrainySensei — Custom Styles
   Loaded after Tailwind v4 CDN to add animations, glassmorphism,
   3D shapes, and component classes that Tailwind cannot generate.
   ============================================================ */

/* ── Root Variables ─────────────────────────────────────── */
:root {
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.10);
  --blur-strength: 16px;
  --tilt-perspective: 1000px;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --brand-purple: #7C3AED;
  --brand-blue: #2563EB;
  --brand-gold: #F59E0B;
  --bg-base: #0D0D1A;
}

/* ── Base ───────────────────────────────────────────────── */
/* NOTE: margin/padding reset deliberately removed — my styles.css is unlayered CSS
   which would beat Tailwind's @layer utilities, breaking mx-auto, px-*, etc.
   Tailwind v4 CDN includes its own preflight that handles element resets. */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  font-family: 'Inter', sans-serif;
  color: #ffffff;
  overflow-x: hidden;
}

/* ── Section Layout Helpers ─────────────────────────────── */
/* These use !important to ensure they override any layer-order conflicts */
.section-subtitle {
  text-align: center !important;
  max-width: 42rem;
  margin-left: auto !important;
  margin-right: auto !important;
}

.section-label {
  text-align: center !important;
  display: block;
}

/* ── Keyframe Animations ────────────────────────────────── */

@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%       { transform: translate(30px, -50px) scale(1.05); }
  66%       { transform: translate(-20px, 20px) scale(0.97); }
}

@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes shapeFloat {
  0%, 100% { transform: translateY(0px); }
  50%       { transform: translateY(-18px); }
}

@keyframes cubeRotate {
  0%   { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

@keyframes ringRotate {
  0%   { transform: rotateX(70deg) rotateZ(0deg); }
  100% { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes toastSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes toastSlideOut {
  from { transform: translateX(0);    opacity: 1; }
  to   { transform: translateX(120%); opacity: 0; }
}

@keyframes buttonShimmer {
  0%   { left: -100%; }
  100% { left: 150%; }
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.3); }
  50%       { box-shadow: 0 0 40px rgba(124,58,237,0.6); }
}

/* ── Glassmorphism Nav ──────────────────────────────────── */
.glass-nav {
  background: rgba(13, 13, 26, 0.6);
  backdrop-filter: blur(var(--blur-strength));
  -webkit-backdrop-filter: blur(var(--blur-strength));
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition-smooth), box-shadow var(--transition-smooth);
}

.glass-nav.nav-scrolled {
  background: rgba(13, 13, 26, 0.92);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.active-nav-link {
  color: var(--brand-purple) !important;
  font-weight: 600;
}

/* ── Glassmorphism Card ─────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  will-change: transform;
  transition: box-shadow var(--transition-smooth);
}

.glass-card:hover {
  box-shadow: 0 0 40px rgba(124, 58, 237, 0.2), 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ── Blob Orbs ──────────────────────────────────────────── */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 10s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

.blob-purple {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.35) 0%, transparent 70%);
  animation-duration: 11s;
}

.blob-blue {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.28) 0%, transparent 70%);
  animation-duration: 14s;
  animation-delay: -4s;
}

.blob-gold {
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18) 0%, transparent 70%);
  animation-duration: 9s;
  animation-delay: -7s;
}

/* ── Gradient Text ──────────────────────────────────────── */
.gradient-text {
  background: linear-gradient(
    90deg,
    var(--brand-purple) 0%,
    var(--brand-blue)   40%,
    var(--brand-gold)   65%,
    var(--brand-purple) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3.5s linear infinite;
}

/* ── 3D Geometric Shapes ────────────────────────────────── */
.hero-shapes-container {
  perspective: 900px;
  position: relative;
}

.hero-shape {
  position: absolute;
  animation: shapeFloat 5s ease-in-out infinite;
}

.shape-cube {
  width: 70px;
  height: 70px;
  transform-style: preserve-3d;
  animation: cubeRotate 9s linear infinite;
  border: 2px solid rgba(124, 58, 237, 0.65);
  background: rgba(124, 58, 237, 0.08);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.45),
              inset 0 0 16px rgba(124, 58, 237, 0.15);
  border-radius: 6px;
}

.shape-ring {
  width: 90px;
  height: 90px;
  border: 7px solid rgba(37, 99, 235, 0.7);
  border-radius: 50%;
  animation: ringRotate 7s linear infinite;
  box-shadow: 0 0 24px rgba(37, 99, 235, 0.45),
              inset 0 0 18px rgba(37, 99, 235, 0.2);
}

.shape-diamond {
  width: 55px;
  height: 55px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.45), rgba(124, 58, 237, 0.35));
  transform: rotate(45deg);
  animation: shapeFloat 7s ease-in-out infinite;
  animation-delay: -3s;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.35);
  border-radius: 4px;
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 35px solid transparent;
  border-right: 35px solid transparent;
  border-bottom: 60px solid rgba(37, 99, 235, 0.35);
  filter: drop-shadow(0 0 12px rgba(37,99,235,0.5));
  animation: shapeFloat 8s ease-in-out infinite;
  animation-delay: -5s;
}

/* ── Scroll Reveal ──────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  min-width: 300px;
  max-width: 380px;
  padding: 16px 20px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: toastSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto;
}

.toast.success {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}

.toast.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.toast.removing {
  animation: toastSlideOut 0.3s ease forwards;
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Form Inputs ────────────────────────────────────────── */
.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: #ffffff;
  padding: 14px 18px;
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
  resize: vertical;
}

.form-input::placeholder {
  color: #475569;
}

.form-input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-input-error {
  border-color: rgba(239, 68, 68, 0.7) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-error-text {
  color: #fca5a5;
  font-size: 0.8rem;
  margin-top: 6px;
}

/* ── CTA Button ─────────────────────────────────────────── */
.cta-button {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue));
  color: #ffffff;
  padding: 14px 34px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

.cta-button::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 55%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: buttonShimmer 2.8s ease infinite;
}

.cta-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 10px 36px rgba(124, 58, 237, 0.55);
}

.cta-button:active {
  transform: translateY(0) scale(0.98);
}

.cta-button:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ── Hamburger / Mobile Nav ─────────────────────────────── */
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: none; /* hidden on desktop by default */
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

/* Show hamburger only on mobile */
@media (max-width: 767px) {
  .hamburger {
    display: flex;
  }
  /* Hide the nav CTA button on mobile — .cta-button { display: inline-block }
     beats Tailwind's hidden utility (unlayered CSS > @layer utilities) */
  header .cta-button {
    display: none !important;
  }
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
  transform-origin: center;
}

.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.open {
  max-height: 480px;
}

/* ── Process Steps ──────────────────────────────────────── */
.process-steps {
  counter-reset: step-counter;
}

.process-step {
  counter-increment: step-counter;
  position: relative;
  padding-left: 68px;
}

.process-step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.95rem;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

/* ── Section Divider Line ───────────────────────────────── */
.section-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
}

/* ── Service Icon Box ───────────────────────────────────── */
.icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.icon-box-purple { background: rgba(124, 58, 237, 0.18); }
.icon-box-blue   { background: rgba(37, 99, 235, 0.18); }
.icon-box-gold   { background: rgba(245, 158, 11, 0.18); }

/* ── Stats Item ─────────────────────────────────────────── */
.stats-number {
  background: linear-gradient(135deg, var(--brand-purple), var(--brand-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Tilt Card 3D ───────────────────────────────────────── */
.tilt-card {
  transform-style: preserve-3d;
  will-change: transform;
  transition: box-shadow var(--transition-smooth);
}

/* ── Page Hero Gradient Overlay ─────────────────────────── */
.hero-gradient-overlay {
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(124, 58, 237, 0.15) 0%,
    rgba(37, 99, 235, 0.08) 40%,
    transparent 70%
  );
}

/* ── Offering Card hover accent line ───────────────────── */
.offering-card {
  border-top: 2px solid transparent;
  transition: border-color 0.3s ease, box-shadow var(--transition-smooth);
}

.offering-card:hover {
  border-top-color: var(--brand-purple);
}

/* ── Nav link hover underline animation ─────────────────── */
.nav-link {
  position: relative;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.25s;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand-purple), var(--brand-blue));
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.nav-link:hover::after,
.nav-link.active-nav-link::after {
  width: 100%;
}

.nav-link.active-nav-link {
  color: #ffffff !important;
}

/* ── Audience Cards ─────────────────────────────────────── */
.audience-card {
  text-align: center;
  padding: 2rem 1.5rem;
  border-radius: 16px;
}

/* ── Responsive Helpers ─────────────────────────────────── */
@media (max-width: 640px) {
  .hero-shapes-container {
    display: none;
  }

  .blob-purple { width: 280px; height: 280px; }
  .blob-blue   { width: 220px; height: 220px; }
  .blob-gold   { width: 180px; height: 180px; }
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.5);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(124, 58, 237, 0.8);
}

/* ── Selection ──────────────────────────────────────────── */
::selection {
  background: rgba(124, 58, 237, 0.35);
  color: #ffffff;
}
