/* ClassGenie Marketing Site — Design Tokens */

:root {
  --primary-blue: hsl(217, 91%, 60%);
  --primary-blue-hover: hsl(217, 91%, 54%);
  --primary-purple: hsl(270, 71%, 60%);
  --primary-pink: hsl(330, 75%, 65%);
  --success-green: hsl(142, 71%, 45%);
  --warning-red: hsl(0, 72%, 55%);
  --warning-orange: hsl(25, 95%, 55%);

  --text-primary: hsl(222, 47%, 11%);
  --text-secondary: hsl(215, 16%, 47%);
  --text-tertiary: hsl(215, 20%, 65%);

  --bg-base: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-lavender: hsl(260, 60%, 98%);

  --border-subtle: hsl(214, 32%, 91%);
  --border-strong: hsl(215, 20%, 82%);

  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04), 0 1px 3px 0 rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 10px 20px -5px rgba(15, 23, 42, 0.1), 0 8px 16px -8px rgba(15, 23, 42, 0.08);
  --shadow-xl: 0 25px 50px -12px rgba(15, 23, 42, 0.18);
  --shadow-glow-blue: 0 10px 40px -10px hsla(217, 91%, 60%, 0.4);
  --shadow-glow-purple: 0 10px 40px -10px hsla(270, 71%, 60%, 0.4);

  --signature-gradient: linear-gradient(135deg, hsl(217, 91%, 60%) 0%, hsl(270, 71%, 60%) 50%, hsl(330, 75%, 65%) 100%);
  --signature-gradient-soft: linear-gradient(135deg, hsla(217, 91%, 60%, 0.08) 0%, hsla(270, 71%, 60%, 0.08) 50%, hsla(330, 75%, 65%, 0.08) 100%);

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

[data-theme="dark"] {
  --text-primary: hsl(0, 0%, 98%);
  --text-secondary: hsl(215, 16%, 70%);
  --text-tertiary: hsl(215, 20%, 55%);
  --bg-base: hsl(222, 47%, 6%);
  --bg-card: hsl(222, 30%, 11%);
  --bg-subtle: hsl(222, 30%, 14%);
  --bg-lavender: hsl(260, 30%, 10%);
  --border-subtle: hsl(222, 30%, 18%);
  --border-strong: hsl(222, 30%, 24%);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px -5px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--text-primary);
}

p { margin: 0; }

a { color: var(--primary-blue); text-decoration: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- Utility ---------- */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (min-width: 768px) {
  .container { padding: 0 32px; }
}

@media (min-width: 1280px) {
  .container { padding: 0 40px; }
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  transition: all 200ms ease;
  min-height: 48px;
  white-space: nowrap;
}

.btn-gradient {
  background: var(--signature-gradient);
  background-size: 200% 200%;
  color: white;
  box-shadow: 0 4px 14px -2px hsla(270, 71%, 60%, 0.4);
  animation: gradientShift 6s ease infinite;
}

.btn-gradient:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px -4px hsla(270, 71%, 60%, 0.5);
}

.btn-gradient:active { transform: scale(0.98); }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
  box-shadow: 0 2px 8px -2px hsla(217, 91%, 60%, 0.4);
}
.btn-primary:hover { background: var(--primary-blue-hover); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { border-color: var(--border-strong); background: var(--bg-subtle); }

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
}
.btn-ghost:hover { background: var(--bg-subtle); }

.btn-white {
  background: white;
  color: var(--primary-purple);
  position: relative;
}
.btn-white span {
  background: var(--signature-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
}

.btn-full { width: 100%; }

@media (min-width: 768px) {
  .btn-md-auto { width: auto; min-width: 200px; }
}

/* ---------- Cards ---------- */

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 200ms ease;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

@media (min-width: 768px) {
  .card { padding: 32px; }
}

.card-accent::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-blue);
}

.accent-blue::before { background: var(--primary-blue); }
.accent-purple::before { background: var(--primary-purple); }
.accent-pink::before { background: var(--primary-pink); }
.accent-green::before { background: var(--success-green); }
.accent-red::before { background: var(--warning-red); }
.accent-orange::before { background: var(--warning-orange); }

/* ---------- Icon containers ---------- */

.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.icon-box-lg {
  width: 56px;
  height: 56px;
  border-radius: 14px;
}

.icon-blue { background: hsla(217, 91%, 60%, 0.1); color: var(--primary-blue); }
.icon-purple { background: hsla(270, 71%, 60%, 0.1); color: var(--primary-purple); }
.icon-pink { background: hsla(330, 75%, 65%, 0.12); color: var(--primary-pink); }
.icon-green { background: hsla(142, 71%, 45%, 0.12); color: var(--success-green); }
.icon-red { background: hsla(0, 72%, 55%, 0.1); color: var(--warning-red); }
.icon-orange { background: hsla(25, 95%, 55%, 0.12); color: var(--warning-orange); }

/* ---------- Section ---------- */

section { padding: 56px 0; }
@media (min-width: 768px) { section { padding: 72px 0; } }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 36px; }
.section-head h2 {
  font-size: clamp(32px, 5vw, 52px);
  margin-bottom: 16px;
}
.section-head p {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ---------- Grid ---------- */

.grid {
  display: grid;
  gap: 20px;
}
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Gradient text ---------- */

.gradient-text {
  background: var(--signature-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ---------- Avatar circles ---------- */

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid white;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -12px; }

.av-blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.av-purple { background: linear-gradient(135deg, #a78bfa, #8b5cf6); }
.av-pink { background: linear-gradient(135deg, #f472b6, #ec4899); }
.av-green { background: linear-gradient(135deg, #34d399, #10b981); }
.av-orange { background: linear-gradient(135deg, #fb923c, #f97316); }
.av-teal { background: linear-gradient(135deg, #5eead4, #14b8a6); }

/* ---------- Badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: hsla(217, 91%, 60%, 0.1); color: var(--primary-blue); }
.badge-purple { background: hsla(270, 71%, 60%, 0.12); color: var(--primary-purple); }
.badge-green { background: hsla(142, 71%, 45%, 0.12); color: var(--success-green); }
.badge-orange { background: hsla(25, 95%, 55%, 0.12); color: var(--warning-orange); }
.badge-red { background: hsla(0, 72%, 55%, 0.1); color: var(--warning-red); }

/* ---------- Focus ---------- */

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary-blue);
  outline-offset: 2px;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Star rating ---------- */
.stars { display: inline-flex; gap: 2px; color: #f59e0b; }

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  padding: 12px 16px;
  background: var(--primary-blue);
  color: white;
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* =========================================================
   MOBILE RESPONSIVENESS — global safety net
   ========================================================= */

/* Prevent horizontal scroll from any rogue element */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, video { max-width: 100%; height: auto; }

/* Force any descendant of main to never overflow horizontally */
main { overflow-x: clip; }

/* ---------- Mobile typography clamp ---------- */
@media (max-width: 640px) {
  h1 { font-size: clamp(28px, 8vw, 40px) !important; line-height: 1.1; letter-spacing: -0.02em; word-break: break-word; }
  h2 { font-size: clamp(26px, 7vw, 36px) !important; line-height: 1.15; letter-spacing: -0.02em; word-break: break-word; }
  h3 { font-size: clamp(20px, 5vw, 26px) !important; line-height: 1.2; word-break: break-word; }
  p, li { font-size: 16px; line-height: 1.6; }

  /* Tighten section spacing on mobile */
  section { padding: 48px 0; }

  /* Tighten container padding */
  .container { padding: 0 18px; }

  /* Section heads */
  .section-head { margin-bottom: 28px; }
  .section-head h2 { font-size: clamp(26px, 7vw, 36px); }
  .section-head p { font-size: 16px; }

  /* Cards: less padding */
  .card { padding: 20px; }

  /* Buttons full-width and proper hit target */
  .btn { padding: 14px 20px; font-size: 15px; min-height: 48px; }
  .btn-gradient,
  .btn-secondary,
  .btn-primary,
  .btn-white {
    width: 100%;
    justify-content: center;
  }
  /* But not for small inline buttons in chips/cards */
  .badge, .chip { width: auto; }

  /* Stack any flex row of buttons */
  .btn + .btn { margin-top: 0; }

  /* Prevent fixed-width text overflow */
  pre, code { white-space: pre-wrap; word-break: break-word; }
}

/* ---------- Mobile grid forcing (medium safety net) ---------- */
@media (max-width: 760px) {
  /* Any inline-styled grid that targets a desktop-only column count */
  [style*="grid-template-columns"][style*="repeat(3"],
  [style*="grid-template-columns"][style*="repeat(4"] {
    /* Don't force-override; specific components handle themselves */
  }
}

/* ---------- Tables & comparison grids ---------- */
@media (max-width: 720px) {
  /* Compare table: stack the 1.4fr 1fr 1fr layout into a horizontally-scrollable card OR shrink fonts */
  /* We'll handle compare specifically by targeting its container */
}

/* ---------- Header / nav small-screen tweaks ---------- */
@media (max-width: 980px) {
  .desktop-cta { display: none !important; }
  .desktop-nav { display: none !important; }
}

/* ---------- AI tool cards: 2-up on small mobile, 1-up on tiny ---------- */
@media (max-width: 380px) {
  .ai-tools-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- Sticky mobile CTA spacer ---------- */
@media (max-width: 768px) {
  body { padding-bottom: 72px; }
}

/* ---------- Pricing comparison & misc 2-col stacks ----------
   .feature-hero / .hero-grid are handled in the mockup-scaling block below
   (max-width: 760px); we keep this rule for the other layouts only. */
@media (max-width: 768px) {
  .pricing-compare,
  .coop-grid,
  .agent-stage {
    grid-template-columns: 1fr !important;
  }
}

/* ---------- Long words / URLs ---------- */
.text-wrap-safe { overflow-wrap: anywhere; }

/* Make all anchor pills wrap nicely */
.eyebrow-pill { max-width: 100%; flex-wrap: wrap; }

/* ---------- Footer columns ---------- */
@media (max-width: 640px) {
  footer .footer-cols,
  footer [class*="footer"] {
    /* let inline grid stack via the styles set inline */
  }
}

/* ---------- Hero / feature mockups on mobile ----------
   The dashboard mockup (homepage) and MiniMock (feature pages) are designed
   for ~640px-wide desktop columns. On phones, instead of letting them squeeze
   (which warps proportions and makes them look long/distorted), we PIN them
   to their natural width and CSS-scale the whole block down so the layout
   stays correct — just smaller. */

@media (max-width: 760px) {
  /* === Homepage hero (.hero-grid) === */
  /* The hero column wrapping <DashboardMockup /> has a floaty translateY
     animation; transform on it would fight the keyframes. The inner child
     is animation-free, so we scale that. */
  .hero-grid {
    grid-template-columns: 1fr !important;
  }
  .hero-grid > div:nth-child(2) {
    animation: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 360px;            /* natural 580 * 0.62 ≈ 360 */
    position: relative;
    overflow: hidden;
  }
  .hero-grid > div:nth-child(2) > div:last-child {
    position: absolute !important;
    top: 0;
    left: 50%;
    width: 640px !important;
    max-width: none !important;
    margin-left: -320px;
    transform: scale(0.62) !important;
    transform-origin: top center !important;
  }

  /* === Feature pages (.feature-hero) === */
  .feature-hero {
    grid-template-columns: 1fr !important;
  }
  .feature-hero > div:nth-child(2) {
    width: 100% !important;
    max-width: 100% !important;
    height: 380px;            /* natural ~600 * 0.64 */
    position: relative;
    overflow: hidden;
  }
  /* MiniMock card itself (the inner border-radius:14px white card) */
  .feature-hero > div:nth-child(2) > div[style*="border-radius: 14px"],
  .feature-hero > div:nth-child(2) > div[style*="borderRadius: 14"] {
    position: absolute !important;
    top: 0;
    left: 50%;
    width: 640px !important;
    max-width: none !important;
    margin-left: -320px;
    transform: scale(0.62) !important;
    transform-origin: top center !important;
    overflow: hidden;
  }

  /* Feature-hero buttons */
  .feature-hero .btn { min-height: 48px !important; }

  /* Other 2-col layouts that should still stack */
  .pricing-compare,
  .coop-grid,
  .agent-stage {
    grid-template-columns: 1fr !important;
  }
}

/* Tiny phones — scale the mockups down a bit further so they fit narrower viewports */
@media (max-width: 420px) {
  .hero-grid > div:nth-child(2) {
    height: 300px;
  }
  .hero-grid > div:nth-child(2) > div:last-child {
    transform: scale(0.52) !important;
  }
  .feature-hero > div:nth-child(2) {
    height: 320px;
  }
  .feature-hero > div:nth-child(2) > div[style*="border-radius: 14px"],
  .feature-hero > div:nth-child(2) > div[style*="borderRadius: 14"] {
    transform: scale(0.52) !important;
  }
}

@media (max-width: 360px) {
  .hero-grid > div:nth-child(2) {
    height: 270px;
  }
  .hero-grid > div:nth-child(2) > div:last-child {
    transform: scale(0.46) !important;
  }
  .feature-hero > div:nth-child(2) {
    height: 290px;
  }
  .feature-hero > div:nth-child(2) > div[style*="border-radius: 14px"],
  .feature-hero > div:nth-child(2) > div[style*="borderRadius: 14"] {
    transform: scale(0.46) !important;
  }
}


/* Hero "homeschool mom" pill: desktop only */
@media (max-width: 768px) {
  .hero-mom-pill { display: none; }
}
