/* =====================================================================
   LearnWith theme — playful pre-school design system
   Part 1: tokens, base, buttons, header, footer, shapes, reveal effects
   ===================================================================== */

:root {
	--ink: #1f2544;
	--ink-soft: #5a6080;
	--paper: #fffaf0;
	--paper-2: #fff3dc;
	--card: #ffffff;
	--line: #eadfc8;
	--chalk: #1f4d3f;
	--chalk-2: #173c31;
	--sun: #ffb400; --sun-d: #c98800;
	--tomato: #ff5a5f; --tomato-d: #c9323a;
	--sky: #00a6ed; --sky-d: #0077aa;
	--grass: #37b24d; --grass-d: #237a33;
	--grape: #8b5cf6; --grape-d: #5b3cc4;
	--pink: #ff7ab6; --pink-d: #d24a8b;
	--orange: #ff8a00; --orange-d: #b86200;
	--teal: #13b5a6; --teal-d: #0b7d72;
	--font-head: 'Fredoka', system-ui, sans-serif;
	--font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--font-hand: 'Caveat', cursive;
	--radius: 24px;
	--container: 1200px;
	--header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body {
	margin: 0; color: var(--ink); font: 400 1.0625rem/1.65 var(--font-body);
	background: var(--paper) radial-gradient(circle, rgba(31, 37, 68, .07) 1.2px, transparent 1.3px) 0 0 / 26px 26px;
	-webkit-font-smoothing: antialiased; overflow-x: clip;
}
img, svg, video { max-width: 100%; height: auto; }
a { color: var(--grape-d); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--tomato); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); }
p { margin: 0 0 1em; }
code { font-family: 'JetBrains Mono', monospace; font-size: .9em; background: #f2efff; color: var(--grape-d); padding: .1em .4em; border-radius: 6px; }
:focus-visible { outline: 3px solid var(--grape); outline-offset: 3px; border-radius: 6px; }
::selection { background: #ffe08a; }

.container { width: min(var(--container), 100% - 32px); margin-inline: auto; }
.narrow { width: min(820px, 100% - 32px); margin-inline: auto; }
.center { text-align: center; }
.stack { display: grid; gap: 16px; }
.section { position: relative; padding: clamp(56px, 8vw, 110px) 0; }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.section-head p { font-size: 1.15rem; color: var(--ink-soft); }
.eyebrow { display: inline-block; font: 700 .85rem/1 var(--font-head); letter-spacing: .12em; text-transform: uppercase; padding: 8px 14px; border-radius: 99px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); margin-bottom: 16px; transform: rotate(-2deg); }
.lead { font-size: clamp(1.1rem, 1.8vw, 1.3rem); color: var(--ink-soft); max-width: 700px; }
.hand { font-family: var(--font-hand); font-size: 1.35em; color: var(--tomato); line-height: 1; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 1000; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; }
.skip-link:focus { left: 8px; }
.bg-sun { background: var(--sun); } .bg-tomato { background: var(--tomato); } .bg-sky { background: var(--sky); } .bg-grass { background: var(--grass); }
.bg-grape { background: var(--grape); } .bg-pink { background: var(--pink); } .bg-orange { background: var(--orange); } .bg-teal { background: var(--teal); }
.c-sun { --c: var(--sun); --cd: var(--sun-d); } .c-tomato { --c: var(--tomato); --cd: var(--tomato-d); } .c-sky { --c: var(--sky); --cd: var(--sky-d); }
.c-grass { --c: var(--grass); --cd: var(--grass-d); } .c-grape { --c: var(--grape); --cd: var(--grape-d); } .c-pink { --c: var(--pink); --cd: var(--pink-d); }
.c-orange { --c: var(--orange); --cd: var(--orange-d); } .c-teal { --c: var(--teal); --cd: var(--teal-d); }

/* ---------- Clay 3D buttons ---------- */
.btn, .lw-btn {
	--b: var(--grape); --bd: var(--grape-d); --t: #fff;
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font: 700 1.05rem/1 var(--font-head); letter-spacing: .01em; text-decoration: none; color: var(--t);
	padding: 15px 24px; border: 0; border-radius: 18px; cursor: pointer; white-space: nowrap;
	background: linear-gradient(180deg, color-mix(in srgb, var(--b) 80%, #fff) 0%, var(--b) 55%);
	box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.12), 0 6px 0 var(--bd), 0 14px 22px -10px var(--bd);
	transition: transform .15s cubic-bezier(.3,1.6,.5,1), box-shadow .15s, filter .15s;
}
.btn:hover, .lw-btn:hover { color: var(--t); transform: translateY(-3px); box-shadow: inset 0 2px 0 rgba(255,255,255,.45), inset 0 -4px 0 rgba(0,0,0,.12), 0 9px 0 var(--bd), 0 18px 26px -10px var(--bd); filter: saturate(1.08); }
.btn:active, .lw-btn:active { transform: translateY(5px); box-shadow: inset 0 2px 0 rgba(255,255,255,.3), 0 1px 0 var(--bd); transition-duration: .05s; }
.btn:disabled, .lw-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn--grass, .lw-btn--grass { --b: var(--grass); --bd: var(--grass-d); }
.btn--sun, .lw-btn--sun { --b: var(--sun); --bd: var(--sun-d); --t: #3a2a00; }
.btn--tomato { --b: var(--tomato); --bd: var(--tomato-d); }
.btn--sky { --b: var(--sky); --bd: var(--sky-d); }
.btn--pink { --b: var(--pink); --bd: var(--pink-d); }
.btn--ghost, .lw-btn--ghost { --b: #fff; --bd: #d8cdb4; --t: var(--ink); background: #fff; box-shadow: inset 0 0 0 2px var(--ink), 0 5px 0 var(--ink); }
.btn--ghost:hover, .lw-btn--ghost:hover { color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink), 0 8px 0 var(--ink); }
.btn--ghost:active, .lw-btn--ghost:active { box-shadow: inset 0 0 0 2px var(--ink), 0 1px 0 var(--ink); }
.btn--sm, .lw-btn--small { padding: 10px 15px; font-size: .92rem; border-radius: 14px; }
.btn--lg, .lw-btn--big { padding: 19px 32px; font-size: 1.2rem; border-radius: 22px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }

/* ---------- Header ---------- */
.scroll-progress { position: fixed; inset: 0 0 auto; height: 5px; z-index: 200; pointer-events: none; }
.scroll-progress i { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--tomato), var(--sun), var(--grass), var(--sky), var(--grape)); }
.site-header { position: sticky; top: 0; z-index: 100; padding: 12px 0; transition: padding .25s, background .25s, box-shadow .25s; }
.site-header.is-scrolled { padding: 6px 0; background: rgba(255, 250, 240, .88); backdrop-filter: blur(12px); box-shadow: 0 2px 0 rgba(31,37,68,.08); }
.header-inner { display: flex; align-items: center; gap: 18px; min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); flex: none; }
.logo-mascot { width: 44px; height: 44px; animation: bob 3s ease-in-out infinite; }
.logo-blocks { display: inline-flex; gap: 2px; perspective: 400px; }
.logo-block { display: grid; place-items: center; width: 27px; height: 30px; font: 700 1.15rem/1 var(--font-head); color: #fff; border-radius: 8px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.18), 0 3px 0 rgba(31,37,68,.25); transform: rotate(calc((var(--i) - 2) * 3deg)); transition: transform .3s cubic-bezier(.3,1.6,.5,1); text-shadow: 0 1px 0 rgba(0,0,0,.2); }
.logo:hover .logo-block { transform: translateY(-4px) rotate(calc((var(--i) - 2) * -6deg)); transition-delay: calc(var(--i) * 40ms); }
.logo-with { font: 700 1.3rem/1 var(--font-hand); color: var(--grape-d); transform: rotate(-8deg) translateY(4px); }
.main-nav { margin-left: auto; }
.nav-list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.nav-list > li { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 13px; border-radius: 14px; font: 600 1rem/1 var(--font-head); color: var(--ink); text-decoration: none; background: none; border: 0; cursor: pointer; transition: background .15s, transform .15s; }
.nav-link:hover, .has-menu.is-open > .nav-link { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); transform: translateY(-1px); }
.caret { font-size: .7em; transition: transform .2s; }
.has-menu.is-open .caret { transform: rotate(180deg); }
.nav-menu { position: absolute; top: calc(100% + 10px); left: 50%; min-width: 290px; padding: 10px; background: #fff; border: 3px solid var(--ink); border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); opacity: 0; visibility: hidden; transform: translate(-50%, 10px) scale(.96); transform-origin: top center; transition: .2s cubic-bezier(.3,1.4,.5,1); z-index: 5; }
.nav-menu--right { left: auto; right: 0; transform: translate(0, 10px) scale(.96); }
.has-menu.is-open > .nav-menu { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.has-menu.is-open > .nav-menu--right { transform: translate(0, 0) scale(1); }
.nav-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.nav-menu a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; text-decoration: none; color: var(--ink); transition: background .15s, transform .15s; }
.nav-menu a:hover { background: #f7f3ff; transform: translateX(4px); color: var(--ink); }
.nav-menu-icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--paper-2); font-size: 1.25rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.06); }
.nav-menu strong { display: block; font: 600 1rem/1.2 var(--font-head); }
.nav-menu small { display: block; color: var(--ink-soft); font-size: .84rem; line-height: 1.3; }
.nav-account { display: flex; align-items: center; gap: 10px; }
.nav-account--mobile { display: none; }
.user-menu { position: relative; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; font: 600 .95rem var(--font-head); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--paper-2); font-size: 1.2rem; }
.user-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-toggle { display: none; margin-left: auto; width: 48px; height: 48px; border-radius: 14px; border: 2px solid var(--ink); background: #fff; box-shadow: 0 4px 0 var(--ink); cursor: pointer; padding: 12px 11px; flex-direction: column; justify-content: space-between; }
.nav-toggle span { display: block; height: 3px; border-radius: 3px; background: var(--ink); transition: transform .25s, opacity .25s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8.5px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8.5px) rotate(-45deg); }

/* ---------- Floating clay shapes ---------- */
.shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.shape { position: absolute; width: 60px; height: 60px; will-change: transform; animation: float 7s ease-in-out infinite; }
.shape:nth-child(2n) { animation-duration: 9s; animation-delay: -2s; }
.shape:nth-child(3n) { animation-duration: 11s; animation-delay: -4s; }
.shape--ball { border-radius: 50%; background: radial-gradient(circle at 32% 28%, #fff9 0 8%, transparent 26%), radial-gradient(circle at 50% 50%, var(--c) 55%, var(--cd) 100%); box-shadow: 0 14px 20px -8px var(--cd); }
.shape--ring { border-radius: 50%; border: 14px solid var(--c); box-shadow: inset 0 -4px 0 var(--cd), 0 6px 0 var(--cd); width: 70px; height: 70px; }
.shape--cube { width: 52px; height: 52px; border-radius: 12px; background: linear-gradient(135deg, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); box-shadow: 8px 8px 0 var(--cd); transform: rotate(18deg); }
.shape--tri { width: 0; height: 0; border-left: 34px solid transparent; border-right: 34px solid transparent; border-bottom: 58px solid var(--c); filter: drop-shadow(0 6px 0 var(--cd)); }
.shape--star { width: 64px; height: 64px; background: var(--c); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); filter: drop-shadow(0 5px 0 var(--cd)); }

/* ---------- Scroll reveal ---------- */
.js [data-reveal] { opacity: 0; transition: opacity .7s ease, transform .8s cubic-bezier(.2,.9,.25,1.15); transition-delay: var(--d, 0s); }
.js [data-reveal="up"] { transform: translateY(40px); }
.js [data-reveal="left"] { transform: translateX(-50px); }
.js [data-reveal="right"] { transform: translateX(50px); }
.js [data-reveal="pop"] { transform: scale(.6) rotate(-8deg); }
.js [data-reveal="flip"] { transform: perspective(800px) rotateX(55deg); transform-origin: top; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.tilt { transform-style: preserve-3d; transition: transform .25s ease, box-shadow .25s ease; will-change: transform; }

/* ---------- Page hero ---------- */
.page-hero { position: relative; padding: clamp(46px, 7vw, 90px) 0 clamp(70px, 9vw, 120px); text-align: center; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--c, var(--grape)) 22%, #fff) 0%, var(--paper) 100%); }
.page-hero--grape { --c: var(--grape); } .page-hero--sky { --c: var(--sky); } .page-hero--grass { --c: var(--grass); } .page-hero--sun { --c: var(--sun); }
.page-hero--tomato { --c: var(--tomato); } .page-hero--pink { --c: var(--pink); } .page-hero--teal { --c: var(--teal); } .page-hero--orange { --c: var(--orange); }
.page-hero-inner { position: relative; z-index: 1; display: grid; justify-items: center; }
.page-hero .lead { margin-inline: auto; }
.page-hero-icon { display: grid; place-items: center; width: 92px; height: 92px; margin-bottom: 18px; border-radius: 28px; font-size: 3rem; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); transform: rotate(-6deg); }
.page-hero-icon span { animation: bob 3s ease-in-out infinite; display: inline-block; }
.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 60px; fill: var(--paper); }

/* ---------- Footer (chalkboard) ---------- */
.site-footer { position: relative; margin-top: 60px; padding: 90px 0 26px; background: var(--chalk) radial-gradient(ellipse at 30% 20%, rgba(255,255,255,.06), transparent 60%); color: #e6f2ec; overflow: hidden; }
.footer-wave { position: absolute; top: -1px; left: 0; width: 100%; height: 70px; fill: var(--paper); }
.footer-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
.site-footer .logo { color: #fff; } .site-footer .logo-with { color: var(--sun); }
.site-footer h3 { color: #fff; font-size: 1.15rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer a { color: #cfe7dc; text-decoration: none; }
.site-footer a:hover { color: var(--sun); }
.chalk { font: 700 1.8rem/1.2 var(--font-hand); color: #fff; margin: 14px 0 8px; }
.footer-bottom { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 2px dashed rgba(255,255,255,.2); font-size: .92rem; }
.to-top { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--sun); color: #3a2a00 !important; box-shadow: 0 4px 0 var(--sun-d); transition: transform .15s; }
.to-top:hover { transform: translateY(-4px); }

/* ---------- Keyframes ---------- */
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
@keyframes float { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -22px; rotate: 12deg; } }
@keyframes wiggle { 0%, 100% { rotate: -3deg; } 50% { rotate: 3deg; } }
@keyframes spin3d { from { transform: rotateX(-22deg) rotateY(0); } to { transform: rotateX(-22deg) rotateY(360deg); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(55,178,77,.55); } 100% { box-shadow: 0 0 0 18px rgba(55,178,77,0); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* =====================================================================
   Part 2: home page + cards
   ===================================================================== */

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(30px, 5vw, 70px) 0 clamp(80px, 10vw, 140px); overflow: hidden; }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
.hero h1 .word { display: inline-block; }
.hero h1 .hl { position: relative; white-space: nowrap; color: var(--grape-d); }
.hero h1 .hl svg { position: absolute; left: -4%; bottom: -.18em; width: 108%; height: .45em; overflow: visible; }
.hero h1 .hl path { fill: none; stroke: var(--sun); stroke-width: 9; stroke-linecap: round; stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw 1.2s .6s ease forwards; }
.hero .lead { margin-bottom: 30px; }
.hero-proof { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 30px; font-weight: 700; color: var(--ink-soft); }
.hero-proof span { display: inline-flex; align-items: center; gap: 6px; }
.hero-art { position: relative; min-height: 460px; perspective: 1200px; }

/* 3D toy cubes */
.cube-scene { position: absolute; width: var(--s, 120px); height: var(--s, 120px); perspective: 900px; }
.cube { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: spin3d var(--t, 14s) linear infinite; }
.cube-face { position: absolute; inset: 0; display: grid; place-items: center; font: 700 calc(var(--s, 120px) * .26)/1 var(--font-head); color: #fff; border-radius: 18px; text-shadow: 0 3px 0 rgba(0,0,0,.18); box-shadow: inset 0 0 0 6px rgba(255,255,255,.35), inset 0 -10px 0 rgba(0,0,0,.12); backface-visibility: hidden; }
.cube-face:nth-child(1) { transform: translateZ(calc(var(--s, 120px) / 2)); background: var(--tomato); }
.cube-face:nth-child(2) { transform: rotateY(90deg) translateZ(calc(var(--s, 120px) / 2)); background: var(--sky); }
.cube-face:nth-child(3) { transform: rotateY(180deg) translateZ(calc(var(--s, 120px) / 2)); background: var(--grass); }
.cube-face:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s, 120px) / 2)); background: var(--sun); color: #3a2a00; }
.cube-face:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s, 120px) / 2)); background: var(--grape); }
.cube-face:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s, 120px) / 2)); background: var(--pink); }
.hero-board { position: absolute; left: 6%; right: 4%; top: 18%; z-index: 2; padding: 22px 22px 18px; border-radius: 26px; background: var(--chalk); border: 10px solid #c8894a; box-shadow: inset 0 0 0 3px rgba(0,0,0,.2), 0 18px 0 -4px #8e5c2c, 0 34px 40px -18px rgba(31,37,68,.5); transform: rotate(-2deg) translateZ(40px); color: #fff; }
.hero-board::after { content: ''; position: absolute; left: 20%; right: 20%; bottom: -26px; height: 12px; border-radius: 6px; background: #b07840; box-shadow: 0 4px 0 #8e5c2c; }
.board-title { font: 700 1.6rem/1 var(--font-hand); color: var(--sun); margin-bottom: 10px; }
.board-code { font: 500 clamp(.95rem, 1.5vw, 1.12rem)/1.75 'JetBrains Mono', monospace; min-height: 11em; white-space: pre; overflow: hidden; }
.board-code .tk-kw { color: #ffb3d9; } .board-code .tk-var { color: #fff; } .board-code .tk-num { color: #ffe08a; } .board-code .tk-str { color: #c9f7a0; }
.board-caret { display: inline-block; width: .55em; height: 1.1em; vertical-align: -.2em; background: #fff; animation: lw-blink 1s steps(1) infinite; }
.board-out { margin-top: 8px; padding-top: 8px; border-top: 2px dashed rgba(255,255,255,.3); font: 700 1.4rem/1 var(--font-hand); color: #c9f7a0; min-height: 1.4em; }
.hero-mascot { position: absolute; right: -2%; bottom: -4%; width: clamp(130px, 16vw, 190px); z-index: 3; animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 16px 12px rgba(31,37,68,.25)); }
.speech { position: absolute; right: 12%; bottom: 30%; z-index: 4; padding: 10px 14px; background: #fff; border: 3px solid var(--ink); border-radius: 18px 18px 4px 18px; font: 700 1.3rem/1 var(--font-hand); box-shadow: 4px 4px 0 var(--ink); animation: wiggle 2.6s ease-in-out infinite; }

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; background: var(--ink); color: #fff; padding: 16px 0; transform: rotate(-1.5deg); margin: -10px -20px 0; box-shadow: 0 8px 0 var(--grape-d); }
.marquee-track { display: flex; gap: 40px; width: max-content; animation: marquee 30s linear infinite; font: 700 1.3rem/1 var(--font-head); }
.marquee-track span { display: inline-flex; gap: 12px; align-items: center; }
.marquee-track b { color: var(--sun); }

/* ---------- How it works (scroll-driven) ---------- */
.how { background: linear-gradient(180deg, #e8f7ff, var(--paper)); overflow: hidden; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.how-sticky { position: sticky; top: calc(var(--header-h) + 30px); }
.how-visual { position: relative; aspect-ratio: 1; max-width: 460px; margin: 0 auto; display: grid; place-items: center; }
.how-orbit { position: absolute; inset: 8%; border-radius: 50%; border: 3px dashed #b7dff5; animation: spin3d 60s linear infinite; }
.how-big { display: grid; place-items: center; text-align: center; width: 62%; aspect-ratio: 1; border-radius: 40px; background: #fff; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); transform: rotate(-4deg); transition: background .4s; }
.how-big .how-emoji { font-size: clamp(4rem, 9vw, 6.5rem); line-height: 1; display: block; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.how-big strong { font: 700 1.6rem var(--font-head); }
.how-big.is-swap .how-emoji { transform: scale(.4) rotate(-40deg); }
.how-steps { list-style: none; margin: 0; display: grid; gap: 11vh; padding: 6vh 0 14vh; }
.how-step { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border-radius: 24px; background: #fff; border: 3px solid var(--line); opacity: .45; transform: scale(.96); transition: .4s cubic-bezier(.2,.9,.25,1.15); }
.how-step.is-active { opacity: 1; transform: scale(1); border-color: var(--ink); box-shadow: 8px 8px 0 var(--c); }
.how-step-num { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; font: 700 1.5rem var(--font-head); color: #fff; background: var(--c); box-shadow: inset 0 -5px 0 var(--cd); }
.how-step h3 { margin: 4px 0 6px; }
.how-step p { margin: 0; color: var(--ink-soft); }

/* ---------- Why cards ---------- */
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 22px; }
.why-card { position: relative; padding: 28px 22px 24px; border-radius: 28px; background: #fff; border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--c); text-align: center; }
.why-card:nth-child(odd) { rotate: -1.2deg; } .why-card:nth-child(even) { rotate: 1.2deg; }
.why-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: -60px auto 14px; border-radius: 26px; font-size: 2.6rem; background: var(--c); border: 3px solid var(--ink); box-shadow: inset 0 -6px 0 var(--cd), 0 6px 0 var(--ink); }
.why-card:hover .why-icon { animation: wiggle .5s ease-in-out 2; }
.why-card h3 { font-size: 1.25rem; }
.why-card p { margin: 0; color: var(--ink-soft); }
.why-grid .why-card { margin-top: 40px; }

/* ---------- Example ---------- */
.example { background: var(--paper-2); }
.example-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: 44px; align-items: center; }
.problem-note { position: relative; padding: 30px 28px; background: #fff59d; border-radius: 6px 6px 30px 6px; box-shadow: 0 14px 24px -12px rgba(31,37,68,.35); transform: rotate(-3deg); font: 700 2rem/1.25 var(--font-hand); }
.problem-note::before { content: ''; position: absolute; top: -16px; left: 50%; width: 120px; height: 34px; transform: translateX(-50%) rotate(3deg); background: rgba(255,255,255,.6); border: 1px solid rgba(0,0,0,.05); }
.problem-note small { display: block; font: 700 .85rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }

/* ---------- Phase cards ---------- */
.phase-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(275px, 1fr)); gap: 26px; }
.phase-card { --pct: 0%; position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px; border-radius: 28px; background: #fff; border: 3px solid var(--ink); box-shadow: 7px 7px 0 var(--c); text-decoration: none; color: var(--ink); overflow: hidden; }
.phase-card::before { content: ''; position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; background: var(--c); opacity: .14; transition: transform .5s; }
.phase-card:hover { color: var(--ink); box-shadow: 10px 10px 0 var(--c); }
.phase-card:hover::before { transform: scale(1.6); }
.phase-card-top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.phase-num { font: 700 .82rem var(--font-head); letter-spacing: .12em; padding: 6px 10px; border-radius: 99px; background: var(--c); color: #fff; box-shadow: inset 0 -3px 0 var(--cd); }
.phase-icon { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 20px; font-size: 2rem; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); transform: rotate(8deg) translateZ(30px); transition: transform .4s cubic-bezier(.3,1.6,.5,1); }
.phase-card:hover .phase-icon { transform: rotate(-8deg) scale(1.1) translateZ(30px); }
.phase-title { font: 700 1.35rem/1.2 var(--font-head); position: relative; }
.phase-tagline { color: var(--ink-soft); font-size: .97rem; flex: 1; }
.phase-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .84rem; font-weight: 700; }
.phase-meta span { padding: 5px 9px; border-radius: 10px; background: var(--paper-2); }
.phase-foot { display: flex; align-items: center; gap: 12px; padding-top: 10px; border-top: 2px dashed var(--line); }
.phase-progress { flex: 1; display: flex; align-items: center; gap: 8px; }
.phase-progress .lw-meter { flex: 1; }
.phase-progress .lw-meter i { width: var(--pct); background: var(--c); }
.phase-progress b { font: 700 .85rem var(--font-head); min-width: 2.6em; text-align: right; }
.diff { font: 700 .72rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; padding: 5px 9px; border-radius: 99px; background: #e9fbe9; color: #1f7a33; }
.diff--easy { background: #e5f6ff; color: var(--sky-d); } .diff--medium { background: #fff4d6; color: #8a5a00; }
.diff--hard { background: #ffecec; color: var(--tomato-d); } .diff--expert { background: #f2efff; color: var(--grape-d); }

/* ---------- Learning path road ---------- */
.road { position: relative; max-width: 900px; margin: 0 auto; padding: 20px 0; }
.road-line { position: absolute; left: 50%; top: 0; bottom: 0; width: 14px; transform: translateX(-50%); border-radius: 99px; background: repeating-linear-gradient(180deg, var(--ink) 0 24px, #fff 24px 40px); opacity: .85; }
.road-fill { position: absolute; left: 50%; top: 0; width: 14px; height: var(--road, 0%); transform: translateX(-50%); border-radius: 99px; background: linear-gradient(180deg, var(--grass), var(--sky), var(--grape), var(--tomato)); transition: height .1s linear; }
.road-stop { position: relative; display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; margin: 22px 0; }
.road-pin { grid-column: 2; justify-self: center; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; font-size: 1.8rem; background: #fff; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); z-index: 1; transition: transform .4s cubic-bezier(.3,1.6,.5,1), background .3s; }
.road-stop.is-in .road-pin { background: var(--c); transform: scale(1.12); }
.road-card { padding: 16px 20px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--c); }
.road-card strong { font: 700 1.2rem var(--font-head); display: block; }
.road-card span { color: var(--ink-soft); font-size: .95rem; }
.road-stop:nth-child(odd) .road-card { grid-column: 1; grid-row: 1; margin-right: 18px; text-align: right; }
.road-stop:nth-child(even) .road-card { grid-column: 3; margin-left: 18px; }

/* ---------- Projects strip ---------- */
.projects-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }
.project-card { position: relative; display: grid; gap: 8px; padding: 22px; border-radius: 26px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--c, var(--grape)); text-decoration: none; color: var(--ink); }
.project-card:hover { color: var(--ink); }
.project-emoji { font-size: 2.6rem; line-height: 1; transition: transform .4s cubic-bezier(.3,1.6,.5,1); display: inline-block; }
.project-card:hover .project-emoji { transform: scale(1.2) rotate(-10deg); }
.project-level { font: 700 .72rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.project-card strong { font: 700 1.2rem var(--font-head); }
.project-card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.project-card .tick { position: absolute; top: 14px; right: 14px; }

/* ---------- Outcome ---------- */
.outcome { background: var(--chalk); color: #fff; overflow: hidden; }
.outcome h2 { color: #fff; }
.outcome .section-head p { color: #cfe7dc; }
.outcome-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.outcome-list li { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border-radius: 20px; background: rgba(255,255,255,.07); border: 2px dashed rgba(255,255,255,.25); font-size: 1.05rem; }
.outcome-list li::before { content: '✔'; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--grass); color: #fff; font-weight: 800; box-shadow: 0 4px 0 var(--grass-d); }

/* ---------- CTA ---------- */
.cta-box { position: relative; overflow: hidden; text-align: center; padding: clamp(40px, 6vw, 70px) 24px; border-radius: 40px; background: linear-gradient(135deg, var(--grape), var(--pink)); color: #fff; border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); }
.cta-box h2 { color: #fff; }
.cta-box p { font-size: 1.2rem; opacity: .95; }

/* ---------- Lesson & problem cards ---------- */
.lesson-list { display: grid; gap: 14px; }
.lesson-card { position: relative; display: flex; align-items: center; gap: 16px; padding: 14px 18px 14px 14px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-decoration: none; color: var(--ink); transition: transform .2s cubic-bezier(.3,1.6,.5,1), box-shadow .2s; }
a.lesson-card:hover { color: var(--ink); transform: translateY(-4px) rotate(-.4deg); box-shadow: 0 9px 0 var(--ink); }
.lesson-num { flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; font: 700 1.3rem var(--font-head); color: #fff; background: var(--c, var(--grape)); box-shadow: inset 0 -5px 0 var(--cd, var(--grape-d)); }
.lesson-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.lesson-title { font: 700 1.12rem/1.25 var(--font-head); }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .86rem; color: var(--ink-soft); font-weight: 700; }
.lesson-state { flex: none; display: grid; place-items: center; min-width: 44px; font-size: 1.3rem; }
.lesson-state .go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--paper-2); transition: transform .2s; }
a.lesson-card:hover .go { transform: translateX(4px); background: var(--sun); }
.free-badge { font: 700 .72rem var(--font-head); letter-spacing: .08em; padding: 5px 9px; border-radius: 99px; background: var(--grass); color: #fff; box-shadow: 0 3px 0 var(--grass-d); }
.tick { display: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--grass); color: #fff; font-weight: 800; box-shadow: 0 4px 0 var(--grass-d); }
.is-done .tick { display: grid; animation: lw-pop .4s cubic-bezier(.3,1.6,.5,1); }
.is-done .lesson-state > :not(.tick), .is-done .problem-top .lw-diff + .tick ~ * { display: none; }
.lesson-card.is-done { background: #f3fff5; }
.lesson-card.is-soon { opacity: .6; border-style: dashed; box-shadow: none; }
.lesson-card.is-soon .lesson-num { background: #c9c3b3; box-shadow: inset 0 -5px 0 #a39d8d; }
.lesson-card.is-locked { background: #faf8f3; }

.problem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.problem-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 20px; border-radius: 24px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); text-decoration: none; color: var(--ink); }
.problem-card:hover { color: var(--ink); }
.problem-card.is-done { background: #f3fff5; }
.problem-top { display: flex; justify-content: space-between; align-items: center; }
.problem-top .tick { width: 30px; height: 30px; font-size: .9rem; }
.problem-title { font: 700 1.18rem/1.25 var(--font-head); }
.problem-excerpt { color: var(--ink-soft); font-size: .93rem; flex: 1; }
.problem-topics { display: flex; flex-wrap: wrap; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--grape-d); }
.problem-card.is-hidden, .glossary-card.is-hidden { display: none; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-bottom: 30px; }
.filter-btn { font: 700 .95rem var(--font-head); padding: 9px 15px; border-radius: 99px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--ink); transition: transform .12s, background .15s; }
.filter-btn:hover { transform: translateY(-2px); }
.filter-btn.is-active { background: var(--ink); color: #fff; transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.search-box { position: relative; width: min(520px, 100%); margin: 0 auto 26px; }
.search-box input { width: 100%; padding: 16px 20px 16px 52px; font: 600 1.05rem var(--font-body); border-radius: 20px; border: 3px solid var(--ink); background: #fff; box-shadow: 0 5px 0 var(--ink); }
.search-box input:focus { outline: none; box-shadow: 0 5px 0 var(--ink), 0 0 0 5px rgba(139,92,246,.25); }
.search-box::before { content: '🔎'; position: absolute; left: 18px; top: 50%; transform: translateY(-50%); font-size: 1.2rem; }
.empty-state { text-align: center; padding: 50px 20px; border-radius: 28px; border: 3px dashed var(--line); }
.empty-state span { font-size: 3.5rem; display: block; }
.list-card { display: grid; gap: 4px; padding: 18px 20px; border-radius: 20px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-decoration: none; color: var(--ink); }
.list-card-type { font: 700 .72rem var(--font-head); text-transform: uppercase; letter-spacing: .1em; color: var(--grape-d); }
.big-emoji { font-size: 5rem; }

/* =====================================================================
   Part 3: phase + lesson pages, glossary, auth, studio, responsive
   ===================================================================== */

/* ---------- Phase page ---------- */
.phase-hero { text-align: left; }
.phase-hero .page-hero-inner { justify-items: start; }
.phase-hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 36px; align-items: center; width: 100%; }
.phase-facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 20px; }
.fact { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 14px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font: 600 .95rem var(--font-head); }
.objectives-card { padding: 22px; border-radius: 26px; background: #fff; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--c, var(--grape)); transform: rotate(1.5deg); }
.objectives-card h3 { font-size: 1.15rem; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; }
.check-list li::before { content: '✔'; flex: none; display: grid; place-items: center; width: 24px; height: 24px; margin-top: 2px; border-radius: 8px; background: var(--grass); color: #fff; font-size: .8rem; font-weight: 800; }
.phase-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; align-items: start; }
.phase-aside { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 20px; }
.aside-card { padding: 20px; border-radius: 24px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); }
.aside-card h3 { font-size: 1.1rem; }
.test-card { background: linear-gradient(135deg, #fff4d6, #ffe7f1); }
.ring-sm { width: 110px; height: 110px; margin: 0 auto 10px; }
.ring-sm strong { font-size: 1.6rem; }

/* ---------- Lesson page ---------- */
.lesson-hero { padding-bottom: 90px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 18px; font: 600 .92rem var(--font-head); }
.crumbs a { text-decoration: none; padding: 6px 12px; border-radius: 99px; background: #fff; border: 2px solid var(--ink); color: var(--ink); }
.crumbs a:hover { background: var(--sun); }
.lesson-facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.lesson-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.lesson-toc { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 16px; }
.toc { padding: 18px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); }
.toc p { font: 700 .8rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: t; }
.toc a { display: block; padding: 7px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: .93rem; font-weight: 600; line-height: 1.3; border-left: 4px solid transparent; transition: background .15s, border-color .15s; }
.toc a:hover { background: var(--paper-2); }
.toc a.is-current { background: #f2efff; border-left-color: var(--grape); color: var(--grape-d); }
.toc-progress { font-size: .85rem; color: var(--ink-soft); margin-top: 10px; }
.notebook { position: relative; padding: clamp(26px, 4vw, 50px) clamp(20px, 4vw, 54px) clamp(26px, 4vw, 50px) clamp(34px, 6vw, 84px); border-radius: 12px 30px 30px 12px; background: #fff linear-gradient(transparent 0 calc(1.8em - 1px), #d9ecff calc(1.8em - 1px) 1.8em) 0 14px / 100% 1.8em; box-shadow: 0 2px 0 #e7e0cc, 0 6px 0 #f3eddb, 0 10px 0 #e7e0cc, 0 26px 40px -20px rgba(31,37,68,.35); line-height: 1.8; }
.notebook::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(20px, 4vw, 58px); width: 2px; background: #ff9aa0; }
.notebook::after { content: ''; position: absolute; top: 24px; bottom: 24px; left: 8px; width: 12px; background: radial-gradient(circle, var(--paper) 5px, transparent 6px) 0 0 / 12px 44px; }
.notebook > * { position: relative; }
.prose h2 { margin-top: 2.2em; padding-top: .2em; display: flex; align-items: center; gap: 12px; }
.prose h2::before { content: ''; flex: none; width: 14px; height: 14px; border-radius: 4px; background: var(--c, var(--grape)); transform: rotate(45deg); box-shadow: 3px 3px 0 var(--ink); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--grape); font-weight: 800; }
.prose strong { background: linear-gradient(transparent 60%, #ffe08a 60%); }
.prose blockquote { margin: 1.5em 0; padding: 14px 20px; border-left: 6px solid var(--sky); background: #eaf6ff; border-radius: 0 16px 16px 0; }
.lesson-objectives { margin-bottom: 30px; padding: 20px 22px; border-radius: 22px; background: #f3fff5; border: 3px dashed var(--grass); }
.lesson-objectives h2 { font-size: 1.3rem; margin: 0 0 10px; } .lesson-objectives h2::before { display: none; }
.takeaways { margin-top: 40px; padding: 24px; border-radius: 26px; background: #fff8e1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--sun); }
.takeaways h2 { margin: 0 0 12px; font-size: 1.4rem; } .takeaways h2::before { display: none; }
.lesson-video { margin: 0 0 34px; border-radius: 26px; overflow: hidden; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--tomato); background: #000; aspect-ratio: 16 / 9; }
.lesson-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.lesson-finish { margin-top: 44px; text-align: center; padding: 30px 20px; border-radius: 30px; background: linear-gradient(135deg, #e8f7ff, #f3efff); border: 3px dashed #b9b0ff; }
.complete-btn { font-size: 1.25rem; padding: 20px 34px; }
.complete-btn.is-done { --b: var(--grass); --bd: var(--grass-d); animation: pulse-ring 1.4s ease-out 2; }
.lesson-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.lesson-nav a { display: grid; gap: 4px; padding: 18px 20px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); text-decoration: none; color: var(--ink); transition: transform .2s; }
.lesson-nav a:hover { transform: translateY(-3px); color: var(--ink); }
.lesson-nav small { font: 700 .75rem var(--font-head); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.lesson-nav strong { font: 700 1.1rem var(--font-head); }
.lesson-nav .next { text-align: right; grid-column: 2; }
.lesson-nav .is-glow { box-shadow: 0 5px 0 var(--ink), 0 0 0 6px rgba(55,178,77,.35); background: #f3fff5; }
.lock-gate { position: relative; margin-top: 10px; padding: 40px 26px; text-align: center; border-radius: 30px; background: #fff; border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--grape); }
.lock-gate .lock-icon { font-size: 4rem; display: inline-block; animation: wiggle 1.2s ease-in-out infinite; }
.lock-teaser { position: relative; max-height: 220px; overflow: hidden; margin-bottom: -60px; }
.lock-teaser::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent, var(--paper) 85%); }

/* ---------- Glossary ---------- */
.alpha { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 28px; }
.alpha a, .alpha span { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; font: 700 1rem var(--font-head); text-decoration: none; background: #fff; border: 2px solid var(--ink); color: var(--ink); box-shadow: 0 3px 0 var(--ink); }
.alpha span { opacity: .3; box-shadow: none; }
.alpha a:hover { background: var(--sun); transform: translateY(-2px); }
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.glossary-letter { grid-column: 1 / -1; font: 700 2.4rem var(--font-head); color: var(--grape); margin: 10px 0 -6px; }
.glossary-card { padding: 20px; border-radius: 24px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--sky); display: flex; flex-direction: column; gap: 8px; }
.glossary-card h3 { margin: 0; font-size: 1.35rem; }
.glossary-card h3 a { color: var(--ink); text-decoration: none; }
.glossary-card p { margin: 0; }
.glossary-card .lw-cb-code { margin: 4px 0; }
.glossary-card .analogy { font-size: .93rem; color: var(--ink-soft); }
.glossary-detail { display: grid; gap: 20px; }
.gl-box { padding: 20px 22px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--c, var(--sky)); }
.gl-box h2 { font-size: 1.15rem; margin-bottom: 6px; }
.gl-box h2::before { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 7px 14px; border-radius: 99px; background: #f2efff; color: var(--grape-d); text-decoration: none; font: 600 .92rem var(--font-head); }

/* ---------- Auth ---------- */
.auth-wrap { position: relative; min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 50px 0 80px; overflow: hidden; }
.auth-grid { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; width: min(1040px, 100% - 32px); }
.auth-card { padding: clamp(24px, 4vw, 40px); border-radius: 34px; background: #fff; border: 4px solid var(--ink); box-shadow: 12px 12px 0 var(--grape); }
.auth-card h1 { font-size: clamp(1.9rem, 3.5vw, 2.5rem); }
.auth-card .sub { color: var(--ink-soft); margin-bottom: 22px; }
.auth-alt { text-align: center; margin: 18px 0 0; }
.auth-side { text-align: center; }
.auth-side img { width: min(300px, 70%); animation: bob 3.2s ease-in-out infinite; filter: drop-shadow(0 20px 14px rgba(31,37,68,.2)); }
.auth-perks { list-style: none; padding: 0; margin: 20px auto 0; display: grid; gap: 10px; max-width: 360px; text-align: left; }
.auth-perks li { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-weight: 700; }
.auth-perks li span { font-size: 1.4rem; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.account-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 30px; align-items: start; }
.account-card { text-align: center; }
.account-avatar { display: grid; place-items: center; width: 120px; height: 120px; margin: 0 auto 12px; font-size: 4rem; border-radius: 36px; background: var(--paper-2); border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); animation: bob 3s ease-in-out infinite; }

/* ---------- Studio ---------- */
.studio-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.studio-tab { font: 700 1rem var(--font-head); padding: 12px 18px; border-radius: 16px; border: 3px solid var(--ink); background: #fff; cursor: pointer; box-shadow: 0 4px 0 var(--ink); color: var(--ink); }
.studio-tab[aria-selected="true"] { background: var(--grape); color: #fff; transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.studio-panel { display: grid; gap: 24px; }
.studio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.key-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.key-list li { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--paper-2); font: 600 .9rem 'JetBrains Mono', monospace; }
.ok { color: var(--grass-d); } .no { color: var(--tomato-d); }
.lesson-table { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
.lesson-table td, .lesson-table th { padding: 10px 12px; text-align: left; }
.lesson-table th { font: 700 .8rem var(--font-head); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); }
.lesson-table tbody tr { background: #fff; box-shadow: 0 3px 0 var(--line); }
.lesson-table tbody td:first-child { border-radius: 14px 0 0 14px; } .lesson-table tbody td:last-child { border-radius: 0 14px 14px 0; }
.video-stage { position: relative; border-radius: 22px; overflow: hidden; border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--tomato); background: #222; }
.video-stage canvas { display: block; width: 100%; height: auto; }
.scene-list { display: grid; gap: 12px; max-height: 560px; overflow: auto; padding-right: 6px; }
.scene { padding: 14px; border-radius: 18px; background: #fff; border: 2px solid var(--line); }
.scene.is-active { border-color: var(--grape); box-shadow: 0 0 0 4px rgba(139,92,246,.15); }
.scene textarea, .scene input { width: 100%; font: 500 .92rem var(--font-body); padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); margin-top: 6px; }
.scene textarea.mono { font-family: 'JetBrains Mono', monospace; font-size: .82rem; }
.scene-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; font: 700 .95rem var(--font-head); }
.pipeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.pipeline li { padding: 14px; border-radius: 18px; background: #fff; border: 3px solid var(--line); text-align: center; font: 600 .95rem var(--font-head); }
.pipeline li span { display: block; font-size: 1.8rem; }
.pipeline li.is-active { border-color: var(--sun); background: #fff8e1; }
.pipeline li.is-done { border-color: var(--grass); background: #f3fff5; }
.log { font: 500 .85rem/1.6 'JetBrains Mono', monospace; background: #151935; color: #b8f28a; padding: 14px; border-radius: 16px; max-height: 220px; overflow: auto; white-space: pre-wrap; }

/* ---------- Content pages ---------- */
.cheat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 24px; }
.cheat-card { padding: 22px; border-radius: 26px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--c, var(--grape)); }
.cheat-card h2 { font-size: 1.4rem; display: flex; gap: 10px; align-items: center; }
.cheat-card .lw-code-block { margin: 12px 0 0; }
.resource-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.resource-card { display: grid; gap: 8px; padding: 24px; border-radius: 26px; background: #fff; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--c); text-decoration: none; color: var(--ink); }
.resource-card:hover { color: var(--ink); }
.resource-card .emoji { font-size: 2.6rem; }
.resource-card strong { font: 700 1.25rem var(--font-head); }
.resource-card span:last-child { color: var(--ink-soft); }
.path-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px; }
.path-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 26px 22px; border-radius: 30px; background: #fff; border: 3px solid var(--ink); box-shadow: 8px 8px 0 var(--c); }
.path-icon { font-size: 3rem; }
.path-card h3 { margin: 0; }
.path-phases { display: flex; flex-wrap: wrap; gap: 5px; }
.path-phases span { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font: 700 .85rem var(--font-head); color: #fff; background: var(--c); box-shadow: inset 0 -3px 0 var(--cd); }
.path-card .btn { margin-top: auto; align-self: flex-start; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.scenario { display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--c); }
.scenario .emoji { font-size: 2.2rem; }
.scenario strong { display: block; font-family: var(--font-head); font-size: 1.05rem; }
.bigo { display: grid; gap: 12px; }
.bigo-row { display: grid; grid-template-columns: 110px 1fr 90px; gap: 14px; align-items: center; font-weight: 700; }
.bigo-row code { font-size: 1rem; text-align: center; }
.bigo-bar { height: 22px; border-radius: 99px; background: #eee9dc; overflow: hidden; }
.bigo-bar i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1.4s cubic-bezier(.2,.8,.2,1); }
.is-in .bigo-bar i { width: var(--w); }
.stat-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 30px; }
.stat-pill { display: grid; justify-items: center; min-width: 140px; padding: 16px 20px; border-radius: 22px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); }
.stat-pill strong { font: 700 2.2rem/1 var(--font-head); color: var(--grape-d); }
.stat-pill small { font-weight: 700; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
	.nav-link { padding: 10px 9px; font-size: .95rem; }
	.nav-link > span:first-child { display: none; }
	.user-name { display: none; }
}
@media (max-width: 960px) {
	:root { --header-h: 68px; }
	.nav-toggle { display: flex; }
	.nav-account--desktop { display: none; }
	.main-nav { position: fixed; inset: 0 0 0 auto; width: min(380px, 88vw); margin: 0; padding: 90px 18px 30px; background: var(--paper); border-left: 4px solid var(--ink); box-shadow: -10px 0 0 rgba(31,37,68,.12); transform: translateX(105%); transition: transform .35s cubic-bezier(.2,.9,.25,1.05); overflow-y: auto; z-index: -1; }
	.nav-open .main-nav { transform: none; }
	.nav-open::after { content: ''; position: fixed; inset: 0; background: rgba(31,37,68,.35); z-index: 90; }
	.site-header { z-index: 100; }
	.nav-open .site-header { z-index: 110; }
	.nav-list { flex-direction: column; align-items: stretch; gap: 6px; }
	.nav-link { width: 100%; padding: 14px; font-size: 1.1rem; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
	.nav-link > span:first-child { display: inline; }
	.caret { margin-left: auto; }
	.nav-menu, .nav-menu--right { position: static; transform: none !important; opacity: 1; visibility: visible; display: none; box-shadow: none; border-width: 2px; margin-top: 6px; min-width: 0; }
	.has-menu.is-open > .nav-menu { display: block; }
	.nav-account--mobile { display: flex; flex-wrap: wrap; margin-top: 18px; }
	.nav-account--mobile .user-menu { width: 100%; }
	.hero-grid, .how-grid, .example-grid, .phase-hero-grid, .phase-layout, .lesson-layout, .auth-grid, .account-grid, .split { grid-template-columns: minmax(0, 1fr); }
	.hero-art { min-height: 400px; }
	.how-sticky { position: relative; top: 0; }
	.how-visual { max-width: 260px; }
	.how-steps { gap: 20px; padding: 10px 0; }
	.how-step { opacity: 1; transform: none; }
	.phase-aside, .lesson-toc { position: static; }
	.lesson-toc .toc { display: none; }
	.auth-side { display: none; }
	.footer-grid { grid-template-columns: 1fr 1fr; }
	.footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	body { font-size: 1rem; }
	.hero-art { min-height: 340px; }
	.cube-scene { --s: 80px !important; }
	.road-stop { grid-template-columns: 56px 1fr; }
	.road-line, .road-fill { left: 28px; }
	.road-pin { grid-column: 1; width: 52px; height: 52px; font-size: 1.4rem; }
	.road-stop:nth-child(odd) .road-card, .road-stop:nth-child(even) .road-card { grid-column: 2; grid-row: 1; margin: 0 0 0 12px; text-align: left; }
	.lesson-nav { grid-template-columns: 1fr; } .lesson-nav .next { grid-column: 1; }
	.notebook { padding-left: 36px; }
	.notebook::before { left: 24px; }
	.footer-grid { grid-template-columns: 1fr; }
	.footer-bottom { flex-direction: column; }
	.bigo-row { grid-template-columns: 80px 1fr; } .bigo-row span:last-child { display: none; }
	.btn--lg { padding: 16px 24px; font-size: 1.08rem; }
	.marquee-track { font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js [data-reveal] { opacity: 1; transform: none; transition: none; }
	.cube, .shape, .marquee-track, .logo-mascot, .hero-mascot { animation: none !important; }
}

/* Grid children must be allowed to shrink below their content width (prevents horizontal overflow). */
.hero-grid > *, .how-grid > *, .example-grid > *, .phase-hero-grid > *, .phase-layout > *, .lesson-layout > *, .auth-grid > *, .account-grid > *, .split > *, .studio-grid > *, .dash-grid > * { min-width: 0; }
.eyebrow { white-space: normal; max-width: 100%; }
@media (max-width: 640px) { .btn-row .btn { white-space: normal; text-align: center; } .hero .btn-row .btn { flex: 1 1 100%; } }
.site-footer .credit { color: var(--sun); font-weight: 800; text-decoration: underline; text-decoration-style: wavy; text-underline-offset: 4px; }
.site-footer .credit:hover { color: #fff; }
