/* ==========================================================================
   Learn ChiTonga – design system
   ========================================================================== */
:root {
	--ink: #1a1612;
	--ink-2: #3f3a34;
	--muted: #776d61;
	--line: #e3d8c6;
	--line-2: #d6c8b1;
	--bg: #f4ede1;
	--bg-2: #ebe1d0;
	--surface: #fffbf4;
	--glass: rgba(255, 250, 241, .55);
	--glass-strong: rgba(255, 251, 244, .78);
	--glass-border: rgba(214, 200, 177, .75);
	--glass-hi: inset 0 1px 0 rgba(255, 255, 255, .85);
	--deep: #1f2422;
	--deep-2: #2f3a36;
	--teal: #24534d;
	--teal-2: #2f6d65;
	--amber: #d9921f;
	--amber-2: #f0b649;
	--clay: #b4532a;
	--indigo: #4a4f9c;
	--wa: #1f9a52;
	--gold: #b8862b;
	--radius: 22px;
	--radius-sm: 14px;
	--shadow: 0 1px 2px rgba(74, 56, 30, .06), 0 10px 28px -12px rgba(74, 56, 30, .22);
	--shadow-lg: 0 2px 6px rgba(74, 56, 30, .07), 0 28px 60px -22px rgba(74, 56, 30, .38);
	--font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--display: "Fraunces", Georgia, serif;
	--tabbar-h: 68px;
	--safe-b: env(safe-area-inset-bottom, 0px);
	color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
	margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
	font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
	-webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -.02em; color: #14110e; }
h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 28px; } }
.ico { width: 20px; height: 20px; flex: none; }
.muted { color: var(--muted); }
.hide-sm { display: none !important; }
@media (min-width: 900px) { .hide-sm { display: inline-flex !important; } .show-sm { display: none !important; } }

/* Ambient background */
.bg-orbs { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-orbs { background: radial-gradient(1200px 700px at 100% 0%, #f8e6c8, transparent 60%), radial-gradient(900px 600px at 0% 100%, #e7e3d0, transparent 60%), var(--bg); }
.bg-orbs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.bg-orbs span:nth-child(1) { width: 460px; height: 460px; background: #f2c79a; top: -120px; right: -140px; }
.bg-orbs span:nth-child(2) { width: 420px; height: 420px; background: #cfdcc8; top: 45%; left: -180px; }
.bg-orbs span:nth-child(3) { width: 380px; height: 380px; background: #efd6b0; bottom: -140px; right: 10%; }

/* Glass surfaces */
.glass, .glass-strong {
	background: var(--glass); border: 1px solid var(--glass-border);
	-webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
	box-shadow: var(--glass-hi), var(--shadow);
}
.glass-strong { background: var(--glass-strong); }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: .95rem; line-height: 1.2;
	transition: transform .18s ease, box-shadow .18s ease, background .18s ease; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn .ico { width: 18px; height: 18px; }
.btn-sm { padding: 9px 16px; font-size: .88rem; }
.btn-lg { padding: 15px 26px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-primary { background: linear-gradient(135deg, #2c3531, var(--deep)); color: #fbf6ec; box-shadow: 0 10px 24px -10px rgba(31, 36, 34, .7); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(31, 36, 34, .8); transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #2a1a04; box-shadow: 0 10px 26px -12px rgba(190, 120, 20, .8); }
.btn-accent:hover { transform: translateY(-1px); box-shadow: 0 14px 30px -12px rgba(190, 120, 20, .95); }
.btn-glass { background: rgba(255, 251, 244, .6); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--glass-hi); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.btn-glass:hover { background: rgba(255, 251, 244, .9); border-color: var(--deep); }
.btn-ghost { background: var(--glass-strong); border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--deep); }
.btn-wa { background: linear-gradient(135deg, #27b866, var(--wa)); color: #fff; box-shadow: 0 10px 24px -12px rgba(31, 154, 82, .85); }
.btn-wa:hover { transform: translateY(-1px); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; transition: background .2s; }
.icon-btn:hover { background: rgba(120, 95, 60, .1); }

/* ---------- Pills & chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; letter-spacing: .01em; }
.pill .ico { width: 15px; height: 15px; }
.pill-glass { background: rgba(255, 251, 244, .65); border: 1px solid var(--line-2); color: var(--ink-2); box-shadow: var(--glass-hi); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.pill-gold { background: rgba(240, 182, 73, .14); color: #f0c46a; border: 1px solid rgba(240, 182, 73, .35); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--clay); box-shadow: 0 0 0 4px rgba(180, 83, 42, .18); }
.chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
	background: var(--glass-strong); border: 1px solid var(--line-2); font-size: .88rem; font-weight: 600; color: var(--ink-2); box-shadow: var(--glass-hi);
	transition: all .18s; white-space: nowrap;
}
.chip small { font-size: .72rem; color: var(--muted); font-weight: 700; }
.chip:hover { border-color: var(--deep); color: var(--ink); }
.chip.active { background: var(--deep); color: #fbf6ec; border-color: var(--deep); }
.chip.active small { color: rgba(255, 255, 255, .7); }
.chip-lg { padding: 10px 16px; font-size: .92rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--clay); margin-bottom: 10px; }
.eyebrow-light { color: var(--clay); }

/* ---------- Top bar ---------- */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); transition: transform .3s ease; }
.topbar-inner {
	max-width: 1180px; margin: 0 auto; height: 60px; padding: 0 8px 0 14px; border-radius: 20px;
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	background: rgba(255, 251, 244, .55); border-color: rgba(214, 200, 177, .8); color: var(--ink);
	transition: background .3s, box-shadow .3s;
}
.topbar.scrolled .topbar-inner { background: rgba(255, 251, 244, .82); box-shadow: var(--glass-hi), 0 12px 30px -14px rgba(74, 56, 30, .35); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 1.08rem; letter-spacing: -.01em; }
.brand b { font-weight: 800; }
.brand-text { font-weight: 500; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: linear-gradient(135deg, #2c3531, var(--deep)); color: var(--amber-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.brand-mark .ico { width: 20px; height: 20px; stroke-width: 2.2; }
.nav-desktop { display: none; gap: 2px; }
.nav-desktop a { padding: 8px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: all .2s; }
.nav-desktop a:hover { color: var(--ink); background: rgba(120, 95, 60, .08); }
.nav-desktop a.active { color: #fbf6ec; background: var(--deep); }
.topbar-actions { display: flex; align-items: center; gap: 4px; }

@media (min-width: 900px) { .nav-desktop { display: flex; } .topbar { padding-top: 14px; } }

/* ---------- Mobile tab bar ---------- */
.tabbar {
	position: fixed; z-index: 45; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b));
	height: var(--tabbar-h); border-radius: 24px; display: grid; grid-template-columns: repeat(5, 1fr);
	padding: 6px; box-shadow: var(--shadow-lg);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 18px; font-size: .68rem; font-weight: 700; color: var(--muted); transition: all .2s; position: relative; }
.tabbar a .ico { width: 22px; height: 22px; transition: transform .2s; }
.tabbar a.active { color: #fbf6ec; background: var(--deep); }
.tabbar a.active .ico { transform: translateY(-1px) scale(1.06); }
.tabbar a:active .ico { transform: scale(.9); }
@media (min-width: 900px) { .tabbar { display: none; } }
@media (max-width: 899px) { body { padding-bottom: calc(var(--tabbar-h) + 24px + var(--safe-b)); } }

/* ---------- Bottom sheet menu ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(40, 30, 18, .35); opacity: 0; pointer-events: none; transition: opacity .3s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.sheet {
	position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh; overflow-y: auto;
	border-radius: 28px 28px 0 0; padding: 10px 18px calc(22px + var(--safe-b));
	transform: translateY(105%); transition: transform .42s cubic-bezier(.2, .9, .25, 1);
}
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
body.sheet-open .sheet { transform: none; }
body.sheet-open { overflow: hidden; }
.sheet-handle { width: 42px; height: 5px; border-radius: 9px; background: rgba(127, 127, 127, .35); margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-title { font-family: var(--display); font-size: 1.5rem; font-weight: 600; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.sheet-link { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 18px; background: rgba(255, 251, 244, .7); border: 1px solid var(--line); font-size: .82rem; font-weight: 700; text-align: center; transition: background .2s; }
.sheet-link.active { border-color: var(--deep); }
.sheet-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #2c3531, var(--deep)); color: var(--amber-2); }
.sheet-extra { border-radius: 18px; overflow: hidden; background: rgba(255, 251, 244, .7); border: 1px solid var(--line); margin-bottom: 14px; }
.sheet-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-weight: 600; font-size: .94rem; border-bottom: 1px solid var(--line); }
.sheet-row:last-child { border-bottom: 0; }
.sheet-row .ico { color: var(--clay); }
.ico-end { margin-left: auto; color: var(--muted) !important; width: 16px; height: 16px; }

/* ---------- Search overlay ---------- */
.search-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(40, 30, 18, .3); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; pointer-events: none; transition: opacity .25s; padding: max(16px, env(safe-area-inset-top)) 12px; }
body.search-open .search-overlay { opacity: 1; pointer-events: auto; }
.search-panel { max-width: 640px; margin: 8vh auto 0; border-radius: 24px; padding: 8px; transform: translateY(-12px) scale(.98); transition: transform .3s; }
body.search-open .search-panel { transform: none; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; }
.search-field > .ico { color: var(--muted); }
.search-field input { flex: 1; height: 52px; border: 0; background: none; font: inherit; font-size: 1.05rem; color: var(--ink); outline: none; min-width: 0; }
.search-results:empty { display: none; }
.search-results { padding: 6px; }
.sr-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; transition: background .15s; }
.sr-item:hover, .sr-item.focus { background: rgba(120, 95, 60, .08); }
.sr-item b { font-weight: 800; color: var(--teal); }
.sr-item span { color: var(--ink-2); font-size: .92rem; }
.sr-item .ico { margin-left: auto; color: var(--muted); width: 16px; height: 16px; }
.sr-empty { padding: 14px; color: var(--muted); font-size: .92rem; }

/* ---------- Hero ---------- */
.hero {
	position: relative; color: var(--ink); overflow: hidden; isolation: isolate;
	padding: 120px 0 120px; min-height: min(92svh, 860px); display: flex; align-items: center;
	background:
		radial-gradient(800px 480px at 85% -5%, rgba(240, 182, 73, .32), transparent 60%),
		radial-gradient(700px 500px at -10% 40%, rgba(150, 175, 140, .3), transparent 60%),
		linear-gradient(175deg, #f8f1e4 0%, #f1e6d3 100%);
}
.hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
	background-image: radial-gradient(rgba(120, 95, 60, .16) 1px, transparent 1px); background-size: 26px 26px;
	-webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%); mask-image: radial-gradient(ellipse at 50% 30%, #000 20%, transparent 70%);
}
.hero-bg { position: absolute; inset: auto 0 0 0; z-index: -1; }
.hero-waves { width: 100%; height: 180px; display: block; }
.hero-waves path:first-child { fill: rgba(180, 140, 90, .14); animation: drift 12s ease-in-out infinite alternate; }
.hero-waves path:last-child { fill: var(--bg); }
@keyframes drift { to { transform: translateX(-30px); } }
.hero-inner { text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-title { font-family: var(--display); font-weight: 600; font-size: clamp(2.9rem, 12vw, 6.2rem); letter-spacing: -.035em; line-height: .98; margin: 22px 0 18px; }
.hero-title em { font-style: italic; background: linear-gradient(120deg, #b4532a, #d48a24); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.hero-title span { display: block; font-family: var(--font); font-size: clamp(1rem, 3.6vw, 1.45rem); font-weight: 600; letter-spacing: .02em; color: var(--ink-2); margin-top: 16px; }
.hero-sub { max-width: 560px; font-size: clamp(1rem, 2.6vw, 1.15rem); color: var(--ink-2); margin-bottom: 30px; }
.hero-cta { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 340px; }
@media (min-width: 640px) { .hero-cta { flex-direction: row; max-width: none; justify-content: center; } }
.hero-stats { display: flex; gap: 10px; margin-top: 34px; }
.hero-stats div { padding: 10px 16px; border-radius: 16px; background: rgba(255, 251, 244, .6); border: 1px solid var(--line-2); box-shadow: var(--glass-hi), var(--shadow); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); display: flex; flex-direction: column; align-items: center; min-width: 92px; }
.hero-stats b { font-size: 1.25rem; font-weight: 800; }
.hero-stats b { color: #14110e; }
.hero-stats span { font-size: .72rem; color: var(--muted); font-weight: 600; }

/* ---------- Search bar (hero) ---------- */
.search-wrap { position: relative; z-index: 5; margin-top: -72px; }
.search-hero { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-radius: 22px; max-width: 760px; margin: 0 auto; box-shadow: var(--shadow-lg); }
.search-hero > .ico { color: var(--clay); width: 22px; height: 22px; }
.search-hero input { flex: 1; min-width: 0; height: 50px; border: 0; outline: 0; background: none; font: inherit; font-size: 1rem; color: var(--ink); }
.search-hero input::placeholder { color: var(--muted); }
.search-hero .btn { padding: 13px 20px; border-radius: 16px; }
.search-results-drop { position: absolute; left: 0; right: 0; top: calc(100% + 8px); background: var(--glass-strong); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); border-radius: 20px; box-shadow: var(--shadow-lg); }
.search-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; font-size: .85rem; color: var(--muted); font-weight: 600; }
.search-chips .chip { padding: 6px 12px; font-size: .82rem; }
@media (max-width: 520px) { .search-hero .btn { width: 48px; height: 48px; padding: 0; font-size: 0; } .search-hero .btn::after { content: "→"; font-size: 1.2rem; } }

/* ---------- Sections ---------- */
.section { padding-top: 46px; padding-bottom: 46px; }
@media (min-width: 768px) { .section { padding-top: 70px; padding-bottom: 70px; } }
.section-head { margin-bottom: 26px; }
.section-head p { color: var(--ink-2); margin: 10px 0 0; max-width: 520px; }
.section-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }

/* Quick cards */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .quick-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } .quick-grid-2 { grid-template-columns: repeat(2, 1fr); } }
.quick-card {
	position: relative; display: flex; flex-direction: column; padding: 18px 16px; border-radius: var(--radius); min-height: 168px;
	background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow); overflow: hidden;
	-webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%);
	transition: transform .25s ease, box-shadow .25s ease;
}
.quick-card::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; right: -60px; top: -60px; background: var(--c); opacity: .1; transition: transform .4s; }
.quick-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.quick-card:hover::after { transform: scale(1.3); }
.quick-ico { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; background: var(--c); color: #fff; margin-bottom: auto; box-shadow: 0 8px 18px -8px var(--c); }
.quick-ico .ico { width: 23px; height: 23px; }
.quick-title { font-weight: 800; font-size: .98rem; line-height: 1.25; margin-top: 18px; }
.quick-sub { font-size: .82rem; color: var(--muted); font-weight: 600; margin-top: 4px; }
.quick-go { position: absolute; right: 14px; bottom: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 251, 244, .8); border: 1px solid var(--line); color: var(--c); transition: transform .25s; }
.quick-go .ico { width: 15px; height: 15px; }
.quick-card:hover .quick-go { transform: translateX(3px); }
.quick-grid .quick-title, .quick-grid .quick-sub { padding-right: 30px; }
.c-teal { --c: var(--teal); } .c-amber { --c: #c07f12; } .c-clay { --c: var(--clay); } .c-indigo { --c: var(--indigo); }
@media (min-width: 900px) { .quick-card { padding: 24px 22px; min-height: 200px; } .quick-title { font-size: 1.1rem; } }

/* Word of the day */
.wotd {
	position: relative; overflow: hidden; border-radius: 30px; padding: 28px 22px; color: var(--ink); isolation: isolate;
	background: linear-gradient(140deg, rgba(255, 251, 244, .78), rgba(248, 236, 214, .6));
	border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
	box-shadow: var(--glass-hi), var(--shadow-lg); display: grid; gap: 24px;
}
.wotd-glow { position: absolute; z-index: -1; inset: -40% -20% auto auto; width: 420px; height: 420px; border-radius: 50%; background: radial-gradient(circle, rgba(240, 182, 73, .4), transparent 65%); }
.wotd-word { font-family: var(--display); font-size: clamp(3rem, 14vw, 5.5rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; margin: 18px 0 8px; }
.wotd-mean { font-size: clamp(1.1rem, 3.5vw, 1.45rem); font-weight: 700; color: var(--clay); margin: 0; }
.wotd-pron { font-size: .9rem; color: var(--muted); margin: 6px 0 0; font-weight: 600; letter-spacing: .04em; }
.wotd-ex { margin: 20px 0 0; padding: 16px 18px; border-radius: 18px; background: rgba(255, 251, 244, .7); border: 1px solid var(--line); border-left: 4px solid var(--clay); }
.wotd-ex p { font-family: var(--display); font-style: italic; font-size: 1.2rem; margin: 0 0 4px; }
.wotd-ex cite { font-style: normal; color: var(--ink-2); font-size: .92rem; }
.wotd-actions { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 768px) { .wotd { grid-template-columns: 1fr auto; align-items: end; padding: 48px; } .wotd-actions { min-width: 230px; } }

/* Categories */
.cat-grid { display: grid; gap: 14px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.cat-card { border-radius: var(--radius); padding: 20px; }
.cat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cat-head h3 { font-size: 1.12rem; font-weight: 800; }
.cat-ico { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; color: #fff; }
.cat-beginners .cat-ico { background: linear-gradient(135deg, #3d7a6f, var(--teal)); }
.cat-learners .cat-ico { background: linear-gradient(135deg, #d4874a, var(--clay)); }
.cat-schools .cat-ico { background: linear-gradient(135deg, #6d72c0, var(--indigo)); }

/* Stories */
.section-stories { background: linear-gradient(180deg, transparent, rgba(214, 190, 150, .18) 30%, transparent); }
.story-rail { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 16px 22px; scrollbar-width: none; }
.story-rail::-webkit-scrollbar { display: none; }
.story-rail .story-card { flex: 0 0 82%; scroll-snap-align: center; }
@media (min-width: 640px) { .story-rail .story-card { flex-basis: 46%; } }
@media (min-width: 900px) { .story-rail { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; max-width: 1180px; margin: 0 auto; padding: 6px 28px 10px; overflow: visible; } }
.story-grid { display: grid; gap: 18px; }
@media (min-width: 640px) { .story-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .story-grid { grid-template-columns: repeat(3, 1fr); gap: 22px; } }
.story-card { display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); transition: transform .3s, box-shadow .3s; }
.story-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.story-img { position: relative; aspect-ratio: 16 / 11; overflow: hidden; background: var(--deep); }
.story-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.story-card:hover .story-img img { transform: scale(1.06); }
.story-tags { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; }
.story-tags span { display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 999px; font-size: .7rem; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .3); border: 1px solid rgba(255, 255, 255, .25); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.story-tags .ico { width: 12px; height: 12px; }
.story-body { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.story-tonga { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--clay); }
.story-body h3 { font-family: var(--display); font-weight: 600; font-size: 1.35rem; margin: 6px 0 8px; }
.story-body p { font-size: .92rem; color: var(--ink-2); margin-bottom: 14px; }
.story-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem; color: var(--teal); }
.story-more .ico { width: 16px; height: 16px; transition: transform .2s; }
.story-card:hover .story-more .ico { transform: translateX(4px); }

/* Split / dictionary */
.split { display: grid; gap: 26px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: .9fr 1.1fr; gap: 50px; } }
.split .section-head .btn { margin-top: 22px; }
@media (max-width: 899px) { .split .section-head .btn { width: 100%; white-space: normal; } }
.dict-card { border-radius: var(--radius); overflow: hidden; padding: 6px; }
.dict-table { width: 100%; border-collapse: collapse; }
.dict-table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 800; padding: 14px 16px 10px; }
.dict-table td { padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.dict-table tbody tr { transition: background .15s; }
.dict-table tbody tr:hover { background: rgba(214, 190, 150, .14); }
.t-end { text-align: right !important; width: 1%; }
.w-tonga { font-weight: 800; color: #14110e; font-size: 1.02rem; }
.w-eng { color: var(--ink-2); }
.w-pron { display: block; font-size: .76rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
@media (max-width: 520px) { .dict-table td { padding: 12px 10px; } .dict-table th { padding: 12px 10px 8px; } .dict-table-full .w-eng { font-size: .9rem; } }

.play-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
td .play-btn, .word-row > .play-btn, .ex-tonga .play-btn, .sound-card .play-btn {
	width: 42px; height: 42px; border-radius: 50%; flex: none;
	background: rgba(255, 251, 244, .85); border: 1px solid var(--line-2); color: var(--deep);
	transition: transform .15s, background .2s;
}
td .play-btn:hover, .word-row > .play-btn:hover, .sound-card .play-btn:hover { background: var(--deep); border-color: var(--deep); color: var(--amber-2); }
.play-btn:active { transform: scale(.9); }
.play-btn.playing { background: var(--deep) !important; color: var(--amber-2) !important; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 83, 42, .4); } 50% { box-shadow: 0 0 0 10px rgba(180, 83, 42, 0); } }
.play-xl { width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, var(--amber-2), var(--amber)); color: #2b1a00; box-shadow: 0 14px 30px -10px rgba(245, 165, 36, .9); flex: none; }
.play-xl .ico { width: 32px; height: 32px; }

/* Pack */
.pack {
	position: relative; overflow: hidden; border-radius: 30px; padding: 30px 22px; color: #fff; isolation: isolate;
	background: radial-gradient(600px 300px at 100% 0%, rgba(240, 182, 73, .28), transparent 60%), linear-gradient(150deg, #1a1714, #24221e 60%, #2c2a24);
	border: 1px solid rgba(240, 182, 73, .3); box-shadow: var(--shadow-lg); display: grid; gap: 22px;
}
.pack-art { position: absolute; z-index: -1; right: -40px; top: -30px; color: rgba(240, 182, 73, .12); }
.pack-art .ico { width: 230px; height: 230px; stroke-width: 1; }
.pack h2 { color: #fff; margin: 14px 0 16px; font-size: clamp(1.6rem, 5vw, 2.4rem); }
.pack-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.pack-list li { display: flex; align-items: center; gap: 8px; font-weight: 600; color: rgba(255, 255, 255, .86); font-size: .95rem; }
.pack-list .ico { width: 18px; height: 18px; color: #f0c46a; stroke-width: 2.6; }
.pack-cta { display: flex; flex-direction: column; gap: 14px; }
.price b { display: block; font-family: var(--display); font-size: 2.2rem; font-weight: 600; color: #f0c46a; line-height: 1.1; }
.price span { color: rgba(255, 255, 255, .65); font-weight: 600; }
@media (min-width: 900px) { .pack { grid-template-columns: 1.4fr 1fr; align-items: center; padding: 50px; } .pack-cta { align-items: flex-start; } }

/* ---------- Inner pages ---------- */
.page-hero {
	position: relative; color: var(--ink); padding: 112px 0 64px; overflow: hidden; isolation: isolate;
	background: radial-gradient(700px 400px at 90% -20%, rgba(240, 182, 73, .3), transparent 60%), radial-gradient(600px 400px at 0% 100%, rgba(150, 175, 140, .28), transparent 60%), linear-gradient(175deg, #f8f1e4, #efe3cf);
	border-bottom: 1px solid var(--line-2); border-radius: 0 0 32px 32px;
}
.page-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 8vw, 3.8rem); letter-spacing: -.03em; margin-bottom: 10px; }
.page-hero p { color: var(--ink-2); max-width: 600px; margin: 0; font-size: 1.04rem; }
@media (min-width: 900px) { .page-hero { padding: 140px 0 80px; border-radius: 0 0 48px 48px; } }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .82rem; color: var(--muted); margin-bottom: 18px; font-weight: 600; }
.crumbs a:hover { color: var(--ink); }
.story-hero .crumbs { color: rgba(255, 255, 255, .65); }
.story-hero .crumbs a:hover { color: #fff; }
.story-hero .eyebrow-light { color: var(--amber-2); }
.story-hero h1 { color: #fff; }
.page-body { padding-top: 26px; padding-bottom: 50px; }
.word-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.word-hero h1 { font-size: clamp(2.8rem, 12vw, 5rem); line-height: 1; }
.word-hero-mean { font-size: 1.35rem !important; font-weight: 700; color: var(--clay) !important; margin-top: 10px !important; }

.tabs-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 6px; margin: 0 -4px 20px; scrollbar-width: none; border-radius: 999px; }
.tabs-scroll::-webkit-scrollbar { display: none; }
.sticky-tabs { position: sticky; top: 82px; z-index: 20; }
@media (min-width: 900px) { .sticky-tabs { top: 92px; } }
.search-inline { margin: -54px 0 18px; position: relative; z-index: 3; }
.result-note { color: var(--ink-2); font-size: .92rem; }
.result-note a { color: var(--clay); font-weight: 700; }

.word-section { margin: 26px 0 34px; }
.word-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.word-section-head h2 { font-size: clamp(1.4rem, 4vw, 1.9rem); }
.word-section-head .count { font-size: .8rem; color: var(--muted); font-weight: 700; }
.link { display: inline-flex; align-items: center; gap: 4px; color: var(--teal); font-weight: 700; font-size: .9rem; }
.link .ico { width: 15px; height: 15px; }
.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 700px) { .word-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1050px) { .word-list { grid-template-columns: repeat(3, 1fr); } }
.word-row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi), 0 1px 2px rgba(74, 56, 30, .05); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .2s, box-shadow .2s, border-color .2s; }
.word-row:hover { transform: translateY(-2px); box-shadow: var(--glass-hi), var(--shadow); border-color: var(--line-2); }
.word-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.word-main .w-eng { font-size: .9rem; line-height: 1.35; }

.practice, .cta-strip, .tip, .audio-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border-radius: 20px; margin-bottom: 18px; }
.practice b, .practice span { display: block; }
.practice span { font-size: .86rem; color: var(--muted); }
.cta-strip { flex-wrap: wrap; margin-top: 30px; padding: 22px; }
.cta-strip h3 { font-size: 1.15rem; font-weight: 800; margin-bottom: 4px; }
.cta-strip p { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .cta-strip .btn { width: 100%; } }
.tip { align-items: flex-start; justify-content: flex-start; margin-top: 24px; }
.tip p { margin: 4px 0 0; color: var(--ink-2); font-size: .94rem; }
.tip-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(180, 83, 42, .1); color: var(--clay); }

.topic-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .topic-grid { grid-template-columns: repeat(4, 1fr); } }
.topic-card { display: flex; flex-direction: column; padding: 18px; border-radius: 20px; transition: transform .2s, box-shadow .2s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.topic-emoji { font-size: 1.9rem; line-height: 1; margin-bottom: 14px; }
.topic-title { font-weight: 800; }
.topic-desc { font-size: .82rem; color: var(--muted); line-height: 1.4; margin-top: 4px; }

.letter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.letter { aspect-ratio: 1; border-radius: 16px; background: var(--glass-strong); border: 1px solid var(--glass-border); box-shadow: var(--glass-hi); flex-direction: column; gap: 0 !important; font-family: var(--display); font-size: 1.6rem; font-weight: 600; color: var(--ink); transition: all .15s; }
.letter small { font-family: var(--font); font-size: .75rem; color: var(--muted); font-weight: 700; }
.letter:hover, .letter.playing { background: var(--deep) !important; color: var(--amber-2) !important; }
.letter:hover small, .letter.playing small { color: rgba(255, 255, 255, .8); }
.sound-grid { display: grid; gap: 10px; }
@media (min-width: 700px) { .sound-grid { grid-template-columns: repeat(2, 1fr); } }
.sound-card { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; }
.sound-card > div { flex: 1; display: flex; flex-direction: column; line-height: 1.35; }
.sound-card span { font-size: .88rem; color: var(--ink-2); }
.sound-card em { font-size: .82rem; color: var(--clay); font-style: normal; font-weight: 700; margin-top: 2px; }
.sound-letter { width: 54px; height: 54px; border-radius: 16px; flex: none; display: grid; place-items: center; font-family: var(--display); font-size: 1.8rem; font-weight: 600; color: var(--amber-2); background: linear-gradient(135deg, #2c3531, var(--deep)); }
.sound-letter-sm { font-size: 1rem; font-family: var(--font); font-weight: 800; background: linear-gradient(135deg, #d4874a, var(--clay)); color: #fff; text-align: center; line-height: 1.1; padding: 4px; }
.next-step { margin-top: 26px; }

.empty { text-align: center; padding: 40px 22px; border-radius: 24px; margin: 10px 0; }
.empty h3 { font-size: 1.25rem; font-weight: 800; margin: 14px 0 8px; }
.empty p { color: var(--ink-2); max-width: 460px; margin: 0 auto 20px; }
.empty-ico { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; font-size: 1.9rem; background: rgba(255, 251, 244, .8); border: 1px solid var(--line-2); color: var(--clay); }
.empty-ico .ico { width: 30px; height: 30px; }

.proverb-grid { display: grid; gap: 14px; }
@media (min-width: 800px) { .proverb-grid { grid-template-columns: repeat(2, 1fr); } }
.proverb { padding: 24px; border-radius: 24px; position: relative; }
.proverb-q { color: var(--clay); }
.proverb-q .ico { width: 30px; height: 30px; }
.proverb-tonga { font-family: var(--display); font-size: 1.4rem; font-weight: 600; margin: 10px 0 6px; }
.proverb-eng { color: var(--teal); font-weight: 700; }
.proverb-mean { color: var(--ink-2); font-size: .92rem; }
.proverb .play-btn { color: var(--teal); font-weight: 700; }

/* Story page */
.story-hero { position: relative; color: #fff; min-height: min(62svh, 620px); display: flex; align-items: flex-end; padding: 110px 0 40px; overflow: hidden; border-radius: 0 0 32px 32px; background: var(--deep); }
.story-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.story-hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(4, 30, 35, .35), rgba(4, 30, 35, .2) 30%, rgba(4, 30, 35, .92)); }
.story-hero-inner { position: relative; }
.story-hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 8vw, 4rem); letter-spacing: -.03em; margin-bottom: 10px; }
.story-hero p { color: rgba(255, 255, 255, .82); max-width: 620px; margin: 0; }
.story-container { max-width: 1000px; }
.audio-bar { margin-top: -50px; position: relative; z-index: 2; }
.audio-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.audio-label .ico { color: var(--teal); }
.audio-bar audio { max-width: 60%; height: 40px; }
.lang-toggle { display: inline-flex; padding: 5px; border-radius: 999px; gap: 4px; margin: 6px 0 22px; }
.lang-toggle button { padding: 9px 18px; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); transition: all .2s; }
.lang-toggle button small { font-size: .72rem; opacity: .7; margin-left: 4px; }
.lang-toggle button.active { background: var(--deep); color: #fbf6ec; box-shadow: var(--shadow); }
.seg-wide { display: flex; width: 100%; max-width: 420px; }
.seg-wide button { flex: 1; }
.story-text { display: grid; gap: 22px; }
@media (min-width: 900px) { .story-text[data-langs="both"] { grid-template-columns: 1fr 1fr; } }
.story-text[data-langs="tonga"] .story-col-english, .story-text[data-langs="english"] .story-col-tonga { display: none; }
.story-col { background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 24px; padding: 24px 22px; box-shadow: var(--glass-hi), var(--shadow); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.story-col h2 { font-family: var(--font); font-size: .82rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.flag { display: inline-grid; place-items: center; width: 30px; height: 22px; border-radius: 6px; font-size: .66rem; color: #fff; background: var(--clay); letter-spacing: .05em; }
.story-col-english .flag { background: var(--deep); }
.story-col p { font-size: 1.06rem; line-height: 1.8; color: var(--ink); }
.story-col p:first-of-type::first-letter { font-family: var(--display); font-size: 3.2em; float: left; line-height: .9; padding: 6px 10px 0 0; color: var(--clay); font-weight: 600; }
.story-col p.muted::first-letter { all: unset; }

/* Papers */
.paper-panel { display: none; }
.paper-panel.active { display: block; animation: fadeUp .35s ease; }
.paper-list { display: grid; gap: 10px; }
@media (min-width: 800px) { .paper-list { grid-template-columns: repeat(2, 1fr); } }
.paper { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 18px; transition: transform .2s; }
.paper:hover { transform: translateY(-2px); }
.paper-ico { width: 48px; height: 56px; border-radius: 10px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #fff; background: linear-gradient(160deg, #d4874a, var(--clay)); flex: none; }
.paper-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.paper-info b { font-weight: 700; line-height: 1.3; }
.paper-info span { font-size: .8rem; color: var(--muted); }
.paper-dl { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--deep); color: var(--amber-2); }

/* About / prose */
.prose-wrap { max-width: 820px; }
.prose { padding: 28px 22px; border-radius: 26px; margin-top: -40px; position: relative; }
@media (min-width: 768px) { .prose { padding: 44px; } }
.prose .lead { font-size: 1.18rem; font-weight: 600; color: var(--ink); }
.prose p { color: var(--ink-2); }
.prose h2 { font-size: 1.6rem; margin: 28px 0 14px; }
.check-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 12px; }
.check-list li { display: flex; gap: 12px; color: var(--ink-2); }
.check-list .ico { color: var(--clay); stroke-width: 2.6; margin-top: 3px; }
.prose .btn-row { justify-content: flex-start; margin: 18px 0 26px; }
.sponsor-note { display: flex; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); font-size: .92rem; }
.sponsor-note .ico { color: var(--clay); }
.example-card { padding: 22px; border-radius: 22px; margin: 6px 0 20px; }
.ex-tonga { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-size: 1.5rem; font-style: italic; margin: 4px 0 6px; }
.ex-eng { color: var(--ink-2); margin: 0; }

/* Footer */
.site-footer { margin-top: 30px; padding: 50px 0 30px; background: linear-gradient(175deg, #ebdfcb, #e2d3ba); color: var(--ink-2); border-top: 1px solid var(--line-2); border-radius: 32px 32px 0 0; }
.footer-grid { display: grid; gap: 30px; grid-template-columns: 1fr 1fr; }
.footer-brand { grid-column: 1 / -1; }
.footer-brand .brand { color: var(--ink); margin-bottom: 14px; }
.footer-brand p { max-width: 360px; font-size: .94rem; }
.site-footer h4 { color: #14110e; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 14px; }
.site-footer .footer-grid > div:not(.footer-brand) a { display: block; padding: 5px 0; font-size: .94rem; }
.site-footer a:hover { color: var(--clay); }
.footer-bottom { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 8px; font-size: .84rem; }
.sponsor b { color: var(--clay); }
@media (min-width: 900px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } .footer-brand { grid-column: auto; } .footer-bottom { flex-direction: row; justify-content: space-between; } }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 30px + var(--safe-b)); z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 18px; border-radius: 16px; background: rgba(31, 36, 34, .94); color: #fbf6ec; font-size: .88rem; font-weight: 600; max-width: calc(100% - 32px); text-align: center; box-shadow: var(--shadow-lg); transition: all .3s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { .toast { bottom: 30px; } }

/* Motion */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } .js .reveal { opacity: 1; transform: none; } html { scroll-behavior: auto; } }
