/* MadhavAI premium light homepage theme.
   Scoped to the public landing page only so signed-in/product surfaces stay unchanged. */

body:has(header a[href="#subjects"]):has(main #faq) {
  background: #f8fafc;
}

body:has(header a[href="#subjects"]):has(main #faq) > div.min-h-screen {
  background: #f8fafc !important;
  color: #0f172a !important;
}

body:has(header a[href="#subjects"]):has(main #faq) > div.min-h-screen > div[aria-hidden] {
  background-image:
    radial-gradient(620px 520px at 50% -8%, rgba(59,130,246,0.15), transparent 70%),
    radial-gradient(520px 460px at 108% 42%, rgba(34,211,238,0.10), transparent 70%),
    radial-gradient(520px 460px at -8% 100%, rgba(99,102,241,0.08), transparent 70%) !important;
}

/* Header */
body:has(header a[href="#subjects"]):has(main #faq) header {
  background: rgba(255,255,255,0.94) !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 10px 35px rgba(15,23,42,0.06);
}

body:has(header a[href="#subjects"]):has(main #faq) header a[href="/"] img[src="/madhavai-mark.webp"] {
  width: 44px !important;
  height: 36px !important;
  padding: 4px;
  border-radius: 12px;
  background: #040818;
  box-shadow: 0 5px 16px rgba(37,99,235,0.18);
}

body:has(header a[href="#subjects"]):has(main #faq) header a[href="/"] .text-white {
  color: #0f172a !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header a[href="/"] .text-blue-300\/80 {
  color: #2563eb !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header nav {
  color: #475569 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header nav a:hover {
  color: #2563eb !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header button[aria-label="Language"] {
  background: #f8fafc !important;
  border-color: #dbeafe !important;
  color: #334155 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header a[href*="mode=signin"] {
  color: #334155 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header a[href*="mode=signin"]:hover {
  color: #2563eb !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header button[aria-label="Menu"] {
  border-color: #dbeafe !important;
  color: #334155 !important;
  background: #fff !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header > div.border-t {
  background: #fff !important;
  border-color: #e2e8f0 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header > div.border-t a {
  color: #334155 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) header > div.border-t a:hover {
  background: #eff6ff !important;
  color: #2563eb !important;
}

/* Hero */
body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type {
  background:
    radial-gradient(720px 460px at 24% 20%, rgba(59,130,246,0.11), transparent 66%),
    radial-gradient(620px 420px at 82% 36%, rgba(34,211,238,0.10), transparent 68%),
    #f8fafc;
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type > div > div:first-child h1 {
  color: #0f172a !important;
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type > div > div:first-child p {
  color: #475569 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type > div > div:first-child > div:first-child {
  background: #eff6ff !important;
  border-color: #bfdbfe !important;
  color: #1d4ed8 !important;
  box-shadow: 0 6px 20px rgba(37,99,235,0.07);
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type a[href="#subjects"] {
  background: rgba(255,255,255,0.88) !important;
  border-color: #bfdbfe !important;
  color: #1e3a8a !important;
  box-shadow: 0 8px 22px rgba(15,23,42,0.06);
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type a[href="#subjects"]:hover {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
}

/* Keep the AI Tutor preview as a premium dark contrast card. */
body:has(header a[href="#subjects"]):has(main #faq) main > section:first-of-type > div > div:nth-child(2) > div {
  background: linear-gradient(145deg, #0f172a 0%, #111827 55%, #172554 100%) !important;
  border-color: rgba(148,163,184,0.18) !important;
  box-shadow: 0 28px 70px rgba(30,64,175,0.20) !important;
}

/* Light section rhythm */
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(2) { background: #eff6ff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(3) { background: #ffffff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(4) { background: #eff6ff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(5) { background: #ffffff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(6) { background: #f8fafc; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(7) { background: #ecfeff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(8) { background: #ffffff; }
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) { background: #f8fafc; }

/* Readable typography across light sections 2–8. */
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-white {
  color: #0f172a !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-slate-200 {
  color: #334155 !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-slate-300 {
  color: #475569 !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-slate-400,
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-slate-500 {
  color: #64748b !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-blue-200 {
  color: #2563eb !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-cyan-300 {
  color: #0891b2 !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-emerald-200 {
  color: #15803d !important;
}
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(n+2):nth-of-type(-n+8) .text-amber-200 {
  color: #b45309 !important;
}

/* Shared light cards */
body:has(header a[href="#subjects"]):has(main #faq) #why .rounded-2xl,
body:has(header a[href="#subjects"]):has(main #faq) #how .rounded-2xl,
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(5) .rounded-2xl,
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(7) article,
body:has(header a[href="#subjects"]):has(main #faq) #faq button {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 12px 32px rgba(15,23,42,0.055);
}

body:has(header a[href="#subjects"]):has(main #faq) #why .rounded-2xl:hover,
body:has(header a[href="#subjects"]):has(main #faq) #how .rounded-2xl:hover,
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(5) .rounded-2xl:hover {
  border-color: #bfdbfe !important;
  box-shadow: 0 18px 42px rgba(37,99,235,0.09);
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(5) .grid.h-11.w-11 {
  background: #eff6ff !important;
  color: #2563eb !important;
}

/* Explore Learning / curriculum availability */
body:has(header a[href="#subjects"]):has(main #faq) #subjects a[href^="/cbse-class-9-"] {
  background: rgba(255,255,255,0.96) !important;
  border-color: #dbeafe !important;
  box-shadow: 0 12px 30px rgba(15,23,42,0.055);
}

body:has(header a[href="#subjects"]):has(main #faq) #subjects a[href^="/cbse-class-9-"]:hover {
  border-color: #93c5fd !important;
  box-shadow: 0 18px 42px rgba(37,99,235,0.10);
  transform: translateY(-2px);
}

body:has(header a[href="#subjects"]):has(main #faq) #subjects article {
  background: rgba(255,255,255,0.92) !important;
  border-color: #fde68a !important;
  box-shadow: 0 12px 30px rgba(15,23,42,0.045);
}

body:has(header a[href="#subjects"]):has(main #faq) #subjects > div > div:last-child {
  background: rgba(255,255,255,0.92) !important;
  border-color: #dbeafe !important;
  box-shadow: 0 14px 36px rgba(15,23,42,0.05);
}

body:has(header a[href="#subjects"]):has(main #faq) #subjects > div > div:last-child > div:first-child span {
  background: #ffffff !important;
  border-color: #dbeafe !important;
  color: #334155 !important;
}

/* Families / Students */
body:has(header a[href="#subjects"]):has(main #faq) #parents article {
  background: linear-gradient(145deg, #ffffff 0%, #eff6ff 58%, #ecfeff 100%) !important;
  border-color: #dbeafe !important;
  box-shadow: 0 16px 42px rgba(37,99,235,0.075);
}

body:has(header a[href="#subjects"]):has(main #faq) #parents article .text-white {
  color: #0f172a !important;
}

body:has(header a[href="#subjects"]):has(main #faq) #parents article .text-slate-200 {
  color: #334155 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) #parents article > div:first-child {
  color: #2563eb !important;
}

body:has(header a[href="#subjects"]):has(main #faq) #parents article a {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 10px 24px rgba(37,99,235,0.18);
}

/* FAQ */
body:has(header a[href="#subjects"]):has(main #faq) #faq button:hover {
  border-color: #93c5fd !important;
  background: #f8fbff !important;
}

body:has(header a[href="#subjects"]):has(main #faq) #faq button .text-white {
  color: #0f172a !important;
}

body:has(header a[href="#subjects"]):has(main #faq) #faq button .text-slate-400 {
  color: #64748b !important;
}

/* Strong closing CTA */
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) > div {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 42%, #0891b2 100%) !important;
  border-color: rgba(255,255,255,0.28) !important;
  box-shadow: 0 24px 64px rgba(37,99,235,0.24);
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) h2,
body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) p {
  color: #ffffff !important;
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) a[href*="mode=signup"] {
  background: #ffffff !important;
  color: #1d4ed8 !important;
}

body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(9) a[href*="mode=signin"] {
  background: rgba(255,255,255,0.12) !important;
  border-color: rgba(255,255,255,0.30) !important;
  color: #ffffff !important;
}

/* Footer remains deep navy for a premium visual anchor. */
body:has(header a[href="#subjects"]):has(main #faq) footer {
  background: #040818 !important;
  border-color: rgba(255,255,255,0.06) !important;
}

body:has(header a[href="#subjects"]):has(main #faq) footer img[src="/madhavai-mark.webp"] {
  border-radius: 10px;
}

@media (prefers-reduced-motion: no-preference) {
  body:has(header a[href="#subjects"]):has(main #faq) #subjects a[href^="/cbse-class-9-"],
  body:has(header a[href="#subjects"]):has(main #faq) #why .rounded-2xl,
  body:has(header a[href="#subjects"]):has(main #faq) #how .rounded-2xl,
  body:has(header a[href="#subjects"]):has(main #faq) main > section:nth-of-type(5) .rounded-2xl {
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
  }
}
