/* ============================================================
   CLDT design layer — loaded last.
   Palette and pattern come from the site's hero illustration:
   hill-forest green, textile maroon and pagoda gold.
   ============================================================ */

:root {
  color-scheme: light;
  --primary: #0f4633;
  --primary-hover: #0a3325;
  --primary-light: #e3efe6;
  --primary-tint: #f1f1e4;

  --maroon: #7d1a28;
  --maroon-deep: #5c111c;
  --forest: #0c3628;
  --forest-deep: #07241a;
  --gold: #c59b27;
  --gold-soft: #e8c766;

  --bg-page: #f4f6f1;
  --bg-card: #ffffff;
  --bg-tint: #ebefe6;
  --bg-dark-footer: #07241a;

  --text-main: #1b2a22;
  --text-body: #3b463f;
  --text-muted: #6a6f62;

  --border-color: #d9dfd5;
  --border-subtle: #e6eae2;

  --shadow-card: 0 1px 2px rgba(20, 40, 30, 0.06);
  --shadow-hover: 0 8px 20px rgba(20, 40, 30, 0.12);

  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-xl: 10px;

  --font-sans: 'Noto Sans', 'Noto Sans Bengali', 'Noto Sans Chakma', system-ui, sans-serif;
  --font-body: var(--font-sans);
  --font-chakma: 'Noto Sans Chakma', 'Noto Sans', sans-serif;
  --font-display: 'Fraunces', 'Noto Sans Bengali', 'Noto Sans Chakma', Georgia, serif;
}

body { font-family: var(--font-sans); background: var(--bg-page); color: var(--text-body); }

h1, h2, h3, .about-title, .mission-card-title, .ld-title, .dict-title {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--maroon);
  margin-bottom: 10px;
}

.narrow { max-width: 820px; }

/* ── Buttons ── */
.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn-pill:hover { transform: translateY(-2px); }
.btn-pill-gold { background: var(--gold-soft); color: #2a1e04; box-shadow: 0 8px 22px rgba(197, 155, 39, 0.3); }
.btn-pill-gold:hover { background: #f1d580; color: #2a1e04; }
.btn-pill-ghost { border-color: rgba(255, 255, 255, 0.45); color: #fff; }
.btn-pill-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-pill-solid { background: var(--forest); color: #fff; }
.btn-pill-solid:hover { background: var(--forest-deep); color: #fff; }

.text-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--maroon); text-decoration: none; }
.text-link i { transition: transform 0.2s ease; }
.text-link:hover i { transform: translateX(4px); }

/* ── Header ── */
.site-header { background: var(--maroon); box-shadow: 0 2px 14px rgba(60, 10, 20, 0.28); }
.site-header::before { display: none; }
.btn-nav-login { background: var(--gold-soft); color: #2a1e04; }
.btn-nav-login:hover { background: #f1d580; color: #2a1e04; }
.btn-nav-login span, .btn-nav-login i { color: #2a1e04; }

/* ── Hero ── */
.hero {
  position: relative;
  overflow: hidden;
  color: #f6f1e4;
  text-align: center;
  background: linear-gradient(160deg, #0f4a36 0%, var(--forest-deep) 100%);
}
.hero-photo {
  background:
    linear-gradient(rgba(7, 36, 26, 0.74), rgba(7, 36, 26, 0.74)),
    var(--hero-photo) center / cover;
}
/* Scattered script watermark */
.script-watermark {
  position: absolute;
  inset: 0;
  font-family: var(--font-chakma);
  line-height: 1;
  color: rgba(255, 255, 255, 0.075);
  pointer-events: none;
  user-select: none;
}
.script-watermark span { position: absolute; }
.script-watermark span:nth-child(1) { left: 3%; top: 12%; font-size: 7rem; rotate: -12deg; }
.script-watermark span:nth-child(2) { left: 15%; top: 58%; font-size: 5rem; rotate: 10deg; }
.script-watermark span:nth-child(3) { left: 24%; top: 8%; font-size: 3.5rem; rotate: 16deg; }
.script-watermark span:nth-child(4) { left: 6%; top: 68%; font-size: 4rem; rotate: -8deg; }
.script-watermark span:nth-child(5) { left: 19%; top: 32%; font-size: 3rem; rotate: -18deg; }
.script-watermark span:nth-child(6) { left: 28%; top: 72%; font-size: 4.5rem; rotate: 8deg; }
.script-watermark span:nth-child(7) { left: 1%; top: 40%; font-size: 3.5rem; rotate: 14deg; }
.script-watermark span:nth-child(8) { left: 91%; top: 10%; font-size: 6rem; rotate: 12deg; }
.script-watermark span:nth-child(9) { left: 79%; top: 56%; font-size: 5.5rem; rotate: -10deg; }
.script-watermark span:nth-child(10) { left: 72%; top: 12%; font-size: 3.5rem; rotate: -14deg; }
.script-watermark span:nth-child(11) { left: 88%; top: 66%; font-size: 4.5rem; rotate: 10deg; }
.script-watermark span:nth-child(12) { left: 76%; top: 34%; font-size: 3rem; rotate: 16deg; }
.script-watermark span:nth-child(13) { left: 68%; top: 74%; font-size: 3.5rem; rotate: -8deg; }
.script-watermark span:nth-child(14) { left: 94%; top: 42%; font-size: 3.5rem; rotate: -16deg; }
/* Khadi flower watermark, redrawn from the woven motif */
.wm-flower {
  position: absolute;
  aspect-ratio: 27 / 59;
  background: rgba(232, 199, 102, 0.13);
  -webkit-mask: url("../images/khadi-flower.d849aa70322d.svg") center / contain no-repeat;
  mask: url("../images/khadi-flower.d849aa70322d.svg") center / contain no-repeat;
}
.wm-flower:nth-of-type(1) { left: 9%; top: 27%; width: 88px; rotate: -7deg; }
.wm-flower:nth-of-type(2) { left: 84%; top: 24%; width: 92px; rotate: 7deg; }
.wm-flower:nth-of-type(3) { left: 15%; top: 5%; width: 54px; rotate: 9deg; }
.wm-flower:nth-of-type(4) { left: 81%; top: 4%; width: 54px; rotate: -9deg; }
.banner-flowers { position: absolute; inset: 0; pointer-events: none; }
.banner-flowers .wm-flower:nth-of-type(1) { left: 66%; top: 16%; width: 70px; rotate: -7deg; }
.banner-flowers .wm-flower:nth-of-type(2) { left: 76%; top: 46%; width: 46px; rotate: 8deg; }
.banner-flowers .wm-flower:nth-of-type(3) { left: 60%; top: 62%; width: 36px; rotate: 8deg; }
.site-bottom .wm-flower { background: rgba(232, 199, 102, 0.1); }
/* Footer flowers sit in the empty space, measured up from the copyright bar */
.site-bottom .wm-flower:nth-of-type(1) { left: 40%; top: auto; bottom: 90px; width: 84px; }
.site-bottom .wm-flower:nth-of-type(2) { left: 86%; top: auto; bottom: 110px; width: 80px; }
.site-bottom .wm-flower:nth-of-type(3) { left: 33%; top: auto; bottom: 120px; width: 44px; }
.site-bottom .wm-flower:nth-of-type(4) { display: none; }
.hero-inner { position: relative; max-width: 920px; padding-top: clamp(56px, 7vw, 104px); padding-bottom: clamp(60px, 7vw, 108px); }
.hero .eyebrow { color: var(--gold-soft); }
.hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
  line-height: 1.12;
  color: #fff;
  margin-bottom: 20px;
}
.hero h1 em { display: block; font-style: italic; color: var(--gold-soft); }
.hero-lead { max-width: 36em; margin: 0 auto 30px; font-size: clamp(1.05rem, 1.5vw, 1.25rem); line-height: 1.65; color: #d9e4da; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.hero-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 48px; margin-top: 36px; }
.hero-stats dd { font-family: var(--font-display); font-size: 2rem; color: #fff; line-height: 1.1; }
.hero-stats dt { font-size: 0.82rem; color: #bccdbf; }

/* Illustrated hero: river-and-hills scene with the text on its pale left side */
.hero-art { background: #fff; color: var(--text-main); }
.hero-art .eyebrow { color: var(--maroon); }
.hero-art h1 { color: var(--forest); }
.hero-art h1 em { color: var(--maroon); }
.hero-art .hero-lead { color: var(--text-body); }
.hero-art .btn-pill-ghost { border-color: rgba(12, 54, 40, 0.35); color: var(--forest); background: rgba(255, 255, 255, 0.7); }
.hero-art .btn-pill-ghost:hover { background: var(--primary-light); color: var(--forest); }
.hero-art .hero-stats dd { color: var(--forest); }
.hero-art .hero-stats dt { color: var(--text-muted); }
.hero-scene { display: block; }
.hero-scene img { display: block; width: 100%; height: auto; }

@media (max-width: 1199px) {
  .hero-art .hero-inner { padding-bottom: 8px; }
  /* Fade the top of the scene into the white behind the text */
  .hero-scene img {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 22%);
  }
}

@media (min-width: 1200px) {
  .hero-art { text-align: left; min-height: clamp(480px, 34vw, 620px); display: flex; align-items: center; }
  .hero-art .hero-inner { max-width: 1200px; width: 100%; z-index: 1; padding-top: 56px; padding-bottom: 60px; }
  .hero-art .hero-inner > * { max-width: 560px; }
  .hero-art h1 { font-size: clamp(2.5rem, 3.4vw, 3.4rem); }
  .hero-art .hero-lead { margin-left: 0; }
  .hero-art .hero-actions, .hero-art .hero-stats { justify-content: flex-start; }
  .hero-scene { position: absolute; inset: 0; }
  .hero-scene img { height: 100%; object-fit: cover; object-position: right center; }
  /* Keep the text side bright enough to read wherever the crop lands */
  .hero-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.9) 28%, rgba(255, 255, 255, 0) 50%);
  }
}

/* The dictionary works without the on-screen keyboard */
body.no-keyboard #dock-keyboard-toggle { display: none; }

/* Dictionary search */
.dict-lookup { position: relative; z-index: 2; max-width: 640px; margin: -74px auto 32px; }
.dict-lang-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: min(100%, 440px); margin: 0 auto 16px; padding: 8px 16px;
  background: var(--bg-card); border-radius: var(--radius-md); box-shadow: 0 6px 18px rgba(12, 54, 40, 0.14);
}
.dict-lang-bar.is-swapped { flex-direction: row-reverse; }
.dict-lang { flex: 1 1 0; min-width: 0; text-align: center; font-size: 1.35rem; line-height: 1.5; color: #5b6a61; }
.dict-lang-chakma { font-family: var(--font-chakma); }
.dict-lang-bangla { font-family: 'Noto Sans Bengali', sans-serif; }
.dict-swap {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%;
  color: #fff; font-size: 1rem; cursor: pointer; background: var(--maroon); transition: transform 0.2s, background 0.2s;
}
.dict-swap:hover { background: #64141f; }
.dict-lang-bar.is-swapped .dict-swap { transform: rotate(180deg); }
.dict-box { padding: 16px; background: var(--bg-card); border-radius: 16px; box-shadow: 0 8px 24px rgba(12, 54, 40, 0.12); }
.dict-field-wrap { position: relative; }
.dict-lookup-field {
  display: block; width: 100%; padding: 14px 16px 14px 48px;
  font-family: 'Noto Sans', 'Noto Sans Chakma', 'Noto Sans Bengali', sans-serif; font-size: 1.05rem; line-height: 1.5;
  color: var(--text-main); background: var(--bg-page); border: 1.5px solid #b9c9bd; border-radius: 12px; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.dict-field-wrap.has-clear .dict-lookup-field { padding-right: 46px; }
.dict-lookup-field::placeholder { color: #6b7a70; opacity: 1; font-size: clamp(0.7rem, 3.5vw, 1.05rem); }
.dict-lookup-field:focus { background: #fff; border-color: var(--forest); box-shadow: 0 0 0 3px rgba(12, 54, 40, 0.14); }
.dict-search-icon {
  position: absolute; top: 50%; left: 8px; transform: translateY(-50%); display: grid; place-items: center;
  width: 36px; height: 36px; padding: 0; color: var(--forest); font-size: 1.05rem; background: none; border: 0; cursor: pointer;
}
.dict-field-wrap .dict-clear-btn { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); }
.dict-live { list-style: none; max-height: 340px; margin: 12px 0 0; padding: 0; overflow-y: auto; }
.dict-live[hidden] { display: none; }
.dict-live li + li { border-top: 1px solid var(--border-color); }
.dict-live a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 10px 12px; color: var(--text-main); border-radius: var(--radius-md); }
.dict-live a:hover, .dict-live a[aria-selected="true"] { background: var(--bg-page); }
.dict-suggest-script { font-family: var(--font-chakma); font-size: 1.2rem; color: var(--forest); }
.dict-suggest-word { font-weight: 600; }
.dict-suggest-meaning { flex-basis: 100%; font-family: 'Noto Sans Bengali', sans-serif; font-size: 0.92rem; color: #5b6a61; }
.dict-suggest-en { margin-top: -2px; font-family: 'Noto Sans', sans-serif; }
.drc-meaning-line { display: block; }
.drc-meaning-en { margin-top: 3px; font-size: 0.94em; color: #5b6a61; }
.dict-targets { display: flex; justify-content: center; gap: 2px; padding: 3px; background: var(--bg-page); border-radius: 999px; }
.dict-target { flex: 1; min-height: 34px; padding: 0 10px; font-family: 'Noto Sans Bengali', 'Noto Sans', sans-serif; font-size: 0.92rem; line-height: 1.2; white-space: nowrap; color: #5b6a61; background: transparent; border: 0; border-radius: 999px; cursor: pointer; }
.dict-target.is-active { color: #fff; background: var(--forest); }
.dict-suggest-empty { padding: 12px; text-align: center; font-family: 'Noto Sans Bengali', sans-serif; color: #5b6a61; }

/* Transcriber */
.trans-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 680px; margin: 0 auto 24px; }
.trans-mode {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 58px; padding: 10px 12px;
  font-family: 'Noto Sans', 'Noto Sans Bengali', 'Noto Sans Chakma', sans-serif; font-size: 1.05rem; font-weight: 600; line-height: 1.25;
  color: var(--forest); background: #fff; border: 1.5px solid #b9c9bd; border-radius: 12px; box-shadow: 0 3px 8px rgba(12, 54, 40, 0.1); cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.trans-mode i { font-size: 0.72rem; color: var(--maroon); transition: color 0.18s; }
.trans-mode:hover { background: #eaf1ea; border-color: var(--forest); box-shadow: 0 5px 12px rgba(12, 54, 40, 0.16); transform: translateY(-1px); }
.trans-mode:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.trans-mode.is-active, .trans-mode.is-active:hover { color: #fff; background: linear-gradient(150deg, #14503b, var(--forest)); border-color: var(--forest); box-shadow: 0 6px 14px rgba(12, 54, 40, 0.3); transform: none; }
.trans-mode.is-active i { color: var(--gold-soft); }
.trans-area { font-family: 'Noto Sans Chakma', 'Noto Sans Bengali', 'Noto Sans', sans-serif !important; }
.tbc-label { font-family: 'Noto Sans', 'Noto Sans Bengali', 'Noto Sans Chakma', sans-serif; }
.trans-output-area { white-space: pre-wrap; overflow-wrap: anywhere; }
.trans-output-area.is-empty { color: #6b7a70; }
.trans-actions-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.trans-advanced { margin-top: 24px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 14px; box-shadow: 0 4px 14px rgba(12, 54, 40, 0.07); overflow: hidden; }
.trans-advanced[hidden] { display: none; }
.trans-advanced summary { display: flex; align-items: center; gap: 12px; padding: 16px 20px; font-size: 1.05rem; font-weight: 700; color: var(--forest); cursor: pointer; list-style: none; user-select: none; }
.trans-advanced summary::-webkit-details-marker { display: none; }
.trans-advanced summary:hover { background: var(--bg-page); }
.trans-advanced summary:focus-visible { outline: 2px solid var(--maroon); outline-offset: -2px; }
.trans-summary-icon { display: grid; place-items: center; width: 36px; height: 36px; font-size: 0.95rem; color: var(--gold-soft); background: var(--forest); border-radius: 10px; }
.trans-summary-chevron { margin-left: auto; font-size: 0.85rem; color: var(--maroon); transition: transform 0.2s; }
.trans-advanced[open] .trans-summary-chevron { transform: rotate(180deg); }
.trans-advanced-body { padding: 18px 20px 20px; border-top: 1px solid var(--border-color); }
.trans-rule-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.trans-rule {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 10px 14px;
  font-family: 'Noto Sans', 'Noto Sans Bengali', 'Noto Sans Chakma', sans-serif; font-size: 0.94rem; font-weight: 500; line-height: 1.4; color: var(--text-main);
  background: var(--bg-page); border: 1.5px solid transparent; border-radius: 11px; cursor: pointer; transition: background 0.15s, border-color 0.15s;
}
.trans-rule:hover { border-color: #b9c9bd; }
.trans-rule:has(input:checked) { background: #e6f0e8; border-color: #9dbba6; color: var(--forest); }
.trans-rule span { min-width: 0; overflow-wrap: anywhere; }
.trans-rule input {
  order: 2; flex: none; position: relative; width: 42px; height: 24px; margin: 0; appearance: none; -webkit-appearance: none;
  background: #b7c2ba; border-radius: 999px; cursor: pointer; transition: background 0.18s;
}
.trans-rule input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.18s; }
.trans-rule input:checked { background: var(--forest); }
.trans-rule input:checked::after { transform: translateX(18px); }
.trans-rule input:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.trans-credit { margin-top: 16px; text-align: center; font-size: 0.85rem; color: #5b6a61; }

.draft-note { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; padding: 10px 14px; font-size: 0.92rem; color: #5c4408; background: #fbf1cf; border: 1px solid var(--gold-soft); border-radius: var(--radius-md); }

/* Sign in */
.signin-page { display: flex; justify-content: center; align-items: center; padding: clamp(28px, 6vw, 72px) 16px; background: var(--bg-page); }
.signin-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(100%, 940px); overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 18px; box-shadow: 0 18px 44px rgba(12, 54, 40, 0.14); }
.signin-side { position: relative; overflow: hidden; display: flex; padding: 40px 38px; color: #e6ece3; background: radial-gradient(circle at 85% 0%, rgba(232, 199, 102, 0.2), transparent 48%), linear-gradient(150deg, #0f4a36, var(--forest-deep)); }
.signin-side-inner { position: relative; display: flex; flex-direction: column; width: 100%; }
.signin-flowers { position: absolute; inset: 0; pointer-events: none; }
.signin-flowers .wm-flower:nth-of-type(1) { left: auto; right: 9%; top: 7%; width: 62px; rotate: 7deg; }
.signin-flowers .wm-flower:nth-of-type(2) { left: auto; right: 30%; top: 5%; width: 34px; rotate: -8deg; }
.signin-flowers .wm-flower:nth-of-type(3) { display: none; }
.signin-glyph { position: absolute; right: -16px; bottom: -44px; font-family: var(--font-chakma); font-size: 13rem; line-height: 1; color: rgba(255, 255, 255, 0.05); pointer-events: none; }
.signin-brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; }
.signin-brand:hover { color: inherit; }
.signin-brand img { width: 46px; height: 46px; padding: 2px; background: #fff; border-radius: 50%; }
.signin-brand strong { display: block; font-size: 1.02rem; line-height: 1.25; color: #fff; }
.signin-brand small { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: #cfdcd1; }
.signin-brand-phone { display: none; color: var(--text-main); }
.signin-brand-phone:hover { color: var(--text-main); }
.signin-brand-phone img { padding: 0; }
.signin-brand-phone strong { color: var(--forest); }
.signin-brand-phone small { color: var(--text-muted); }
.signin-quote { margin: auto 0 22px; padding-top: 56px; font-family: var(--font-display); font-size: clamp(1.6rem, 2.7vw, 2.1rem); line-height: 1.2; color: #fff; }
.signin-quote em { display: block; font-style: italic; color: var(--gold-soft); }
.signin-points { margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.signin-points li { display: flex; align-items: center; gap: 12px; margin-top: 11px; }
.signin-points i { width: 18px; text-align: center; color: var(--gold-soft); }
.signin-main { display: flex; flex-direction: column; justify-content: center; padding: 44px 42px; }
.signin-title { font-size: 2rem; line-height: 1.15; color: var(--text-main); }
.signin-sub { margin: 6px 0 24px; font-size: 0.96rem; color: var(--text-muted); }
.signin-error { display: flex; gap: 10px; margin-bottom: 16px; padding: 11px 13px; font-size: 0.9rem; line-height: 1.45; color: #8f1d1d; background: #fdeeee; border: 1px solid #f2c9c9; border-radius: 9px; }
.signin-error i { margin-top: 3px; }
.signin-error p { margin: 0; }
.signin-field { margin-bottom: 16px; }
.signin-field label { display: block; margin-bottom: 6px; font-size: 0.89rem; font-weight: 600; color: var(--text-main); }
.signin-options { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 12px; margin-bottom: 18px; }
.signin-options a { font-size: 0.88rem; font-weight: 600; color: var(--maroon); }
.signin-options a:hover { text-decoration: underline; }
.signin-input { position: relative; }
.signin-input > i { position: absolute; top: 50%; left: 14px; transform: translateY(-50%); font-size: 0.92rem; color: #7c8b81; pointer-events: none; }
.signin-input input { display: block; width: 100%; height: 48px; padding: 0 44px 0 40px; font-size: 1rem; color: var(--text-main); background: #fff; border: 1.5px solid #c9d5cc; border-radius: 10px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.signin-input input:focus { border-color: var(--forest); box-shadow: 0 0 0 3px rgba(12, 54, 40, 0.13); }
.signin-eye { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px; padding: 0; color: #66756b; background: none; border: 0; border-radius: 8px; cursor: pointer; }
.signin-eye:hover { color: var(--forest); background: var(--bg-page); }
.signin-eye:focus-visible, .signin-submit:focus-visible { outline: 2px solid var(--maroon); outline-offset: 2px; }
.signin-remember { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--text-main); cursor: pointer; }
.signin-remember input { width: 16px; height: 16px; accent-color: var(--forest); }
.signin-submit { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; height: 50px; font-size: 1.02rem; font-weight: 700; color: #fff; background: var(--forest); border: 0; border-radius: 10px; cursor: pointer; transition: background 0.15s, box-shadow 0.15s; }
.signin-submit:hover { background: #14503b; box-shadow: 0 6px 16px rgba(12, 54, 40, 0.24); }
.signin-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; font-size: 0.82rem; color: var(--text-muted); }
.signin-divider::before, .signin-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.signin-social { display: flex; justify-content: center; gap: 10px; }
.signin-social a { display: grid; place-items: center; width: 42px; height: 42px; color: var(--forest); border: 1.5px solid #c9d5cc; border-radius: 10px; }
.signin-foot { margin: 22px 0 0; text-align: center; font-size: 0.93rem; color: var(--text-muted); }
.signin-foot a { font-weight: 700; color: var(--maroon); }
.signin-foot a:hover { text-decoration: underline; }

.footer-credit a { font-weight: 600; color: var(--gold-soft); }
.footer-credit a:hover { text-decoration: underline; }

/* Round account icon in the header */
.nav-avatar {
  display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; font-size: 1rem; font-weight: 700; line-height: 1;
  color: #2a1e04; background: var(--gold-soft); border-radius: 50%; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); transition: background 0.15s;
}
.nav-avatar:hover, .user-avatar-btn:hover .nav-avatar { background: #f1d580; color: #2a1e04; }
.user-avatar-btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0 !important; background: none !important; border: 0; }
.user-avatar-btn span.nav-avatar { display: grid; }
.dropdown-account-name { margin: 0; padding: 10px 16px 8px; font-weight: 700; color: var(--forest); overflow-wrap: anywhere; }

/* About page */
.about-who, .about-team { margin-bottom: 24px; }
.about-team { margin-top: 24px; margin-bottom: 0; }
.about-who-text p { margin: 0; font-size: 1.05rem; line-height: 1.75; }
.about-who-text p + p { margin-top: 12px; }
.team-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0 0; padding: 0; list-style: none; }
.team-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--bg-page); border: 1px solid var(--border-color); border-radius: 12px; }
.team-photo { flex: none; width: 72px; height: 72px; object-fit: cover; border-radius: 50%; }
.team-initials { display: grid; place-items: center; font-family: var(--font-display); font-size: 1.5rem; color: var(--gold-soft); background: var(--forest); }
.team-text { min-width: 0; overflow-wrap: anywhere; }
.team-text strong { display: block; font-size: 1.05rem; color: var(--text-main); }
.team-text small { display: block; margin-top: 2px; font-size: 0.92rem; color: var(--maroon); }

/* Video players in posts, lessons and resources */
.video-frame { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 0 0 24px; background: #000; border-radius: var(--radius-md); overflow: hidden; }
.video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }

/* ── Sections ── */
.band { padding: 72px 0; }
.band-tint { background: var(--bg-tint); }
.band-head { max-width: 640px; margin-bottom: 36px; }
.band-head h2, .alphabet-copy h2 { font-size: clamp(1.75rem, 3.2vw, 2.4rem); line-height: 1.15; color: var(--text-main); }
.band-head-row { max-width: none; display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }

/* ── Tool cards ── */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.tool-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 290px;
  padding: 28px 24px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.tool-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.tool-card > i { font-size: 1.5rem; margin-bottom: 18px; }
.tool-card h3 { font-size: 1.5rem; margin-bottom: 8px; color: inherit; }
.tool-card p { font-size: 0.95rem; line-height: 1.55; color: inherit; opacity: 0.86; }
.tool-go { margin-top: auto; padding-top: 18px; font-weight: 600; font-size: 0.92rem; display: inline-flex; gap: 8px; align-items: center; }
.tool-glyph {
  position: absolute;
  right: -8px;
  bottom: -30px;
  font-family: var(--font-chakma);
  font-size: 9rem;
  line-height: 1;
  opacity: 0.1;
  transition: transform 0.35s ease;
}
.tool-card:hover .tool-glyph { transform: scale(1.1) rotate(-4deg); }
.tool-forest { background: var(--forest); color: #f3efe2; }
.tool-maroon { background: var(--maroon); color: #fbeee0; }
.tool-gold { background: var(--gold-soft); color: #2a1e04; }
.tool-paper { background: var(--bg-card); color: var(--text-main); border: 1px solid var(--border-color); }

/* ── Alphabet ── */
.alphabet-layout { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 56px; align-items: center; }
.alphabet-copy p:not(.eyebrow) { margin: 14px 0 18px; line-height: 1.65; }
.alphabet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 8px; }
.alphabet-tile {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 12px;
  font-family: var(--font-chakma);
  font-size: 1.5rem;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.alphabet-tile:hover { background: var(--maroon); border-color: var(--maroon); color: #fff; transform: translateY(-3px) scale(1.06); }

/* ── Word of the day ── */
.word-feature {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 36px 40px;
  border-radius: 10px;
  background: var(--forest);
  color: #f3efe2;
  text-decoration: none;
  border-bottom: 5px solid var(--gold-soft);
  transition: transform 0.25s ease;
}
.word-feature:hover { transform: translateY(-3px); color: #f3efe2; }
.word-feature .eyebrow { color: var(--gold-soft); }
.word-feature-roman { font-family: var(--font-display); font-size: 2.2rem; color: #fff; line-height: 1.1; }
.word-feature-meaning { margin-top: 6px; color: #d4e0d6; }
.word-feature-script { font-family: var(--font-chakma); font-size: clamp(2.6rem, 7vw, 4.4rem); color: var(--gold-soft); }

/* ── Cards ── */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.lesson-card, .topic-card, .post-card, .resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
  color: var(--text-body);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.lesson-card:hover, .topic-card:hover, .post-card:hover, .resource-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary);
  color: var(--text-body);
}
.lesson-card, .topic-card { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 24px; }
.lesson-card h3, .topic-card h2 { font-size: 1.3rem; line-height: 1.25; color: var(--text-main); }
.lesson-card p, .topic-card p { font-size: 0.93rem; line-height: 1.55; }
.lesson-card-foot { margin-top: auto; padding-top: 8px; font-size: 0.84rem; font-weight: 600; color: var(--maroon); }

.topic-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 1.2rem;
}

.chip { padding: 3px 12px; border-radius: var(--radius-pill); font-size: 0.74rem; font-weight: 700; white-space: nowrap; }
.chip-beginner { background: #dcefe0; color: #14532d; }
.chip-intermediate { background: #f8e9bf; color: #6b4e05; }
.chip-advanced { background: #f6dcd9; color: #7d1a28; }

.post-card { display: flex; flex-direction: column; overflow: hidden; }
.post-card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  background: linear-gradient(140deg, var(--maroon), var(--forest));
  overflow: hidden;
}
.post-card-media { position: relative; }
.post-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.post-card-glyph { font-family: var(--font-chakma); font-size: 4rem; color: rgba(255, 255, 255, 0.5); }
.post-card-body { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 18px; }
.post-card-body strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.08rem;
  line-height: 1.4;
  color: var(--text-main);
  transition: color 0.15s ease;
}
.post-card:hover .post-card-body strong { color: var(--primary); }
.post-card-meta { font-size: 0.8rem; color: var(--text-muted); }

.resource-card { display: flex; align-items: center; gap: 16px; padding: 20px; }
.resource-card-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.resource-card-text strong { color: var(--text-main); line-height: 1.3; }
.resource-card-text small { font-size: 0.86rem; line-height: 1.45; }
.resource-card { position: relative; }
.resource-card-link { color: inherit; text-decoration: none; }
.resource-card-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.resource-card-link:focus-visible { outline: none; }
.resource-card:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.resource-card-cover { flex: none; width: 56px; height: 72px; object-fit: cover; border-radius: 6px; box-shadow: 0 2px 6px rgba(20, 40, 30, 0.18); }
.resource-card-dl {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  flex: none; width: 40px; height: 40px;
  border-radius: 50%;
  color: var(--primary);
  transition: background 0.15s ease;
}
a.resource-card-dl:hover { background: var(--primary-light); }

/* ── Filters ── */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.filter-pill {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.filter-pill:hover { border-color: var(--gold); color: var(--text-main); }
.filter-pill.active, .filter-pill.active:hover { background: var(--forest); border-color: var(--forest); color: #fff; }

/* ── Lesson list ── */
.lesson-rows { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-body);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.lesson-row:hover { border-color: var(--primary); box-shadow: var(--shadow-hover); color: var(--text-body); }
.lesson-row-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--forest);
  color: var(--gold-soft);
  font-family: var(--font-display);
  font-size: 1.1rem;
}
.lesson-row-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.lesson-row-text strong { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--text-main); }
.lesson-row-text small { font-size: 0.88rem; line-height: 1.45; }

/* ── Page banner ── */
.page-banner {
  position: relative;
  overflow: hidden;
  padding: 64px 0 60px;
  color: #f3efe2;
  background:
    radial-gradient(circle at 85% 0%, rgba(232, 199, 102, 0.2), transparent 45%),
    linear-gradient(150deg, #0f4a36, var(--forest-deep));
}
.page-banner-inner { position: relative; }
.page-banner .eyebrow { color: var(--gold-soft); }
.page-banner h1 { font-size: clamp(2.1rem, 4.6vw, 3.3rem); line-height: 1.1; color: #fff; max-width: 18em; }
.page-banner-sub { margin-top: 12px; max-width: 36em; font-size: 1.08rem; line-height: 1.6; color: #d4e0d6; }
.page-banner-glyph {
  position: absolute;
  right: 4%;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--font-chakma);
  font-size: 15rem;
  line-height: 1;
  color: rgba(232, 199, 102, 0.13);
  pointer-events: none;
}

/* ── Empty state ── */
.empty-state {
  max-width: 520px;
  margin: 16px auto;
  padding: 52px 28px;
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.empty-state-glyph { display: block; font-family: var(--font-chakma); font-size: 4.4rem; line-height: 1.2; color: var(--maroon); }
.empty-state h2 { font-size: 1.5rem; color: var(--text-main); margin: 8px 0; }
.empty-state p { line-height: 1.6; margin-bottom: 4px; }
.empty-state .btn-pill { margin-top: 18px; }

/* ── Reading pages: white sheet with a thin border ── */
.reading-page { padding: 36px 0 64px; background: var(--bg-page); }
.reading-sheet {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 40px 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.reading-head { margin-bottom: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--border-color); }
.reading-kicker {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.reading-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.3rem); line-height: 1.3; color: var(--text-main); }
.reading-meta { margin-top: 10px; font-size: 0.86rem; color: var(--text-muted); }
.reading-cover { margin: 0 0 22px; padding: 10px; background: var(--bg-tint); border-radius: 6px; }
.reading-cover img { display: block; width: 100%; max-height: 460px; object-fit: contain; }

.prose { font-size: 1.07rem; line-height: 1.85; color: var(--text-main); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose table { margin-bottom: 1.1em; }
.prose h2, .prose h3, .prose h4 { margin: 1.6em 0 0.5em; line-height: 1.35; color: var(--text-main); scroll-margin-top: 90px; }
.prose h2 { font-size: 1.45rem; }
.prose h3 { font-size: 1.22rem; }
.prose h4 { font-size: 1.05rem; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.3em; }
.prose a { color: var(--primary); text-underline-offset: 3px; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 0.97rem; }
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--border-color); text-align: left; }
.prose th { background: var(--bg-tint); }

/* Contents box and quotes share the bordered callout */
.prose .toc, .prose blockquote {
  padding: 16px 20px;
  background: var(--bg-tint);
  border-left: 5px solid var(--primary);
  border-radius: 4px;
}
.prose .toc { margin-bottom: 1.4em; }
.prose .toctitle { display: block; margin-bottom: 8px; font-size: 1.15rem; font-weight: 700; color: var(--text-main); }
.prose .toc ul { list-style: none; margin: 0; padding-left: 18px; }
.prose .toc > ul { padding-left: 14px; }
.prose .toc li { margin: 0; }
.prose .toc a { text-decoration: none; }
.prose .toc a:hover { text-decoration: underline; }

.lesson-audio { display: block; width: 100%; margin-bottom: 20px; }
.reading-page .lesson-nav { max-width: 780px; margin: 20px auto 0; }

.share-row { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border-color); font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.share-row a {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--primary);
  text-decoration: none;
}
.share-row a:hover { border-color: var(--primary); }

.reading-related { margin-top: 44px; }
.reading-related h2 { font-size: 1.4rem; margin-bottom: 18px; color: var(--text-main); }

/* ── Account pages (sign up, password reset...) ── */
.auth-page #main-content {
  width: calc(100% - 32px);
  max-width: 460px;
  margin: 44px auto 56px;
  padding: 30px 32px 34px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-card);
}
.auth-page #main-content h1 { font-size: 1.8rem; line-height: 1.25; margin-bottom: 10px; color: var(--text-main); }
.auth-page #main-content > p { margin-bottom: 16px; line-height: 1.6; }
.auth-page #main-content a { color: var(--primary); font-weight: 600; }
.auth-page form p { margin-bottom: 14px; }
.auth-page label { display: block; margin-bottom: 5px; font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]) {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}
.auth-page #main-content input:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.auth-page #main-content button[type="submit"] {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--forest);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.auth-page #main-content button[type="submit"]:hover { background: var(--forest-deep); }
.auth-page .errorlist { list-style: none; margin-bottom: 6px; font-size: 0.88rem; color: #b91c1c; }
.auth-page .helptext, .auth-page form ul:not(.errorlist) { font-size: 0.82rem; color: var(--text-muted); }
.auth-page form ul:not(.errorlist) { margin: 6px 0 0 1.1em; list-style: disc; }

/* The on-screen keyboard must stay usable on short screens */
.virtual-keyboard-panel { max-height: calc(100vh - 90px); overflow-y: auto; }

/* ── Mission call to action ── */
.mission-cta { position: relative; padding: 60px 0 44px; color: #e6ece3; }
.mission-cta-inner { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 28px; flex-wrap: wrap; }
.mission-cta h2 { font-size: clamp(1.7rem, 3.2vw, 2.3rem); color: #fff; line-height: 1.15; }
.mission-cta p { margin-top: 8px; }

/* ── Menu drawer ── */
.drawer-overlay { background: rgba(7, 36, 26, 0.6); backdrop-filter: none; }
.drawer {
  width: 340px;
  max-width: 88vw;
  background: var(--bg-card);
  box-shadow: none;
}
.drawer.open { box-shadow: -10px 0 40px rgba(0, 0, 0, 0.25); }
.drawer-header {
  position: relative;
  padding: 14px 16px 14px 20px;
  background: var(--maroon);
  border-bottom: 0;
}
.drawer-header .logo-title { color: #fff; }
.drawer-header .logo-sub { color: var(--gold-soft); }
.drawer-close {
  width: 40px;
  height: 40px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}
.drawer-close:hover { background: rgba(255, 255, 255, 0.26); color: #fff; }
.drawer-content-scroll { padding: 14px 12px 18px; gap: 12px; }
.drawer-nav { gap: 2px; }
.drawer-link {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-main);
}
.drawer-link i { color: var(--text-muted); font-size: 1rem; }
.drawer-link:hover { background: var(--primary-tint); color: var(--text-main); }
.drawer-link.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--gold);
}
.drawer-link.active i { color: var(--primary); }
.drawer-accordion.open > .drawer-link { color: var(--primary); }
.drawer-subnav { margin: 2px 0 8px 23px; padding-left: 14px; gap: 0; border-left: 2px solid var(--border-color); }
.drawer-subnav a { display: flex; align-items: center; min-height: 42px; padding: 8px 10px; font-size: 0.94rem; color: var(--text-body); border-radius: 8px; }
.drawer-subnav a:hover { background: var(--primary-tint); color: var(--primary); }
.drawer-auth-box { margin-top: auto; padding: 16px 8px 4px; border-top: 1px solid var(--border-color); }
.drawer-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border-radius: 12px;
  background: var(--forest);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}
.drawer-login-btn:hover { background: var(--forest-deep); color: #fff; }

/* ── 404 ── */
.error-page-section { background: var(--bg-page); padding: 64px 0; }

/* ── Footer ── */
.site-bottom { position: relative; overflow: hidden; background: var(--bg-dark-footer); }
.site-bottom .script-watermark { color: rgba(255, 255, 255, 0.05); }
.site-footer { position: relative; background: transparent; }
.footer-grid { grid-template-columns: 1.6fr 1fr; }
.footer-grid.has-topics { grid-template-columns: 1.6fr 1fr 1fr; }

/* ── Existing pages picking up the system ── */
.dictionary-main-section, .transcriber-main-section, .about-main-section { padding-top: 44px; }
.about-header-wrap { display: none; }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .post-grid { grid-template-columns: repeat(3, 1fr); }
  .alphabet-layout { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 820px) {
  .page-banner-glyph { font-size: 9rem; right: -10px; }
}

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

@media (max-width: 820px) {
  .script-watermark { color: rgba(255, 255, 255, 0.055); }
  .script-watermark span { scale: 0.68; }
  .wm-flower:nth-of-type(1) { left: 3%; top: 4%; width: 44px; }
  .wm-flower:nth-of-type(2) { left: auto; right: 3%; top: 4%; width: 44px; }
  .wm-flower:nth-of-type(n+3) { display: none; }
  .banner-flowers .wm-flower:nth-of-type(1) { left: auto; right: 5%; top: 8%; width: 40px; }
  .banner-flowers .wm-flower:nth-of-type(2) { left: auto; right: 16%; top: 12%; width: 26px; }
  .site-bottom .wm-flower:nth-of-type(1) { left: 62%; bottom: 125px; width: 44px; }
  .site-bottom .wm-flower:nth-of-type(2) { left: auto; right: 3%; top: 4%; bottom: auto; width: 44px; }
}

@media (max-width: 600px) {
  .band { padding: 48px 0; }
  .card-grid, .post-grid { grid-template-columns: 1fr; }
  .reading-page { padding: 16px 0 44px; }
  .reading-sheet { padding: 20px 18px 24px; }
  .prose { font-size: 1.03rem; line-height: 1.8; }
  /* Phone layout matches the tablet one: two-line headline, paired buttons, 2 x 2 cards */
  .hero h1 { font-size: clamp(1.55rem, 7.4vw, 2.5rem); }
  .hero-lead { font-size: 0.98rem; margin-bottom: 24px; }
  .hero-actions { flex-wrap: nowrap; gap: 8px; }
  .hero-actions .btn-pill { flex: 1 1 0; justify-content: center; gap: 6px; padding: 12px 8px; font-size: 0.86rem; white-space: nowrap; }
  .tool-grid { gap: 12px; }
  .tool-card { min-height: 236px; padding: 18px 15px; }
  .tool-card > i { font-size: 1.25rem; margin-bottom: 12px; }
  .tool-card h3 { font-size: 1.18rem; }
  .tool-card p { font-size: 0.84rem; }
  .tool-go { font-size: 0.82rem; }
  .tool-glyph { font-size: 6rem; bottom: -20px; }
  .btn-nav-login { width: auto; height: 38px; padding: 0 14px; font-size: 0.85rem; }
  .btn-nav-login span { display: inline; }
  .footer-links { display: block; columns: 2; column-gap: 20px; }
  .footer-links li { margin-bottom: 12px; break-inside: avoid; }
  .hero .eyebrow { font-size: 0.68rem; letter-spacing: 0.1em; }
  .hero-stats { gap: 26px; }
  .word-feature { padding: 26px 24px; }
  .lesson-row { flex-wrap: wrap; padding: 16px; gap: 12px; }
  .lesson-row-text { flex-basis: calc(100% - 60px); }
  .lesson-row .chip { margin-left: 56px; }
  .footer-grid, .footer-grid.has-topics { grid-template-columns: 1fr; }
  .mission-cta { padding: 44px 0 28px; }
}

/* Tablets: the hero is wider, so the two flowers sit clear of the letters */
@media (min-width: 601px) and (max-width: 1023px) {
  .wm-flower:nth-of-type(1) { left: 10%; }
  .wm-flower:nth-of-type(2) { right: 10%; }
}

/* Tablet footer: keep the flowers out of the link column */
@media (min-width: 601px) and (max-width: 820px) {
  .site-bottom .wm-flower:nth-of-type(1) { left: 36%; }
  .site-bottom .wm-flower:nth-of-type(2) { right: 10%; }
}

@media (max-width: 600px) {
  .dict-lookup { margin-top: -56px; }
  .dict-lang-bar { padding: 6px 10px; margin-bottom: 12px; }
  .dict-target { padding: 0 6px; font-size: 0.84rem; }
  .dict-lang { font-size: 1.15rem; }
  .dict-swap { width: 40px; height: 40px; }
  .dict-box { padding: 12px; }
  .dict-lookup-field { padding: 13px 10px 13px 42px; font-size: 1rem; }
  .dict-search-icon { left: 4px; }
}

@media (max-width: 480px) {
  .trans-modes { gap: 8px; }
  .trans-mode { flex-direction: column; gap: 1px; min-height: 84px; padding: 8px 4px; font-size: 0.95rem; }
  .trans-mode i { transform: rotate(90deg); margin: 1px 0; }
}

@media (max-width: 600px) {
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .trans-rule-list { grid-template-columns: minmax(0, 1fr); }
  .trans-advanced summary, .trans-advanced-body { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 760px) {
  .signin-card { grid-template-columns: minmax(0, 1fr); width: min(100%, 460px); }
  .signin-side { display: none; }
  .signin-main { padding: 30px 24px; }
  .signin-brand-phone { display: inline-flex; margin-bottom: 22px; }
  .signin-title { font-size: 1.7rem; }
}

/* Footer columns. The brand spans the row, so it must not ask for more columns than exist. */
@media (max-width: 820px) {
  .footer-grid.has-topics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid.has-topics .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .footer-grid, .footer-grid.has-topics { grid-template-columns: minmax(0, 1fr); }
  .footer-brand, .footer-grid.has-topics .footer-brand { grid-column: auto; }
}

/* Narrow phones: keep the name whole by slimming the Login button */
@media (max-width: 374px) {
  .site-header .logo-title { font-size: 0.92rem; line-height: 1.4; }
  .btn-nav-login { padding: 0 11px; }
  .btn-nav-login i { display: none; }
}

@media (max-width: 339px) {
  .btn-nav-login { width: 38px; padding: 0; }
  .btn-nav-login i { display: inline; }
  .btn-nav-login span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tool-card, .lesson-card, .topic-card, .post-card, .resource-card, .lesson-row, .btn-pill, .alphabet-tile { transition: none; }
}

/* Touch: no browser square on tap, a gentle press instead */
html { -webkit-tap-highlight-color: transparent; }
@media (hover: none) {
  .btn-pill:active, .nav-avatar:active, .hamburger:active, .dock-btn:active, .trans-mode:active, .trans-rule:active,
  .btn-trans-clear:active, .btn-copy-trans:active, .dict-swap:active, .dict-target:active, .signin-submit:active,
  .tool-card:active, .drawer-link:active, .post-card:active, .resource-card:active, .btn-join-mission:active { opacity: 0.8; }
}
