:root {
  --bg: #fffdf5;
  --surface: #ffffff;
  --surface-2: #fef3c7;
  --line: #f3d48a;
  --text: #2b2110;
  --muted: #6a5632;
  --green: #15803d;
  --orange: #ea580c;
  --gold: #f59e0b;
  --blue: #1d4ed8;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.18), transparent 28%),
    linear-gradient(180deg, #fffef7, #fff8e8 38%, #fffdf8);
}
a { color: inherit; }

.devanagari {
  font-family: 'Noto Sans Devanagari', 'Baloo 2', sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 4vw;
  background: rgba(255, 253, 245, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(107, 86, 50, 0.14);
}

.brand {
  text-decoration: none;
  font-family: 'Baloo 2', cursive;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--orange);
}

.toplinks {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  border: 1px solid rgba(107, 86, 50, 0.14);
  background: rgba(255,255,255,0.78);
}

.hero {
  width: min(1360px, 96vw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 2.2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: start;
}

.eyebrow {
  color: var(--green);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin-bottom: 0.9rem;
}

h1, h2, h3 {
  font-family: 'Baloo 2', cursive;
  line-height: 1.08;
  margin: 0;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  margin-bottom: 1rem;
}

.lead {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--muted);
  max-width: 720px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  font-weight: 900;
  text-decoration: none;
}

.btn.primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(234,88,12,0.22); }
.btn.secondary { background: #fff; border: 1px solid rgba(107, 86, 50, 0.16); }

.panel, .section, .lesson-card, .callout, .quiz-card, .info-card {
  background: var(--surface);
  border: 1px solid rgba(107, 86, 50, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 40px rgba(67, 43, 14, 0.08);
}

.panel {
  padding: 1.25rem;
}

.panel ul { margin: 0; padding-left: 1.1rem; color: var(--muted); line-height: 1.7; }
.panel li + li { margin-top: 0.55rem; }

.section {
  width: min(1360px, 96vw);
  margin: 0 auto 1.25rem;
  padding: 1.4rem;
}

.section p { color: var(--muted); line-height: 1.7; }

.grid {
  display: grid;
  gap: 1rem;
}

.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.lesson-card, .quiz-card, .info-card {
  padding: 1rem;
}

.media-frame {
  overflow: hidden;
  padding: 0;
}

.media-frame video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.media-caption {
  padding: 1rem 1rem 1.1rem;
}

.media-caption p {
  margin: 0.5rem 0 0;
}

.scene-flow {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.scene-card {
  overflow: hidden;
  padding: 0;
}

.scene-board {
  position: relative;
  display: grid;
  align-content: space-between;
  gap: 1rem;
  width: 100%;
  aspect-ratio: 16 / 9;
  padding: 1.15rem;
  color: #1f1609;
  background: linear-gradient(135deg, #fff8dd, #ffe08a);
}

.scene-board::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 18%, rgba(255,255,255,0.75), transparent 18%),
    radial-gradient(circle at 84% 20%, rgba(255,255,255,0.28), transparent 16%),
    radial-gradient(circle at 82% 78%, rgba(255,255,255,0.2), transparent 18%);
  pointer-events: none;
}

.scene-board > * {
  position: relative;
  z-index: 1;
}

.scene-board.sunrise { background: linear-gradient(135deg, #fff7d3, #ffca66); }
.scene-board.ocean { background: linear-gradient(135deg, #dff7ff, #5cc8ff); }
.scene-board.berry { background: linear-gradient(135deg, #ffe0ef, #ff8cbc); }
.scene-board.mint { background: linear-gradient(135deg, #e8ffe9, #8ce99a); }
.scene-board.midnight { background: linear-gradient(135deg, #10224a, #244a8f); color: #f8fbff; }

.scene-board-header,
.scene-board-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.scene-board-label,
.scene-board-scene {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.78);
  color: inherit;
  font-size: 0.75rem;
  font-weight: 900;
}

.scene-board.midnight .scene-board-label,
.scene-board.midnight .scene-board-scene {
  background: rgba(255,255,255,0.14);
  color: #f8fbff;
}

.scene-board-main {
  display: grid;
  gap: 0.55rem;
  align-self: center;
}

.scene-board-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.35;
}

.scene-board-hindi {
  margin: 0;
  font-family: 'Noto Sans Devanagari', 'Baloo 2', sans-serif;
  font-size: clamp(1.9rem, 4vw, 3.4rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.scene-board-caption {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(31, 22, 9, 0.85);
}

.scene-board.midnight .scene-board-caption {
  color: rgba(248, 251, 255, 0.88);
}

.scene-board-chips {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.scene-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  font-family: 'Noto Sans Devanagari', 'Baloo 2', sans-serif;
  font-size: 1rem;
  font-weight: 700;
}

.scene-board.midnight .scene-chip {
  background: rgba(255,255,255,0.14);
  color: #f8fbff;
}

.scene-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #f8ecd0;
}

.scene-content {
  padding: 1rem 1rem 1.15rem;
}

.scene-meta {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.55rem;
}

.scene-step {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #fff3cd;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 900;
}

.scene-content h3 {
  font-size: 1.25rem;
  margin-bottom: 0.45rem;
}

.scene-content p {
  margin: 0;
  color: var(--muted);
}

.reading-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.reading-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.reading-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.reading-card {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid rgba(107, 86, 50, 0.14);
  background: linear-gradient(180deg, #fffef8, #fff5db);
  box-shadow: 0 18px 40px rgba(67, 43, 14, 0.08);
}

.reading-letter {
  display: block;
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--orange);
}

.reading-word {
  display: block;
  margin-top: 0.45rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.reading-gloss {
  display: block;
  margin-top: 0.45rem;
  color: var(--muted);
  line-height: 1.55;
}

.reading-note {
  margin-top: 0.85rem;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: #ecfccb;
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 900;
  margin-bottom: 0.75rem;
}

.lesson-card h3 { font-size: 1.28rem; margin-bottom: 0.45rem; }
.lesson-card p { font-size: 0.95rem; }

.anchor {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 132px;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, #fffefb, #fff6da);
}
.anchor .letter { font-size: 2.6rem; font-weight: 900; color: var(--orange); }
.anchor .word { font-size: 1.1rem; font-weight: 800; }
.anchor .gloss { font-size: 0.9rem; color: var(--muted); }

.rhythm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff8e6;
  border: 1px dashed rgba(234,88,12,0.22);
}
.rhythm strong { font-size: 1.1rem; color: var(--orange); }
.rhythm span { color: var(--muted); }

.steps {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.75;
}

.navline {
  width: min(1100px, 92vw);
  margin: 0 auto 3rem;
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.navline a {
  text-decoration: none;
  font-weight: 900;
  color: var(--blue);
}

.quiz-card ul { margin: 0.5rem 0 0; padding-left: 1.15rem; color: var(--muted); line-height: 1.7; }

.footer {
  width: min(1360px, 96vw);
  margin: 0 auto 3rem;
  color: var(--muted);
  font-size: 1.1rem;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .grid.two, .grid.three, .grid.four { grid-template-columns: minmax(0, 1fr); }
  .reading-grid.two, .reading-grid.four { grid-template-columns: minmax(0, 1fr); }
}

/* ── Single-column hero variant ────────────────────────────── */
.hero.hero-single-col {
  grid-template-columns: minmax(0, 1fr);
}

/* ── Swar grid (12 vowel letters) ──────────────────────────── */
.swar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.swar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.5rem 0.7rem;
  gap: 0.4rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(107, 86, 50, 0.14);
}

.swar-letter {
  font-size: clamp(2.8rem, 5vw, 4.4rem);
  line-height: 1;
  color: var(--text, #1f1609);
}

.swar-label {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Video block ───────────────────────────────────────────── */
.video-block {
  margin-top: 1rem;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  max-width: 100%;
}

.video-block video {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(68vh, 760px);
  object-fit: contain;
}

/* ── Letter card image grid ───────────────────────────────── */
.letter-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.letter-card-grid img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(107, 86, 50, 0.14);
}

/* Barakhadi landscape cards — one large row per card */
.bara-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

.bara-card-grid img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(107, 86, 50, 0.14);
}

/* Word+image cards — 3 per row */
.word-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.word-card-grid img {
  display: block;
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(107, 86, 50, 0.14);
}

/* ── Writing practice page ───────────────────────────────── */
.writing-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.stroke-grid, .writing-grid, .copy-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.stroke-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.writing-grid { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.copy-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.stroke-card, .writing-card, .copy-card {
  background: #fffefb;
  border: 1px solid rgba(107, 86, 50, 0.16);
  border-radius: 14px;
  padding: 1rem;
}

.stroke-mark, .trace-letter, .copy-word {
  font-family: 'Noto Sans Devanagari', 'Baloo 2', sans-serif;
  color: var(--orange);
}

.stroke-mark {
  display: block;
  min-height: 70px;
  font-size: 3.4rem;
  line-height: 1;
  text-align: center;
}

.stroke-card strong { display: block; margin-top: 0.45rem; }
.stroke-card p, .copy-card p { margin: 0.25rem 0 0; }

.trace-letter {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-bottom: 0.75rem;
  border-radius: 12px;
  background: repeating-linear-gradient(180deg, #fffaf0 0 38px, #f6e3b0 39px 40px);
  border: 1px solid rgba(107, 86, 50, 0.12);
  font-size: 5rem;
  font-weight: 800;
}

.writing-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.writing-card ol { margin: 0; padding-left: 1.2rem; color: var(--muted); line-height: 1.6; }

.copy-word {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.1;
}

.practice-line {
  height: 44px;
  margin-top: 0.75rem;
  border-bottom: 2px solid rgba(107, 86, 50, 0.28);
  background: linear-gradient(180deg, transparent 48%, rgba(245, 158, 11, 0.12) 49%, transparent 52%);
}

/* ── Grammar basics page ───────────────────────────────── */
.grammar-grid, .practice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.pattern-card, .practice-card {
  background: #fffefb;
  border: 1px solid rgba(107, 86, 50, 0.16);
  border-radius: 14px;
  padding: 1rem;
}

.pattern-card h3 {
  color: var(--orange);
  font-size: 2rem;
  margin-bottom: 0.45rem;
}

.pattern-card strong {
  display: block;
  margin-top: 0.75rem;
  font-size: 1.7rem;
  color: var(--green);
}

.pattern-card span { color: var(--muted); font-weight: 800; }

.grammar-table {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.grammar-table div[role="row"] {
  display: grid;
  grid-template-columns: 70px minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.8rem;
  border: 1px solid rgba(107, 86, 50, 0.14);
  border-radius: 12px;
  background: #fffefb;
}

.grammar-table strong {
  color: var(--orange);
  font-size: 1.3rem;
}

.grammar-table .devanagari {
  font-size: 1.35rem;
  font-weight: 800;
}

.practice-card p {
  margin: 0 0 0.55rem;
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
}

.practice-card strong { color: var(--green); }

@media (max-width: 680px) {
  .grammar-table div[role="row"] { grid-template-columns: 1fr; }
}

@media print {
  .topbar, .section-nav, .navline, .footer, .writing-actions { display: none; }
  body { background: #fff; }
  .section { width: 100%; box-shadow: none; break-inside: avoid; }
  .hero { padding: 1rem 0; }
}

/* ── Plain lesson link list ───────────────────────────────── */
.lesson-link-list {
  margin-top: 1rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.6rem;
}

.lesson-link-list li {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--muted);
}

.lesson-link-list a {
  color: var(--green, #2f7d32);
  font-weight: 800;
  text-decoration: none;
}

.lesson-link-list a:hover { text-decoration: underline; }

/* ── Section navigation pills ─────────────────────────────────────────── */
.section-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: #f4f4f8;
  border-bottom: 1.5px solid #dde;
}
.section-nav a {
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  color: #444;
  background: white;
  border: 1.5px solid #d0d0e0;
  transition: background 0.12s;
}
.section-nav a:hover { background: #eef; border-color: #aab; }
.section-nav a.active { background: #1a2a6c; color: white; border-color: #1a2a6c; }

/* ── Parent guide lists ───────────────────────────────────────────────── */
.parent-list {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.6rem;
  color: var(--text);
  line-height: 1.65;
}
.parent-list li { font-size: 1rem; }
.parent-list strong { color: var(--orange); }

/* ── Inline FAQ details (parent guide) ────────────────────────────────── */
.section details {
  background: #fff8e8;
  border: 1px solid rgba(107, 86, 50, 0.18);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-top: 0.6rem;
}
.section details[open] { background: #fffdf5; }
.section summary {
  font-weight: 800;
  cursor: pointer;
  color: var(--text);
  font-family: 'Baloo 2', sans-serif;
  font-size: 1.02rem;
  min-height: 36px;
  display: flex;
  align-items: center;
}
.section summary::-webkit-details-marker { display: none; }
.section summary::after {
  content: '+';
  margin-left: auto;
  color: var(--orange);
  font-weight: 900;
}
.section details[open] summary::after { content: '−'; }
.section details p { margin-top: 0.5rem; color: var(--muted); line-height: 1.6; }
