/* Layout: bold brand. Full-width navy and red bands alternate with white; oversized Chinese characters act as section graphics. */
:root {
  --paper: #f7f8fb;
  --surface: #ffffff;
  --ink: #12203d;
  --muted: #4d5872;
  --line: #dde2ec;
  --brand: #1f3a6a;
  --brand-ink: #ffffff;
  --brand-soft: #e8edf6;
  --seal: #ad0000;
  --seal-hover: #c41414;
  --deep: #14264d;
  --deep-card: #1e3566;
  --on-deep: #f4f6fb;
  --on-deep-muted: #b8c3dc;
  --red-band: #a30f12;
  --red-card: #b92a2c;
  --on-red-muted: #ffd9d6;
  --giant: rgba(196, 20, 20, 0.62);
  --mark: #e9edf5;
  --shadow: rgba(18, 32, 61, 0.18);
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --zh: "Noto Serif SC", "Songti SC", "SimSun", serif;
  --radius: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0b1020; --surface: #121a2e; --ink: #e9edf6; --muted: #a3aec6; --line: #243049;
    --brand: #95b3e8; --brand-ink: #0b1020; --brand-soft: #17213a; --seal: #d42a22; --seal-hover: #e8443b;
    --deep: #142045; --deep-card: #1d2b56; --on-deep: #f1f4fb; --on-deep-muted: #aeb9d4;
    --red-band: #5c1316; --red-card: #74201f; --on-red-muted: #f3c9c5;
    --giant: rgba(232, 68, 59, 0.5); --mark: #151e33; --shadow: rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0b1020; --surface: #121a2e; --ink: #e9edf6; --muted: #a3aec6; --line: #243049;
  --brand: #95b3e8; --brand-ink: #0b1020; --brand-soft: #17213a; --seal: #d42a22; --seal-hover: #e8443b;
  --deep: #142045; --deep-card: #1d2b56; --on-deep: #f1f4fb; --on-deep-muted: #aeb9d4;
  --red-band: #5c1316; --red-card: #74201f; --on-red-muted: #f3c9c5;
  --giant: rgba(232, 68, 59, 0.5); --mark: #151e33; --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 1.0625rem; line-height: 1.65; overflow-x: hidden; }
img { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--seal); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.06; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.5rem, 6.4vw, 5rem); font-weight: 800; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 750; letter-spacing: -0.02em; }
h3 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }

.wrap { width: 100%; max-width: 74rem; margin-inline: auto; padding-inline: 20px; position: relative; z-index: 1; }
.prose { max-width: 42rem; display: grid; gap: 1rem; min-width: 0; }
.prose h2 { margin-top: 1.5rem; }
.prose h3 { margin-top: 0.75rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.25rem; display: grid; gap: 0.4rem; }

.eyebrow { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: baseline; font-family: var(--mono); font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.eyebrow .zh { font-family: var(--zh); letter-spacing: 0; text-transform: none; font-size: 1rem; font-weight: 700; color: var(--seal); }

/* Logo */
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 2.15rem; width: auto; display: block; }
.brand .logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand .logo-light { display: none; } :root:not([data-theme="light"]) .brand .logo-dark { display: block; } }
:root[data-theme="dark"] .brand .logo-light { display: none; }
:root[data-theme="dark"] .brand .logo-dark { display: block; }
.site-footer .brand img { height: 1.9rem; }

/* Header */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.85rem; }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; font-weight: 600; }
.nav a:hover { color: var(--seal); }
.nav a[aria-current="page"] { color: var(--seal); }
.nav a.nav-learn { display: inline-flex; align-items: center; gap: 0.4rem; }
.nav-zh { display: inline-grid; place-items: center; width: 1.4rem; height: 1.4rem; border-radius: 5px; background: var(--seal); color: #fff; font-family: var(--zh); font-size: 0.82rem; line-height: 1; }
.nav-toggle { display: none; background: none; border: 2px solid var(--line); color: var(--ink); border-radius: 999px; padding: 0.4rem 0.9rem; font: inherit; font-weight: 600; cursor: pointer; }
@media (max-width: 1000px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 0.5rem 20px 1.25rem; }
  .nav.open { display: flex; }
  .nav a { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 0.9rem; text-align: center; border-bottom: none; }
}

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: var(--brand-ink) !important; text-decoration: none !important; font-weight: 700; padding: 0.95rem 1.6rem; border-radius: 999px; border: 2px solid var(--brand); font-family: var(--body); font-size: 1.02rem; cursor: pointer; line-height: 1.2; transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease; }
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px var(--shadow); }
.btn.ghost { background: transparent; color: var(--brand) !important; }
.btn.red { background: var(--seal); border-color: var(--seal); color: #fff !important; }
.btn.red:hover { background: var(--seal-hover); border-color: var(--seal-hover); }
.btn.ghost-light { background: transparent; border-color: var(--on-deep); color: var(--on-deep) !important; }
.btn.small { padding: 0.55rem 1.1rem; font-size: 0.92rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
section { padding-block: clamp(3.5rem, 8vw, 6.5rem); position: relative; }
.section-head { display: grid; gap: 0.85rem; max-width: 46rem; margin-bottom: 2.5rem; }
.section-head p { color: var(--muted); font-size: 1.12rem; }
.section-head p.eyebrow { font-size: 0.78rem; }
.band { background: var(--brand-soft); }

/* Oversized character section marks */
.marked { overflow: hidden; }
.mark { position: absolute; z-index: 0; top: clamp(1rem, 4vw, 3rem); right: -0.08em; font-family: var(--zh); font-weight: 700; font-size: clamp(6rem, 17vw, 14rem); line-height: 1; color: var(--mark); pointer-events: none; user-select: none; white-space: nowrap; }

/* Navy hero (home) and navy page heroes */
.hero-bold, .page-hero { background: var(--deep); color: var(--on-deep); overflow: hidden; }
.hero-bold { padding-block: clamp(3.5rem, 9vw, 7rem); }
.hero-giant { position: absolute; z-index: 0; right: -0.12em; bottom: -0.18em; font-family: var(--zh); font-weight: 700; line-height: 1; color: var(--giant); font-size: clamp(9rem, 30vw, 26rem); pointer-events: none; user-select: none; white-space: nowrap; animation: drift 1.4s cubic-bezier(.2,.7,.2,1) both; }
.page-hero .hero-giant { font-size: clamp(7rem, 22vw, 18rem); bottom: -0.22em; }
@media (max-width: 760px) { .hero-giant, .page-hero .hero-giant { opacity: 0.4; } }
@keyframes drift { from { transform: translateX(6%); } to { transform: none; } }
.hero-bold-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
.hero-copy { display: grid; gap: 1.25rem; }
.hero-bold h1 em, .page-hero h1 em { font-style: normal; color: #ff8f84; }
.hero-bold .lede, .page-hero .lede { color: var(--on-deep-muted); font-size: 1.2rem; max-width: 36rem; }
.hero-bold .eyebrow, .page-hero .eyebrow { color: var(--on-deep-muted); }
.hero-bold .eyebrow .zh, .page-hero .eyebrow .zh { color: #ff8f84; }
.page-hero { padding-block: clamp(3rem, 7vw, 5.5rem); }
.page-hero .lede { margin-top: 1rem; max-width: 42rem; }
.page-hero h1 { max-width: 52rem; }
.page-hero a:not(.btn) { color: var(--on-deep); }
.page-hero .btn { background: var(--seal); border-color: var(--seal); color: #fff !important; }
.page-hero .btn.ghost { background: transparent; border-color: var(--on-deep); color: var(--on-deep) !important; }
.page-hero .checked { color: var(--on-deep-muted); }
@media (max-width: 860px) { .hero-bold-inner { grid-template-columns: 1fr; } }

/* Two-path chooser */
.paths { display: grid; gap: 1rem; }
.path { display: grid; gap: 0.35rem; text-decoration: none; color: var(--ink); background: var(--surface); border-radius: var(--radius); padding: 1.5rem 1.6rem; box-shadow: 0 20px 40px -24px rgba(0,0,0,.5); transition: transform .18s ease; }
.path:hover { transform: translateY(-4px); }
.path-zh { font-family: var(--zh); font-size: 2.5rem; font-weight: 700; line-height: 1; color: var(--seal); }
.path-label { font-family: var(--display); font-size: 1.45rem; font-weight: 750; }
.path-desc { color: var(--muted); }
.path-go { color: var(--brand); font-weight: 700; margin-top: 0.3rem; }
.path-learn { background: var(--seal); color: #fff; }
.path-learn .path-zh, .path-learn .path-go { color: #fff; }
.path-learn .path-desc { color: #ffe0dc; }

/* Generic hero card (Learn Chinese page) */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 3rem; align-items: center; }
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; gap: 2rem; } }
.hero-card { background: var(--surface); color: var(--ink); border-radius: var(--radius); padding: 1.75rem; display: grid; gap: 0.9rem; }
.hero-card .big-zh { font-family: var(--zh); font-weight: 700; font-size: clamp(3.5rem, 9vw, 5.5rem); line-height: 1; color: var(--seal); }
.hero-card p { color: var(--muted); }

/* Grids and cards */
.grid { display: grid; gap: 1.25rem; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid.two, .grid.three { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.75rem; display: grid; gap: 0.65rem; align-content: start; min-width: 0; color: var(--ink); }
.card p { color: var(--muted); }
.card .more, .card a.more { color: var(--brand); font-weight: 700; text-decoration: none; margin-top: 0.25rem; }
a.card { text-decoration: none; }
.chunky { position: relative; overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
a.chunky:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 22px 40px -26px var(--shadow); }
.card-zh { font-family: var(--zh); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--seal); margin-bottom: 0.4rem; }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 1rem; padding-block: 1.35rem; border-top: 2px solid var(--line); }
.steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 0.95rem; color: var(--seal); padding-top: 0.25rem; font-weight: 500; }
.steps li div { display: grid; gap: 0.35rem; }
.steps li p { color: var(--muted); }
.steps.big { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.steps.big li { grid-template-columns: 1fr; align-content: start; border-top: 4px solid var(--seal); padding-top: 1.25rem; }
.steps.big li::before { font-family: var(--display); font-size: 3rem; font-weight: 800; line-height: 1; padding: 0; }
@media (max-width: 760px) { .steps.big { grid-template-columns: 1fr; } }

/* Navy band (stories) */
.navy-band { background: var(--deep); color: var(--on-deep); }
.navy-band .section-head p, .navy-band .eyebrow { color: var(--on-deep-muted); }
.navy-band .eyebrow .zh { color: #ff8f84; }
.navy-band .mark { color: rgba(255,255,255,0.05); }
.quotes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
@media (max-width: 860px) { .quotes { grid-template-columns: 1fr; } }
.quote { margin: 0; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1.75rem; display: grid; gap: 1rem; align-content: space-between; position: relative; }
.navy-band .quote { background: var(--deep-card); border-color: transparent; color: var(--on-deep); }
.quote-mark { font-family: var(--display); font-weight: 800; font-size: 4.5rem; line-height: 0.6; color: var(--seal); height: 1.6rem; }
.navy-band .quote-mark { color: #ff8f84; }
.quote blockquote { margin: 0; font-size: 1.08rem; }
.quote figcaption { font-family: var(--mono); font-size: 0.82rem; color: var(--muted); }
.navy-band .quote figcaption { color: var(--on-deep-muted); }
.quote figcaption strong { display: block; color: inherit; font-family: var(--body); font-size: 1rem; }
.navy-band .quote figcaption strong { color: var(--on-deep); }

/* Red Learn Chinese band */
.learn-band { background: var(--red-band); color: #fff; }
.learn-band .section-head p, .learn-band .eyebrow { color: var(--on-red-muted); }
.learn-band .eyebrow .zh { color: #fff; }
.learn-band .mark { color: rgba(255,255,255,0.07); }
.learn-band .btn { background: #fff; color: var(--red-band) !important; border-color: #fff; }
.learn-band .btn.ghost { background: transparent; color: #fff !important; }
.learn-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; margin-bottom: 2.25rem; }
.tones { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 860px) { .tones { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tone { background: var(--red-card); border-radius: var(--radius); padding: 1.4rem; display: grid; gap: 0.2rem; justify-items: start; align-content: start; }
.tone svg { width: 4.5rem; height: 3.75rem; overflow: visible; }
.tone svg path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.tone-zh { font-family: var(--zh); font-size: 3rem; line-height: 1.1; font-weight: 700; }
.tone-py { font-family: var(--display); font-size: 1.5rem; font-weight: 750; }
.tone-en { color: var(--on-red-muted); }
.tone-name { font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--on-red-muted); margin-bottom: 0.7rem; }

/* Phrases */
.phrases { list-style: none; margin: 0; padding: 0; display: grid; border-top: 2px solid var(--line); min-width: 0; }
.phrases li { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "zh" "py" "en"; column-gap: 1rem; padding-block: 1rem; border-bottom: 2px solid var(--line); align-items: center; }
.ph-zh { grid-area: zh; font-family: var(--zh); font-size: 1.6rem; font-weight: 700; }
.ph-py { grid-area: py; font-family: var(--display); font-weight: 700; color: var(--seal); }
.ph-en { grid-area: en; color: var(--muted); }

/* Meet Dr Li */
.meet { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; }
@media (max-width: 760px) { .meet { grid-template-columns: 1fr; } }
.portrait { width: 100%; max-width: 26rem; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); box-shadow: 14px 14px 0 var(--seal); }
.seal-block { width: calc(100% - 14px); max-width: 22rem; aspect-ratio: 1; border-radius: var(--radius); background: var(--seal); display: grid; place-items: center; box-shadow: 14px 14px 0 var(--deep); }
.seal-block span { font-family: var(--zh); font-weight: 700; color: #fff; font-size: clamp(8rem, 22vw, 14rem); line-height: 1; transform: rotate(-4deg); }

/* Tables */
.table-wrap { overflow-x: auto; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.97rem; }
th, td { text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
tr:last-child td { border-bottom: none; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 700; }

.note { border-left: 4px solid var(--seal); background: var(--surface); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; }
.note strong { color: var(--seal); }
.checked { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; min-width: 0; }
.checklist li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: 0.5rem; }
.checklist li::before { content: ""; width: 1rem; height: 1rem; background: var(--seal); margin-top: 0.35rem; clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 38% 72%); }

/* FAQ */
.faq { display: grid; border-top: 2px solid var(--line); min-width: 0; }
.faq details { border-bottom: 2px solid var(--line); padding-block: 1.1rem; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--display); font-weight: 800; color: var(--seal); font-size: 1.6rem; line-height: 0.8; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { margin-top: 0.75rem; color: var(--muted); display: grid; gap: 0.6rem; max-width: 46rem; }

/* Forms */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
form { display: grid; gap: 1rem; }
.field { display: grid; gap: 0.35rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
label { font-weight: 700; font-size: 0.95rem; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 2px solid var(--line); border-radius: 10px; padding: 0.75rem 0.9rem; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); }
textarea { min-height: 8rem; resize: vertical; }
.form-status { font-size: 0.95rem; min-height: 1.5em; }
.form-status.ok { color: var(--brand); font-weight: 700; }
.form-status.err { color: var(--seal); font-weight: 600; }
.hint { font-size: 0.88rem; color: var(--muted); }
.consent { display: grid; grid-template-columns: 1.25rem minmax(0, 1fr); gap: 0.6rem; font-weight: 400; font-size: 0.92rem; color: var(--muted); }
.consent input { width: 1.1rem; height: 1.1rem; margin-top: 0.25rem; padding: 0; }
.newsletter { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; align-items: center; }
.newsletter form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.newsletter .form-status { grid-column: 1 / -1; }
@media (max-width: 760px) { .newsletter, .newsletter form { grid-template-columns: 1fr; } }

.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }
.copy-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.copy-line code { font-family: var(--mono); font-size: 0.95rem; background: var(--brand-soft); padding: 0.25rem 0.55rem; border-radius: 6px; user-select: all; }
.copy-btn { font: inherit; font-size: 0.85rem; font-weight: 600; background: none; border: 2px solid var(--line); color: var(--ink); border-radius: 999px; padding: 0.2rem 0.75rem; cursor: pointer; }

/* CTA band */
.cta { background: var(--seal); color: #fff; }
.cta .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; }
.cta p { color: #ffe0dc; margin-top: 0.6rem; max-width: 40rem; }
.cta .btn { background: #fff; color: var(--seal) !important; border-color: #fff; }

/* Footer */
.site-footer { background: var(--deep); color: var(--on-deep); padding-block: 3.5rem 2rem; font-size: 0.95rem; }
.site-footer .brand .logo-light { display: none !important; }
.site-footer .brand .logo-dark { display: block !important; }
.site-footer p { color: var(--on-deep-muted) !important; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.footer-grid h3 { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-deep-muted); font-weight: 500; margin-bottom: 0.75rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.footer-grid a, .footer-grid span { color: var(--on-deep) !important; text-decoration: none; overflow-wrap: anywhere; }
.footer-grid a:hover { color: #ff8f84 !important; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.14); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; color: var(--on-deep-muted); font-size: 0.85rem; }
.footer-base a { color: var(--on-deep); }

/* Scroll motion: content is always visible; it only rises slightly into place */
.reveal { transition: transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.pre { transform: translateY(22px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal.pre { transform: none; }
}

/* Floating WhatsApp button */
.wa-float{position:fixed;right:16px;bottom:16px;z-index:60;display:inline-flex;align-items:center;gap:8px;padding:12px 16px;border-radius:999px;background:#128c4a;color:#fff;font:600 15px/1 "Public Sans",system-ui,sans-serif;text-decoration:none;box-shadow:0 6px 20px rgba(0,0,0,.28);transition:transform .15s ease,background .15s ease}
.wa-float:hover{background:#0e7a40;transform:translateY(-2px)}
.wa-float:focus-visible{outline:3px solid #fff;outline-offset:2px;box-shadow:0 0 0 6px #128c4a}
@media (max-width:560px){.wa-float{padding:14px}.wa-float span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
@media print{.wa-float{display:none}}

/* Video cards */
.video-card{display:block;text-decoration:none;color:inherit;overflow:hidden;padding:0}
.video-card img{display:block;width:100%;height:auto;aspect-ratio:4/3;object-fit:cover;background:var(--deep)}
.video-card h3,.video-card p{padding:0 1.1rem}
.video-card h3{margin-top:1rem}
.video-card p{padding-bottom:1.1rem;color:var(--muted)}

/* Malayalam text */
:lang(ml){font-family:"Noto Sans Malayalam","Nirmala UI",system-ui,sans-serif;line-height:1.75}
h1:lang(ml),h2:lang(ml),h3:lang(ml){line-height:1.35}

/* Language switch (header) */
.lang-switch{font-size:.9rem;font-weight:600;text-decoration:none;color:inherit;border:1.5px solid currentColor;border-radius:999px;padding:.3rem .8rem;opacity:.85;white-space:nowrap}
.lang-switch:hover,.lang-switch:focus-visible{opacity:1}
.lang-switch.in-bar{display:none}
@media (max-width:1000px){
  .lang-switch.in-bar{display:inline-block;margin-left:auto}
  .lang-switch.in-nav{display:none}
}
/* Malayalam: long unbroken words must wrap, not clip */
:lang(ml){overflow-wrap:anywhere;word-break:normal}
h1:lang(ml){font-size:clamp(1.7rem,8vw,3.4rem)}
h2:lang(ml){font-size:clamp(1.4rem,6.2vw,2.4rem)}
h3:lang(ml){font-size:clamp(1.15rem,5vw,1.5rem)}
@media (max-width:420px){.btn:lang(ml),a.btn:lang(ml){white-space:normal;text-align:center}}
.nav-toggle,.lang-switch{overflow-wrap:normal;white-space:nowrap}
