/* ==========================================================================
   TutoBuddy / Katlego — design system v3 (Sept 2026)
   Palette sampled from the Katlego logo animation (bg #041C2E),
   teal-to-orange mark: cyan #3FCBE0, teal #0F5867, gold #E8963C.
   Type: Sora (display), IBM Plex Sans (body), IBM Plex Mono (labels).
   ========================================================================== */

:root {
  --bg: #041C2E;
  --bg-2: #062536;
  --bg-3: #0A2F43;
  --navy: #131E36;
  --teal: #0F5867;
  --cyan: #3FCBE0;
  --cyan-2: #29B6D4;
  --gold: #E8963C;
  --gold-2: #F0AC5E;
  --ink: #EDF5F6;
  --muted: #9FB6BE;
  --muted-2: #6E8891;
  --line: rgba(255,255,255,0.09);
  --surface: rgba(255,255,255,0.04);
  --surface-2: rgba(255,255,255,0.075);
  --paper: #F3F6F5;
  --paper-ink: #0B2233;
  --paper-muted: #50656F;
  --paper-line: rgba(11,34,51,0.12);
  --grad: linear-gradient(90deg, var(--cyan) 0%, #9fd8cf 50%, var(--gold) 100%);
  --f-display: 'Sora', system-ui, sans-serif;
  --f-body: 'IBM Plex Sans', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.22,1,.36,1);
  --ease-in: cubic-bezier(.65,0,.35,1);
  --r: 18px;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }
body {
  font-family: var(--f-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--cyan); color: var(--bg); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
@media (max-width: 600px) { .wrap { padding: 0 16px; } }
section { padding: 120px 0; position: relative; }
@media (max-width: 800px) { section { padding: 80px 0; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

h1, h2, h3, h4, h5 { font-family: var(--f-display); font-weight: 700; line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
p { text-wrap: pretty; }
strong { color: var(--ink); font-weight: 600; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- section labels (Romanelli-style indexed rhythm) ---------- */
.label {
  display: flex; align-items: center; gap: 14px;
  font-family: var(--f-mono); font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan); margin-bottom: 26px;
}
.label .idx { color: var(--muted-2); }
.label::after { content: ""; flex: 0 0 56px; height: 1px; background: currentColor; opacity: .5; }
.title-xl { font-size: clamp(2.4rem, 5.6vw, 4.6rem); }
.title-l { font-size: clamp(2rem, 4.2vw, 3.3rem); max-width: 22ch; }
.title-m { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--muted); max-width: 58ch; margin-top: 22px; }
.sub { color: var(--muted); max-width: 64ch; margin-top: 18px; font-size: 1.05rem; }

/* ---------- buttons ---------- */
.btn {
  --bgc: var(--surface-2); --fg: var(--ink);
  position: relative; display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 26px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bgc); color: var(--fg); font-weight: 600; font-size: .95rem;
  text-decoration: none; cursor: pointer; overflow: hidden; isolation: isolate;
  transition: transform .35s var(--ease), border-color .3s, color .3s;
  will-change: transform;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--grad); transform: translateY(101%); transition: transform .5s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover, .btn:focus-visible { color: var(--bg); border-color: transparent; }
.btn .arr { transition: transform .35s var(--ease); }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { --bgc: var(--gold); --fg: #1a1206; border-color: var(--gold); }
.btn-primary::before { background: var(--ink); }
.btn-cyan { --bgc: var(--cyan); --fg: var(--bg); border-color: var(--cyan); }
.btn-cyan::before { background: var(--ink); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
.ctarow { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 36px; }

/* ---------- nav ---------- */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  transition: transform .5s var(--ease), background .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.topnav.scrolled { background: rgba(4,28,46,0.72); backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); border-bottom-color: var(--line); }
.topnav.hide { transform: translateY(-100%); }
.topnav .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 20px; }
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 40px; width: auto; }
.navlinks { display: flex; gap: 6px; font-size: .93rem; font-weight: 500; }
.navlinks a {
  position: relative; text-decoration: none; color: var(--muted); padding: 8px 14px; border-radius: 999px;
  transition: color .25s, background .25s;
}
.navlinks a:hover { color: var(--ink); background: var(--surface-2); }
.navlinks a.active { color: var(--ink); }
.navlinks a.active::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); transform: translateX(-50%); }
.nav-right { display: flex; align-items: center; gap: 10px; }
.nav-right .btn { padding: 11px 20px; font-size: .88rem; }
.menu-btn { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease), top .4s var(--ease); }
.menu-btn span:nth-child(1) { top: 17px; } .menu-btn span:nth-child(2) { top: 25px; }
.menu-open .menu-btn span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21px; transform: rotate(-45deg); }
.mobile-menu {
  position: fixed; inset: 0; z-index: 55; background: var(--bg); padding: 110px 16px 40px;
  display: flex; flex-direction: column; gap: 6px; clip-path: inset(0 0 100% 0); transition: clip-path .6s var(--ease-in); visibility: hidden;
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); visibility: visible; }
.mobile-menu a { font-family: var(--f-display); font-size: 2.2rem; font-weight: 700; text-decoration: none; padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: baseline; }
.mobile-menu a small { font-family: var(--f-mono); font-size: .75rem; color: var(--muted-2); font-weight: 400; }
.mobile-menu .btn { margin-top: 28px; justify-content: center; font-family: var(--f-body); font-size: 1rem; }
@media (max-width: 880px) {
  .navlinks, .nav-right .btn { display: none; }
  .menu-btn { display: block; }
  .brand img { height: 34px; }
}

/* ---------- progress + cursor glow + curtain ---------- */
.scroll-progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 70; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); }
.cursor-glow {
  position: fixed; top: 0; left: 0; width: 520px; height: 520px; margin: -260px 0 0 -260px; border-radius: 50%;
  pointer-events: none; z-index: 1; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle, rgba(63,203,224,0.10) 0%, rgba(232,150,60,0.05) 35%, transparent 70%);
  will-change: transform;
}
body.has-pointer .cursor-glow { opacity: 1; }
.curtain {
  position: fixed; inset: 0; z-index: 100; background: var(--bg); display: grid; place-items: center;
  transform: translateY(0); pointer-events: none;
}
.curtain svg { width: 150px; height: auto; }
.curtain path { fill: none; stroke: url(#curtainGrad); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: 260; stroke-dashoffset: 260; }
.js .curtain { transition: transform .8s var(--ease-in); }
.js.loaded .curtain { transform: translateY(-101%); }
.js.leaving .curtain { transform: translateY(0); transition: transform .6s var(--ease-in); }
.js .curtain path { animation: draw 1.1s var(--ease) forwards; }
.js.leaving .curtain { animation: none; }
html:not(.js) .curtain { display: none; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---------- reveal system (only when JS is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease), transform 1.1s var(--ease); transition-delay: var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }
.js [data-reveal="img"] { opacity: 1; transform: none; clip-path: inset(12% 12% 12% 12% round 24px); transition: clip-path 1.4s var(--ease); }
.js [data-reveal="img"] img { transform: scale(1.25); transition: transform 1.8s var(--ease); }
.js [data-reveal="img"].in { clip-path: inset(0 0 0 0 round var(--r)); }
.js [data-reveal="img"].in img { transform: scale(1.04); }
.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.js [data-split] .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease); transition-delay: calc(var(--i) * 45ms + var(--d, 0s)); }
.js [data-split].in .w > span { transform: none; }

/* ---------- hero ---------- */
.hero { min-height: 100vh; min-height: 100svh; padding: 140px 0 80px; display: flex; align-items: center; overflow: hidden; }
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::before {
  content: ""; position: absolute; width: 900px; height: 900px; right: -260px; top: -200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15,88,103,0.55), transparent 65%); filter: blur(40px); z-index: 0;
}
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 160px; background: linear-gradient(transparent, var(--bg)); z-index: 1; }
.hero .wrap { position: relative; z-index: 2; width: 100%; }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 64px; align-items: center; }
@media (max-width: 980px) { .hero-grid { grid-template-columns: 1fr; gap: 56px; } }
.hero-logo { display: flex; align-items: center; gap: 16px; margin-bottom: 30px; }
.hero-logo video, .hero-logo img { width: 76px; height: 76px; border-radius: 20px; object-fit: cover; box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(63,203,224,0.18); }
.hero-logo .tag { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); line-height: 1.5; }
.hero-logo .tag b { display: block; color: var(--cyan); font-weight: 500; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.02; }
.hero h1 em { font-style: normal; }
.hero-chip {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 34px; padding: 8px 18px 8px 8px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9rem; color: var(--muted);
}
.hero-chip img { width: 34px; height: 34px; border-radius: 50%; background: var(--bg-3); object-fit: contain; padding: 3px; }
.hero-chip b { color: var(--ink); font-weight: 600; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #3DDC84; box-shadow: 0 0 0 0 rgba(61,220,132,.6); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(61,220,132,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); } }
.scroll-cue { position: absolute; left: 28px; bottom: 34px; z-index: 3; display: flex; align-items: center; gap: 12px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-2); }
.scroll-cue i { width: 1px; height: 46px; background: linear-gradient(var(--cyan), transparent); position: relative; overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cue 2.2s var(--ease) infinite; }
@keyframes cue { to { top: 110%; } }
@media (max-width: 980px) { .scroll-cue { display: none; } }

/* sub-page hero */
.subhero { padding: 190px 0 110px; overflow: hidden; }
.subhero .wrap { position: relative; z-index: 2; }
.subhero h1 { font-size: clamp(2.3rem, 5.4vw, 4.4rem); max-width: 20ch; }
.subhero .hero-canvas { opacity: .8; }
.subhero::before { content: ""; position: absolute; width: 760px; height: 760px; left: -300px; top: -320px; border-radius: 50%; background: radial-gradient(circle, rgba(15,88,103,0.5), transparent 65%); filter: blur(40px); }
.crumb { font-family: var(--f-mono); font-size: 12px; color: var(--muted-2); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 28px; display: flex; gap: 10px; }
.crumb a { text-decoration: none; } .crumb a:hover { color: var(--cyan); }

/* ---------- marquee ---------- */
.marquee { border-block: 1px solid var(--line); padding: 26px 0; overflow: hidden; position: relative; z-index: 2; background: var(--bg); }
.marquee-track { display: flex; gap: 0; width: max-content; animation: marquee 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-family: var(--f-display); font-size: clamp(1.4rem, 2.6vw, 2.2rem); font-weight: 600; white-space: nowrap; color: var(--muted-2); display: inline-flex; align-items: center; }
.marquee span::after { content: "∞"; margin: 0 34px; color: var(--gold); font-size: .8em; }
.marquee span:nth-child(odd) { color: var(--ink); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- paper (light) sections ---------- */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 36px 36px 0 0; margin-top: -1px; }
.paper + .paper { border-radius: 0; }
.paper .label { color: var(--teal); }
.paper .label .idx { color: var(--paper-muted); }
.paper .lead, .paper .sub, .paper p { color: var(--paper-muted); }
.paper strong { color: var(--paper-ink); }
.paper h2, .paper h3 { color: var(--paper-ink); }
.to-dark { border-radius: 0 0 36px 36px; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 70px; border-top: 1px solid var(--line); }
.paper .stats { border-top-color: var(--paper-line); }
.stat { padding: 34px 26px 10px 0; border-right: 1px solid var(--line); }
.paper .stat { border-right-color: var(--paper-line); }
.stat + .stat { padding-left: 26px; }
.stat:last-child { border-right: 0; }
.stat .num { font-family: var(--f-display); font-weight: 700; font-size: clamp(2.2rem, 3.8vw, 3.4rem); letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .num.sm { font-size: clamp(1.6rem, 2.4vw, 2.1rem); }
.c-cyan { color: var(--cyan); } .c-gold { color: var(--gold); }
.paper .c-cyan { color: #0E8BA3; } .paper .c-gold { color: #C4701D; }
.stat p { margin-top: 16px; font-size: .95rem; color: var(--muted); }
.stat .src { margin-top: 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; color: var(--muted-2); text-transform: uppercase; }
.paper .stat .src { color: #7c8f97; }
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat, .stat + .stat { padding: 28px 18px 18px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .paper .stat { border-bottom-color: var(--paper-line); }
  .stat:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
  .paper .stat:nth-child(even) { border-left-color: var(--paper-line); }
}
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } .stat:nth-child(even) { padding-left: 0; border-left: 0; } }

/* ---------- split media ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-top: 90px; }
.split.first { margin-top: 0; }
.split.rev .media { order: -1; }
.split h3 { font-size: clamp(1.6rem, 2.8vw, 2.3rem); margin-bottom: 22px; }
.split p + p { margin-top: 16px; }
.split p { color: var(--muted); font-size: 1.04rem; }
.media { border-radius: var(--r); overflow: hidden; position: relative; aspect-ratio: 4/3.2; background: var(--bg-3); }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media .cap { position: absolute; left: 16px; bottom: 16px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; background: rgba(4,28,46,.7); backdrop-filter: blur(8px); color: var(--ink); padding: 7px 12px; border-radius: 999px; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; margin-top: 64px; } .split.rev .media { order: 0; } }
.note { font-family: var(--f-mono); font-size: 12px; color: var(--muted-2); margin-top: 22px; line-height: 1.6; }
.paper .note { color: #7c8f97; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 32px; position: relative; overflow: hidden; transition: border-color .4s, transform .5s var(--ease), background .4s; }
.card:hover { border-color: rgba(63,203,224,.35); background: var(--surface-2); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 60px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-top: 60px; }
@media (max-width: 900px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
.vp .ic { width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center; background: rgba(232,150,60,.12); color: var(--gold); font-size: 1.5rem; margin-bottom: 26px; transition: transform .6s var(--ease); }
.vp:hover .ic { transform: rotate(180deg); }
.vp h4 { font-size: 1.25rem; margin-bottom: 12px; }
.vp p { color: var(--muted); font-size: .97rem; }
.vp .n { position: absolute; top: 26px; right: 28px; font-family: var(--f-mono); font-size: 12px; color: var(--muted-2); }

/* market */
.macro { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
.macro .card { display: flex; gap: 26px; align-items: center; }
.macro .num { font-family: var(--f-display); font-size: 2.6rem; font-weight: 700; color: var(--gold); flex: none; }
.macro p { color: var(--muted); font-size: .95rem; }
@media (max-width: 800px) { .macro { grid-template-columns: 1fr; } }
.funnel { display: grid; grid-template-columns: 1.2fr 1fr 0.8fr 1.2fr; gap: 20px; margin-top: 60px; align-items: stretch; }
.funnel .card { display: flex; flex-direction: column; }
.funnel .tag { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; color: var(--cyan); margin-bottom: auto; padding-bottom: 40px; }
.funnel .num { font-family: var(--f-display); font-weight: 700; font-size: clamp(1.5rem, 2.4vw, 2.1rem); letter-spacing: -0.02em; line-height: 1.1; }
.funnel p { color: var(--muted); font-size: .92rem; margin-top: 12px; }
.funnel .card.hl { background: linear-gradient(160deg, rgba(15,88,103,.6), rgba(4,28,46,.2)); border-color: rgba(63,203,224,.3); }
@media (max-width: 1000px) { .funnel { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .funnel { grid-template-columns: 1fr; } }

/* compare */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 60px; }
@media (max-width: 900px) { .compare { grid-template-columns: 1fr; } }
.compare .card { padding: 40px; min-height: 380px; display: flex; flex-direction: column; }
.compare h3 { font-size: 1.5rem; }
.compare .viz { flex: 1; display: grid; place-items: center; padding: 30px 0; }
.compare p { color: var(--muted); font-size: .95rem; }
.class-grid { display: grid; grid-template-columns: repeat(10, 14px); gap: 10px; position: relative; padding-top: 50px; }
.class-grid i { width: 14px; height: 14px; border-radius: 50%; background: var(--muted-2); opacity: .35; transition: opacity .4s, background .4s; }
.class-grid i.lit { opacity: 1; background: var(--gold); }
.class-grid .teacher { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 26px; height: 26px; border-radius: 50%; background: var(--ink); }
.compare .card.ai { background: linear-gradient(160deg, rgba(15,88,103,.55), rgba(4,28,46,.3)); border-color: rgba(63,203,224,.3); }
.loop-viz { width: 100%; max-width: 360px; }
.loop-viz .track { fill: none; stroke: rgba(255,255,255,.12); stroke-width: 2; }
.loop-viz .flow { fill: none; stroke: url(#loopGrad); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 40 220; animation: flow 3.2s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -260; } }
.loop-viz text { font-family: var(--f-mono); font-size: 7px; fill: var(--muted); letter-spacing: .1em; }
.loop-viz circle.node { stroke-width: 1.5; }

/* impact strip */
.impact { display: grid; grid-template-columns: 1.2fr 1fr; gap: 70px; align-items: center; }
@media (max-width: 900px) { .impact { grid-template-columns: 1fr; gap: 40px; } }
.impact h3 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); margin-bottom: 20px; }
.impact p { color: var(--muted); }
.badges { display: grid; gap: 16px; }
.badges .card { padding: 26px 28px; }
.badges b { display: block; font-family: var(--f-display); font-size: 1.05rem; margin-bottom: 8px; color: var(--ink); }
.badges .card p { font-size: .93rem; }
.paper .card { background: #fff; border-color: var(--paper-line); }
.paper .card:hover { border-color: rgba(15,88,103,.35); }
.paper .badges b { color: var(--paper-ink); }

/* timeline */
.timeline { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 70px; padding-top: 40px; }
.timeline::before { content: ""; position: absolute; top: 7px; left: 0; right: 0; height: 1px; background: var(--line); }
.paper .timeline::before { background: var(--paper-line); }
.timeline .bar { position: absolute; top: 6px; left: 0; height: 3px; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); border-radius: 2px; }
.tl { position: relative; }
.tl::before { content: ""; position: absolute; top: -40px; left: 0; width: 15px; height: 15px; border-radius: 50%; background: var(--bg); border: 2px solid var(--cyan); transition: background .4s, transform .4s var(--ease); }
.paper .tl::before { background: var(--paper); border-color: var(--teal); }
.tl.on::before { background: var(--gold); border-color: var(--gold); transform: scale(1.2); }
.tl .step { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--cyan); text-transform: uppercase; }
.paper .tl .step { color: var(--teal); }
.tl h5 { font-size: 1.2rem; margin: 12px 0 10px; }
.tl p { color: var(--muted); font-size: .94rem; }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; padding-top: 0; padding-left: 36px; gap: 36px; }
  .timeline::before { top: 0; bottom: 0; left: 7px; right: auto; width: 1px; height: auto; }
  .timeline .bar { top: 0; left: 6px; width: 3px; height: 100%; transform: scaleY(var(--p, 0)); transform-origin: 50% 0; }
  .tl::before { top: 4px; left: -36px; }
}

/* mastery bands (interactive) */
.mastery { margin-top: 60px; display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: stretch; }
@media (max-width: 900px) { .mastery { grid-template-columns: 1fr; } }
.meter { padding: 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 30px; }
.meter .val { font-family: var(--f-display); font-size: clamp(3.6rem, 8vw, 6rem); font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.meter .val small { font-size: .4em; color: var(--muted); font-weight: 600; }
.meter .act { font-family: var(--f-mono); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-top: 8px; }
.meter label { font-size: .9rem; color: var(--muted); display: block; margin-bottom: 12px; }
input[type=range].mrange { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 99px; background: linear-gradient(90deg, #6E8891 0 40%, #29B6D4 40% 70%, #3FCBE0 70% 85%, #E8963C 85%); outline: none; cursor: pointer; }
input[type=range].mrange::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--cyan), 0 6px 20px rgba(0,0,0,.4); }
input[type=range].mrange::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ink); border: 4px solid var(--bg); box-shadow: 0 0 0 2px var(--cyan); }
.bands { display: grid; gap: 12px; }
.band { display: grid; grid-template-columns: 110px 1fr; gap: 18px; align-items: center; padding: 20px 24px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); transition: all .45s var(--ease); cursor: pointer; }
.band .pct { font-family: var(--f-display); font-weight: 700; font-size: 1.25rem; color: var(--muted); transition: color .4s; }
.band p { color: var(--muted); font-size: .95rem; }
.band p b { color: var(--ink); font-weight: 600; }
.band.on { border-color: var(--cyan); background: linear-gradient(90deg, rgba(63,203,224,.14), rgba(63,203,224,.02)); transform: translateX(8px); }
.band.on .pct { color: var(--cyan); }
.band.on[data-b="4"] { border-color: var(--gold); background: linear-gradient(90deg, rgba(232,150,60,.16), rgba(232,150,60,.02)); }
.band.on[data-b="4"] .pct { color: var(--gold); }

/* steps (how it works) */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 60px; counter-reset: s; }
@media (max-width: 1000px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.stepc { padding: 30px; min-height: 260px; display: flex; flex-direction: column; }
.stepc .big { font-family: var(--f-display); font-size: 4rem; font-weight: 800; line-height: 1; color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.25); margin-bottom: auto; transition: -webkit-text-stroke-color .4s, color .4s; }
.stepc:hover .big { color: var(--cyan); -webkit-text-stroke-color: var(--cyan); }
.stepc .step { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--gold); text-transform: uppercase; margin-top: 30px; }
.stepc h5 { font-size: 1.2rem; margin: 10px 0 8px; }
.stepc p { color: var(--muted); font-size: .93rem; }

/* tiers */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; perspective: 1400px; }
@media (max-width: 980px) { .tiers { grid-template-columns: 1fr; } }
.tier { padding: 0; display: flex; flex-direction: column; transform-style: preserve-3d; transition: transform .25s ease-out, border-color .4s; }
.tier .head { padding: 34px 32px 28px; border-bottom: 1px solid var(--line); position: relative; }
.tier .kind { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.tier.gold .kind { color: var(--gold); }
.tier h4 { font-size: 1.55rem; margin: 14px 0 22px; }
.tier .body { padding: 28px 32px 32px; display: flex; flex-direction: column; gap: 22px; flex: 1; }
.tier .desc { color: var(--muted); }
.tier ul { list-style: none; display: grid; gap: 12px; }
.tier li { display: flex; gap: 12px; font-size: .95rem; }
.tier li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 3px; border-radius: 50%; background: rgba(63,203,224,.15) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%233FCBE0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.tier .use { margin-top: auto; padding: 18px 20px; border-radius: 12px; background: rgba(0,0,0,.18); border: 1px dashed var(--line); }
.tier .use .lb { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-2); margin-bottom: 6px; }
.tier .use p { font-size: .92rem; color: var(--muted); }
.tier.featured { border-color: rgba(63,203,224,.45); background: linear-gradient(170deg, rgba(15,88,103,.55), rgba(4,28,46,.4) 60%); box-shadow: 0 30px 80px rgba(0,0,0,.35), 0 0 0 1px rgba(63,203,224,.15); }
.pill { position: absolute; top: 30px; right: 28px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 999px; background: var(--gold); color: #1a1206; font-weight: 600; }
.tier .btn { align-self: flex-start; }

/* final cta */
.final { text-align: center; padding: 160px 0; overflow: hidden; }
.final h2 { font-size: clamp(2.4rem, 6vw, 5rem); max-width: 16ch; margin: 0 auto; position: relative; z-index: 2; }
.final .ctarow { justify-content: center; position: relative; z-index: 2; }
.final .tagline { margin-top: 40px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); position: relative; z-index: 2; }
.final .big-loop { position: absolute; left: 50%; top: 50%; width: min(1100px, 130vw); transform: translate(-50%, -50%); z-index: 0; opacity: .5; }
.final .big-loop path { fill: none; stroke: url(#bigGrad); stroke-width: .6; stroke-dasharray: 260; stroke-dashoffset: 260; transition: stroke-dashoffset 3s var(--ease); }
.final.in .big-loop path, .final .big-loop.in path { stroke-dashoffset: 0; }

/* footer */
footer { border-top: 1px solid var(--line); padding: 80px 0 36px; position: relative; z-index: 2; background: var(--bg); }
.fgrid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 50px; }
@media (max-width: 800px) { .fgrid { grid-template-columns: 1fr; gap: 36px; } }
.flogo { width: 220px; }
.fcol h6 { font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted-2); font-weight: 500; margin-bottom: 18px; }
.fcol a { display: block; text-decoration: none; color: var(--muted); padding: 5px 0; transition: color .25s, transform .3s var(--ease); }
.fcol a:hover { color: var(--ink); transform: translateX(4px); }
.fbottom { margin-top: 70px; padding-top: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .85rem; color: var(--muted-2); }
.fbig { font-family: var(--f-display); font-weight: 800; font-size: clamp(3rem, 13vw, 11rem); line-height: .9; letter-spacing: -0.05em; margin-top: 70px; background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0)); -webkit-background-clip: text; background-clip: text; color: transparent; user-select: none; white-space: nowrap; overflow: hidden; }

/* ==========================================================================
   Katlego chat demo
   ========================================================================== */
.chat-stage { position: relative; display: flex; justify-content: center; }
.chat-stage::before { content: ""; position: absolute; inset: 8% -6% -4%; background: radial-gradient(closest-side, rgba(63,203,224,.22), transparent); filter: blur(30px); z-index: 0; }
.phone {
  position: relative; z-index: 1; width: 100%; max-width: 380px; height: 640px;
  border-radius: 46px; padding: 11px; background: linear-gradient(145deg, #1b3446, #07131d);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 50px 100px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.05);
}
.phone .screen { position: relative; height: 100%; border-radius: 36px; overflow: hidden; display: flex; flex-direction: column; background: #0B141A; }
.phone .notch { position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 96px; height: 26px; border-radius: 20px; background: #000; z-index: 5; }
.c-status { display: flex; justify-content: space-between; padding: 12px 26px 4px; font-size: 12px; font-weight: 600; color: #e9edef; background: #1F2C34; font-variant-numeric: tabular-nums; }
.c-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 12px; background: #1F2C34; color: #e9edef; }
.c-head .back { font-size: 20px; opacity: .85; }
.c-av { position: relative; width: 40px; height: 40px; border-radius: 50%; background: #041C2E; display: grid; place-items: center; flex: none; }
.c-av img { width: 34px; height: 34px; object-fit: contain; }
.c-av::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid transparent; background: conic-gradient(from 0deg, var(--cyan), var(--gold), var(--cyan)) border-box; -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .3s; }
.c-av.thinking::after { opacity: 1; animation: spin 1.4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.c-who { flex: 1; min-width: 0; line-height: 1.25; }
.c-name { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.c-name svg { width: 14px; height: 14px; }
.c-sub { font-size: 12px; color: #8696a0; transition: color .3s; }
.c-sub.typing { color: #3DDC84; }
.c-icons { display: flex; gap: 18px; opacity: .85; }
.c-icons svg { width: 20px; height: 20px; fill: #e9edef; }
.c-body {
  flex: 1; overflow-y: auto; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 4px; scroll-behavior: smooth;
  background-color: #0B141A;
  background-image: radial-gradient(rgba(255,255,255,.035) 1px, transparent 1px), radial-gradient(rgba(63,203,224,.03) 1px, transparent 1px);
  background-size: 22px 22px, 34px 34px; background-position: 0 0, 11px 17px;
  scrollbar-width: none;
}
.c-body::-webkit-scrollbar { display: none; }
.c-day { align-self: center; font-size: 11.5px; color: #8696a0; background: #182229; padding: 5px 12px; border-radius: 8px; margin: 2px 0 10px; }
.c-enc { align-self: center; max-width: 88%; text-align: center; font-size: 11.5px; line-height: 1.45; color: #d9ae62; background: #182229; padding: 7px 12px; border-radius: 8px; margin-bottom: 10px; }
.msg {
  position: relative; max-width: 82%; padding: 7px 10px 20px 11px; border-radius: 10px; font-size: 14.2px; line-height: 1.42; color: #e9edef;
  animation: msgIn .45s var(--ease) both; transform-origin: bottom left; word-wrap: break-word;
}
.msg.k { align-self: flex-start; background: #202C33; border-top-left-radius: 3px; }
.msg.u { align-self: flex-end; background: #005C4B; border-top-right-radius: 3px; transform-origin: bottom right; }
.msg + .msg.k, .msg + .msg.u { margin-top: 2px; }
.msg.u + .msg.k, .msg.k + .msg.u { margin-top: 8px; }
.msg .t { position: absolute; right: 9px; bottom: 4px; font-size: 11px; color: rgba(233,237,239,.6); display: flex; align-items: center; gap: 3px; }
.msg .ticks { width: 16px; height: 11px; color: rgba(233,237,239,.6); transition: color .4s; }
.msg .ticks.read { color: #53BDEB; }
.msg .ticks .t2 { opacity: 0; transition: opacity .3s; }
.msg .ticks.dlv .t2, .msg .ticks.read .t2 { opacity: 1; }
.msg code { font-family: var(--f-mono); font-size: 13px; background: rgba(0,0,0,.25); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
.msg.k b { color: #fff; }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
.msg.typing-b { padding: 12px 14px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: #8696a0; animation: bounce 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }
.msg.card-m { padding: 12px 12px 22px; min-width: 230px; }
.prog-t { font-size: 12px; color: #8696a0; font-family: var(--f-mono); letter-spacing: .04em; text-transform: uppercase; }
.prog-n { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 8px; font-weight: 600; }
.prog-n span:last-child { color: var(--cyan); font-family: var(--f-display); font-size: 18px; font-variant-numeric: tabular-nums; }
.prog-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.prog-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--gold)); transition: width 1.6s var(--ease); }
.prog-band { display: inline-block; margin-top: 10px; font-size: 11.5px; font-family: var(--f-mono); color: var(--gold); background: rgba(232,150,60,.12); padding: 3px 9px; border-radius: 99px; }
.c-choices { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; padding: 10px 12px 4px; background: #0B141A; min-height: 50px; }
.chip {
  font: inherit; font-size: 13.5px; color: #e9edef; background: transparent; border: 1px solid rgba(63,203,224,.55);
  padding: 8px 14px; border-radius: 999px; cursor: pointer; animation: msgIn .4s var(--ease) both; animation-delay: calc(var(--i) * 70ms);
  transition: background .25s, border-color .25s, transform .25s var(--ease);
}
.chip:hover { background: rgba(63,203,224,.14); transform: translateY(-2px); }
.chip.replay { border-color: rgba(232,150,60,.6); color: var(--gold-2); }
.c-hint { width: 100%; text-align: right; font-size: 11px; color: #8696a0; font-family: var(--f-mono); letter-spacing: .06em; margin-bottom: 2px; }
.c-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px 14px; background: #0B141A; }
.c-field { flex: 1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; background: #202C33; color: #8696a0; font-size: 14.5px; min-height: 42px; overflow: hidden; white-space: nowrap; }
.c-field svg { width: 20px; height: 20px; fill: #8696a0; flex: none; }
.c-field .typed { color: #e9edef; overflow: hidden; text-overflow: ellipsis; }
.c-field .caret { display: inline-block; width: 1.5px; height: 17px; background: var(--cyan); animation: blink 1s steps(1) infinite; margin-left: -6px; }
@keyframes blink { 50% { opacity: 0; } }
.c-mic { width: 42px; height: 42px; border-radius: 50%; background: #00A884; display: grid; place-items: center; flex: none; transition: transform .2s; }
.c-mic svg { width: 20px; height: 20px; fill: #fff; }
.c-mic.send { transform: scale(1.08); }
.demo-note { text-align: center; margin-top: 18px; font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .06em; color: var(--muted-2); position: relative; z-index: 1; }
@media (max-width: 480px) { .phone { height: 600px; border-radius: 40px; } .phone .screen { border-radius: 30px; } }

/* demo explainer (how-it-works) */
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; margin-top: 60px; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; gap: 50px; } }
.explain { display: grid; gap: 14px; }
.explain .card { padding: 22px 24px; display: grid; grid-template-columns: 40px 1fr; gap: 16px; align-items: start; transition: all .45s var(--ease); }
.explain .card .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted-2); padding-top: 3px; }
.explain .card h5 { font-size: 1.05rem; margin-bottom: 6px; }
.explain .card p { color: var(--muted); font-size: .93rem; }
.explain .card.on { border-color: var(--cyan); background: linear-gradient(90deg, rgba(63,203,224,.12), transparent); transform: translateX(8px); }
.explain .card.on .n { color: var(--cyan); }

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .marquee-track { animation: none; }
  .js [data-reveal], .js [data-split] .w > span { opacity: 1; transform: none; }
  .js [data-reveal="img"] { clip-path: none; }
}
.js .grad-text .w > span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---- fixes after QA pass 1 ---- */
.hero, .subhero { position: relative; }
.hero h1 { font-size: clamp(2.5rem, 5.2vw, 4.4rem); }
.paper p, .paper .split p, .paper .stat p, .paper .tl p, .paper .card p, .paper .sub { color: var(--paper-muted); }
.paper .tl h5, .paper .stat .num:not(.c-cyan):not(.c-gold) { color: var(--paper-ink); }
.topnav.scrolled { background: rgba(4,28,46,0.9); }
.prog-n { gap: 14px; }
.js.loaded .curtain { visibility: hidden; transition: transform .8s var(--ease-in), visibility 0s linear .8s; }
.js.leaving .curtain { visibility: visible; transition: transform .6s var(--ease-in), visibility 0s; }
.tier h4 { min-height: 2.3em; }
@media (max-width: 900px) { .explain .card.on, .band.on { transform: none; } }
