/* =========================================================
   BrainiBooks — Landing Site Styles
   Palette: midnight navy + electric cyan + intelligent purple
   Fonts: Sora (headings), Inter (body)
   ========================================================= */

:root {
  --bg: #0A1330;
  --bg-2: #0F1B47;
  --bg-3: #131F52;
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.10);
  --border-strong: rgba(255,255,255,0.18);
  --text: #EAF0FF;
  --text-dim: #A8B3D6;
  --text-muted: #7A86AD;
  --cyan: #22D3EE;
  --cyan-2: #67E8F9;
  --purple: #8B5CF6;
  --purple-2: #A78BFA;
  --green: #34D399;
  --warn: #FBBF24;
  --danger: #F87171;
  --grad-primary: linear-gradient(135deg, #22D3EE 0%, #8B5CF6 100%);
  --grad-ai: linear-gradient(135deg, #8B5CF6 0%, #22D3EE 100%);
  --grad-bg: radial-gradient(1200px 600px at 15% -10%, rgba(34,211,238,.18), transparent 60%),
             radial-gradient(900px 500px at 110% 10%, rgba(139,92,246,.22), transparent 60%);
  --shadow-lg: 0 30px 80px -20px rgba(0,0,0,.6), 0 8px 24px -12px rgba(34,211,238,.18);
  --shadow-md: 0 12px 30px -10px rgba(0,0,0,.5);
  --radius: 18px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; min-width: 0; }
html, body { overflow-x: clip; max-width: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Sora', 'Inter', sans-serif;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 .5em;
  color: #fff;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1rem; color: var(--text-dim); }
a { color: var(--cyan-2); text-decoration: none; }
a:hover { color: #fff; }

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

/* Anti-overflow safety net for all section children */
section, .container, .cards, .pricing, .form, .footer__grid { max-width: 100%; }

.eyebrow {
  display: inline-block;
  font-family: 'Sora', sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(34,211,238,.1);
  color: var(--cyan-2);
  border: 1px solid rgba(34,211,238,.25);
  margin-bottom: 18px;
}
.ai-eyebrow {
  background: rgba(139,92,246,.12);
  color: var(--purple-2);
  border-color: rgba(139,92,246,.3);
}

.muted { color: var(--text-muted); }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(10,19,48,.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: padding .25s ease, background .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  transition: padding .25s ease;
}
.nav.scrolled { background: rgba(10,19,48,.85); box-shadow: 0 8px 24px -16px rgba(0,0,0,.6); border-bottom-color: var(--border); }
.nav.scrolled .nav__inner { padding: 10px 24px; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-family: 'Sora', sans-serif; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }
.brand__mark { display: inline-flex; }

.nav__links { display: flex; align-items: center; gap: 6px; }
.nav__links a { color: var(--text-dim); padding: 8px 12px; font-size: .92rem; font-weight: 500; border-radius: 8px; transition: color .2s, background .2s; }
.nav__links a:hover { color: #fff; background: var(--surface); }
.nav__links a.active { color: #fff; background: var(--surface-2); }
.nav__cta {
  background: var(--grad-primary) !important;
  color: #0A1330 !important;
  font-weight: 600 !important;
  padding: 9px 16px !important;
  margin-left: 8px;
}
.nav__cta:hover { transform: translateY(-1px); }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav__toggle span { display: block; width: 22px; height: 2px; background: #fff; margin: 4px 0; border-radius: 2px; transition: transform .2s, opacity .2s; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  border-radius: 12px;
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s;
  text-decoration: none;
}
.btn .arrow { transition: transform .25s ease; display: inline-block; }
.btn:hover .arrow { transform: translateX(4px); }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn--primary {
  background: var(--grad-primary);
  color: #0A1330;
  box-shadow: 0 10px 28px -10px rgba(34,211,238,.55);
}
.btn--ghost {
  background: var(--surface);
  color: #fff;
  border-color: var(--border-strong);
}
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { display: flex; width: 100%; justify-content: center; }

/* ---------- HERO ---------- */
.hero { position: relative; padding: 150px 0 90px; overflow: hidden; }
.hero__bg {
  position: absolute; inset: 0;
  background: var(--grad-bg);
  pointer-events: none;
}
.hero__grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 56px; align-items: center;
  position: relative;
}
.hero__grid > * { min-width: 0; }
.hero__copy h1 { margin-bottom: 18px; }
.lead { font-size: 1.12rem; color: #C9D2F0; }
.hero__cta { display: flex; gap: 14px; margin: 26px 0 22px; flex-wrap: wrap; }
.trust { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; color: var(--text-muted); }
.trust li { display: inline-flex; align-items: center; }
.trust li + li::before { content: '•'; margin-right: 18px; color: rgba(255,255,255,.18); }

/* Hero animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.reveal.in { opacity: 1; transform: none; }

/* Hero entrance — CSS-only so it works even before JS runs (and on no-JS) */
.hero__copy,
.hero__visual {
  animation: heroIn .9s ease both;
}
.hero__visual { animation-delay: .15s; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}
/* Don't let the .reveal opacity:0 hide the hero blocks */
.hero__copy.reveal,
.hero__visual.reveal { opacity: 1; transform: none; }

/* ---------- Dashboard mockup ---------- */
.dashboard {
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.dashboard__header { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.dots span { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; background: #f87171; }
.dots span:nth-child(2) { background: #fbbf24; }
.dots span:nth-child(3) { background: #34d399; }
.dashboard__title { font-family: 'Sora', sans-serif; font-size: .82rem; color: var(--text-dim); }
.dashboard__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.kpi {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  min-height: 96px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi--wide { grid-column: span 2; }
.kpi__label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.kpi__value { font-family: 'Sora', sans-serif; font-size: 1.1rem; color: #fff; font-weight: 700; }
.kpi__delta { font-size: .78rem; color: var(--text-dim); }
.kpi__delta.up { color: var(--green); }
.kpi__delta.down { color: var(--danger); }
.kpi__delta.warn { color: var(--warn); }
.spark { margin-top: auto; }
.kpi--ai {
  background: linear-gradient(135deg, rgba(139,92,246,.22), rgba(34,211,238,.18));
  border-color: rgba(139,92,246,.45);
}
.kpi--ai .kpi__label { color: var(--purple-2); }

.floaty { animation: float 6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.glow { animation: glowPulse 3s ease-in-out infinite; }
@keyframes glowPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(139,92,246,.0), inset 0 0 0 1px rgba(139,92,246,.35); }
  50%     { box-shadow: 0 0 40px 0 rgba(139,92,246,.35), inset 0 0 0 1px rgba(139,92,246,.6); }
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; position: relative; }
.section--alt { background: var(--bg-2); }
.section__head { text-align: center; max-width: 820px; margin: 0 auto 56px; }
.section__head p { font-size: 1.05rem; }

.wave { line-height: 0; }
.wave svg { width: 100%; height: 80px; display: block; }
.wave--flip svg { transform: rotate(180deg); }

/* ---------- Cards ---------- */
.cards { display: grid; gap: 20px; }
.cards--5 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cards--4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.cards--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease, background .3s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(34,211,238,.0), rgba(139,92,246,.0));
  opacity: 0; transition: opacity .3s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-6px) rotate(-.3deg);
  border-color: rgba(34,211,238,.35);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.card__icon {
  font-size: 1.6rem;
  display: inline-flex;
  width: 46px; height: 46px;
  align-items: center; justify-content: center;
  border-radius: 12px;
  background: rgba(34,211,238,.12);
  border: 1px solid rgba(34,211,238,.25);
  margin-bottom: 14px;
}
.card--ai .card__icon { background: rgba(139,92,246,.14); border-color: rgba(139,92,246,.3); }
.card p { font-size: .94rem; margin-bottom: 0; }

/* ---------- AI section ---------- */
.ai-section { position: relative; overflow: hidden; }
.ai-section__glow {
  position: absolute; inset: 0;
  background: radial-gradient(800px 400px at 50% 0%, rgba(139,92,246,.18), transparent 60%);
  pointer-events: none;
}
.ai-footnote {
  max-width: 820px; margin: 40px auto 0; text-align: center; color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
}

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px; margin-top: 50px;
}
.stat {
  text-align: center;
  padding: 24px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat__num {
  font-family: 'Sora', sans-serif;
  font-size: 2.4rem; font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.stat__label { font-size: .85rem; color: var(--text-muted); letter-spacing: .04em; }

/* ---------- Pricing ---------- */
.pricing {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}
.plan {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease;
}
.plan:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.plan--featured {
  background: linear-gradient(180deg, rgba(139,92,246,.18), rgba(34,211,238,.08));
  border-color: rgba(139,92,246,.5);
  box-shadow: 0 20px 60px -20px rgba(139,92,246,.35);
}
.plan__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--grad-primary); color: #0A1330;
  padding: 5px 14px; border-radius: 999px;
  font-family: 'Sora', sans-serif; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
}
.plan__tag {
  font-family: 'Sora', sans-serif; font-size: 1.4rem; font-weight: 700;
  color: #fff; margin-bottom: 8px;
}
.plan__for { color: var(--text-dim); font-size: .95rem; min-height: 50px; }
.plan__list { list-style: none; padding: 0; margin: 18px 0 26px; flex: 1; }
.plan__list li {
  padding: 9px 0; color: var(--text-dim); font-size: .94rem;
  border-bottom: 1px solid var(--border);
  position: relative; padding-left: 22px;
}
.plan__list li::before {
  content: '✓'; position: absolute; left: 0; top: 9px;
  color: var(--green); font-weight: 700;
}
.plan__list li:last-child { border-bottom: 0; }
.pricing__note { text-align: center; margin-top: 30px; color: var(--text-muted); font-size: .9rem; }

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: border-color .2s;
}
.faq__item[open] { border-color: rgba(34,211,238,.35); }
.faq__item summary {
  list-style: none; cursor: pointer;
  padding: 18px 22px;
  font-family: 'Sora', sans-serif; font-weight: 600;
  color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__icon { font-size: 1.4rem; color: var(--cyan); transition: transform .25s; line-height: 1; }
.faq__item[open] .faq__icon { transform: rotate(45deg); }
.faq__item p { padding: 0 22px 20px; margin: 0; color: var(--text-dim); }

/* ---------- Form ---------- */
.form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex; flex-direction: column; gap: 16px;
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: flex; flex-direction: column; gap: 6px; }
.form__field label { font-size: .85rem; font-weight: 500; color: var(--text-dim); font-family: 'Sora', sans-serif; }
.form__field input,
.form__field select,
.form__field textarea {
  background: rgba(0,0,0,.25);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  font-family: inherit;
  font-size: .95rem;
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
.form__field textarea { resize: vertical; min-height: 120px; }
.form__field input:focus,
.form__field select:focus,
.form__field textarea:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34,211,238,.18);
}
.form__field.invalid input,
.form__field.invalid textarea,
.form__field.invalid select {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(248,113,113,.15);
}
.err { color: var(--danger); font-size: .8rem; min-height: 1em; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; width: 0; overflow: hidden; }

.form-status {
  display: none; margin: 0 0 20px;
  padding: 14px 18px; border-radius: 12px;
  font-weight: 500;
}
.form-status.success { display: block; background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.4); color: #6EE7B7; }
.form-status.error   { display: block; background: rgba(248,113,113,.12); border: 1px solid rgba(248,113,113,.4); color: #FCA5A5; }

/* ---------- Footer ---------- */
.footer {
  background: #060C24;
  border-top: 1px solid var(--border);
  padding: 60px 0 30px;
  margin-top: 40px;
}
.footer__grid {
  display: grid; grid-template-columns: 1.6fr 1fr 1fr;
  gap: 40px;
}
.footer__desc { color: var(--text-muted); font-size: .92rem; margin-top: 14px; max-width: 380px; }
.brand--footer { margin-bottom: 0; }
.footer h4 { font-family: 'Sora', sans-serif; font-size: .95rem; color: #fff; margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 5px 0; color: var(--text-dim); font-size: .92rem; }
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--cyan-2); }
.footer__bottom {
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  color: var(--text-muted); font-size: .85rem;
}
.footer__bottom p { margin: 0; color: var(--text-muted); }

/* ---------- WhatsApp button ---------- */
.wa {
  position: fixed; right: 22px; bottom: 22px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #25D366;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 28px -8px rgba(37,211,102,.55);
  z-index: 200;
  transition: transform .2s;
}
.wa:hover { transform: scale(1.06); }
.wa__pulse {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid #25D366;
  animation: waPulse 2s ease-out infinite;
}
@keyframes waPulse {
  0%   { transform: scale(1);   opacity: .7; }
  100% { transform: scale(1.6); opacity: 0; }
}
.wa__tooltip {
  position: absolute; right: 72px; top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: #0F1B47; color: #fff;
  padding: 8px 14px; border-radius: 8px;
  font-size: .82rem; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.wa__tooltip::after {
  content: ''; position: absolute; right: -5px; top: 50%; transform: translateY(-50%) rotate(45deg);
  width: 10px; height: 10px; background: #0F1B47; border-right: 1px solid var(--border); border-top: 1px solid var(--border);
}
.wa:hover .wa__tooltip { opacity: 1; transform: translateY(-50%) translateX(0); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 130px 0 60px; }
  .hero__grid { grid-template-columns: 1fr; gap: 40px; }
  .section { padding: 70px 0; }
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
  .nav__links { display: none; position: absolute; top: 100%; left: 0; right: 0; background: rgba(10,19,48,.97); backdrop-filter: blur(14px); flex-direction: column; align-items: stretch; padding: 14px 24px 24px; gap: 4px; border-bottom: 1px solid var(--border); }
  .nav__links.open { display: flex; }
  .nav__links a { padding: 12px 14px; }
  .nav__cta { margin-left: 0 !important; text-align: center; }
  .nav__toggle { display: block; }
}
@media (max-width: 560px) {
  .form__row { grid-template-columns: 1fr; }
  .form { padding: 22px; }
  .dashboard__grid { grid-template-columns: 1fr 1fr; }
  .kpi--wide { grid-column: span 2; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  h1 { font-size: 1.7rem; line-height: 1.2; }
  h2 { font-size: 1.5rem; }
  .dashboard { padding: 14px; }
  .kpi { padding: 12px; min-height: 80px; }
  .kpi__value { font-size: .98rem; }
  .container { padding: 0 18px; }
  .lead { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}