:root {
  --purple-950: #2a0a55;
  --purple-900: #3a126f;
  --purple-800: #5420a4;
  --purple-700: #6f35d9;
  --purple-600: #8548f5;
  --purple-500: #9864ff;
  --purple-100: #efe8ff;
  --purple-50: #f8f5ff;
  --green-800: #176b4a;
  --green-700: #21865e;
  --green-500: #31b77b;
  --green-100: #dcf8eb;
  --yellow-500: #ffd447;
  --yellow-100: #fff6cf;
  --ink-950: #15111d;
  --ink-800: #2c2635;
  --ink-700: #4f4858;
  --ink-600: #6b6473;
  --ink-300: #cfc8d8;
  --ink-200: #e4deeb;
  --ink-100: #f2eef6;
  --white: #ffffff;
  --danger: #c33b4d;
  --success: #16875b;
  --shadow-sm: 0 8px 24px rgba(42, 10, 85, 0.08);
  --shadow-md: 0 18px 48px rgba(42, 10, 85, 0.13);
  --shadow-lg: 0 32px 80px rgba(42, 10, 85, 0.18);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink-950);
  background: #fbfaff;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
body.menu-open { overflow: hidden; }
img, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.section { padding: 92px 0; }
.section-sm { padding: 58px 0; }
.section-title { max-width: 760px; margin: 0 auto 48px; text-align: center; }
.section-title.align-left { margin-left: 0; text-align: left; }
.section-title .eyebrow { margin-bottom: 12px; }
.section-title h2 { margin: 0 0 14px; font-size: clamp(2rem, 4vw, 3.45rem); line-height: 1.07; letter-spacing: -0.04em; }
.section-title p { margin: 0; color: var(--ink-600); font-size: 1.08rem; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 13px; border-radius: 999px;
  color: var(--purple-800); background: var(--purple-100);
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.eyebrow.green { color: var(--green-800); background: var(--green-100); }
.eyebrow.yellow { color: #7b5b00; background: var(--yellow-100); }
.muted { color: var(--ink-600); }
.gradient-text { background: linear-gradient(100deg, var(--yellow-500), #fff2a9); background-clip: text; -webkit-background-clip: text; color: transparent; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.86); backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(111,53,217,.1);
}
.navbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-weight: 900; letter-spacing: -0.03em; font-size: 1.15rem; }
.brand-mark { width: 43px; height: 43px; border-radius: 14px; box-shadow: 0 9px 20px rgba(111,53,217,.25); }
.brand span:last-child small { display: block; margin-top: -4px; color: var(--ink-600); font-size: .63rem; letter-spacing: .13em; text-transform: uppercase; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { position: relative; color: var(--ink-700); font-weight: 700; font-size: .94rem; }
.nav-links a:hover, .nav-links a.active { color: var(--purple-700); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 3px; border-radius: 3px; background: var(--purple-600); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { border: 1px solid var(--ink-200); background: white; color: var(--ink-800); border-radius: 12px; padding: 9px 10px; font-weight: 700; font-size: .86rem; }
.menu-toggle { display: none; border: 0; background: var(--purple-100); color: var(--purple-900); width: 44px; height: 44px; border-radius: 13px; }
.menu-toggle span { width: 20px; height: 2px; background: currentColor; display: block; margin: 4px auto; transition: .2s; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-weight: 800; transition: transform .2s, box-shadow .2s, background .2s; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: white; background: linear-gradient(135deg, var(--purple-700), var(--purple-500)); box-shadow: 0 14px 30px rgba(111,53,217,.27); }
.btn-primary:hover { box-shadow: 0 18px 35px rgba(111,53,217,.35); }
.btn-secondary { color: var(--purple-800); background: var(--purple-100); }
.btn-outline { color: var(--ink-950); background: rgba(255,255,255,.85); border-color: var(--ink-200); }
.btn-sm { min-height: 40px; padding: 0 15px; font-size: .88rem; border-radius: 12px; }
.btn svg { width: 18px; height: 18px; }

/* Home hero */
.hero { position: relative; overflow: hidden; color: white; background:
  radial-gradient(circle at 12% 20%, rgba(255,212,71,.24), transparent 26%),
  radial-gradient(circle at 88% 12%, rgba(69,210,149,.22), transparent 25%),
  linear-gradient(135deg, var(--purple-950), var(--purple-700) 56%, #6a35c8);
}
.hero::after { content: ""; position: absolute; inset: auto -15% -48% 44%; height: 620px; border-radius: 50%; background: rgba(255,255,255,.06); transform: rotate(-14deg); }
.hero-grid { position: relative; z-index: 2; min-height: 710px; display: grid; grid-template-columns: 1.03fr .97fr; gap: 62px; align-items: center; padding: 82px 0 88px; }
.hero-copy h1 { margin: 18px 0 20px; font-size: clamp(3rem, 6vw, 5.8rem); line-height: .96; letter-spacing: -.062em; }
.hero-copy p { max-width: 640px; margin: 0; color: rgba(255,255,255,.82); font-size: clamp(1.05rem, 1.6vw, 1.27rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-actions .btn-secondary { color: var(--purple-950); background: var(--yellow-500); }
.hero-actions .btn-outline { color: white; background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.25); }
.hero-note { margin-top: 23px; display: flex; flex-wrap: wrap; gap: 18px; color: rgba(255,255,255,.77); font-size: .88rem; font-weight: 700; }
.hero-note span { display: inline-flex; gap: 7px; align-items: center; }
.hero-note span::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: var(--purple-950); background: var(--green-100); font-size: .75rem; }
.hero-visual { position: relative; min-height: 550px; }
.hero-image { position: absolute; inset: 24px 0 0 28px; width: calc(100% - 28px); height: 470px; object-fit: cover; border-radius: 34px; border: 1px solid rgba(255,255,255,.25); box-shadow: 0 38px 75px rgba(23,5,53,.37); }
.hero-image-shade { position: absolute; inset: 24px 0 auto 28px; height: 470px; border-radius: 34px; background: linear-gradient(180deg, transparent 40%, rgba(29,8,54,.75)); }
.floating-card { position: absolute; z-index: 3; padding: 16px 18px; border: 1px solid rgba(255,255,255,.3); border-radius: 18px; background: rgba(255,255,255,.91); color: var(--ink-950); box-shadow: var(--shadow-md); backdrop-filter: blur(12px); }
.floating-card strong { display: block; font-size: 1.05rem; }
.floating-card small { color: var(--ink-600); }
.floating-card.one { left: 0; bottom: 55px; }
.floating-card.two { right: -22px; top: 5px; }
.floating-card.three { right: 22px; bottom: 0; display: flex; align-items: center; gap: 11px; }
.mini-orb { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--green-100); color: var(--green-800); font-size: 1.35rem; }
.hero-stats { position: relative; z-index: 3; margin-top: -38px; }
.stats-panel { display: grid; grid-template-columns: repeat(3, 1fr); background: white; border: 1px solid var(--ink-100); border-radius: 24px; box-shadow: var(--shadow-md); overflow: hidden; }
.stat { padding: 28px 34px; display: flex; align-items: center; gap: 16px; }
.stat + .stat { border-left: 1px solid var(--ink-100); }
.stat-number { color: var(--purple-700); font-size: 2.25rem; line-height: 1; font-weight: 900; letter-spacing: -.05em; }
.stat p { margin: 0; color: var(--ink-600); font-size: .9rem; line-height: 1.4; }

/* Cards and grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card { background: white; border: 1px solid var(--ink-100); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.feature-card { padding: 28px; transition: transform .25s, box-shadow .25s; }
.feature-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.icon-box { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; color: var(--purple-800); background: var(--purple-100); margin-bottom: 18px; }
.icon-box.green { color: var(--green-800); background: var(--green-100); }
.icon-box.yellow { color: #7b5b00; background: var(--yellow-100); }
.icon-box svg { width: 25px; height: 25px; }
.feature-card h3 { margin: 0 0 9px; font-size: 1.18rem; }
.feature-card p { margin: 0; color: var(--ink-600); }

.problem-section { background: linear-gradient(180deg, #fbfaff, #f3edff); }
.problem-card { padding: 25px; border-top: 4px solid var(--purple-600); }
.problem-card .number { display: block; margin-bottom: 12px; color: var(--ink-300); font-size: 2.2rem; line-height: 1; font-weight: 900; }
.problem-card h3 { margin: 0 0 8px; }
.problem-card p { margin: 0; color: var(--ink-600); font-size: .96rem; }

.split { display: grid; grid-template-columns: .95fr 1.05fr; gap: 68px; align-items: center; }
.media-frame { position: relative; }
.media-frame img { width: 100%; min-height: 480px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.media-frame::before { content: ""; position: absolute; z-index: -1; inset: 22px -22px -22px 22px; border-radius: var(--radius-lg); background: var(--green-100); }
.check-list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.check-list li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; align-items: start; }
.check-list li::before { content: "✓"; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: var(--green-800); background: var(--green-100); font-weight: 900; }
.check-list strong { display: block; }
.check-list span { color: var(--ink-600); font-size: .95rem; }

/* Lesson cards */
.lesson-card { overflow: hidden; display: flex; flex-direction: column; min-height: 100%; transition: transform .25s, box-shadow .25s; }
.lesson-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.lesson-image { position: relative; height: 220px; overflow: hidden; background: var(--purple-100); }
.lesson-image img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s; }
.lesson-card:hover .lesson-image img { transform: scale(1.05); }
.lesson-badge { position: absolute; top: 15px; left: 15px; padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--purple-800); font-size: .76rem; font-weight: 900; box-shadow: var(--shadow-sm); }
.lesson-content { padding: 24px; display: flex; flex-direction: column; flex: 1; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 13px; color: var(--ink-600); font-size: .82rem; font-weight: 700; }
.lesson-content h3 { margin: 12px 0 8px; font-size: 1.35rem; line-height: 1.25; }
.lesson-content p { margin: 0 0 20px; color: var(--ink-600); }
.lesson-content .lesson-link { margin-top: auto; color: var(--purple-700); font-weight: 900; display: inline-flex; align-items: center; gap: 8px; }
.lesson-art { height: 220px; display: grid; place-items: center; position: relative; overflow: hidden; background: linear-gradient(135deg, #e8dcff, #dbf8ea); }
.adaptation-art .animal { font-size: 4.8rem; filter: drop-shadow(0 12px 15px rgba(42,10,85,.15)); }
.adaptation-art .leaf { position: absolute; font-size: 4rem; opacity: .5; }
.adaptation-art .leaf.one { left: 17px; bottom: 5px; transform: rotate(-15deg); }
.adaptation-art .leaf.two { right: 10px; top: 4px; transform: rotate(30deg); }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step-card { position: relative; padding: 26px; overflow: hidden; }
.step-card::after { counter-increment: step; content: "0" counter(step); position: absolute; top: 5px; right: 15px; color: var(--purple-100); font-size: 4.5rem; line-height: 1; font-weight: 900; }
.step-card > * { position: relative; z-index: 1; }
.step-card h3 { margin: 14px 0 7px; }
.step-card p { margin: 0; color: var(--ink-600); }

/* Outcomes */
.outcome-section { color: white; background:
  radial-gradient(circle at 20% 20%, rgba(255,212,71,.16), transparent 28%),
  linear-gradient(135deg, var(--purple-950), var(--purple-700)); }
.outcome-section .section-title p { color: rgba(255,255,255,.7); }
.outcome-card { padding: 28px; border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-md); background: rgba(255,255,255,.09); backdrop-filter: blur(8px); }
.outcome-card strong { display: block; margin: 14px 0 7px; font-size: 1.15rem; }
.outcome-card p { margin: 0; color: rgba(255,255,255,.72); }
.outcome-card .big { color: var(--yellow-500); font-size: 2.4rem; font-weight: 900; }

/* CTA */
.cta-panel { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 35px; align-items: center; padding: 48px; color: white; border-radius: var(--radius-lg); background: linear-gradient(135deg, var(--green-800), var(--green-500)); box-shadow: var(--shadow-md); }
.cta-panel::after { content: ""; position: absolute; width: 330px; height: 330px; border-radius: 50%; right: -120px; top: -150px; border: 50px solid rgba(255,255,255,.1); }
.cta-panel > * { position: relative; z-index: 1; }
.cta-panel h2 { margin: 0 0 8px; font-size: clamp(1.9rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.04em; }
.cta-panel p { margin: 0; color: rgba(255,255,255,.8); }
.cta-panel .btn { background: white; color: var(--green-800); }

/* Footer */
.site-footer { padding: 64px 0 24px; color: rgba(255,255,255,.78); background: var(--ink-950); }
.footer-grid { display: grid; grid-template-columns: 1.4fr .8fr .8fr 1fr; gap: 45px; padding-bottom: 42px; }
.site-footer .brand { color: white; }
.footer-about { max-width: 390px; margin: 18px 0 0; }
.footer-heading { margin: 0 0 16px; color: white; font-size: .92rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-links { display: grid; gap: 10px; }
.footer-links a:hover { color: white; }
.footer-bottom { display: flex; justify-content: space-between; gap: 20px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); font-size: .85rem; }

/* Inner page hero */
.page-hero { position: relative; overflow: hidden; padding: 82px 0 72px; color: white; background:
  radial-gradient(circle at 82% 18%, rgba(49,183,123,.24), transparent 24%),
  linear-gradient(135deg, var(--purple-950), var(--purple-700)); }
.page-hero::after { content: ""; position: absolute; width: 430px; height: 430px; right: -130px; bottom: -290px; border: 70px solid rgba(255,255,255,.06); border-radius: 50%; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: rgba(255,255,255,.67); font-size: .85rem; font-weight: 700; }
.breadcrumbs a:hover { color: white; }
.page-hero h1 { max-width: 800px; margin: 17px 0 14px; font-size: clamp(2.6rem, 5vw, 4.7rem); line-height: 1; letter-spacing: -.055em; }
.page-hero p { max-width: 760px; margin: 0; color: rgba(255,255,255,.78); font-size: 1.12rem; }
.page-hero .meta-row { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 12px; }
.meta-pill { padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.16); font-size: .82rem; font-weight: 800; }

/* Lesson page */
.lesson-layout { display: grid; grid-template-columns: 250px minmax(0,1fr); gap: 42px; align-items: start; }
.lesson-sidebar { position: sticky; top: 98px; padding: 20px; }
.lesson-sidebar h3 { margin: 0 0 13px; font-size: .92rem; color: var(--ink-600); text-transform: uppercase; letter-spacing: .08em; }
.lesson-nav { display: grid; gap: 6px; }
.lesson-nav a { padding: 10px 12px; border-radius: 10px; color: var(--ink-700); font-weight: 700; font-size: .9rem; }
.lesson-nav a:hover, .lesson-nav a.active { color: var(--purple-800); background: var(--purple-100); }
.lesson-main { min-width: 0; }
.lesson-block { padding: 34px; margin-bottom: 26px; }
.lesson-block h2 { margin: 0 0 14px; font-size: clamp(1.6rem, 3vw, 2.35rem); letter-spacing: -.035em; }
.lesson-block h3 { margin: 22px 0 8px; }
.lesson-block p { color: var(--ink-700); }
.lesson-block p:last-child { margin-bottom: 0; }
.lesson-cover { overflow: hidden; padding: 0; }
.lesson-cover img, .lesson-cover video { width: 100%; max-height: 500px; object-fit: cover; }
.cover-caption { padding: 20px 25px; display: flex; justify-content: space-between; gap: 16px; color: var(--ink-600); font-size: .88rem; }
.objective-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; list-style: none; padding: 0; margin: 0; }
.objective-list li { padding: 14px 15px; border-radius: 13px; background: var(--purple-50); border: 1px solid var(--purple-100); color: var(--ink-800); }
.objective-list li::before { content: "✓"; margin-right: 8px; color: var(--green-700); font-weight: 900; }

.process-stepper { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
.process-buttons { display: grid; align-content: start; gap: 8px; }
.process-btn { width: 100%; padding: 13px 14px; text-align: left; border: 1px solid var(--ink-100); border-radius: 12px; background: white; color: var(--ink-700); font-weight: 800; }
.process-btn.active { color: white; border-color: var(--purple-700); background: var(--purple-700); box-shadow: 0 9px 20px rgba(111,53,217,.2); }
.process-display { min-height: 260px; padding: 26px; border-radius: 18px; background: linear-gradient(135deg, var(--purple-50), #eefcf5); }
.process-display .process-icon { font-size: 3rem; }
.process-display h3 { margin: 12px 0 6px; }
.process-display p { margin: 0; }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.info-card { padding: 20px; border-radius: 16px; border: 1px solid var(--ink-100); background: #fff; }
.info-card strong { display: block; margin-bottom: 6px; }
.info-card p { margin: 0; font-size: .92rem; color: var(--ink-600); }
.info-card .symbol { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 12px; border-radius: 13px; background: var(--yellow-100); font-size: 1.25rem; }
.definition { padding: 20px 22px; border-left: 4px solid var(--purple-600); border-radius: 0 15px 15px 0; background: var(--purple-50); }
.definition strong { color: var(--purple-800); }
.callout { padding: 20px 22px; border-radius: 16px; background: var(--green-100); color: var(--green-800); }
.callout strong { color: var(--green-800); }
.diagram { width: 100%; max-height: 520px; object-fit: contain; border-radius: 18px; background: #f5fbff; border: 1px solid var(--ink-100); }

.soil-table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 15px; }
.soil-table th, .soil-table td { padding: 14px 13px; text-align: left; border-bottom: 1px solid var(--ink-100); }
.soil-table th { color: var(--purple-800); background: var(--purple-50); font-size: .85rem; }
.soil-table tr:last-child td { border-bottom: 0; }

/* Quiz */
.quiz { padding: 32px; background: linear-gradient(145deg, #fff, var(--purple-50)); }
.quiz-progress { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-bottom: 20px; color: var(--ink-600); font-size: .88rem; font-weight: 700; }
.progress-track { flex: 1; height: 9px; border-radius: 99px; background: var(--ink-100); overflow: hidden; }
.progress-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple-600), var(--green-500)); transition: width .35s; }
.quiz-question { margin: 0 0 18px; font-size: 1.35rem; line-height: 1.35; }
.quiz-options { display: grid; gap: 10px; }
.quiz-option { padding: 14px 16px; text-align: left; border: 1px solid var(--ink-200); border-radius: 13px; background: white; color: var(--ink-800); font-weight: 700; }
.quiz-option:hover { border-color: var(--purple-500); background: var(--purple-50); }
.quiz-option.selected { color: var(--purple-900); border-color: var(--purple-600); background: var(--purple-100); }
.quiz-option.correct { color: var(--success); border-color: var(--success); background: #e6f8f0; }
.quiz-option.wrong { color: var(--danger); border-color: var(--danger); background: #fff0f2; }
.quiz-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.quiz-feedback { display: none; margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-weight: 700; }
.quiz-feedback.show { display: block; }
.quiz-feedback.success { color: var(--success); background: #e6f8f0; }
.quiz-feedback.error { color: var(--danger); background: #fff0f2; }
.quiz-result { text-align: center; padding: 22px 0; }
.quiz-result .score-ring { width: 120px; height: 120px; display: grid; place-items: center; margin: 0 auto 18px; border-radius: 50%; border: 12px solid var(--purple-100); color: var(--purple-800); font-size: 2rem; font-weight: 900; }

/* Language demo */
.language-panel { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.language-tabs { display: flex; gap: 7px; flex-wrap: wrap; }
.language-tab { border: 1px solid var(--ink-200); background: white; color: var(--ink-700); padding: 9px 12px; border-radius: 10px; font-weight: 800; }
.language-tab.active { color: white; border-color: var(--purple-700); background: var(--purple-700); }
.translation-box { padding: 20px; border-radius: 16px; background: var(--yellow-100); }
.translation-box h3 { margin-top: 0; color: #6d5200; }
.translation-box p { color: #5a4a18; }

/* Lessons directory */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 16px; margin-bottom: 28px; }
.search-box { flex: 1; position: relative; }
.search-box input { width: 100%; padding: 13px 15px 13px 43px; border: 1px solid var(--ink-200); border-radius: 13px; background: #fff; outline: none; }
.search-box input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 4px var(--purple-100); }
.search-box svg { position: absolute; left: 15px; top: 50%; width: 18px; transform: translateY(-50%); color: var(--ink-600); }
.filter-chips { display: flex; gap: 7px; flex-wrap: wrap; }
.filter-chip { border: 1px solid var(--ink-200); background: white; color: var(--ink-700); padding: 10px 13px; border-radius: 11px; font-weight: 800; font-size: .86rem; }
.filter-chip.active { color: white; background: var(--purple-700); border-color: var(--purple-700); }
.lesson-item.hidden { display: none; }

/* About project */
.poster-grid { display: grid; grid-template-columns: .78fr 1.22fr; gap: 58px; align-items: start; }
.poster-preview { position: sticky; top: 100px; }
.poster-preview img { width: 100%; border-radius: 24px; box-shadow: var(--shadow-lg); }
.target-list { display: grid; gap: 14px; margin-top: 26px; }
.target-item { display: grid; grid-template-columns: 72px 1fr; gap: 16px; align-items: center; padding: 18px; }
.target-item .target-number { color: var(--purple-700); font-size: 1.65rem; font-weight: 900; }
.target-item h3 { margin: 0 0 3px; font-size: 1rem; }
.target-item p { margin: 0; color: var(--ink-600); font-size: .9rem; }

/* Toast */
.toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%, 20px); padding: 13px 18px; border-radius: 12px; color: white; background: var(--ink-950); box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

/* Responsive */
@media (max-width: 1050px) {
  .nav-links { position: fixed; inset: 77px 0 auto; display: none; padding: 24px 20px 30px; background: white; box-shadow: var(--shadow-md); flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; border-radius: 10px; }
  .nav-links a.active::after { display: none; }
  .nav-links a.active { background: var(--purple-100); }
  .menu-toggle { display: block; }
  .nav-actions .btn { display: none; }
  .hero-grid { grid-template-columns: 1fr; min-height: auto; gap: 35px; padding-top: 68px; }
  .hero-visual { min-height: 520px; max-width: 760px; width: 100%; margin-inline: auto; }
  .split { grid-template-columns: 1fr; gap: 45px; }
  .split .media-frame { order: -1; max-width: 760px; }
  .grid-4, .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.2fr 1fr 1fr; }
  .footer-grid > :last-child { grid-column: 1 / -1; }
  .lesson-layout { grid-template-columns: 1fr; }
  .lesson-sidebar { position: static; }
  .lesson-nav { display: flex; overflow-x: auto; padding-bottom: 4px; }
  .lesson-nav a { white-space: nowrap; }
  .poster-grid { grid-template-columns: 1fr; }
  .poster-preview { position: static; max-width: 520px; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 28px), var(--container)); }
  .section { padding: 70px 0; }
  .section-sm { padding: 46px 0; }
  .navbar { min-height: 70px; }
  .nav-links { inset: 71px 0 auto; }
  .brand span:last-child { font-size: 1rem; }
  .lang-switch { display: none; }
  .hero-grid { padding: 56px 0 72px; }
  .hero-copy h1 { font-size: clamp(3rem, 14vw, 4.5rem); }
  .hero-visual { min-height: 430px; }
  .hero-image, .hero-image-shade { inset-left: 0; left: 0; width: 100%; height: 360px; }
  .floating-card.two { right: 8px; }
  .floating-card.one { left: 8px; bottom: 17px; }
  .floating-card.three { display: none; }
  .hero-stats { margin-top: -24px; }
  .stats-panel { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--ink-100); }
  .stat { padding: 21px 24px; }
  .grid-2, .grid-3, .grid-4, .steps, .info-grid { grid-template-columns: 1fr; }
  .lesson-image, .lesson-art { height: 235px; }
  .cta-panel { grid-template-columns: 1fr; padding: 34px 28px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child, .footer-grid > :last-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; }
  .page-hero { padding: 65px 0 58px; }
  .lesson-block { padding: 25px 20px; }
  .objective-list { grid-template-columns: 1fr; }
  .process-stepper { grid-template-columns: 1fr; }
  .process-buttons { grid-template-columns: repeat(2, 1fr); }
  .process-btn { text-align: center; font-size: .85rem; }
  .soil-table { display: block; overflow-x: auto; white-space: nowrap; }
  .cover-caption { flex-direction: column; }
  .language-panel { grid-template-columns: 1fr; }
  .filter-bar { align-items: stretch; flex-direction: column; }
  .poster-grid { gap: 34px; }
}

@media (max-width: 430px) {
  .hero-actions .btn { width: 100%; }
  .hero-visual { min-height: 390px; }
  .hero-image, .hero-image-shade { height: 320px; }
  .floating-card { padding: 12px 14px; }
  .floating-card.two { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-grid > * { grid-column: auto !important; }
  .process-buttons { grid-template-columns: 1fr; }
  .quiz { padding: 24px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Mathematics: bearings lesson */
.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink-950); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cover-caption a { color: var(--purple-700); font-weight: 900; }
.bearing-number-grid { grid-template-columns: repeat(4, 1fr); }
.bearing-number { margin-bottom: 10px; color: var(--purple-700); font-size: 2rem; line-height: 1; font-weight: 900; letter-spacing: -.04em; }
.worked-example { padding: 24px; border: 1px solid var(--ink-100); border-radius: 18px; background: linear-gradient(145deg, #fff, var(--purple-50)); }
.worked-example > span { display: inline-block; margin-bottom: 8px; color: var(--green-800); font-size: .78rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.worked-example h3 { margin: 0 0 8px; }
.worked-example p { margin: 0 0 8px; }
.worked-example ol { margin-bottom: 0; }
.formula-box { display: grid; gap: 8px; margin-top: 18px; padding: 22px; border-left: 5px solid var(--yellow-500); border-radius: 0 16px 16px 0; background: var(--yellow-100); color: #5a4a18; }
.formula-box strong { color: #6d5200; font-size: 1.05rem; }
.warning-list li::before { content: "!"; color: #7b5b00; background: var(--yellow-100); }
.lesson-pagination { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .bearing-number-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .bearing-number-grid { grid-template-columns: 1fr; }
  .lesson-pagination .btn { width: 100%; }
}

/* =========================================================
   StemSphere legacy interactive lesson layer
   ========================================================= */
:root {
  --mobile-nav-height: 72px;
  --surface: #ffffff;
  --surface-soft: #f8f5ff;
  --page: #fbfaff;
  --text: #15111d;
  --text-soft: #6b6473;
  --line: #e4deeb;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --surface: #21192b;
  --surface-soft: #2b2039;
  --page: #15101c;
  --text: #f7f3fb;
  --text-soft: #c7bdd1;
  --line: #40334e;
  --ink-950: #f7f3fb;
  --ink-800: #eee7f4;
  --ink-700: #d5cadd;
  --ink-600: #b8acbf;
  --ink-300: #71647a;
  --ink-200: #44374f;
  --ink-100: #34283f;
  --purple-50: #2d203d;
  --purple-100: #3b2852;
  --green-100: #173e31;
  --yellow-100: #453b18;
  --white: #21192b;
  --shadow-sm: 0 8px 24px rgba(0,0,0,.23);
  --shadow-md: 0 18px 48px rgba(0,0,0,.32);
  --shadow-lg: 0 32px 80px rgba(0,0,0,.42);
}

html[data-theme="dark"] body,
html[data-theme="dark"] .problem-section { background: var(--page); }
html[data-theme="dark"] .card,
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .mobile-bottom-nav,
html[data-theme="dark"] .chatbot-panel,
html[data-theme="dark"] .quiz-option,
html[data-theme="dark"] .filter-chip,
html[data-theme="dark"] .language-tab,
html[data-theme="dark"] .process-btn,
html[data-theme="dark"] .info-card,
html[data-theme="dark"] .worked-example,
html[data-theme="dark"] .search-box input,
html[data-theme="dark"] input,
html[data-theme="dark"] select { background: var(--surface); color: var(--text); border-color: var(--line); }
html[data-theme="dark"] .lesson-card,
html[data-theme="dark"] .quiz { background: linear-gradient(145deg, var(--surface), var(--surface-soft)); }
html[data-theme="dark"] .translation-box { background: #3b3218; }
html[data-theme="dark"] .translation-box p { color: #f4e8b2; }
html[data-theme="dark"] .definition,
html[data-theme="dark"] .process-display { background: var(--surface-soft); }
html[data-theme="dark"] .lesson-image img { background: #f3eff8; }
html[data-theme="dark"] .chatbot-notice { background: #2d203d; }
html[data-theme="dark"] .chat-message.bot p { background: #2d203d; }
html[data-theme="dark"] .chat-message.user p { background: #6f35d9; color: white; }

body {
  background: var(--page);
  color: var(--text);
  padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
}
body.chatbot-open { overflow: hidden; }
.container { width: min(calc(100% - 24px), var(--container)); }
.section { padding: 54px 0; }
.section-sm { padding: 38px 0; }
.section-title { margin-bottom: 30px; }
.section-title h2 { font-size: clamp(1.9rem, 9vw, 3.45rem); }
.section-title p { font-size: 1rem; }

/* Mobile header first */
.site-header { background: rgba(255,255,255,.94); }
.navbar { min-height: 64px; gap: 10px; }
.brand { gap: 8px; font-size: 1rem; min-width: 0; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; }
.brand span:last-child small { font-size: .55rem; }
.nav-links {
  position: fixed;
  inset: 65px 10px auto;
  display: none;
  padding: 12px;
  max-height: calc(100vh - 155px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.nav-links.open { display: flex; }
.nav-links a { padding: 12px 14px; border-radius: 11px; }
.nav-links a.active { background: var(--purple-100); color: var(--purple-700); }
.nav-links a.active::after { display: none; }
.nav-actions { gap: 7px; }
.nav-actions .btn,
.lang-switch { display: none; }
.menu-toggle { display: block; width: 42px; height: 42px; }
.theme-toggle {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
}

/* Mobile home hero */
.hero-grid { min-height: auto; grid-template-columns: 1fr; gap: 28px; padding: 48px 0 60px; }
.hero-copy h1 { font-size: clamp(2.65rem, 14vw, 4.6rem); }
.hero-copy p { font-size: 1rem; }
.hero-actions { display: grid; grid-template-columns: 1fr; }
.hero-actions .btn { width: 100%; }
.hero-note { gap: 10px 14px; }
.hero-visual { min-height: 360px; }
.hero-image,
.hero-image-shade { inset: 0; left: 0; width: 100%; height: 310px; border-radius: 24px; }
.floating-card { padding: 11px 13px; border-radius: 14px; }
.floating-card.one { left: 8px; bottom: 4px; }
.floating-card.two { display: none; }
.floating-card.three { display: none; }
.hero-stats { margin-top: -20px; }
.stats-panel { grid-template-columns: 1fr; border-radius: 20px; }
.stat { padding: 18px 20px; }
.stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
.stat-number { font-size: 1.85rem; }

.grid-2,
.grid-3,
.grid-4,
.steps,
.info-grid,
.split,
.poster-grid,
.study-dashboard-grid,
.tools-grid,
.progress-stats,
.progress-columns { grid-template-columns: 1fr; }
.split { gap: 34px; }
.media-frame img { min-height: 310px; }
.lesson-image,
.lesson-art { height: 220px; }
.lesson-content { padding: 21px; }
.lesson-meta { gap: 7px; }
.lesson-meta span { font-size: .75rem; }
.lesson-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.icon-action {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--purple-700);
  font-size: 1.5rem;
}
.icon-action.active { color: #8a6500; background: var(--yellow-100); }

.page-hero { padding: 52px 0 48px; }
.page-hero h1 { font-size: clamp(2.3rem, 12vw, 4.7rem); }
.page-hero p { font-size: 1rem; }
.meta-row { gap: 8px !important; }
.meta-pill { font-size: .75rem; }

.lesson-section { padding-top: 24px; }
.lesson-layout { grid-template-columns: 1fr; gap: 18px; }
.lesson-sidebar { position: static; padding: 12px; overflow: hidden; }
.lesson-sidebar h3 { padding-inline: 8px; }
.lesson-nav { display: flex; overflow-x: auto; gap: 4px; padding-bottom: 4px; scrollbar-width: thin; }
.lesson-nav a { white-space: nowrap; flex: 0 0 auto; }
.lesson-block { padding: 23px 18px; margin-bottom: 18px; }
.lesson-cover { margin-bottom: 18px; }
.lesson-cover img,
.lesson-cover video { max-height: 330px; }
.cover-caption { padding: 16px 18px; flex-direction: column; gap: 3px; }
.objective-list { grid-template-columns: 1fr; }
.process-stepper { grid-template-columns: 1fr; }
.process-buttons { grid-template-columns: 1fr 1fr; }
.process-btn { text-align: center; font-size: .82rem; }
.language-panel { grid-template-columns: 1fr; }
.quiz { padding: 24px 17px; }
.quiz-progress { align-items: flex-start; flex-direction: column; }
.progress-track { width: 100%; }
.quiz-actions .btn { width: 100%; }
.lesson-pagination { display: grid; }
.lesson-pagination .btn { width: 100%; }
.table-wrap,
.soil-table { overflow-x: auto; display: block; }
.soil-table { min-width: 610px; }

/* Lesson utility strip */
.lesson-utility-wrap {
  position: sticky;
  top: 64px;
  z-index: 35;
  background: rgba(251,250,255,.93);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
html[data-theme="dark"] .lesson-utility-wrap { background: rgba(21,16,28,.93); }
.lesson-utility-bar { display: flex; gap: 7px; overflow-x: auto; padding-block: 9px; scrollbar-width: none; }
.lesson-utility-bar::-webkit-scrollbar { display: none; }
.lesson-utility-btn {
  min-height: 39px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  font-size: .78rem;
}
.lesson-utility-btn.primary { color: white; background: var(--purple-700); border-color: var(--purple-700); }
.lesson-utility-btn.completed { background: var(--green-700); border-color: var(--green-700); color: white; }
.lesson-utility-btn.active { color: #7b5b00; background: var(--yellow-100); }
.reading-progress-track { position: fixed; inset: 0 0 auto; z-index: 90; height: 4px; background: transparent; }
.reading-progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--yellow-500), var(--green-500), var(--purple-500)); }

/* Dashboard and tools */
.study-dashboard-section { background: linear-gradient(180deg, var(--page), var(--surface-soft)); }
.study-dashboard-grid { display: grid; gap: 14px; }
.dashboard-card { padding: 22px; }
.dashboard-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 15px; background: var(--purple-100); color: var(--purple-800); font-size: 1.35rem; }
.dashboard-card h3 { margin: 0 0 8px; }
.small-label { display: block; margin-bottom: 4px; color: var(--green-700); font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.button-link { border: 0; padding: 0; background: none; }
.daily-answer { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--green-100); color: var(--green-800); font-weight: 800; }
.tool-banner { display: grid; gap: 18px; margin-top: 18px; padding: 25px; border-radius: 23px; color: white; background: linear-gradient(135deg, var(--purple-950), var(--purple-700)); }
.tool-banner h3 { margin: 13px 0 0; font-size: 1.35rem; }

.tools-grid { display: grid; gap: 18px; }
.tool-card { padding: 23px; }
.tool-card h3 { margin: 0 0 8px; }
.tool-card label { display: grid; gap: 7px; color: var(--text-soft); font-size: .86rem; font-weight: 800; }
.tool-card input { width: 100%; min-height: 49px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); outline: none; }
.tool-card input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 4px var(--purple-100); }
.tool-input-row { display: grid; gap: 9px; margin-top: 11px; }
.input-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 13px 0; }
.full-width { width: 100%; }
.tool-result { margin-top: 14px; padding: 13px; border-radius: 12px; background: var(--purple-50); color: var(--purple-800); }
.tool-result.error { background: #fff0f2; color: var(--danger); }
.timer-display { margin: 16px 0; font-size: clamp(3.2rem, 18vw, 5rem); line-height: 1; font-weight: 900; letter-spacing: -.06em; text-align: center; color: var(--purple-700); }
.timer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.flashcard { width: 100%; min-height: 210px; display: grid; place-content: center; gap: 12px; margin: 15px 0; padding: 22px; border: 1px solid var(--purple-100); border-radius: 20px; background: linear-gradient(145deg, var(--purple-50), var(--yellow-100)); color: var(--text); text-align: center; }
.flashcard.revealed { background: linear-gradient(145deg, var(--green-100), var(--purple-50)); }
.flashcard-label { color: var(--purple-700); font-size: .75rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.flashcard strong { font-size: 1.25rem; }
.glossary-search { max-width: 620px; margin-bottom: 22px; }
.glossary-grid { display: grid; gap: 12px; }
.glossary-item { padding: 17px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.glossary-item h3 { margin: 0 0 5px; color: var(--purple-700); font-size: 1rem; }
.glossary-item p { margin: 0; color: var(--text-soft); font-size: .9rem; }
.glossary-item.hidden { display: none; }

.progress-board { display: grid; gap: 24px; }
.progress-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.progress-stat { padding: 18px; text-align: center; }
.progress-stat strong { display: block; color: var(--purple-700); font-size: 1.8rem; line-height: 1; }
.progress-stat span { display: block; margin-top: 7px; color: var(--text-soft); font-size: .78rem; }
.progress-columns { display: grid; gap: 28px; }
.progress-columns h3 { margin-top: 0; }
.progress-list { display: grid; gap: 9px; }
.progress-row { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 15px; }
.progress-row strong,
.progress-row small { display: block; }
.progress-row small { margin-top: 3px; color: var(--text-soft); }
.bookmark-list { display: flex; flex-wrap: wrap; gap: 8px; }
.bookmark-chip { padding: 9px 12px; border-radius: 999px; background: var(--yellow-100); color: #735700; font-size: .82rem; font-weight: 800; }
.empty-state { padding: 25px; text-align: center; }
.text-button { margin-top: 20px; padding: 0; border: 0; background: none; color: var(--danger); font-weight: 800; }
.lesson-results-note { margin: -10px 0 18px; color: var(--text-soft); font-size: .88rem; font-weight: 700; }

/* New lesson visuals */
.ph-scale { display: flex; justify-content: space-between; gap: 10px; margin: 20px 0; padding: 18px 14px; border-radius: 16px; color: #211522; background: linear-gradient(90deg,#d84252 0%,#f78a42 22%,#ffd447 45%,#64c985 60%,#49aee8 80%,#7543c7 100%); font-size: .78rem; font-weight: 900; }
.flow-symbols { display: grid; gap: 13px; }
.flow-symbols > div { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; }
.flow-symbols strong,
.flow-symbols small { display: block; }
.flow-symbols small { color: var(--text-soft); }
.flow-shape { min-height: 56px; display: grid; place-items: center; padding: 9px; color: var(--purple-900); background: var(--yellow-100); border: 3px solid var(--purple-600); font-weight: 900; }
.flow-shape.oval { border-radius: 50%; }
.flow-shape.rectangle { border-radius: 6px; }
.flow-shape.diamond { transform: rotate(45deg); width: 68px; height: 68px; margin-inline: auto; }
.flow-shape.diamond::first-line { transform: rotate(-45deg); }
.flow-shape.parallelogram { transform: skew(-12deg); }
.code-card { margin: 18px 0; overflow-x: auto; padding: 20px; border-radius: 17px; color: #eaf9f2; background: #181120; }
.code-card pre { margin: 0; font: 700 .92rem/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* Chatbot */
.chatbot-fab {
  position: fixed;
  z-index: 72;
  right: 13px;
  bottom: calc(var(--mobile-nav-height) + 13px + env(safe-area-inset-bottom));
  min-height: 49px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--purple-700), var(--purple-500));
  box-shadow: 0 16px 38px rgba(42,10,85,.35);
}
.chatbot-fab span { font-size: 1.25rem; }
.chatbot-fab strong { font-size: .82rem; }
.chatbot-panel {
  position: fixed;
  z-index: 80;
  inset: auto 8px calc(var(--mobile-nav-height) + 8px + env(safe-area-inset-bottom));
  height: min(690px, calc(100dvh - var(--mobile-nav-height) - 18px));
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 23px 23px 16px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(24px) scale(.98);
  transition: .22s ease;
}
.chatbot-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0) scale(1); }
.chatbot-header { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 13px; color: white; background: linear-gradient(135deg, var(--purple-950), var(--purple-700)); }
.chatbot-header > div { display: flex; align-items: center; gap: 10px; }
.bot-avatar { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 13px; color: var(--purple-950); background: var(--yellow-500); font-weight: 900; }
.chatbot-header strong,
.chatbot-header small { display: block; }
.chatbot-header small { color: rgba(255,255,255,.72); font-size: .68rem; }
.chatbot-header button { width: 38px; height: 38px; border: 0; border-radius: 12px; color: white; background: rgba(255,255,255,.13); font-size: 1.6rem; }
.chatbot-notice { padding: 9px 13px; color: var(--text-soft); background: var(--purple-50); font-size: .72rem; line-height: 1.4; }
.chatbot-messages { overflow-y: auto; padding: 15px 12px; }
.chat-message { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 12px; }
.chat-message.user { align-items: flex-end; }
.chat-message-label { margin: 0 7px 3px; color: var(--text-soft); font-size: .65rem; font-weight: 800; }
.chat-message p { max-width: 88%; margin: 0; padding: 10px 12px; border-radius: 15px 15px 15px 4px; background: var(--purple-50); color: var(--text); font-size: .86rem; line-height: 1.5; }
.chat-message.user p { border-radius: 15px 15px 4px 15px; color: white; background: var(--purple-700); }
.chatbot-prompts { display: flex; gap: 6px; overflow-x: auto; padding: 8px 11px; border-top: 1px solid var(--line); scrollbar-width: none; }
.chatbot-prompts button { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font-size: .72rem; font-weight: 800; }
.chatbot-form { display: grid; grid-template-columns: 1fr 44px; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chatbot-form input { min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); outline: none; }
.chatbot-form input:focus { border-color: var(--purple-500); box-shadow: 0 0 0 3px var(--purple-100); }
.chatbot-form button { border: 0; border-radius: 12px; color: white; background: var(--purple-700); font-size: 1.2rem; }

/* Mobile bottom navigation */
.mobile-bottom-nav {
  position: fixed;
  z-index: 70;
  inset: auto 0 0;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 8px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  box-shadow: 0 -10px 30px rgba(42,10,85,.08);
}
.mobile-bottom-nav a,
.mobile-bottom-nav button { display: grid; place-items: center; align-content: center; gap: 1px; border: 0; border-radius: 13px; background: transparent; color: var(--text-soft); }
.mobile-bottom-nav span { font-size: 1.3rem; line-height: 1; }
.mobile-bottom-nav small { font-size: .65rem; font-weight: 800; }
.mobile-bottom-nav .active { color: var(--purple-700); background: var(--purple-100); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (min-width: 560px) {
  .container { width: min(calc(100% - 34px), var(--container)); }
  .hero-actions { display: flex; }
  .hero-actions .btn { width: auto; }
  .study-dashboard-grid,
  .tools-grid,
  .glossary-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-input-row { grid-template-columns: 1fr auto; }
  .flow-symbols { grid-template-columns: repeat(2, 1fr); }
  .progress-stats { grid-template-columns: repeat(4, 1fr); }
  .lesson-pagination { display: flex; }
}

@media (min-width: 760px) {
  .section { padding: 72px 0; }
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .lesson-image,
  .lesson-art { height: 245px; }
  .objective-list { grid-template-columns: repeat(2, 1fr); }
  .process-stepper { grid-template-columns: 200px 1fr; }
  .process-buttons { grid-template-columns: 1fr; }
  .process-btn { text-align: left; }
  .language-panel { grid-template-columns: auto 1fr; }
  .tool-banner { grid-template-columns: 1fr auto; align-items: center; }
  .tool-banner .btn { justify-self: end; }
  .progress-columns { grid-template-columns: 1.35fr .65fr; }
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .mobile-bottom-nav { display: none; }
  .chatbot-fab { right: 24px; bottom: 24px; }
  .chatbot-panel { inset: auto 24px 84px auto; width: 390px; height: min(650px, calc(100vh - 110px)); border-radius: 23px; }
  .study-dashboard-grid { grid-template-columns: repeat(4, 1fr); }
  .tools-grid { grid-template-columns: repeat(3, 1fr); }
  .glossary-grid { grid-template-columns: repeat(3, 1fr); }
  .info-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .lesson-cover img,
  .lesson-cover video { max-height: 500px; }
  .lesson-block { padding: 34px; }
  .quiz { padding: 32px; }
  .quiz-actions .btn { width: auto; }
  .lesson-utility-wrap { top: 76px; }
}

@media (min-width: 1080px) {
  .navbar { min-height: 76px; gap: 22px; }
  .brand { font-size: 1.15rem; }
  .brand-mark { width: 43px; height: 43px; }
  .nav-links {
    position: static;
    display: flex;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex-direction: row;
    align-items: center;
    gap: 22px;
  }
  .nav-links a { padding: 0; }
  .nav-links a.active { background: transparent; }
  .nav-links a.active::after { display: block; }
  .menu-toggle { display: none; }
  .nav-actions .btn,
  .lang-switch { display: inline-flex; }
  .hero-grid { grid-template-columns: 1.03fr .97fr; gap: 58px; padding: 78px 0 86px; }
  .hero-visual { min-height: 550px; }
  .hero-image,
  .hero-image-shade { inset: 24px 0 auto 28px; width: calc(100% - 28px); height: 470px; border-radius: 34px; }
  .floating-card.one { left: 0; bottom: 55px; }
  .floating-card.two { display: block; right: -18px; top: 5px; }
  .floating-card.three { display: flex; right: 22px; bottom: 0; }
  .stats-panel { grid-template-columns: repeat(3, 1fr); }
  .stat + .stat { border-top: 0; border-left: 1px solid var(--line); }
  .split { grid-template-columns: .95fr 1.05fr; gap: 68px; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .lesson-layout { grid-template-columns: 250px minmax(0,1fr); gap: 42px; }
  .lesson-sidebar { position: sticky; top: 142px; }
  .lesson-nav { display: grid; overflow: visible; }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-panel { transition: none; }
}

/* Footer mobile-first correction */
.footer-grid { grid-template-columns: 1fr; gap: 30px; }
@media (min-width: 600px) { .footer-grid { grid-template-columns: 1.2fr 1fr; } }
@media (min-width: 950px) { .footer-grid { grid-template-columns: 1.35fr .75fr .75fr 1fr; } .footer-grid > :last-child { grid-column: auto; } }
