/* Math Lab website — www.mathlab.co.in */
:root {
  --navy: #0B1533; --blue: #1D47C9; --blue-2: #3B6EF5; --blue-3: #A9C4FF; --sky: #E3ECFF; --sky-2: #EEF3FF; --sky-3: #F3F7FF;
  --amber: #FFB020; --amber-ink: #8A5300; --amber-bg: #FFF4DE; --amber-2: #FFE7B5;
  --ink: #26304F; --ink-strong: #0B1533; --body: #3A4466; --muted: #56607E; --rule: #E1E7F7; --rule-2: #C9D3EC;
  --page: #F5F7FD; --white: #FFFFFF; --on-navy: #C9D5F5; --on-navy-2: #9FB0DA; --bad: #B42318;
  --head: 'Nunito', system-ui, sans-serif; --text: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--text); font-size: 17px; line-height: 1.55; -webkit-text-size-adjust: 100%; }
img, svg { display: block; }
a { color: var(--blue); }
a:hover { color: var(--ink-strong); }
button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); color: var(--ink-strong); padding: 10px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: 14px; border: 0; font-weight: 700; font-size: 17px; text-decoration: none; cursor: pointer; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-amber { background: var(--amber); color: var(--navy); }
.btn-amber:hover { background: #FFC24B; color: var(--navy); }
.btn-blue { background: var(--blue); color: var(--white); }
.btn-blue:hover { background: #2552DD; color: var(--white); }
.btn-navy { background: var(--navy); color: var(--white); }
.btn-navy:hover { background: #18254F; color: var(--white); }
.btn-line { background: transparent; color: var(--white); border: 1.5px solid rgba(201,213,245,.45); }
.btn-line:hover { color: var(--white); border-color: var(--white); }
.btn-soft { background: var(--white); color: var(--blue); border: 1.5px solid var(--rule-2); }
.btn-soft:hover { color: var(--ink-strong); border-color: var(--blue); }
.btn-sm { min-height: 44px; padding: 0 16px; font-size: 16px; border-radius: 12px; }
.btn[disabled] { opacity: .65; cursor: wait; }

/* ---------- hero ---------- */
.hero { background-color: var(--navy); background-image: linear-gradient(rgba(120,150,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(120,150,255,.07) 1px, transparent 1px); background-size: 32px 32px; color: var(--white); }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding-top: 18px; padding-bottom: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand b { font-family: var(--head); font-weight: 900; font-size: 24px; letter-spacing: -.3px; }
.badge-preview { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; background: var(--amber); color: var(--navy); padding: 3px 8px; border-radius: 999px; }
.nav-links { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; font-weight: 600; font-size: 16px; }
.nav-links a.lnk { color: var(--on-navy); text-decoration: none; }
.nav-links a.lnk:hover { color: var(--white); }
.nav-links .btn-line { min-height: 44px; padding: 0 14px; font-size: 16px; }
.nav-signin { background: var(--white); color: var(--navy); }
.nav-signin:hover { color: var(--navy); background: var(--sky); }
@media (max-width: 760px) { .nav-links a.lnk { display: none; } .nav-links { gap: 8px; } }
@media (max-width: 400px) { .nav-links .btn { padding: 0 12px; } .nav-share span { display: none; } }

.hero-in { display: flex; flex-wrap: wrap; align-items: center; gap: 40px; padding-top: 40px; padding-bottom: 80px; }
.hero-text { flex: 1 1 460px; min-width: 0; }
.eyebrow { margin: 0; font-size: 14px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--blue); }
.hero .eyebrow { color: #8FB3FF; }
h1 { margin: 16px 0 0; font-family: var(--head); font-weight: 900; font-size: clamp(42px, 6vw, 76px); line-height: 1.02; letter-spacing: -1.5px; }
h1 em { font-style: normal; color: var(--amber); }
.tagline { margin: 16px 0 0; font-family: var(--head); font-weight: 800; font-size: 22px; color: #8FB3FF; }
.lead { margin: 20px 0 0; max-width: 560px; font-size: 19px; line-height: 1.6; color: var(--on-navy); }
.chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.chip2 { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 8px 14px; border-radius: 999px; }
.chip2 svg { width: 18px; height: 18px; flex: none; }
.chip2.d2 { background: rgba(143,179,255,.14); color: #DCE6FF; }
.chip2.d3 { background: rgba(255,176,32,.16); color: #FFD27A; }
.cta-row { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 14px; }
.cta-row .btn { min-height: 56px; font-size: 18px; }
.small-note { margin: 18px 0 0; font-size: 15px; color: var(--on-navy-2); }

.hero-art { flex: 1 1 380px; min-width: 0; position: relative; display: flex; justify-content: center; padding: 24px 0; }
.cube { width: 340px; max-width: 80%; height: auto; animation: float 6s ease-in-out infinite; }
.cube .tl { animation: lit 6s linear infinite; }
.fchip { position: absolute; background: var(--white); color: #10235C; font-family: var(--mono); font-weight: 700; font-size: 15px; padding: 10px 14px; border-radius: 12px; animation: chip 5s ease-in-out infinite; white-space: nowrap; }
.fchip.a { top: 14px; left: 2%; }
.fchip.b { top: 46%; right: 0; background: var(--amber); color: var(--navy); animation-delay: 1.2s; }
.fchip.c { bottom: 10px; left: 8%; animation-delay: 2.4s; }
@media (max-width: 520px) { .fchip { font-size: 13px; padding: 8px 10px; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes lit { 0%, 10%, 100% {} 5% { fill: #FFC24B; } }
@keyframes chip { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (prefers-reduced-motion: reduce) { .cube, .cube .tl, .fchip { animation: none; } }

/* ---------- sections ---------- */
section.block { padding-top: 80px; }
h2 { margin: 10px 0 0; font-family: var(--head); font-weight: 900; font-size: clamp(30px, 4vw, 46px); line-height: 1.12; color: var(--ink-strong); letter-spacing: -.6px; }
.intro { margin: 14px 0 0; max-width: 680px; font-size: 18px; line-height: 1.6; color: var(--body); }
.card { background: var(--white); border: 1px solid var(--rule); border-radius: 24px; }

/* ---------- models ---------- */
.legend { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; }
.legend .chip2.d2 { background: var(--sky); color: var(--blue); }
.legend .chip2.d3 { background: var(--amber-2); color: #7A4900; }
.tabs { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 10px; }
.tab { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px 0 18px; border-radius: 999px; border: 1.5px solid var(--rule-2); background: var(--white); color: var(--ink-strong); font-size: 17px; font-weight: 700; cursor: pointer; }
.tab .k { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--sky); color: var(--blue); }
.tab .k.k3 { background: var(--amber); color: var(--navy); }
.tab[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.tab[aria-selected="true"] .k:not(.k3) { background: var(--blue-2); color: var(--white); }
.lab { margin-top: 18px; padding: clamp(18px, 3vw, 34px); display: flex; flex-wrap: wrap; gap: 30px; }
.stage { flex: 1 1 360px; min-width: 0; background: var(--sky-3); border-radius: 18px; display: flex; align-items: center; justify-content: center; padding: 12px; min-height: 280px; }
.stage svg { width: 100%; max-width: 460px; height: auto; font-family: var(--text); }
.stage svg.drag { touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.stage svg.drag:active { cursor: grabbing; }
.controls { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.model { display: contents; }
.panel[hidden], .model[hidden] { display: none; }
.kicker { font-size: 13px; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: 1px; }
h3 { margin: 6px 0 0; font-family: var(--head); font-weight: 900; font-size: 27px; line-height: 1.2; color: var(--ink-strong); }
.slider label { display: flex; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.slider output, .mono { font-family: var(--mono); }
input[type=range] { width: 100%; height: 34px; accent-color: var(--blue); cursor: pointer; margin: 2px 0 0; }
.reads { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.reads.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; text-align: center; }
.reads.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; text-align: center; }
.read { background: var(--sky-2); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.read.am { background: var(--amber-bg); }
.read .t { font-size: 14px; font-weight: 700; color: var(--blue); }
.read.am .t { color: var(--amber-ink); }
.read .v { font-family: var(--mono); font-size: 24px; font-weight: 700; color: var(--ink-strong); overflow-wrap: anywhere; }
.reads.r3 .read, .reads.r4 .read { padding: 10px 4px; }
.reads.r3 .v, .reads.r4 .v { font-size: 19px; }
.eq { font-family: var(--mono); font-size: 23px; font-weight: 700; color: var(--ink-strong); }
.try { margin: 0; font-size: 17px; line-height: 1.5; color: var(--body); }
.try b { color: var(--ink-strong); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.more { margin-top: auto; justify-content: space-between; }

/* ---------- subjects ---------- */
.grid-subjects { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 20px; }
.subj { padding: 26px; display: flex; flex-direction: column; gap: 12px; border-radius: 20px; }
.subj .top { display: flex; align-items: center; justify-content: space-between; }
.ico { width: 52px; height: 52px; border-radius: 14px; background: var(--sky); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; }
.ico svg { width: 28px; height: 28px; }
.live { font-size: 13px; font-weight: 700; background: var(--sky); color: var(--blue); padding: 4px 10px; border-radius: 999px; }
.subj h3 { font-size: 24px; margin: 0; }
.subj p { margin: 0; color: var(--body); line-height: 1.55; }
.subj a.play { margin-top: auto; font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }

/* ---------- solve ---------- */
.split { display: flex; flex-wrap: wrap; gap: 44px; align-items: center; }
.split > * { flex: 1 1 400px; min-width: 0; }
.ticks { margin: 22px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.ticks li { display: flex; gap: 12px; line-height: 1.5; }
.ticks svg { width: 24px; height: 24px; flex: none; color: var(--blue); }
.fine { font-size: 15px; color: var(--muted); }
.solver { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.qbox { display: flex; align-items: center; gap: 10px; background: var(--sky-3); border-radius: 14px; padding: 14px 16px; color: var(--ink-strong); }
.qbox svg { width: 22px; height: 22px; flex: none; color: var(--blue); }
.lab-h { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.steps { margin: -6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.steps .mono { color: var(--ink-strong); }
.answer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; background: var(--amber-bg); border-radius: 14px; padding: 14px 16px; }
.answer span:first-child { color: var(--amber-ink); font-weight: 700; }
.answer .mono { font-size: 20px; font-weight: 700; color: var(--ink-strong); }

/* ---------- features ---------- */
.features { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); overflow: hidden; }
.feat { padding: 30px; display: flex; gap: 18px; border-bottom: 1px solid #EDF1FA; border-right: 1px solid #EDF1FA; }
.feat .fi { flex: none; width: 48px; height: 48px; border-radius: 12px; background: var(--navy); color: var(--amber); display: flex; align-items: center; justify-content: center; }
.feat .fi svg { width: 24px; height: 24px; }
.feat h3 { margin: 0; font-family: var(--text); font-size: 20px; font-weight: 700; }
.feat p { margin: 8px 0 0; color: var(--body); }

/* ---------- free code ---------- */
.free { background: var(--navy); color: var(--white); border-radius: 28px; padding: clamp(24px, 5vw, 60px); display: flex; flex-wrap: wrap; gap: 44px; align-items: flex-start; }
.free > * { flex: 1 1 380px; min-width: 0; }
.free .eyebrow { color: var(--amber); }
.free h2 { color: var(--white); }
.nsteps { margin: 28px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 20px; }
.nsteps li { display: flex; gap: 16px; align-items: flex-start; }
.nsteps .n { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--amber); color: var(--navy); font-family: var(--head); font-weight: 900; font-size: 19px; display: flex; align-items: center; justify-content: center; }
.nsteps b { font-size: 19px; }
.nsteps p { margin: 4px 0 0; color: var(--on-navy); }
.includes { margin-top: 28px; background: rgba(143,179,255,.10); border: 1px solid rgba(143,179,255,.25); border-radius: 18px; padding: 20px; }
.includes .h { font-size: 14px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: #8FB3FF; }
.inc-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.inc-grid b { display: block; font-family: var(--head); font-weight: 900; font-size: 34px; line-height: 1.1; color: var(--amber); }
.inc-grid span { font-size: 15px; color: var(--on-navy); }
.includes p { margin: 14px 0 0; font-size: 15px; color: var(--on-navy); }
.formcard { background: var(--white); color: var(--ink); border-radius: 22px; padding: 30px; }
.formcard h3 { margin: 0 0 18px; font-size: 26px; }
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field label { font-size: 16px; font-weight: 700; color: var(--ink-strong); }
.field input { min-height: 52px; padding: 0 16px; border: 1.5px solid var(--rule-2); border-radius: 12px; font-size: 17px; color: var(--ink-strong); background: var(--white); width: 100%; }
.field input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(29,71,201,.18); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.err { margin: 0 0 14px; font-size: 15px; font-weight: 600; color: var(--bad); }
.err:empty { display: none; }
.formcard .btn { width: 100%; min-height: 56px; font-size: 18px; }
.formcard .fine { margin: 14px 0 0; font-size: 14px; }
.formcard .alt { margin: 12px 0 0; font-size: 15px; color: var(--body); }
.slip { border: 2px dashed #8FB3FF; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #F7F9FF; margin: 16px 0; }
.slip .sh { display: flex; align-items: center; gap: 8px; }
.slip .sh b { font-family: var(--head); font-weight: 900; font-size: 18px; color: var(--ink-strong); }
.slip .sh .badge-preview { font-size: 10px; }
.slip .for { font-size: 15px; color: var(--body); overflow-wrap: anywhere; }
.slip .for b { color: var(--ink-strong); }
.slip .coderow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.slip .code { font-family: var(--mono); font-weight: 700; font-size: 30px; letter-spacing: 3px; color: var(--ink-strong); }
.slip .lim { font-size: 14px; color: var(--muted); }
.done-h { text-align: center; }
.done .btn-amber { margin-top: 4px; }
.linkbtn { display: block; width: 100%; margin-top: 8px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 15px; text-decoration: underline; cursor: pointer; }

/* ---------- schools + footer ---------- */
.schools { padding: 34px; display: flex; flex-wrap: wrap; align-items: center; gap: 26px; }
.schools .ico { width: 64px; height: 64px; border-radius: 16px; background: var(--amber-2); color: var(--amber-ink); }
.schools .ico svg { width: 32px; height: 32px; }
.schools .txt { flex: 1 1 400px; min-width: 0; }
.schools h2 { font-size: 28px; margin: 0; }
.schools p { margin: 8px 0 0; color: var(--body); }
footer { margin-top: 90px; background: var(--navy); color: var(--on-navy); }
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding-top: 38px; padding-bottom: 38px; }
.foot p { margin: 0; flex: 1 1 340px; font-size: 15px; line-height: 1.6; }
.foot a { color: var(--white); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: var(--white); padding: 14px 20px; border-radius: 12px; font-size: 16px; font-weight: 600; z-index: 40; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 24px rgba(11,21,51,.3); }
.toast[hidden] { display: none; }
@media (max-width: 480px) {
  body { font-size: 16px; }
  .reads.r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .read .v { font-size: 21px; }
  .feat { padding: 24px 20px; }
  .formcard { padding: 22px; }
  .slip .code { font-size: 25px; letter-spacing: 2px; }
}
.refnote { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent, #1D4ED8) 10%, transparent); font-size: 14.5px; font-weight: 600; }
