/* =============================================
   MATHEMATICS LEARNING HUB — Landing Page
   Theme: Deep Indigo / Academic Precision
   ============================================= */

:root {
  --accent: #4f46e5;
  --accent-dark: #3730a3;
  --accent-light: #c7d2fe;
  --accent-xlight: #eef2ff;
  --secondary: #7c3aed;
  --text-primary: #0f0e1a;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-soft: #f8f8ff;
  --bg-card: #ffffff;
  --border: #e5e7eb;
  --border-soft: #f0f0ff;
  --shadow-sm: 0 1px 3px rgba(79,70,229,0.06);
  --shadow-md: 0 4px 16px rgba(79,70,229,0.10);
  --shadow-lg: 0 12px 40px rgba(79,70,229,0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --nav-height: 70px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); background: var(--bg); color: var(--text-primary); overflow-x: hidden; line-height: 1.6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }

h1 { font-size: clamp(2.1rem, 4.5vw, 3.6rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.6rem); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
h3 { font-size: clamp(1rem, 1.8vw, 1.2rem); font-weight: 600; }
p { color: var(--text-secondary); }
a { text-decoration: none; color: inherit; }

.gradient-text {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: linear-gradient(135deg, #4f46e5, #3730a3);
  color: white; font-weight: 600; font-size: 0.95rem;
  padding: 0.75rem 1.5rem; border-radius: 50px;
  border: none; cursor: pointer; transition: all 0.25s;
  box-shadow: 0 4px 14px rgba(79,70,229,0.35); white-space: nowrap;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(79,70,229,0.45); }
.btn-primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.btn-secondary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: transparent; color: var(--accent-dark);
  font-weight: 600; font-size: 0.95rem;
  padding: 0.75rem 1.5rem; border-radius: 50px;
  border: 2px solid var(--accent); cursor: pointer; transition: all 0.25s;
}
.btn-secondary:hover { background: var(--accent-xlight); transform: translateY(-2px); }
.btn-secondary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-large { padding: 1rem 2rem; font-size: 1.05rem; }

/* ===== NAVIGATION ===== */
.nav-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
  height: var(--nav-height); transition: all 0.3s;
}
.nav-header.scrolled { box-shadow: var(--shadow-md); }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 clamp(1rem,4vw,2rem); height: 100%; display: flex; align-items: center; gap: 1.5rem; }
.nav-logo { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1rem; color: var(--text-primary); flex-shrink: 0; }
.nav-logo-icon { font-size: 1.6rem; color: var(--accent); font-weight: 900; line-height: 1; }
.nav-links { display: flex; list-style: none; gap: 0.1rem; margin-left: auto; }
.nav-links a { color: var(--text-secondary); font-size: 0.88rem; font-weight: 500; padding: 0.4rem 0.7rem; border-radius: 8px; transition: all 0.2s; }
.nav-links a:hover { color: var(--accent); background: var(--accent-xlight); }
.nav-links a:focus-visible { outline: 2px solid var(--accent); }
.nav-cta { margin-left: 0.5rem; background: linear-gradient(135deg, #4f46e5, #3730a3); color: white; font-weight: 600; font-size: 0.875rem; padding: 0.5rem 1.2rem; border-radius: 50px; transition: all 0.25s; white-space: nowrap; box-shadow: 0 2px 8px rgba(79,70,229,0.3); }
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(79,70,229,0.4); }
.nav-cta:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 4px; border-radius: 8px; margin-left: auto; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text-primary); border-radius: 2px; transition: all 0.3s; }
.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); }
.hamburger:focus-visible { outline: 2px solid var(--accent); }

.mobile-menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(320px,85vw);
  background: white; z-index: 2000; padding: 2rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transform: translateX(100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.12);
}
.mobile-menu.open { transform: translateX(0); }
.mobile-menu ul { list-style: none; display: flex; flex-direction: column; gap: 0.25rem; margin-top: 1rem; }
.mobile-link { display: block; padding: 0.75rem 1rem; border-radius: 12px; font-weight: 500; color: var(--text-secondary); transition: all 0.2s; }
.mobile-link:hover { background: var(--accent-xlight); color: var(--accent-dark); }
.mobile-menu-close { align-self: flex-end; background: var(--bg-soft); border: none; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; font-size: 1rem; color: var(--text-secondary); transition: all 0.2s; }
.mobile-cta { margin-top: 1.5rem; justify-content: center; }
.mobile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 1999; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.mobile-overlay.visible { opacity: 1; pointer-events: all; }

/* ===== HERO ===== */
.hero {
  min-height: 100svh; padding-top: var(--nav-height);
  display: flex; align-items: center; position: relative; overflow: hidden;
  background: linear-gradient(155deg, #eef2ff 0%, #ffffff 45%, #f5f3ff 100%);
}
.hero-bg { position: absolute; inset: 0; pointer-events: none; }
.bg-grid {
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(79,70,229,0.08) 1px, transparent 1px);
  background-size: 32px 32px; opacity: 0.6;
}
.bg-orb { position: absolute; border-radius: 50%; }
.orb-1 { width: clamp(350px,45vw,650px); height: clamp(350px,45vw,650px); background: radial-gradient(circle, rgba(79,70,229,0.10), transparent 70%); top: -15%; right: -10%; }
.orb-2 { width: clamp(200px,28vw,400px); height: clamp(200px,28vw,400px); background: radial-gradient(circle, rgba(124,58,237,0.08), transparent 70%); bottom: 5%; left: -5%; }

.math-float {
  position: absolute; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 900;
  color: rgba(79,70,229,0.08); user-select: none;
  animation: floatMath 6s ease-in-out infinite;
}
.f1 { top: 12%; left: 5%; animation-delay: 0s; }
.f2 { top: 25%; right: 8%; animation-delay: 1s; font-size: 3rem; }
.f3 { bottom: 30%; left: 3%; animation-delay: 2s; }
.f4 { top: 60%; right: 5%; animation-delay: 0.5s; }
.f5 { bottom: 15%; right: 12%; animation-delay: 1.5s; }
.f6 { top: 45%; left: 8%; animation-delay: 2.5s; }
@keyframes floatMath { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-12px) rotate(5deg); } }

.hero-inner { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,5rem); align-items: center; padding: clamp(2rem,5vw,4rem) 0 clamp(3rem,6vw,5rem); }
.hero-badge { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--accent-xlight); color: var(--accent-dark); font-size: 0.82rem; font-weight: 600; padding: 0.4rem 1rem; border-radius: 50px; border: 1px solid var(--accent-light); margin-bottom: 1.25rem; }
.hero-content h1 { margin-bottom: 1.25rem; }
.hero-desc { font-size: clamp(1rem,1.8vw,1.12rem); color: var(--text-secondary); margin-bottom: 2rem; max-width: 480px; line-height: 1.7; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag { background: white; border: 1px solid var(--border); color: var(--text-secondary); font-size: 0.78rem; font-weight: 500; padding: 0.3rem 0.8rem; border-radius: 50px; box-shadow: var(--shadow-sm); font-family: 'Courier New', monospace; }

/* Phone Mockup */
.hero-visual { position: relative; display: flex; justify-content: center; align-items: center; }
.phone-mockup { position: relative; z-index: 2; }
.phone-shell {
  width: clamp(220px,30vw,285px);
  background: linear-gradient(160deg, #1a1333, #0e0b1f);
  border-radius: 40px; padding: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3), 0 8px 24px rgba(79,70,229,0.2), inset 0 0 0 1px rgba(255,255,255,0.08);
}
.mock-screen { background: #100d24; border-radius: 28px; padding: 1rem; }
.mock-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.mock-app-name { color: white; font-size: 0.85rem; font-weight: 700; }
.mock-level { background: rgba(79,70,229,0.3); color: #a5b4fc; font-size: 0.7rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 50px; }
.mock-subject-list { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.75rem; }
.mock-subject { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 0.6rem 0.7rem; border: 1px solid rgba(255,255,255,0.06); }
.mock-subject.active { border-color: rgba(79,70,229,0.4); background: rgba(79,70,229,0.1); }
.ms-icon { font-size: 0.9rem; color: #a5b4fc; font-family: 'Courier New', monospace; font-weight: 700; }
.ms-info { display: flex; justify-content: space-between; margin: 0.25rem 0; }
.ms-name { color: white; font-size: 0.75rem; font-weight: 500; }
.ms-progress { color: #a5b4fc; font-size: 0.7rem; }
.ms-bar { height: 3px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.ms-fill { height: 100%; background: linear-gradient(90deg, #4f46e5, #7c3aed); border-radius: 2px; }
.mock-formula-card { background: linear-gradient(135deg, rgba(79,70,229,0.2), rgba(124,58,237,0.2)); border: 1px solid rgba(79,70,229,0.3); border-radius: 12px; padding: 0.75rem; text-align: center; }
.mfc-label { color: rgba(255,255,255,0.5); font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.35rem; }
.mfc-formula { color: #a5b4fc; font-family: 'Courier New', monospace; font-size: 1rem; font-weight: 700; margin-bottom: 0.2rem; }
.mfc-name { color: rgba(255,255,255,0.6); font-size: 0.65rem; }

.float-card {
  position: absolute; background: white; border: 1px solid var(--border);
  border-radius: 50px; padding: 0.5rem 1rem; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); box-shadow: var(--shadow-md);
  white-space: nowrap; animation: floatCard 4s ease-in-out infinite;
}
.fcard-1 { top: 8%; left: -8%; animation-delay: 0s; }
.fcard-2 { bottom: 32%; left: -12%; animation-delay: 1.2s; }
.fcard-3 { top: 50%; right: -5%; animation-delay: 0.6s; }
@keyframes floatCard { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ===== HIGHLIGHTS ===== */
.highlights { padding: clamp(2.5rem,5vw,4rem) 0; background: var(--bg-soft); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.highlights-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 1.25rem; }
.hl-item { display: flex; align-items: center; gap: 0.75rem; background: white; border-radius: var(--radius); padding: 1rem 1.2rem; border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm); transition: all 0.25s; }
.hl-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.hl-icon { font-size: 1.4rem; flex-shrink: 0; }
.hl-item div { display: flex; flex-direction: column; gap: 0.1rem; }
.hl-item strong { font-size: 0.88rem; color: var(--text-primary); }
.hl-item span { font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; margin-bottom: clamp(2rem,4vw,3.5rem); }
.section-tag { display: inline-block; background: var(--accent-xlight); color: var(--accent-dark); font-size: 0.78rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; padding: 0.3rem 0.9rem; border-radius: 50px; border: 1px solid var(--accent-light); margin-bottom: 0.75rem; }
.section-header h2 { margin-bottom: 0.75rem; }
.section-header p { color: var(--text-muted); max-width: 560px; margin: 0 auto; font-size: 1rem; }

/* ===== SUBJECTS ===== */
.subjects { padding: clamp(4rem,8vw,7rem) 0; }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1.25rem; }
.subject-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: clamp(1.25rem,3vw,1.75rem);
  transition: all 0.3s; text-align: center; box-shadow: var(--shadow-sm);
}
.subject-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-light); }
.subject-symbol {
  font-size: 2.2rem; font-weight: 900; font-family: 'Courier New', monospace;
  color: var(--accent); margin-bottom: 0.75rem; display: block;
  background: var(--accent-xlight); width: 56px; height: 56px;
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 0.75rem;
}
.subject-card h3 { margin-bottom: 0.5rem; }
.subject-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ===== FEATURES ===== */
.features { padding: clamp(4rem,8vw,7rem) 0; background: var(--bg-soft); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 1.25rem; }
.feature-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(1.25rem,3vw,1.75rem); transition: all 0.3s; box-shadow: var(--shadow-sm); }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--accent-light); }
.feature-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.feature-card h3 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.feature-card p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.6; }

/* ===== SHOWCASE ===== */
.showcase { padding: clamp(3rem,6vw,6rem) 0; }
.showcase-row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem,5vw,4rem); align-items: center; margin-bottom: clamp(3rem,6vw,5rem); }
.showcase-row:last-child { margin-bottom: 0; }
.showcase-row.reverse { direction: rtl; }
.showcase-row.reverse > * { direction: ltr; }
.showcase-vis-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-lg); }

/* Formula vis */
.formula-vis .fv-header { font-size: 0.85rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 1rem; }
.formula-chip {
  display: inline-block; background: var(--accent-xlight); color: var(--accent-dark);
  font-family: 'Courier New', monospace; font-size: 0.9rem; font-weight: 700;
  padding: 0.4rem 0.9rem; border-radius: 8px; border: 1px solid var(--accent-light);
  margin: 0 0.4rem 0.5rem 0;
}
.fv-count { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.75rem; }

/* Chat vis */
.chat-vis { display: flex; flex-direction: column; gap: 0.75rem; }
.chat-row { padding: 0.75rem 1rem; border-radius: 14px; font-size: 0.85rem; line-height: 1.5; }
.chat-row.user { background: var(--accent); color: white; align-self: flex-end; max-width: 85%; border-bottom-right-radius: 4px; }
.chat-row.ai { background: white; color: var(--text-secondary); border: 1px solid var(--border); align-self: flex-start; max-width: 95%; border-bottom-left-radius: 4px; }
.chat-formula { font-family: 'Courier New', monospace; font-weight: 700; color: var(--accent-dark); background: var(--accent-xlight); padding: 0.2rem 0.4rem; border-radius: 6px; display: inline-block; margin: 0.25rem 0; }

.showcase-tag { display: inline-block; background: var(--accent-xlight); color: var(--accent-dark); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.25rem 0.75rem; border-radius: 50px; margin-bottom: 0.75rem; }
.showcase-content h3 { font-size: clamp(1.3rem,3vw,1.9rem); margin-bottom: 0.75rem; }
.showcase-content p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 1.25rem; line-height: 1.7; }
.showcase-list { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.showcase-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--text-secondary); }
.showcase-list li::before { content: '✓'; color: var(--accent); font-weight: 700; }

/* ===== SCREENSHOTS ===== */
.screenshots { padding: clamp(4rem,8vw,7rem) 0; background: var(--bg-soft); }
.screenshots-row { display: flex; justify-content: center; align-items: flex-end; gap: clamp(1rem,3vw,2rem); flex-wrap: wrap; }
.screenshot-frame { display: flex; flex-direction: column; align-items: center; gap: 1rem; transition: transform 0.3s; }
.screenshot-frame:hover { transform: translateY(-6px); }
.screenshot-frame p { font-size: 0.82rem; font-weight: 600; color: var(--text-muted); }
.screenshot-frame.featured { transform: scale(1.06); }
.screenshot-frame.featured:hover { transform: scale(1.06) translateY(-6px); }
.phone-frame { width: clamp(140px,20vw,175px); background: #1a1333; border-radius: 32px; padding: 10px; box-shadow: 0 20px 60px rgba(0,0,0,0.25), inset 0 0 0 1px rgba(255,255,255,0.07); }
.phone-screen-ss { border-radius: 24px; overflow: hidden; aspect-ratio: 9/18; background: #100d24; }
.ss-inner { padding: 0.75rem; height: 100%; display: flex; flex-direction: column; gap: 0.45rem; }
.ss-bar { display: flex; justify-content: space-between; font-size: 0.68rem; font-weight: 600; color: rgba(255,255,255,0.7); padding-bottom: 0.4rem; border-bottom: 1px solid rgba(255,255,255,0.08); }
.ss-tile { padding: 0.5rem 0.65rem; border-radius: 10px; font-size: 0.68rem; font-weight: 600; color: white; border-left: 3px solid; }
.ss-tile.indigo { background: rgba(79,70,229,0.2); border-color: #4f46e5; }
.ss-tile.blue { background: rgba(59,130,246,0.2); border-color: #3b82f6; }
.ss-tile.violet { background: rgba(124,58,237,0.2); border-color: #7c3aed; }
.ss-tile.teal { background: rgba(20,184,166,0.2); border-color: #14b8a6; }
.ss-question { background: rgba(255,255,255,0.07); border-radius: 10px; padding: 0.6rem; font-size: 0.72rem; font-weight: 600; color: white; }
.ss-opt { padding: 0.4rem 0.65rem; border-radius: 8px; font-size: 0.68rem; font-weight: 500; color: rgba(255,255,255,0.6); background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.06); }
.ss-opt.correct { background: rgba(34,197,94,0.15); color: #4ade80; border-color: rgba(34,197,94,0.3); }
.ss-score { text-align: center; font-size: 0.72rem; font-weight: 700; color: #a5b4fc; background: rgba(79,70,229,0.15); border-radius: 8px; padding: 0.4rem; }
.ss-progress-row { display: flex; align-items: center; gap: 0.5rem; }
.ss-progress-row span { font-size: 0.65rem; color: rgba(255,255,255,0.6); width: 34px; flex-shrink: 0; }
.ss-pbar { flex: 1; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; overflow: hidden; }
.ss-pfill { height: 100%; background: linear-gradient(90deg, #4f46e5, #7c3aed); border-radius: 2px; }
.ss-streak { background: rgba(249,115,22,0.15); border-radius: 8px; padding: 0.4rem; font-size: 0.68rem; font-weight: 600; color: #fb923c; text-align: center; margin-top: auto; }

/* ===== HOW IT WORKS ===== */
.how-it-works { padding: clamp(4rem,8vw,7rem) 0; }
.steps-row { display: flex; align-items: flex-start; gap: 0; flex-wrap: wrap; justify-content: center; }
.step-card { flex: 1; min-width: 160px; max-width: 220px; text-align: center; padding: 1.5rem 1rem; }
.step-connector { flex: 0 0 40px; height: 2px; background: linear-gradient(90deg, var(--accent-light), var(--accent)); align-self: center; margin-top: -2rem; }
.step-num { font-size: 2.5rem; font-weight: 900; color: var(--accent-light); line-height: 1; margin-bottom: 0.25rem; }
.step-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.step-card h3 { margin-bottom: 0.5rem; font-size: 0.95rem; }
.step-card p { font-size: 0.82rem; color: var(--text-muted); }

/* ===== BENEFITS ===== */
.benefits { padding: clamp(4rem,8vw,7rem) 0; background: var(--bg-soft); }
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: 1.5rem; }
.benefit-card { background: white; border: 1px solid var(--border-soft); border-radius: var(--radius-lg); padding: clamp(1.5rem,3vw,2rem); transition: all 0.3s; }
.benefit-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-light); }
.benefit-icon { font-size: 2rem; margin-bottom: 1rem; }
.benefit-card h3 { margin-bottom: 0.5rem; }
.benefit-card p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.6; }

/* ===== FAQ ===== */
.faq { padding: clamp(4rem,8vw,7rem) 0; }
.faq-list { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { background: white; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.faq-question { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; text-align: left; padding: 1.2rem 1.5rem; font-size: 0.92rem; font-weight: 600; color: var(--text-primary); cursor: pointer; gap: 1rem; transition: background 0.2s; }
.faq-question:hover { background: var(--bg-soft); }
.faq-question:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.faq-question[aria-expanded="true"] { color: var(--accent-dark); }
.faq-icon { font-size: 1.2rem; font-weight: 400; color: var(--accent); flex-shrink: 0; transition: transform 0.3s; line-height: 1; }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 1.5rem 1.2rem; }
.faq-answer p { font-size: 0.875rem; color: var(--text-muted); line-height: 1.7; }

/* ===== FINAL CTA ===== */
.final-cta { padding: clamp(4rem,8vw,7rem) 0; background: var(--bg-soft); }
.cta-box { text-align: center; background: linear-gradient(135deg, #eef2ff, #ede9fe); border: 1px solid var(--accent-light); border-radius: var(--radius-lg); padding: clamp(3rem,6vw,5rem) clamp(1.5rem,4vw,3rem); }
.cta-symbol { font-size: 3.5rem; font-weight: 900; font-family: 'Courier New', monospace; color: var(--accent); margin-bottom: 0.75rem; line-height: 1; }
.cta-box h2 { margin-bottom: 0.75rem; }
.cta-box p { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 2rem; max-width: 480px; margin-left: auto; margin-right: auto; }

/* ===== FOOTER ===== */
.footer { background: #0f0e1a; color: rgba(255,255,255,0.6); padding: clamp(3rem,6vw,5rem) 0 2rem; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: clamp(2rem,4vw,3rem); margin-bottom: 3rem; }
.footer-brand { display: flex; flex-direction: column; gap: 0.75rem; }
.footer-logo { display: flex; align-items: center; gap: 0.6rem; font-size: 1rem; font-weight: 700; color: white; }
.footer-logo-symbol { font-size: 1.6rem; font-family: 'Courier New', monospace; font-weight: 900; color: var(--accent-light); }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; max-width: 280px; }
.footer-dl { align-self: flex-start; margin-top: 0.5rem; font-size: 0.875rem; }
.footer-links h3 { color: white; font-size: 0.82rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }
.footer-links ul { list-style: none; display: flex; flex-direction: column; gap: 0.6rem; }
.footer-links a { font-size: 0.875rem; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-links a:hover { color: var(--accent-light); }
.footer-links a:focus-visible { outline: 2px solid var(--accent); border-radius: 2px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 1.5rem; display: flex; flex-direction: column; gap: 0.25rem; }
.footer-bottom p { font-size: 0.8rem; color: rgba(255,255,255,0.35); }

/* ===== BACK TO TOP ===== */
.back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 900;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: white; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(79,70,229,0.4);
  transition: all 0.3s; opacity: 0; transform: translateY(8px);
}
.back-to-top:not([hidden]) { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--accent-dark); transform: translateY(-2px); }
.back-to-top:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ===== SCROLL REVEAL ===== */
[data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
[data-reveal].revealed { opacity: 1; transform: translateY(0); }

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
  .math-float, .float-card { animation: none; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .steps-row { gap: 0; }
  .step-connector { flex: 0 0 20px; }
}
@media (max-width: 768px) {
  .nav-links, .nav-cta { display: none; }
  .hamburger { display: flex; }
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-desc, .hero-actions, .hero-tags { justify-content: center; margin-left: auto; margin-right: auto; }
  .hero-desc { max-width: 100%; }
  .float-card { display: none; }
  .showcase-row, .showcase-row.reverse { grid-template-columns: 1fr; direction: ltr; }
  .steps-row { flex-wrap: wrap; gap: 0.5rem; }
  .step-connector { display: none; }
  .step-card { min-width: 45%; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-brand { grid-column: auto; }
}
@media (max-width: 480px) {
  .hero-actions { flex-direction: column; align-items: center; }
  .hero-actions > * { width: 100%; max-width: 280px; justify-content: center; }
  .subjects-grid, .features-grid { grid-template-columns: 1fr; }
  .step-card { min-width: 100%; }
  .screenshots-row { flex-direction: column; align-items: center; }
  .screenshot-frame.featured { transform: scale(1); }
}
@media (max-width: 360px) {
  h1 { font-size: 1.9rem; }
  .subjects-grid { grid-template-columns: 1fr; }
}

/* ── Mathematics Learning Hub — Loading Screen v2 ── */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@600;700;800&display=swap');
#ml-loader{position:fixed;inset:0;z-index:9999;display:flex;flex-direction:column;align-items:center;justify-content:center;background:radial-gradient(ellipse at 40% 50%,#07061a 0%,#040410 55%,#020209 100%);overflow:hidden;transition:opacity .65s ease,visibility .65s ease;}
#ml-loader.ml-out{opacity:0;visibility:hidden;pointer-events:none;}
.mll-bg{position:absolute;inset:0;background-image:linear-gradient(rgba(79,70,229,.08) 1px,transparent 1px),linear-gradient(90deg,rgba(79,70,229,.08) 1px,transparent 1px);background-size:44px 44px;animation:mllGridPulse 4s ease-in-out infinite;}
@keyframes mllGridPulse{0%,100%{opacity:.4;}50%{opacity:1;}}
.mll-symbols{position:absolute;inset:0;pointer-events:none;}
.mll-sym{position:absolute;font-size:1.8rem;font-weight:700;color:rgba(99,102,241,.12);animation:mllSymFloat 5s ease-in-out infinite;font-family:serif;}
.mll-sym:nth-child(1){top:12%;left:8%;animation-delay:0s;}.mll-sym:nth-child(2){top:25%;right:12%;animation-delay:.8s;}
.mll-sym:nth-child(3){bottom:20%;left:15%;animation-delay:1.6s;}.mll-sym:nth-child(4){top:55%;right:7%;animation-delay:2.4s;}
@keyframes mllSymFloat{0%{opacity:0;transform:translateY(15px);}30%{opacity:.5;}70%{opacity:.5;}100%{opacity:0;transform:translateY(-20px);}}
.mll-orb-1{position:absolute;border-radius:50%;pointer-events:none;width:500px;height:500px;background:radial-gradient(circle,rgba(99,102,241,.13) 0%,transparent 65%);top:-100px;right:-80px;animation:mllOrb 6s ease-in-out infinite;}
.mll-orb-2{position:absolute;border-radius:50%;pointer-events:none;width:360px;height:360px;background:radial-gradient(circle,rgba(139,92,246,.09) 0%,transparent 65%);bottom:-80px;left:-60px;animation:mllOrb 8s ease-in-out infinite reverse;}
@keyframes mllOrb{0%,100%{transform:scale(1);}50%{transform:scale(1.1);}}
.mll-content{position:relative;z-index:2;display:flex;flex-direction:column;align-items:center;gap:1.4rem;}
.mll-ring{position:relative;width:110px;height:110px;}
.mll-ring::before{content:'';position:absolute;inset:0;border-radius:50%;border:3px solid transparent;border-top-color:#4f46e5;border-left-color:rgba(79,70,229,.5);animation:mllSpin 1.1s linear infinite;}
.mll-ring::after{content:'';position:absolute;inset:10px;border-radius:50%;border:2px solid transparent;border-bottom-color:#8b5cf6;border-right-color:rgba(139,92,246,.4);animation:mllSpin 1.7s linear infinite reverse;}
@keyframes mllSpin{to{transform:rotate(360deg);}}
.mll-icon{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;font-size:2.8rem;animation:mllBounce .65s cubic-bezier(.34,1.56,.64,1) both;}
@keyframes mllBounce{from{transform:scale(0) rotate(-20deg);opacity:0;}to{transform:scale(1) rotate(0);opacity:1;}}
.mll-name{font-family:'Space Grotesk',system-ui;font-size:1.9rem;font-weight:800;letter-spacing:-.03em;background:linear-gradient(135deg,#818cf8,#a78bfa);-webkit-background-clip:text;-webkit-text-fill-color:transparent;background-clip:text;animation:mllFadeUp .6s .3s ease both;}
.mll-tagline{font-size:.85rem;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:rgba(165,180,252,.5);animation:mllFadeUp .6s .42s ease both;}
.mll-chips{display:flex;gap:.6rem;flex-wrap:wrap;justify-content:center;animation:mllFadeUp .6s .55s ease both;}
.mll-chip{background:rgba(79,70,229,.1);border:1px solid rgba(99,102,241,.22);border-radius:50px;padding:.28rem .8rem;font-size:.76rem;font-weight:600;color:#a5b4fc;animation:mllChip 2.5s ease-in-out infinite;}
.mll-chip:nth-child(2){animation-delay:.3s;}.mll-chip:nth-child(3){animation-delay:.6s;}.mll-chip:nth-child(4){animation-delay:.9s;}
@keyframes mllChip{0%,100%{transform:translateY(0);}50%{transform:translateY(-5px);}}
.mll-bar-wrap{width:210px;height:4px;background:rgba(79,70,229,.12);border-radius:50px;overflow:hidden;animation:mllFadeUp .6s .65s ease both;}
.mll-bar{height:100%;background:linear-gradient(90deg,#4f46e5,#8b5cf6);border-radius:50px;width:0%;transition:width .1s linear;box-shadow:0 0 10px rgba(79,70,229,.7);}
@keyframes mllFadeUp{from{opacity:0;transform:translateY(18px);}to{opacity:1;transform:translateY(0);}}
#ml-scroll-progress{position:fixed;top:0;left:0;height:3px;width:0%;background:linear-gradient(90deg,#4f46e5,#8b5cf6);z-index:9999;pointer-events:none;transition:width .1s linear;box-shadow:0 0 6px rgba(79,70,229,.6);}
