/* ==========================================================================
   ExamSphere — Global Stylesheet
   Design language: "Answer Sheet" — deep indigo/violet gradients, an amber
   highlighter accent, geometric display type, and OMR-bubble motifs that
   echo the physical answer sheets this product replaces.
   ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
  /* Color */
  --ink: #1e1b4b;              /* deep indigo — headings, primary text on light */
  --violet: #7c3aed;           /* electric violet — primary brand */
  --violet-dark: #5b21b6;
  --lavender: #f5f3ff;         /* page background */
  --lavender-deep: #ede9fe;
  --amber: #f59e0b;            /* highlighter accent — CTAs, highlights */
  --amber-dark: #d97706;
  --coral: #ef4444;            /* danger / wrong */
  --emerald: #10b981;          /* success / correct */
  --slate: #475569;            /* body text */
  --slate-light: #94a3b8;
  --white: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.35);

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #1e1b4b 0%, #5b21b6 55%, #7c3aed 100%);
  --grad-amber: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  --grad-bg: radial-gradient(circle at 15% 10%, #ede9fe 0%, #f5f3ff 45%, #ffffff 100%);

  /* Typography */
  --font-display: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-soft: 0 10px 30px rgba(30, 27, 75, 0.10);
  --shadow-hover: 0 18px 40px rgba(124, 58, 237, 0.22);
  --container: 1180px;
  --nav-height: 76px;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--slate);
  background: var(--grad-bg);
  overflow-x: hidden;
  line-height: 1.6;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.02em;
}

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

/* focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Loading Overlay ---------- */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-bubble {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 5px solid rgba(255,255,255,0.25);
  border-top-color: var(--amber);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast Notifications ---------- */
.toast-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 5000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  min-width: 260px;
  max-width: 340px;
  background: var(--white);
  border-left: 5px solid var(--violet);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 14px 18px;
  font-size: 0.92rem;
  color: var(--ink);
  animation: toastIn 0.35s ease forwards;
}
.toast.success { border-left-color: var(--emerald); }
.toast.error { border-left-color: var(--coral); }
.toast.warning { border-left-color: var(--amber); }
.toast.fade-out { animation: toastOut 0.35s ease forwards; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
  transition: box-shadow 0.3s ease;
}
.navbar.scrolled { box-shadow: 0 4px 24px rgba(30, 27, 75, 0.08); }
.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ink);
}
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}
.nav-links a {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--slate);
  transition: background 0.25s ease, color 0.25s ease;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { background: var(--lavender-deep); color: var(--violet); }
.nav-cta {
  background: var(--grad-amber) !important;
  color: var(--white) !important;
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35);
}
.nav-cta:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(245, 158, 11, 0.45); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 30px;
  background: none;
  padding: 6px;
}
.hamburger span {
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 30px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  font-family: var(--font-body);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.btn-primary {
  background: var(--grad-amber);
  color: var(--white);
  box-shadow: 0 10px 26px rgba(245, 158, 11, 0.35);
}
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(245, 158, 11, 0.45); }
.btn-outline {
  background: rgba(255,255,255,0.6);
  color: var(--ink);
  border: 2px solid var(--violet);
}
.btn-outline:hover { background: var(--violet); color: var(--white); transform: translateY(-3px); }
.btn-ghost {
  background: transparent;
  color: var(--violet);
  font-weight: 700;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 620px;
  height: 620px;
  background: var(--grad-primary);
  border-radius: 50%;
  opacity: 0.08;
  filter: blur(10px);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lavender-deep);
  color: var(--violet-dark);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: 999px;
  margin-bottom: 22px;
  animation: fadeInUp 0.7s ease both;
}
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.12;
  margin-bottom: 20px;
  animation: fadeInUp 0.7s ease 0.1s both;
}
.hero h1 .accent { color: var(--violet); }
.hero h1 .underline {
  position: relative;
  display: inline-block;
}
.hero h1 .underline::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 6px;
  height: 12px;
  background: var(--amber);
  opacity: 0.35;
  z-index: -1;
  border-radius: 4px;
}
.hero p.lead {
  font-size: 1.12rem;
  color: var(--slate);
  max-width: 520px;
  margin-bottom: 34px;
  animation: fadeInUp 0.7s ease 0.2s both;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  animation: fadeInUp 0.7s ease 0.3s both;
}
.hero-stats {
  display: flex;
  gap: 34px;
  margin-top: 44px;
  animation: fadeInUp 0.7s ease 0.4s both;
}
.hero-stats .stat b {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--ink);
  display: block;
}
.hero-stats .stat span { font-size: 0.85rem; color: var(--slate-light); }

/* Hero visual: an animated "answer sheet" card mockup */
.hero-visual {
  position: relative;
  animation: fadeInUp 0.8s ease 0.25s both;
}
.sheet-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 30px;
  position: relative;
  z-index: 2;
}
.sheet-card .sheet-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.sheet-card .sheet-timer {
  font-family: var(--font-mono);
  background: var(--ink);
  color: var(--amber);
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
}
.sheet-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--lavender-deep);
  overflow: hidden;
  margin-bottom: 24px;
}
.sheet-progress span {
  display: block;
  height: 100%;
  background: var(--grad-amber);
  width: 62%;
  border-radius: 999px;
  animation: growBar 1.6s ease both;
}
.sheet-bubbles {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.sheet-bubbles .bubble {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--violet);
  opacity: 0.35;
}
.sheet-bubbles .bubble.filled {
  background: var(--violet);
  opacity: 1;
  animation: pop 0.4s ease both;
}
.sheet-bubbles .bubble.current {
  border-color: var(--amber);
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.2);
}
.float-badge {
  position: absolute;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9rem;
  z-index: 3;
  animation: floaty 4s ease-in-out infinite;
}
.float-badge.b1 { top: -18px; left: -30px; animation-delay: 0.2s; }
.float-badge.b2 { bottom: -20px; right: -20px; animation-delay: 0.8s; }
.float-badge i { color: var(--emerald); }
.float-badge.b2 i { color: var(--amber-dark); }

@keyframes fadeInUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes growBar { from { width: 0; } }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Section shared ---------- */
.section { padding: 100px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head .eyebrow { margin-bottom: 14px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); margin-bottom: 14px; }
.section-head p { color: var(--slate); font-size: 1.02rem; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Features ---------- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.feature-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 34px 26px;
  text-align: left;
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.feature-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-hover); }
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 1.3rem;
  margin-bottom: 18px;
}
.feature-card h3 { font-size: 1.12rem; margin-bottom: 10px; }
.feature-card p { font-size: 0.92rem; color: var(--slate); }

/* ---------- Categories ---------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-top: 4px solid var(--violet);
}
.category-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.category-card .cat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--lavender-deep);
  color: var(--violet);
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.category-card h3 { font-size: 1.15rem; margin-bottom: 12px; }
.category-card ul li {
  font-size: 0.9rem;
  color: var(--slate);
  padding: 6px 0;
  border-bottom: 1px dashed var(--lavender-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-card ul li:last-child { border-bottom: none; }
.category-card ul li i { color: var(--amber-dark); font-size: 0.7rem; }

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--grad-primary);
  border-radius: var(--radius-lg);
  margin: 0 auto;
  max-width: var(--container);
  padding: 60px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.cta-banner::after {
  content: "";
  position: absolute;
  right: -60px; bottom: -60px;
  width: 220px; height: 220px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.18);
}
.cta-banner h2 { color: var(--white); font-size: 1.8rem; margin-bottom: 10px; }
.cta-banner p { color: rgba(255,255,255,0.78); max-width: 420px; }

/* ---------- Footer ---------- */
footer {
  background: var(--ink);
  color: rgba(255,255,255,0.72);
  padding: 70px 0 0;
  margin-top: 100px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 50px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--white); margin-bottom: 14px; }
.footer-brand img { width: 34px; height: 34px; border-radius: 8px; }
.footer-col h4 { color: var(--white); font-size: 1rem; margin-bottom: 18px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a:hover { color: var(--amber); }
.footer-col p { font-size: 0.9rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.social-icons { display: flex; gap: 12px; margin-top: 16px; }
.social-icons a {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}
.social-icons a:hover { background: var(--amber); transform: translateY(-3px); color: var(--ink); }
.footer-bottom {
  text-align: center;
  padding: 22px 0;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 460px; margin: 0 auto; }
}
@media (max-width: 768px) {
  .nav-links { position: fixed; top: var(--nav-height); left: 0; right: 0; background: var(--white); flex-direction: column; align-items: stretch; padding: 16px; box-shadow: var(--shadow-soft); transform: translateY(-140%); transition: transform 0.35s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { text-align: center; }
  .hamburger { display: flex; }
  .cta-banner { flex-direction: column; text-align: center; }
  .features-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 425px) {
  .hero-stats { gap: 20px; }
  .section { padding: 70px 0; }
  .float-badge { display: none; }
}
