/* ── Fonts ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ── Tokens — Indian Earth ─────────────────────────────── */
:root {
  --bg:           #faf6f0;
  --surface:      #ffffff;
  --border:       #ede4d5;
  --text:         #3d2b1f;
  --text-muted:   #8b7560;
  --accent:       #c2452d;
  --action:       #1a5c4c;
  --action-hover: #145040;
  --sand:         #c4a67d;
  --shadow:       rgba(61,43,31,0.08);
  --shadow-md:    rgba(61,43,31,0.14);

  --c-teacher:    #1a5c4c;
  --c-class:      #7a5c2e;
  --c-char1:      #c2452d;
  --c-char2:      #1a5c4c;

  --font-heading: 'Libre Baskerville', Georgia, serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --r-sm:   4px;
  --r-md:   8px;
  --r-lg:   12px;
  --max-w:  720px;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
}
h1, h2, h3, h4 { font-family: var(--font-heading); font-weight: 400; line-height: 1.3; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ────────────────────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Nav ───────────────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 0;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav-links a {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover,
.nav-links a.active { background: var(--border); color: var(--text); text-decoration: none; }

/* ── Section scaffold ──────────────────────────────────── */
.section {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.section-header { margin-bottom: 2rem; }
.section-header h2 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.section-header p  { color: var(--text-muted); font-size: 0.9rem; max-width: 540px; }
.section-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ── Hero ──────────────────────────────────────────────── */
.hero {
  padding: 3rem 0 2.5rem;
}
.hero-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); margin-bottom: 0.75rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 520px;
  margin-bottom: 1.75rem;
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.stat-n { display: block; font-size: 1.5rem; font-family: var(--font-heading); color: var(--action); }
.stat-l { display: block; font-size: 0.75rem; color: var(--text-muted); line-height: 1.4; }

/* ── Principles ────────────────────────────────────────── */
.principles-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}
.principle-card {
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.principle-n {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--sand);
  flex-shrink: 0;
  padding-top: 2px;
}
.principle-text { font-size: 0.95rem; }

/* ── Layers ────────────────────────────────────────────── */
.layers { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.layer {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.layer-badge {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--surface);
  background: var(--action);
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-sm);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.layer-body h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.layer-body p  { font-size: 0.85rem; color: var(--text-muted); }

/* ── Segment cards (Routine) ───────────────────────────── */
.segments { display: flex; flex-direction: column; gap: 0.75rem; }

.segment-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.segment-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.segment-header:hover { background: var(--bg); }
.segment-n {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.segment-meta { flex: 1; }
.segment-meta h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; }
.segment-meta .dur { font-size: 0.75rem; color: var(--text-muted); }
.segment-chevron {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.segment-card.open .segment-chevron { transform: rotate(180deg); }
.segment-card.open .segment-n { background: var(--action); color: white; }

.segment-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.segment-card.open .segment-body { display: block; }

.segment-purpose {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.75rem 0 1rem;
}
.teacher-note {
  font-size: 0.82rem;
  color: var(--action);
  background: #f0f7f4;
  border-left: 3px solid var(--action);
  padding: 0.5rem 0.75rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 1rem;
}

/* ── Exchange (greeting + closing) ────────────────────── */
.exchanges { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.exchange {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--r-md);
  background: var(--bg);
}
.exchange.teacher { border-left: 3px solid var(--c-teacher); }
.exchange.class   { border-left: 3px solid var(--c-class); }
.exchange-who {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  width: 3.5rem;
  flex-shrink: 0;
}
.exchange.teacher .exchange-who { color: var(--c-teacher); }
.exchange.class   .exchange-who { color: var(--c-class); }
.exchange-text { flex: 1; font-size: 0.9rem; }
.play-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  color: var(--action);
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.play-btn:hover { background: var(--action); color: white; border-color: var(--action); }
.play-btn.playing { background: var(--action); color: white; border-color: var(--action); }

/* ── TPR command chips ─────────────────────────────────── */
.commands-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.command-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}
.command-chip:hover { background: var(--border); }
.command-chip .w-badge {
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--border);
  padding: 0.1rem 0.3rem;
  border-radius: 2rem;
}

/* ── Pair talk prompts ─────────────────────────────────── */
.prompts-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.prompt-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── Week-script (Today's Language) ───────────────────── */
.week-days { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.5rem; }
.day-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.day-n {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 2.2rem;
  flex-shrink: 0;
  padding-top: 2px;
}
.day-script { font-size: 0.85rem; }

/* ── Activity cards ────────────────────────────────────── */
.activities-grid { display: flex; flex-direction: column; gap: 0.75rem; }
.activity-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.activity-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem 1.25rem;
  cursor: pointer;
  user-select: none;
}
.activity-header:hover { background: var(--bg); }
.activity-meta { flex: 1; }
.activity-meta h3 { font-size: 1rem; font-family: var(--font-sans); font-weight: 600; }
.activity-badges {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.badge {
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: var(--r-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.activity-chevron { font-size: 0.7rem; color: var(--text-muted); transition: transform 0.2s; margin-top: 2px; }
.activity-card.open .activity-chevron { transform: rotate(180deg); }
.activity-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
}
.activity-card.open .activity-body { display: block; }
.activity-purpose { font-size: 0.85rem; color: var(--text-muted); margin: 0.75rem 0 1rem; }

.instructions-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.instructions-list li {
  display: flex;
  gap: 0.6rem;
  font-size: 0.875rem;
  align-items: baseline;
}
.instructions-list li::before {
  content: counter(step);
  counter-increment: step;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.instructions-list { counter-reset: step; }

.examples-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.examples-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── Story reader ──────────────────────────────────────── */
.story-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.vocab-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  background: #fff8f0;
  border: 1px solid #f0d8c0;
  border-radius: 2rem;
  color: var(--text-muted);
}
.story-lines { display: flex; flex-direction: column; gap: 0.5rem; }
.story-line {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.story-line-text {
  flex: 1;
}
.story-line-text p { font-size: 1rem; margin-bottom: 0.2rem; }
.story-line-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }
.story-teacher-note {
  font-size: 0.82rem;
  color: var(--action);
  background: #f0f7f4;
  border-left: 3px solid var(--action);
  padding: 0.6rem 0.75rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 1.25rem;
}

/* ── Play / script ─────────────────────────────────────── */
.play-header { margin-bottom: 1.25rem; }
.play-header h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.play-header .level { font-size: 0.78rem; color: var(--text-muted); }
.play-chars {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.play-char {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
}
.char-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
}
.char1 .char-dot { background: var(--c-char1); }
.char2 .char-dot { background: var(--c-char2); }
.script-lines { display: flex; flex-direction: column; gap: 0.4rem; }
.script-line {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.875rem;
  border-radius: var(--r-md);
}
.script-line.char1 { background: #fdf5f4; border-left: 3px solid var(--c-char1); }
.script-line.char2 { background: #f4f9f7; border-left: 3px solid var(--c-char2); }
.script-who {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  width: 5.5rem;
  flex-shrink: 0;
  text-transform: uppercase;
}
.char1 .script-who { color: var(--c-char1); }
.char2 .script-who { color: var(--c-char2); }
.script-text { flex: 1; font-size: 0.9rem; }
.plays-grid { display: flex; flex-direction: column; gap: 2rem; }

/* ── Translation Bridge ────────────────────────────────── */
.bridge-entries { display: flex; flex-direction: column; gap: 0.6rem; }
.bridge-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.bridge-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.125rem;
  cursor: pointer;
  user-select: none;
}
.bridge-summary:hover { background: var(--bg); }
.bridge-marathi {
  flex: 1;
}
.bridge-marathi-text {
  font-size: 1.1rem;
  line-height: 1.3;
}
.bridge-roman {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.bridge-arrow { color: var(--border); font-size: 0.9rem; flex-shrink: 0; }
.bridge-english-preview {
  flex: 1;
  font-size: 0.9rem;
  color: var(--action);
  font-style: italic;
}
.bridge-detail {
  display: none;
  padding: 0 1.125rem 1.125rem;
  border-top: 1px solid var(--border);
}
.bridge-card.open .bridge-detail { display: block; }
.bridge-context {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0.5rem;
}
.bridge-audio-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 0.875rem;
  flex-wrap: wrap;
}
.bridge-audio-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  border-radius: 2rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--text);
  transition: background 0.15s;
}
.bridge-audio-btn:hover { background: var(--border); }
.bridge-audio-btn.mr { border-color: var(--sand); }
.bridge-audio-btn.en { border-color: var(--action); color: var(--action); }
.bridge-teach {
  font-size: 0.85rem;
  background: #f0f7f4;
  border-left: 3px solid var(--action);
  padding: 0.6rem 0.875rem;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  line-height: 1.6;
}
.bridge-teach strong {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--action);
  margin-bottom: 0.3rem;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(4rem);
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  padding: 0.6rem 1.25rem;
  border-radius: 2rem;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent); }

/* ── Bilingual teacher notes ───────────────────────────── */
.note-label { font-size: 0.65rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); display: block; margin-bottom: 0.25rem; }
.note-mr { font-size: 0.88rem; color: var(--text); line-height: 1.6; margin-bottom: 0.4rem; }
.note-en { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; padding-top: 0.3rem; border-top: 1px solid var(--border); margin-top: 0.3rem; }
.day-script-mr { font-size: 0.85rem; color: var(--text); background: rgba(194,69,45,0.06); border-left: 3px solid var(--accent); padding: 0.4rem 0.6rem; border-radius: 0 4px 4px 0; margin-bottom: 0.25rem; display: block; }
.day-script { font-size: 0.78rem; color: var(--text-muted); display: block; }
.instructions-mr li { color: var(--text); }
.instructions-en { margin-top: 0.5rem; }
.instructions-en li { color: var(--text-muted); font-size: 0.82rem; }
.story-line-note-mr { font-size: 0.75rem; color: var(--accent); font-style: italic; margin-top: 0.15rem; display: block; }
.story-line-note { color: var(--text-muted); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 540px) {
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 1rem; }
  .bridge-english-preview { display: none; }
  .bridge-arrow { display: none; }
  .nav-links a { padding: 0.25rem 0.4rem; }
}

/* ── Print ─────────────────────────────────────────────── */
@media print {
  .nav, .play-btn, .play-btn, .bridge-audio-btn, .segment-chevron,
  .activity-chevron, .footer { display: none; }
  .segment-body, .activity-body, .bridge-detail { display: block !important; }
  .segment-card, .activity-card, .bridge-card { border: 1px solid #ccc; break-inside: avoid; }
  body { font-size: 12pt; background: white; }
}
