/* ============================================================
   kids.moseotool.com — Design System
   Premium, playful, professional. Light + dark.
   ============================================================ */

/* ---------- Self-hosted fonts ---------- */
@font-face { font-family:"Poppins"; font-style:normal; font-weight:600; font-display:swap; src:url("../vendor/fonts/poppins-600.woff2") format("woff2"); }
@font-face { font-family:"Poppins"; font-style:normal; font-weight:700; font-display:swap; src:url("../vendor/fonts/poppins-700.woff2") format("woff2"); }
@font-face { font-family:"Poppins"; font-style:normal; font-weight:800; font-display:swap; src:url("../vendor/fonts/poppins-800.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:400; font-display:swap; src:url("../vendor/fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:500; font-display:swap; src:url("../vendor/fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:600; font-display:swap; src:url("../vendor/fonts/inter-600.woff2") format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  /* Brand */
  --primary: #4F46E5;
  --primary-600: #4338CA;
  --primary-700: #3730A3;
  --violet: #7C3AED;
  --cyan: #06B6D4;
  --sky: #0EA5E9;
  --emerald: #10B981;
  --amber: #F59E0B;
  --rose: #F43F5E;
  --pink: #EC4899;

  /* Ink & surfaces (light) */
  --ink: #0F172A;
  --ink-soft: #334155;
  --muted: #64748B;
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-alt: #F1F5F9;
  --card: #FFFFFF;
  --line: #E7EAF0;

  /* Gradients */
  --grad-brand: linear-gradient(135deg, #6366F1 0%, #7C3AED 100%);
  --grad-hero: radial-gradient(1000px 500px at 15% -10%, #EEF2FF 0, transparent 55%),
               radial-gradient(900px 500px at 100% 0%, #ECFEFF 0, transparent 50%),
               linear-gradient(180deg, #FBFCFF 0%, #FFFFFF 60%);
  --grad-cta: linear-gradient(135deg, #4F46E5 0%, #7C3AED 55%, #06B6D4 130%);

  /* Elevation (soft, slightly tinted) */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, .06);
  --shadow: 0 12px 30px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 60px rgba(79, 70, 229, .16);

  /* Radius */
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 26px;
  --r-xl: 34px;
  --r-pill: 999px;

  /* Type */
  --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --nav-h: 74px;
}

[data-bs-theme="dark"] {
  --ink: #F1F5F9;
  --ink-soft: #CBD5E1;
  --muted: #94A3B8;
  --bg: #0B1120;
  --bg-soft: #0F172A;
  --bg-alt: #131C31;
  --card: #131C31;
  --line: #24314B;
  --grad-hero: radial-gradient(1000px 500px at 15% -10%, #1E1B4B 0, transparent 55%),
               radial-gradient(900px 500px at 100% 0%, #083344 0, transparent 50%),
               linear-gradient(180deg, #0B1120 0%, #0B1120 100%);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
  --shadow: 0 14px 34px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .55);
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* `overflow-x: clip` (not `hidden`) stops horizontal scroll WITHOUT creating a
   scroll container — so `position: sticky` on the navbar keeps working. */
html, body { max-width: 100%; overflow-x: clip; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, .display-1, .display-2, .display-3, .display-4, .navbar-brand {
  font-family: var(--font-head);
  letter-spacing: -.02em;
  color: var(--ink);
}
h2 { font-weight: 700; }
p { color: var(--ink-soft); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-600); }
.text-muted { color: var(--muted) !important; }
section { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* Accessibility */
.skip-link {
  position: fixed; left: 1rem; top: -80px; z-index: 3000;
  background: var(--card); color: var(--ink);
  padding: .55rem .9rem; border-radius: var(--r-sm); box-shadow: var(--shadow);
  transition: top .18s ease;
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Layout helpers ---------- */
.container { max-width: 1200px; }
.section { padding: clamp(3.5rem, 7vw, 6.5rem) 0; }
.bg-soft { background: var(--bg-soft); }
.bg-alt { background: var(--bg-alt); }
.eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-head); font-weight: 600; font-size: .82rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  padding: .4rem .8rem; border-radius: var(--r-pill);
}
.section-title { font-size: clamp(1.7rem, 3.4vw, 2.6rem); font-weight: 800; }
.section-lead { color: var(--muted); font-size: 1.08rem; max-width: 620px; }
#categories .section-lead { max-width: none; }
.text-gradient {
  background: var(--grad-brand); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* ---------- Buttons ---------- */
.btn { font-family: var(--font-head); font-weight: 600; border-radius: var(--r-pill); }
.btn-lg { padding: .8rem 1.6rem; }
.btn-brand {
  color: #fff; border: none; background-image: var(--grad-brand);
  box-shadow: 0 10px 24px rgba(99, 102, 241, .35);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-brand:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 16px 34px rgba(124, 58, 237, .42); filter: saturate(1.05); }
.btn-ghost {
  color: var(--ink); background: var(--card); border: 1px solid var(--line);
  transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn-soft {
  color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); border: none;
}
.btn-soft:hover { color: var(--primary-700); background: color-mix(in srgb, var(--primary) 16%, transparent); }

/* ---------- Navbar ---------- */
.brand-nav {
  height: var(--nav-h); background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s, background .2s;
}
.brand-nav.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-xs); }
/* Below the lg breakpoint, Bootstrap's expanded .navbar-collapse renders
   inline (not as an absolutely-positioned dropdown) and needs the nav to
   grow with it — otherwise the fixed height above clips the box while the
   menu content visually spills out over the section below it. */
@media (max-width: 991.98px) {
  .brand-nav { height: auto; min-height: var(--nav-h); }
  /* A 12-item mega menu makes the expanded panel taller than most phone
     screens. Without a cap, the sticky nav itself grows past the viewport,
     which makes position:sticky behave unpredictably while scrolling (items
     appear to vanish/reappear). Bound it to the viewport and let the panel
     scroll internally instead — every item stays reachable via one obvious
     scroll region. */
  .brand-nav .navbar-collapse.show {
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}
.navbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; font-size: 1.28rem; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; background-image: var(--grad-brand);
  display: grid; place-items: center; color: #fff; font-size: 1.25rem; box-shadow: 0 6px 16px rgba(99,102,241,.4);
}
.brand-nav .nav-link { font-family: var(--font-head); font-weight: 500; color: var(--ink-soft); border-radius: var(--r-pill); padding: .45rem .85rem; }
.brand-nav .nav-link:hover, .brand-nav .nav-link:focus { color: var(--primary); background: var(--bg-alt); }

/* Keep the navbar CTA cluster whole: never shrink it, never wrap/clip a button
   (so "Start free" / "Dashboard" always render fully). Search lives on the
   pages themselves (hero, gallery, forum), so the navbar stays uncluttered. */
.brand-nav .navbar-collapse > .d-flex { flex-shrink: 0; }
.brand-nav .btn { white-space: nowrap; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); display: grid; place-items: center;
  transition: transform .15s, border-color .15s, color .15s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }

/* Mega menu */
.mega-menu {
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 1rem; width: min(720px, 92vw); background: var(--card);
}
.mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
/* Fixed 2 columns below lg — minmax(0, 1fr) (not a bare 1fr, and not a
   150px-minimum track) so each column shrinks to fit even very narrow
   phones instead of overflowing a 3rd/wider column off-screen, where it
   would get silently clipped by the site-wide overflow-x:clip rule. */
@media (max-width: 991.98px) {
  .mega-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.mega-item {
  display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: var(--r-sm);
  color: var(--ink); transition: background .15s, transform .15s;
}
.mega-item:hover { background: var(--bg-alt); color: var(--ink); transform: translateX(2px); }
.mega-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; flex: none; }
.mega-item small { color: var(--muted); display: block; }

/* ---------- Hero ---------- */
.hero { background: var(--grad-hero); position: relative; overflow: hidden; padding: clamp(3rem, 6vw, 5.5rem) 0 clamp(3.5rem, 7vw, 6rem); }
.hero h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); font-weight: 800; line-height: 1.05; }
.hero-lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--ink-soft); max-width: 560px; }
.hero-search {
  display: flex; align-items: center; gap: .5rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: .55rem .65rem .55rem 1.1rem;
  box-shadow: var(--shadow); max-width: 560px;
}
.hero-search input { flex: 1; border: none; outline: none; background: transparent; color: var(--ink); font-size: 1.02rem; }
.hero-search .btn { flex: none; }
.trust-row { display: flex; flex-wrap: wrap; gap: 1.4rem 2rem; align-items: center; color: var(--muted); }
.trust-row .stat { display: flex; flex-direction: column; }
.trust-row .stat b { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; color: var(--ink); line-height: 1; }
.trust-badges { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 500;
  color: var(--ink-soft); background: var(--card); border: 1px solid var(--line);
  padding: .4rem .8rem; border-radius: var(--r-pill);
}

/* Hero visual collage */
.hero-visual { position: relative; }
.hero-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); padding: 1.25rem;
}
.hero-card .tile {
  background: var(--bg-alt); border-radius: var(--r-sm); padding: .8rem .5rem; font-weight: 600;
  font-family: var(--font-head); display: grid; gap: .25rem; place-items: center;
}
.float-badge {
  position: absolute; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--shadow); padding: .6rem .8rem;
  display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 600; font-size: .9rem;
}
.float-badge .fb-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.fb-1 { top: -14px; left: -18px; }
.fb-2 { bottom: 18px; right: -22px; }
.fb-3 { bottom: -18px; left: 30%; }
@media (max-width: 991px) { .float-badge { display: none; } }

.progress { background: var(--bg-alt); border-radius: var(--r-pill); }

/* ---------- Category cards ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.cat-card {
  position: relative; display: block; border-radius: var(--r-lg); padding: 1.15rem;
  color: #fff; overflow: hidden; min-height: 132px; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .18s ease;
  isolation: isolate;
}
.cat-card::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .92;
  background: var(--cc, var(--grad-brand));
}
.cat-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); color: #fff; }
.cat-ico { width: 48px; height: 48px; border-radius: 14px; background: rgba(255,255,255,.22); display: grid; place-items: center; font-size: 1.5rem; margin-bottom: .8rem; }
.cat-card h3 { color: #fff; font-size: 1.06rem; margin: 0; font-weight: 700; }
.cat-card small { color: rgba(255,255,255,.85); }
.cat-card .go { position: absolute; top: 1.1rem; right: 1.1rem; opacity: 0; transform: translateX(-4px); transition: .18s; }
.cat-card:hover .go { opacity: 1; transform: translateX(0); }

/* Trending chips */
.trend-wrap { display: flex; flex-wrap: wrap; gap: .55rem; }
.trend {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem; border-radius: var(--r-pill);
  background: var(--card); border: 1px solid var(--line); color: var(--ink-soft); font-weight: 500; font-size: .92rem;
  transition: transform .15s, border-color .15s, color .15s;
}
.trend:hover { transform: translateY(-2px); border-color: var(--primary); color: var(--primary); }
.trend i { color: var(--rose); }

/* ---------- Bento / feature cards ---------- */
.bento { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; }
.bento .cell { grid-column: span 2; }
.bento .cell.wide { grid-column: span 3; }
.bento .cell.tall { grid-column: span 2; }
.feature-card {
  height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 1.4rem; box-shadow: var(--shadow-xs); transition: transform .18s, box-shadow .18s, border-color .18s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.feature-ico {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  color: #fff; font-size: 1.5rem; margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.feature-card h3 { font-size: 1.15rem; margin-bottom: .35rem; }
.feature-card p { color: var(--muted); margin: 0; font-size: .96rem; }
.feature-card .learn { display: inline-flex; align-items: center; gap: .35rem; margin-top: .9rem; font-weight: 600; font-family: var(--font-head); }
@media (max-width: 900px) { .bento { grid-template-columns: repeat(2, 1fr); } .bento .cell, .bento .cell.wide, .bento .cell.tall { grid-column: span 1; } }

/* ---------- Library — PDF preview ---------- */
.pdf-preview { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--bg-alt); box-shadow: var(--shadow-xs); }
.pdf-preview iframe { width: 100%; height: 82vh; min-height: 480px; max-height: 900px; border: 0; display: block; }

/* Gradient utility backgrounds for icons/cards */
.g-indigo { background: linear-gradient(135deg,#6366F1,#4338CA); }
.g-violet { background: linear-gradient(135deg,#8B5CF6,#6D28D9); }
.g-cyan   { background: linear-gradient(135deg,#22D3EE,#0891B2); }
.g-sky    { background: linear-gradient(135deg,#38BDF8,#0284C7); }
.g-emerald{ background: linear-gradient(135deg,#34D399,#059669); }
.g-amber  { background: linear-gradient(135deg,#FBBF24,#D97706); }
.g-rose   { background: linear-gradient(135deg,#FB7185,#E11D48); }
.g-pink   { background: linear-gradient(135deg,#F472B6,#DB2777); }
.g-slate  { background: linear-gradient(135deg,#64748B,#334155); }
.g-teal   { background: linear-gradient(135deg,#2DD4BF,#0D9488); }

/* ---------- Featured gallery ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.gal-card {
  position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-sm); transition: transform .18s, box-shadow .18s;
}
.gal-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.gal-thumb { position: absolute; inset: 0; display: grid; place-items: center; font-size: 3.2rem; color: #fff; }
.gal-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end;
  padding: .9rem; background: linear-gradient(180deg, transparent 40%, rgba(2,6,23,.72) 100%);
  color: #fff; opacity: 1;
}
.gal-overlay h4 { color: #fff; font-size: 1rem; margin: 0; }
.gal-overlay small { color: rgba(255,255,255,.85); }
.gal-actions { position: absolute; top: .7rem; right: .7rem; display: flex; gap: .4rem; opacity: 0; transform: translateY(-4px); transition: .18s; }
.gal-card:hover .gal-actions { opacity: 1; transform: translateY(0); }
.gal-btn { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; }

/* ---------- Split (parents / teachers) ---------- */
.split-card {
  border-radius: var(--r-xl); padding: clamp(1.6rem, 3vw, 2.6rem); height: 100%;
  border: 1px solid var(--line); background: var(--card); box-shadow: var(--shadow-sm);
}
.split-card.accent { color: #fff; border: none; background-image: var(--grad-cta); box-shadow: var(--shadow-lg); }
.split-card.accent p, .split-card.accent li { color: rgba(255,255,255,.92); }
.split-list { list-style: none; padding: 0; margin: 1.2rem 0 1.6rem; display: grid; gap: .6rem; }
.split-list li { display: flex; align-items: center; gap: .6rem; }
.split-list i { flex: none; }

/* ---------- Stats band ---------- */
.stats-band { background-image: var(--grad-cta); color: #fff; border-radius: var(--r-xl); padding: clamp(2rem,4vw,3rem); }
.stats-band .num { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.8rem,4vw,2.8rem); line-height: 1; }
.stats-band .lbl { color: rgba(255,255,255,.85); font-size: .95rem; }

/* ---------- Testimonials ---------- */
.tcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem; box-shadow: var(--shadow-xs); height: 100%; }
.tcard .stars { color: var(--amber); margin-bottom: .6rem; }
.tcard p { color: var(--ink-soft); }
.tavatar { width: 44px; height: 44px; border-radius: var(--r-pill); display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 700; }

/* ---------- Final CTA ---------- */
.cta-panel { position: relative; overflow: hidden; border-radius: var(--r-xl); background-image: var(--grad-cta); color: #fff; padding: clamp(2.4rem, 5vw, 4rem); text-align: center; box-shadow: var(--shadow-lg); }
.cta-panel h2 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.8rem); }
.cta-panel p { color: rgba(255,255,255,.9); }
.cta-panel::before, .cta-panel::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); }
.cta-panel::before { width: 320px; height: 320px; top: -120px; right: -80px; }
.cta-panel::after { width: 220px; height: 220px; bottom: -110px; left: -60px; }

/* ---------- Footer ---------- */
.brand-footer { background: var(--bg-soft); border-top: 1px solid var(--line); }
.brand-footer h5 { font-family: var(--font-head); font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.brand-footer a { color: var(--ink-soft); display: block; padding: .22rem 0; }
.brand-footer a:hover { color: var(--primary); }
.footer-social a { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft); }
.footer-social a:hover { color: var(--primary); border-color: var(--primary); }
.footer-bottom { border-top: 1px solid var(--line); }

/* ---------- Gamification bar (kept) ---------- */
.gami-bar { border-radius: var(--r-lg); background: var(--card); border: 1px solid var(--line); }
.gami-level-icon { font-size: 2rem; line-height: 1; }
.gami-progress { height: 14px; border-radius: var(--r-pill); }
.gami-stats span { white-space: nowrap; font-size: .95rem; }
.gami-badge { background: var(--bg-alt); color: var(--ink); border: 1px solid var(--line); font-weight: 600; }

/* ============================================================
   Community Forum
   ============================================================ */
.forum-hero { background: var(--grad-hero); padding: clamp(2.5rem,5vw,4rem) 0; }
.leaderlist { list-style: none; padding: 0; margin: 0; counter-reset: lb; }
.leaderlist li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.leaderlist li:last-child { border-bottom: none; }
.leaderlist .tavatar { width: 34px; height: 34px; font-size: .9rem; }
.leaderlist .rep { color: var(--amber); font-weight: 700; font-family: var(--font-head); white-space: nowrap; }
.leaderlist-full .rank { width: 26px; font-weight: 800; font-family: var(--font-head); color: var(--muted); text-align: center; }

/* Section chips grid */
.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: .75rem; }
.section-chip {
  display: flex; align-items: center; gap: .7rem; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: .7rem .85rem; color: var(--ink); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.section-chip:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-sm); color: var(--ink); }
.sc-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 1.15rem; flex: none; }
.sc-name { font-weight: 600; font-family: var(--font-head); line-height: 1.15; }
.sc-count { margin-left: auto; background: var(--bg-alt); color: var(--muted); border-radius: var(--r-pill); padding: .1rem .55rem; font-size: .8rem; font-weight: 600; }

/* Post cards */
.post-list { display: grid; gap: .85rem; }
.post-card { display: flex; gap: 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem 1.1rem; transition: border-color .15s, box-shadow .15s; }
.post-card:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.pc-stats { display: flex; flex-direction: column; gap: .4rem; text-align: center; flex: none; min-width: 56px; }
.pc-stat { display: flex; flex-direction: column; font-size: .72rem; color: var(--muted); }
.pc-stat b { font-family: var(--font-head); font-size: 1rem; color: var(--ink); }
.pc-stat.solved b { color: var(--emerald); }
.pc-title { font-size: 1.12rem; margin: .1rem 0 .4rem; line-height: 1.3; }
.pc-title a { color: var(--ink); }
.pc-title a:hover { color: var(--primary); }
.pc-tags { display: flex; flex-wrap: wrap; gap: .35rem; }
.tagpill { font-size: .76rem; font-weight: 600; color: var(--ink-soft); background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .12rem .55rem; }
a.tagpill:hover { color: var(--primary); border-color: var(--primary); }
.pc-meta { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.ptype { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 700; font-family: var(--font-head); color: #fff; border-radius: var(--r-pill); padding: .18rem .6rem; }

/* Vote widget */
.vote { display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.vote-btn { border: none; background: transparent; color: var(--muted); font-size: 1.2rem; line-height: 1; padding: .1rem .3rem; border-radius: 8px; cursor: pointer; }
.vote-btn:hover:not(:disabled) { background: var(--bg-alt); color: var(--primary); }
.vote-btn.active { color: var(--emerald); }
.vote-btn.active-down { color: var(--rose); }
.vote-score { font-family: var(--font-head); font-weight: 800; }
.vote-score.pos { color: var(--emerald); } .vote-score.neg { color: var(--rose); }

/* Mini post list */
.post-list-mini { display: grid; gap: .5rem; }
.mini-post { display: flex; gap: .55rem; align-items: baseline; color: var(--ink-soft); font-size: .9rem; }
.mini-post:hover { color: var(--primary); }
.mini-score { flex: none; min-width: 28px; text-align: center; font-weight: 700; font-family: var(--font-head); color: var(--muted); background: var(--bg-alt); border-radius: 8px; padding: 0 .35rem; }

/* Post detail */
.post-detail { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; }
.post-head { display: flex; gap: 1rem; align-items: flex-start; }
.post-title { font-size: clamp(1.4rem,3vw,2rem); margin: 0; }
.post-featured { width: 100%; border-radius: var(--r); margin: 1rem 0; }
.post-content { margin-top: 1rem; }
.rich { line-height: 1.7; color: var(--ink-soft); word-break: break-word; }
.rich p { color: var(--ink-soft); }
.rich a { text-decoration: underline; }
.rich pre, .rich code { background: var(--bg-alt); border-radius: 8px; padding: .1rem .35rem; }
.rich pre { padding: .8rem; overflow-x: auto; }
.post-actions { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.linkbtn { border: none; background: transparent; color: var(--ink-soft); font-weight: 600; font-size: .9rem; cursor: pointer; padding: 0; display: inline-flex; align-items: center; gap: .3rem; }
.linkbtn:hover { color: var(--primary); }
.ai-box { background: color-mix(in srgb, var(--violet) 8%, transparent); border: 1px solid color-mix(in srgb, var(--violet) 25%, var(--line)); border-radius: var(--r); padding: .9rem 1.1rem; }
.ai-label { font-family: var(--font-head); font-weight: 700; color: var(--violet); font-size: .85rem; margin-bottom: .25rem; }

/* Comments */
.comment-list { display: grid; gap: 1rem; }
.comment { border: 1px solid var(--line); border-radius: var(--r); padding: .9rem; background: var(--card); }
.comment.accepted { border-color: var(--emerald); box-shadow: 0 0 0 1px var(--emerald) inset; }
.comment-row { display: flex; gap: .8rem; align-items: flex-start; }
.comment-body { flex-grow: 1; min-width: 0; }
.accepted-tag { color: var(--emerald); font-weight: 700; font-size: .82rem; margin-bottom: .3rem; }
.comment-meta { font-size: .8rem; color: var(--muted); margin-top: .5rem; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.comment-children { margin: .8rem 0 0 1.4rem; padding-left: .8rem; border-left: 2px solid var(--line); display: grid; gap: .8rem; }
.reply-form { margin-top: .7rem; }

/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.filter-bar .input-group { flex: 1 1 240px; }

/* Profile */
.profile-cover { height: 180px; background: var(--grad-cta); background-size: cover; background-position: center; }
.profile-head { display: flex; align-items: flex-end; gap: 1rem; margin-top: -44px; flex-wrap: wrap; }
.profile-avatar { width: 88px; height: 88px; font-size: 2rem; border: 4px solid var(--bg); box-shadow: var(--shadow-sm); }
.profile-head .num { font-family: var(--font-head); font-weight: 800; font-size: 1.5rem; }

.breadcrumb { --bs-breadcrumb-divider-color: var(--muted); font-size: .88rem; }
.breadcrumb a { color: var(--muted); } .breadcrumb a:hover { color: var(--primary); }

/* ============================================================
   Homepage v2 — premium, illustration-led
   ============================================================ */
.illo { display: inline-flex; }
.illo svg { width: 100%; height: 100%; display: block; }

/* Motion primitives */
@keyframes floaty { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-14px) } }
@keyframes floaty-slow { 0%,100% { transform: translateY(0) rotate(0) } 50% { transform: translateY(-10px) rotate(-3deg) } }
@keyframes blob { 0%,100% { transform: translate(0,0) scale(1) } 33% { transform: translate(20px,-16px) scale(1.06) } 66% { transform: translate(-16px,12px) scale(.96) } }
@keyframes glowpulse { 0%,100% { opacity:.5 } 50% { opacity:.9 } }
@keyframes blink { 0%,90%,100% { opacity:1 } 95% { opacity:.2 } }

/* ---- Hero v2 ---- */
.hero2 { position: relative; overflow: hidden; background: var(--grad-hero); padding: clamp(3rem,6vw,5.5rem) 0 clamp(4rem,8vw,7rem); }
.hero2 .blob { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .5; z-index: 0; animation: blob 18s ease-in-out infinite; }
.hero2 .blob.b1 { width: 460px; height: 460px; background: #a5b4fc; top: -140px; left: -80px; }
.hero2 .blob.b2 { width: 380px; height: 380px; background: #7dd3fc; bottom: -160px; right: 8%; animation-delay: -6s; }
.hero2 .blob.b3 { width: 300px; height: 300px; background: #f0abfc; top: 20%; right: -80px; animation-delay: -11s; }
.hero2 .container { position: relative; z-index: 2; }
.hero2 h1 { font-size: clamp(2.6rem, 5.6vw, 4.6rem); font-weight: 800; line-height: 1.03; letter-spacing: -.03em; }
.hero2 .hero-lead { font-size: clamp(1.05rem,1.5vw,1.28rem); max-width: 540px; }

/* Big search */
.searchbig { display: flex; align-items: center; gap: .5rem; background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: var(--r-pill); padding: .7rem .7rem .7rem 1.4rem; box-shadow: var(--shadow-lg); max-width: 580px; }
.searchbig input { flex: 1; border: none; outline: none; background: transparent; color: var(--ink); font-size: 1.1rem; min-width: 0; }
.searchbig .mic, .searchbig .cam { color: var(--muted); font-size: 1.1rem; padding: .2rem; background: none; border: none; cursor: pointer; }
.searchbig .mic:hover, .searchbig .cam:hover { color: var(--primary); }
.hint-row { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.hint-row .lbl { color: var(--muted); font-size: .85rem; font-weight: 600; }

/* Hero illustrated scene */
.hero-scene { position: relative; aspect-ratio: 1/1; max-width: 460px; margin-inline: auto; }
.hero-scene .mascot { position: absolute; inset: 18% 18% auto 18%; width: 64%; animation: floaty 6s ease-in-out infinite; z-index: 2; }
.hero-scene .orb { position: absolute; width: 84px; animation: floaty-slow 7s ease-in-out infinite; filter: drop-shadow(0 12px 20px rgba(15,23,42,.14)); }
.hero-scene .o1 { top: 2%; left: 0; width: 96px; animation-delay: -1s; }
.hero-scene .o2 { top: 6%; right: 2%; animation-delay: -3s; }
.hero-scene .o3 { bottom: 8%; left: 4%; animation-delay: -2s; }
.hero-scene .o4 { bottom: 0; right: 8%; width: 92px; animation-delay: -4s; }
.hero-badge { position: absolute; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: .5rem .75rem; display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 700; font-size: .82rem; animation: floaty 5s ease-in-out infinite; }
.hero-badge.hb-a { top: 30%; left: -6%; } .hero-badge.hb-b { bottom: 20%; right: -6%; animation-delay: -2.5s; }
.hero-badge .dot { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; }
@media (max-width: 991px){ .hero-badge { display: none } }

/* Trust strip */
.trust-strip { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.4rem; color: var(--muted); font-weight: 600; font-size: .9rem; }
.trust-strip .school { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-family: var(--font-head); }

/* ---- Category rails ---- */
.cat-rail { display: flex; gap: 1rem; overflow-x: auto; padding: .5rem .25rem 1.25rem; scroll-snap-type: x mandatory; }
.cat-rail::-webkit-scrollbar { height: 8px; } .cat-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.cat-illo-card { scroll-snap-align: start; flex: 0 0 auto; width: 172px; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1rem 1rem; transition: transform .2s, box-shadow .2s, border-color .2s; }
.cat-illo-card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: color-mix(in srgb,var(--primary) 30%, var(--line)); }
.cat-illo-card .illo { width: 92px; height: 92px; margin: 0 auto .6rem; transition: transform .25s; }
.cat-illo-card:hover .illo { transform: scale(1.08) rotate(-3deg); }
.cat-illo-card h4 { font-size: 1rem; margin: 0; color: var(--ink); }
.cat-illo-card .count { display: inline-block; margin-top: .3rem; font-size: .72rem; font-weight: 700; color: var(--primary); background: color-mix(in srgb,var(--primary) 12%, transparent); border-radius: var(--r-pill); padding: .05rem .5rem; }
.cat-illo-card .desc { color: var(--muted); font-size: .78rem; margin: .35rem 0 0; }

/* ---- Featured resources (image-forward) ---- */
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 1.1rem; }
.res-card { border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-xs); transition: transform .2s, box-shadow .2s; }
.res-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.res-thumb { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; }
.res-thumb.t-science { background: radial-gradient(circle at 30% 20%, #EEF2FF, #E0E7FF); }
.res-thumb.t-arts { background: radial-gradient(circle at 30% 20%, #FCE7F3, #FBCFE8); }
.res-thumb .illo { width: 66%; height: 66%; transition: transform .3s; }
.res-card:hover .res-thumb .illo { transform: scale(1.08); }
.res-type { position: absolute; top: .6rem; left: .6rem; background: rgba(15,23,42,.7); color: #fff; font-size: .7rem; font-weight: 700; padding: .12rem .5rem; border-radius: var(--r-pill); }
.res-actions { position: absolute; top: .55rem; right: .55rem; display: flex; gap: .35rem; opacity: 0; transform: translateY(-6px); transition: .2s; }
.res-card:hover .res-actions { opacity: 1; transform: none; }
.res-actions .a { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.95); color: var(--ink); display: grid; place-items: center; border: none; cursor: pointer; }
.res-actions .a:hover { color: var(--primary); }
.res-info { padding: .8rem .9rem; }
.res-info h4 { font-size: .98rem; margin: 0; }
.res-info .meta { color: var(--muted); font-size: .78rem; }
.res-dl { display: flex; align-items: center; justify-content: space-between; margin-top: .5rem; }
.res-dl .btn { padding: .3rem .8rem; font-size: .82rem; }

/* ---- AI dark section ---- */
.ai-dark { position: relative; overflow: hidden; background: #0A0A1A; color: #E6E9F5; padding: clamp(4rem,7vw,6.5rem) 0; }
.ai-dark::before { content:""; position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(124,58,237,.5), transparent 60%); top: -180px; left: -120px; animation: glowpulse 6s ease-in-out infinite; }
.ai-dark::after { content:""; position: absolute; width: 520px; height: 520px; border-radius: 50%; background: radial-gradient(circle, rgba(6,182,212,.35), transparent 60%); bottom: -200px; right: -140px; animation: glowpulse 7s ease-in-out infinite; }
.ai-dark .container { position: relative; z-index: 2; }
.ai-dark h2 { color: #fff; }
.ai-dark .section-lead { color: #A9B0CE; }
.glass-tile { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: var(--r-lg); padding: 1.2rem; backdrop-filter: blur(8px); transition: transform .2s, background .2s, border-color .2s; }
.glass-tile:hover { transform: translateY(-4px); background: rgba(255,255,255,.09); border-color: rgba(124,58,237,.6); }
.glass-tile .gt-ico { width: 46px; height: 46px; border-radius: 13px; background: var(--grad-brand); display: grid; place-items: center; color: #fff; font-size: 1.25rem; margin-bottom: .7rem; box-shadow: 0 8px 20px rgba(124,58,237,.5); }
.glass-tile h3 { color: #fff; font-size: 1.05rem; margin: 0 0 .25rem; }
.glass-tile p { color: #A9B0CE; font-size: .88rem; margin: 0; }
/* AI chat mock */
.chat-mock { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: var(--r-lg); padding: 1.1rem; backdrop-filter: blur(10px); }
.chat-mock .head { display: flex; align-items: center; gap: .55rem; color: #A9B0CE; font-size: .85rem; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: .7rem; margin-bottom: .9rem; }
.chat-mock .dotlive { width: 9px; height: 9px; border-radius: 50%; background: #34D399; box-shadow: 0 0 0 4px rgba(52,211,153,.2); }
.bubble { max-width: 82%; padding: .6rem .85rem; border-radius: 14px; font-size: .92rem; margin-bottom: .7rem; line-height: 1.5; }
.bubble.me { margin-left: auto; background: var(--grad-brand); color: #fff; border-bottom-right-radius: 4px; }
.bubble.ai { background: rgba(255,255,255,.1); color: #E6E9F5; border-bottom-left-radius: 4px; }
.typing-cursor::after { content:"▋"; margin-left: 2px; animation: blink 1s step-end infinite; color: #7DF9FF; }

/* ---- Today wall ---- */
.today-wall { display: grid; grid-template-columns: repeat(6,1fr); gap: 1rem; }
.today-wall .w1 { grid-column: span 3; } .today-wall .w2 { grid-column: span 3; }
.today-wall .w { grid-column: span 2; }
.today-card { position: relative; display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; height: 100%; transition: transform .2s, box-shadow .2s; overflow: hidden; }
.today-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.today-card .illo { width: 62px; height: 62px; flex: none; }
.today-card .lbl { font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); }
.today-card h4 { font-size: 1rem; margin: .15rem 0 .4rem; line-height: 1.25; }
.today-timer { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-head); font-weight: 700; background: var(--bg-alt); border-radius: var(--r-pill); padding: .3rem .8rem; }
@media (max-width: 800px){ .today-wall { grid-template-columns: 1fr; } .today-wall .w, .today-wall .w1, .today-wall .w2 { grid-column: 1; } }

/* ---- Community preview ---- */
.thread { display: flex; gap: .9rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: .85rem 1rem; transition: border-color .2s, box-shadow .2s; }
.thread:hover { border-color: color-mix(in srgb,var(--primary) 30%,var(--line)); box-shadow: var(--shadow-xs); }
.thread .ans { flex: none; text-align: center; min-width: 48px; }
.thread .ans b { font-family: var(--font-head); font-size: 1.05rem; display: block; }
.thread .ans.solved b { color: var(--emerald); }
.thread .ans span { font-size: .68rem; color: var(--muted); }
.podium li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.podium li:last-child { border: none; }
.podium .rk { width: 22px; font-weight: 800; font-family: var(--font-head); color: var(--muted); }

/* ---- Dashboard mock (parent/teacher) ---- */
.browser-frame { border-radius: var(--r-lg); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--card); }
.browser-bar { display: flex; align-items: center; gap: .4rem; padding: .55rem .8rem; background: var(--bg-alt); border-bottom: 1px solid var(--line); }
.browser-bar .d { width: 11px; height: 11px; border-radius: 50%; }
.browser-body { padding: 1.1rem; }
.mini-kpi { display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem; margin-bottom: .9rem; }
.mini-kpi .k { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); padding: .6rem; }
.mini-kpi .k b { font-family: var(--font-head); font-size: 1.15rem; display: block; }
.mini-kpi .k span { font-size: .7rem; color: var(--muted); }
.chart-svg { width: 100%; height: 120px; }
.chart-svg .line { stroke: var(--primary); stroke-width: 3; fill: none; stroke-dasharray: 600; stroke-dashoffset: 600; }
.chart-svg.in .line { animation: draw 1.6s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0 } }
.seg-toggle { display: inline-flex; background: var(--bg-alt); border-radius: var(--r-pill); padding: .25rem; }
.seg-toggle button { border: none; background: transparent; padding: .4rem 1rem; border-radius: var(--r-pill); font-weight: 600; font-family: var(--font-head); color: var(--muted); cursor: pointer; }
.seg-toggle button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-xs); }

/* ---- Testimonials v2 ---- */
.tcard2 { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem; box-shadow: var(--shadow-xs); height: 100%; }
.tcard2 .who { display: flex; align-items: center; gap: .7rem; margin-bottom: .9rem; }
.tcard2 .who .illo, .tcard2 .who .av { width: 50px; height: 50px; border-radius: 50%; }
.verified { color: var(--sky); font-size: .85rem; }
.tcard2 .stars { color: var(--amber); }
.tcard2 .school { color: var(--muted); font-size: .78rem; }

/* ---- Stats counters ---- */
/* minmax(0,1fr) + min-width:0 lets the big numbers shrink instead of forcing
   the grid wider than the page (which caused horizontal scroll). */
.counter-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.counter { text-align: center; color: #fff; min-width: 0; }
.counter .ci { font-size: 1.35rem; opacity: .85; }
.counter .cn { font-family: var(--font-head); font-weight: 800; font-size: clamp(1.25rem, 2.1vw, 2rem); line-height: 1; }
.counter .cl { color: rgba(255,255,255,.85); font-size: .82rem; }
@media (max-width: 1100px){ .counter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 520px){ .counter-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }

/* ---- Mega footer additions ---- */
.footer-tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.footer-tags a { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .2rem .7rem; font-size: .8rem; }

/* ============================================================
   Homepage v2 — refinements (responsive categories, print cards,
   richer testimonials, mega footer)
   ============================================================ */
/* Tint washes reused across preview thumbs */
.t-science { background: radial-gradient(circle at 30% 25%, #EEF2FF, #E0E7FF); }
.t-arts { background: radial-gradient(circle at 30% 25%, #FCE7F3, #FBCFE8); }

/* Categories: responsive wrapping grid (was a horizontal rail) */
.cat-illo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
.cat-illo-grid .cat-illo-card { width: auto; }

/* Featured resources → downloadable "prints" */
.res-showcase { display: grid; grid-template-columns: 1.25fr 1.75fr; gap: 1.1rem; align-items: start; }
@media (max-width: 900px){ .res-showcase { grid-template-columns: 1fr; } }
.res-print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.res-print { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-xs); transition: transform .2s, box-shadow .2s; }
.res-print:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.print-mat { position: relative; aspect-ratio: 4/3; display: grid; place-items: center; overflow: hidden; background: var(--bg-alt); }
.print-mat::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(15,23,42,.10); border-radius: 10px; pointer-events: none; }
[data-bs-theme="dark"] .print-mat::after { border-color: rgba(255,255,255,.10); }
.res-illo { display: inline-grid; place-items: center; width: 100%; height: 100%; }
.res-illo .illo { width: 62%; height: 62%; transition: transform .3s; }
.res-print:hover .res-illo .illo { transform: scale(1.07); }
.res-img { width: 100%; height: 100%; object-fit: cover; }
.print-body { padding: .85rem .95rem; }
.print-body h3 { font-size: 1.3rem; margin: 0 0 .1rem; }
.print-body h4 { font-size: .98rem; margin: 0; }
.print-body .meta { color: var(--muted); font-size: .8rem; }
.print-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .45rem; }
.print-foot .rate { color: var(--amber); font-weight: 700; font-size: .78rem; white-space: nowrap; }
.print-dl { position: absolute; right: 12px; bottom: 12px; width: 38px; height: 38px; border-radius: 11px; background: var(--grad-brand); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); opacity: 0; transform: translateY(6px); transition: .2s; }
.res-print:hover .print-dl { opacity: 1; transform: none; color: #fff; }
.res-print-hero .print-mat { aspect-ratio: 16/11; }
.res-print-hero .print-body { padding: 1.3rem 1.4rem 1.5rem; }

/* Today wall lead cards */
.today-thumb { width: 62px; height: 62px; border-radius: 15px; display: grid; place-items: center; flex: none; }
.today-thumb .illo { width: 78%; height: 78%; }
.today-card--big { padding: 1.3rem; }
.today-card--big .today-thumb { width: 88px; height: 88px; }
.today-card--big h4 { font-size: 1.18rem; }

/* Testimonials v2 — featured + portraits */
.testi-layout { display: grid; grid-template-columns: 1.1fr .9fr; gap: 1.25rem; align-items: stretch; }
@media (max-width: 900px){ .testi-layout { grid-template-columns: 1fr; } }
.testi-feature { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-xl); padding: clamp(1.6rem,3vw,2.4rem); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.testi-quote-mark { position: absolute; top: .8rem; right: 1.4rem; font-size: 4.5rem; line-height: 1; color: color-mix(in srgb, var(--primary) 14%, transparent); }
.testi-feature blockquote { position: relative; font-family: var(--font-head); font-weight: 600; font-size: clamp(1.15rem, 2vw, 1.55rem); line-height: 1.42; color: var(--ink); margin: 0 0 1rem; }
.testi-side { display: grid; gap: 1.25rem; }
.tcard2 blockquote { color: var(--ink-soft); font-size: .95rem; line-height: 1.55; }
.av-illo { width: 54px; height: 54px; border-radius: 50%; overflow: hidden; flex: none; }
.testi-feature .av-illo { width: 66px; height: 66px; }
.school-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .6rem 1.4rem; margin-top: 2.2rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.school-strip .lbl { color: var(--muted); font-weight: 600; font-size: .85rem; }
.school-logo { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); font-family: var(--font-head); font-weight: 700; font-size: .92rem; }

/* Mega footer additions */
.footer-popular { border-bottom: 1px solid var(--line); }
.footer-popular h5 { font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--ink); }
.footer-seals { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; font-weight: 600; }

/* ============================================================
   Project Gallery
   ============================================================ */
.gimg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; }
.gimg-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-xs); transition: transform .2s, box-shadow .2s; }
.gimg-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.gimg-thumb { position: relative; display: block; aspect-ratio: 4/3; background: var(--bg-alt); overflow: hidden; }
.gimg-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gimg-card:hover .gimg-thumb img { transform: scale(1.06); }
.gimg-badge { position: absolute; top: .55rem; left: .55rem; background: rgba(15,23,42,.7); color: #fff; font-size: .68rem; font-weight: 700; padding: .1rem .45rem; border-radius: var(--r-pill); }
.gimg-actions { position: absolute; top: .5rem; right: .5rem; display: flex; gap: .35rem; opacity: 0; transform: translateY(-6px); transition: .2s; }
.gimg-card:hover .gimg-actions { opacity: 1; transform: none; }
.gimg-actions .ga { width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.95); color: var(--ink); display: grid; place-items: center; }
.gimg-info { padding: .75rem .85rem; }
.gimg-info h4 { font-size: .95rem; margin: 0 0 .15rem; line-height: 1.3; }
.gimg-info h4 a { color: var(--ink); }
.gimg-info h4 a:hover { color: var(--primary); }
.gimg-meta { color: var(--muted); font-size: .78rem; }
.gimg-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .5rem; color: var(--muted); font-size: .8rem; }

.gdetail-stage { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1rem; display: grid; place-items: center; }
.gdetail-stage img { max-width: 100%; height: auto; border-radius: var(--r-sm); box-shadow: var(--shadow-sm); }

/* ---------- Download studio (gallery detail) ---------- */
.dl-group { margin-bottom: 1rem; }
.dl-label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.dl-hint { display: block; font-size: .76rem; color: var(--muted); margin-top: .35rem; }

/* Segmented control (format, resolution) */
.dl-seg { display: flex; gap: .25rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-sm); padding: .25rem; }
.dl-seg-btn { flex: 1 1 0; min-width: 0; border: 0; background: transparent; color: var(--ink-soft); font: 600 .85rem/1 var(--font-body); padding: .5rem .3rem; border-radius: calc(var(--r-sm) - 5px); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.dl-seg-btn:hover { color: var(--ink); }
.dl-seg .dl-seg-btn.is-active { background: var(--card); color: var(--primary); font-weight: 700; box-shadow: var(--shadow-xs); }
.dl-seg-btn i { margin-right: .25rem; }

/* Aspect-ratio chips with a tiny proportional swatch */
.dl-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.dl-chip { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); font: 600 .8rem/1 var(--font-body); padding: .4rem .6rem; border-radius: var(--r-pill); cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.dl-chip:hover { border-color: var(--primary); color: var(--ink); }
.dl-chips .dl-chip.is-active { border-color: var(--primary); color: var(--primary); font-weight: 700; background: color-mix(in srgb, var(--primary) 12%, var(--card)); box-shadow: 0 0 0 1px var(--primary) inset; }
.dl-shape { display: inline-block; height: 13px; width: calc(13px * var(--rw) / var(--rh)); max-width: 22px; border: 1.5px solid currentColor; border-radius: 2px; opacity: .85; }

/* Readout + primary action */
.dl-readout { text-align: center; font: 700 .95rem/1 var(--font-head); color: var(--ink); background: var(--bg-alt); border-radius: var(--r-sm); padding: .6rem; margin-bottom: .6rem; }
.dl-download { font-weight: 700; }
.dl-foot { display: flex; flex-direction: column; gap: .25rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--line); font-size: .78rem; }
.dl-foot .text-muted { font-size: .78rem; }

/* ---------- Pricing page ---------- */
.pricing-toggle { display: inline-flex; gap: .25rem; background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-pill); padding: .3rem; margin-top: 1.1rem; }
.pt-btn { border: 0; background: transparent; color: var(--ink-soft); font: 600 .9rem/1 var(--font-body); padding: .5rem 1rem; border-radius: var(--r-pill); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.pricing-toggle .pt-btn.is-active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-xs); }
.pt-save { font-size: .72rem; font-weight: 700; color: #16a34a; margin-left: .25rem; }

.pricing-card { position: relative; display: flex; flex-direction: column; }
.pricing-card.is-featured { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.pricing-badge { position: absolute; top: -.8rem; left: 50%; transform: translateX(-50%); background: var(--grad-brand); color: #fff; font-size: .72rem; font-weight: 700; padding: .25rem .7rem; border-radius: var(--r-pill); white-space: nowrap; }
.pricing-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .35rem; }
.pricing-ico { width: 38px; height: 38px; flex-shrink: 0; display: grid; place-items: center; border-radius: 11px; background: var(--bg-alt); color: var(--primary); font-size: 1.15rem; }
.pricing-card.is-featured .pricing-ico { background: var(--grad-brand); color: #fff; }
.pricing-forwho { display: block; font-size: .74rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.pricing-price { min-height: 68px; }
.pp-amount { font: 800 2.2rem/1 var(--font-head); color: var(--ink); }
.pp-per { color: var(--muted); font-size: .9rem; margin-left: .15rem; }
.pp-note { color: var(--muted); font-size: .8rem; margin-top: .2rem; }
.cta-note { color: var(--muted); font-size: .76rem; }
.pricing-inherit { font-size: .82rem; font-weight: 700; color: var(--ink); padding: .6rem 0 .1rem; border-top: 1px solid var(--line); margin-top: .4rem; }
.pricing-feats li { display: flex; gap: .55rem; align-items: flex-start; padding: .35rem 0; color: var(--ink-soft); font-size: .92rem; }
.pricing-feats li i { color: #16a34a; margin-top: .15rem; flex-shrink: 0; }
.pricing-cta { background: var(--bg-alt); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 2.2rem 1.5rem; }

.pricing-trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 1.6rem; color: var(--muted); font-size: .88rem; }
.pricing-faq details { cursor: pointer; }
.pricing-faq summary { font-weight: 600; color: var(--ink); list-style: none; }
.pricing-faq summary::-webkit-details-marker { display: none; }
.pricing-faq summary::after { content: "\F282"; font-family: "bootstrap-icons"; float: right; color: var(--muted); transition: transform .2s; }
.pricing-faq details[open] summary::after { transform: rotate(180deg); }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .55s ease, transform .55s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce){
  .hero2 .blob, .hero-scene .mascot, .hero-scene .orb, .hero-badge { animation: none !important; }
}

/* ---------- AI suite (Module 5) ---------- */
.ai-output {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}
.ai-chat-log {
  height: 52vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--bg);
}
.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }
.ai-bubble {
  max-width: 82%;
  padding: .7rem 1rem;
  border-radius: var(--r-lg);
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.55;
  box-shadow: var(--shadow-xs);
}
.ai-msg-user .ai-bubble {
  background-image: var(--grad-cta);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-assistant .ai-bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
}
.ai-msg-note .ai-bubble { background: #fff4f4; border-color: #f5c2c7; color: #842029; }
.ai-chat-input {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  border-top: 1px solid var(--line);
  background: var(--card);
}
.ai-chat-input input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: .6rem 1rem;
  font-size: 1rem;
}
.ai-chat-input input:focus { outline: none; border-color: var(--primary-500, #6366f1); }
@media print {
  .navbar, .ai-chat-input, footer, #ai-submit, [onclick] { display: none !important; }
  .feature-card { box-shadow: none !important; border: none !important; }
}

/* ───────────────────────── Module 7 — Habit Trackers ───────────────────────── */
.tracker-list { display: flex; flex-direction: column; gap: .35rem; }
.tracker-row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .35rem; border-bottom: 1px solid var(--line);
}
.tracker-row:last-child { border-bottom: 0; }
.tracker-row.is-done .feature-ico { opacity: .55; }
.tracker-row .min-w-0 { min-width: 0; }
.tracker-streak {
  font-size: .78rem; font-weight: 700; font-family: var(--font-head);
  color: #EA580C; white-space: nowrap;
}
.tracker-donebtn { white-space: nowrap; }
.tracker-donebtn.is-done { color: #16A34A; background: color-mix(in srgb, #16A34A 14%, transparent); border-color: transparent; }

/* 7-day mini dot row */
.tracker-week { display: flex; gap: 4px; }
.tdot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--line); display: inline-block;
}
.tdot.on { background: linear-gradient(135deg,#34D399,#059669); }
.tdot.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.tracker-weeklabels span {
  width: 12px; text-align: center; font-size: .62rem; color: var(--muted);
  font-family: var(--font-head); text-transform: uppercase;
}

/* progress ring */
.tracker-progress-banner { background: color-mix(in srgb, var(--primary) 5%, var(--card)); }
.tracker-ring {
  --pct: 0; flex: 0 0 auto;
  width: 62px; height: 62px; border-radius: 50%;
  background: conic-gradient(var(--primary) calc(var(--pct) * 1%), var(--line) 0);
  display: grid; place-items: center;
}
.tracker-ring span {
  width: 48px; height: 48px; border-radius: 50%; background: var(--card);
  display: grid; place-items: center; font-family: var(--font-head);
  font-weight: 800; font-size: .8rem; color: var(--ink);
}

/* suggestion chips */
.suggest-chip {
  display: flex; align-items: center; gap: .7rem; text-align: left;
  width: 100%; padding: .6rem .8rem; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-lg); cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.suggest-chip:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-lg, 0 12px 30px rgba(2,6,23,.10)); }

/* 30-day heatmap on the detail page */
.tracker-heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; max-width: 320px; }
.hcell {
  aspect-ratio: 1 / 1; border-radius: 6px; background: var(--line);
}
.hcell.on { background: linear-gradient(135deg,#34D399,#059669); }
.hcell.today { outline: 2px solid var(--primary); outline-offset: 1px; }

/* ───────────────────────── Module 8 — Analytics charts ───────────────────────── */
.chart-svg { width: 100%; height: 200px; display: block; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-area { fill: color-mix(in srgb, var(--primary) 16%, transparent); stroke: none; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-dot  { fill: var(--primary); stroke: var(--card); stroke-width: 2; }
.chart-amber .chart-area { fill: color-mix(in srgb, #F59E0B 18%, transparent); }
.chart-amber .chart-line { stroke: #F59E0B; }
.chart-amber .chart-dot  { fill: #F59E0B; }
.bar-activities { fill: var(--primary); }
.bar-habits { fill: #10B981; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.legend-dot.bar-activities { background: var(--primary); }
.legend-dot.bar-habits { background: #10B981; }

/* ───────────────────────── Module 9 — Accessibility polish ───────────────────────── */
/* Active nav link (aria-current="page"). */
.brand-nav .nav-link.active { color: var(--primary); font-weight: 600; }
.brand-nav .nav-link.active::after {
  content: ""; display: block; height: 2px; border-radius: 2px;
  background: var(--primary); margin-top: 2px;
}
/* The skip-link target receives programmatic focus — don't show an outline box
   around the whole <main>, but keep it reachable for screen readers. */
#main:focus { outline: none; }
/* Respect reduced-motion globally (belt-and-braces with per-page guards). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
