/* kids.yoga.org design system — warm cream/gold DNA from yoga.org, plus
   a soft playful accent set for the four doors. Not a school LMS: rounded,
   generous whitespace, big touch targets, no dense UI chrome. */
:root {
  --bg: #f6f1e8;
  --card: #fffdf8;
  --ink: #1c1916;
  --muted: #6b635a;
  --line: #e4d9c8;
  /* Darkened from #9a7b3c after a real contrast check found the original
     failed WCAG AA for normal text (3.54:1 on cream bg, 3.98:1 for white
     button text) — this shade passes both at 4.5:1+. Accessibility gate 5. */
  --gold: #846933;
  --gold-soft: #c4a574;

  /* four doors — soft, kid-friendly, still on-brand (desaturated, warm-adjacent) */
  --watch: #4f7cac;   /* sky blue */
  --watch-bg: #eaf2fa;
  --practice: #5a8f6b; /* leaf green */
  --practice-bg: #eaf5ee;
  --color: #c4587a;   /* berry */
  --color-bg: #fbeaf1;
  --learn: #c98a2e;   /* sun gold */
  --learn-bg: #fbf1e0;
  --gita: #7a5ea8;    /* gentle violet, distinct from the four doors */
  --gita-bg: #f2eefb;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow-soft: 0 2px 14px rgba(28, 25, 22, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: "Iowan Old Style", Georgia, serif;
  font-weight: 500;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}
p { line-height: 1.55; margin: 0 0 1em; }
a { color: inherit; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---- top nav ---- */
.ks-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px; flex-wrap: wrap;
  background: rgba(246, 241, 232, 0.96);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.ks-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.ks-brand em { font-style: normal; color: var(--gold); }
.ks-brand .emoji { font-size: 1.4rem; }
.ks-nav { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ks-nav a {
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: 14px;
  padding: 8px 12px; border-radius: 999px; min-height: 40px; display: inline-flex; align-items: center;
}
.ks-nav a:hover, .ks-nav a[aria-current="page"] { color: var(--ink); background: var(--card); }
.ks-nav a.grownups { border: 1px solid var(--line); }

/* ---- hero ---- */
.ks-hero-art {
  position: relative; overflow: hidden; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.ks-hero-art img { display: block; width: 100%; height: clamp(220px, 34vw, 400px); object-fit: cover; }
.ks-hero { padding: 40px 0 40px; text-align: center; }
.ks-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; margin-bottom: 14px; }
.ks-hero .lead { max-width: 42em; margin: 0 auto 28px; font-size: 1.15rem; color: var(--muted); }
.ks-door-icon { width: 44px; height: 44px; display: block; margin-bottom: 10px; }
.ks-cta {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--gold); color: #fff; font-weight: 800; font-size: 17px;
  padding: 16px 30px; border-radius: 999px; box-shadow: var(--shadow-soft);
}
.ks-cta:hover { filter: brightness(1.05); }

/* ---- door grid ---- */
.ks-doors { display: grid; gap: 16px; grid-template-columns: 1fr; padding: 10px 0 40px; }
@media (min-width: 640px) { .ks-doors { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .ks-doors { grid-template-columns: repeat(4, 1fr); } }
.ks-door {
  display: block; text-decoration: none; color: var(--ink);
  border-radius: var(--radius-lg); padding: 26px 22px; min-height: 160px;
  border: 1px solid var(--line); box-shadow: var(--shadow-soft);
  transition: transform .15s ease;
}
.ks-door:hover { transform: translateY(-2px); }
.ks-disabled, a.ks-disabled { cursor: default; opacity: 0.85; pointer-events: none; }
.ks-disabled:hover { transform: none; }
.ks-door .ico { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.ks-door strong { display: block; font-size: 1.2rem; margin-bottom: 4px; font-family: "Iowan Old Style", Georgia, serif; }
.ks-door span { color: var(--muted); font-size: 14px; }
.ks-door.watch { background: var(--watch-bg); }
.ks-door.watch strong { color: var(--watch); }
.ks-door.practice { background: var(--practice-bg); }
.ks-door.practice strong { color: var(--practice); }
.ks-door.color { background: var(--color-bg); }
.ks-door.color strong { color: var(--color); }
.ks-door.learn { background: var(--learn-bg); }
.ks-door.learn strong { color: var(--learn); }

/* ---- gita feature strip ---- */
.ks-gita-strip {
  background: var(--gita-bg); border-radius: var(--radius-lg); padding: 30px 28px;
  display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin: 10px 0 40px;
}
.ks-gita-strip .txt { flex: 1 1 320px; }
.ks-gita-strip h2 { color: var(--gita); font-size: 1.5rem; margin-bottom: 8px; }
.ks-gita-strip .ks-cta { background: var(--gita); }

/* ---- status badges (content manifest states) ---- */
.ks-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.ks-badge.live { background: #e3f3e8; color: #276b43; }
.ks-badge.staging { background: #fdf0da; color: #93620e; }
.ks-badge.approved { background: #e3f3e8; color: #276b43; }
.ks-badge.awaiting_approval { background: #fdf0da; color: #93620e; }
.ks-badge.scaffold { background: #f1ecf9; color: #6a4fa0; }
.ks-badge.planned { background: #eee9e0; color: var(--muted); }

/* ---- content cards ---- */
.ks-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .ks-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .ks-grid { grid-template-columns: repeat(3, 1fr); } }
.ks-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 20px; box-shadow: var(--shadow-soft); }
.ks-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.ks-card p { color: var(--muted); font-size: 14px; margin-bottom: 10px; }

/* ---- learning pack: focus mode (one step at a time, no promo chrome) ---- */
.ks-focus-wrap { max-width: 640px; margin: 0 auto; padding: 24px 20px 60px; }
.ks-focus-steps { display: flex; gap: 6px; justify-content: center; margin-bottom: 24px; }
.ks-focus-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.ks-focus-dot.done { background: var(--gold-soft); }
.ks-focus-dot.active { background: var(--gold); transform: scale(1.3); }
.ks-focus-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow-soft);
}
.ks-focus-card .step-label { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.ks-focus-card h2 { font-size: 1.6rem; margin-bottom: 14px; }
.ks-focus-card p { font-size: 1.05rem; color: var(--ink); line-height: 1.6; }
.ks-focus-card .unavailable-note { color: var(--muted); font-size: 14px; margin-top: 16px; }
.ks-focus-img { width: 160px; height: 160px; margin: 0 auto 16px; display: block; }
.ks-focus-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.ks-focus-btn {
  flex: 1; text-align: center; padding: 14px 18px; border-radius: 999px; font-weight: 800; font-size: 15px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
}
.ks-focus-btn.primary { background: var(--gold); color: #fff; border-color: var(--gold); }
.ks-focus-btn:disabled { opacity: 0.45; cursor: default; }
/* "Next when you're ready" pattern — information cards use this, not urgency timers */
.ks-focus-end { text-align: center; padding: 40px 20px; }

/* ---- audience lane pills (editorial nav band, not identity/profile) ---- */
.ks-lanes { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.ks-lane { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ks-lane.active { border-color: var(--gold); color: var(--gold); }

/* ---- learning pack flow ---- */
.ks-flow { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0; }
.ks-flow-step { flex: 1 1 140px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 16px; text-align: center; }
.ks-flow-step .n { display: block; font-size: 12px; font-weight: 800; color: var(--gold); margin-bottom: 4px; }

/* ---- section ---- */
.ks-section { padding: 36px 0; }
.ks-section h2 { font-size: 1.8rem; margin-bottom: 6px; }
.ks-section .sub { color: var(--muted); margin-bottom: 20px; }

/* ---- footer (legal bar lives above this via yoga-chrome.js) ---- */
.ks-foot { border-top: 1px solid var(--line); padding: 30px 0; margin-top: 30px; text-align: center; color: var(--muted); font-size: 13px; }
.ks-foot a { color: var(--gold); text-decoration: none; }

/* ---- coming soon / next-when-ready pattern ---- */
.ks-nextwhen {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--gold); font-weight: 700; font-size: 14px; padding: 10px 16px;
  border: 1px solid var(--gold-soft); border-radius: 999px;
}

/* ---- timer (guided activity only — never decorative countdown) ---- */
.ks-timer { display: none; }
.ks-timer.ks-timer-active { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--practice); }

@media (max-width: 480px) {
  .ks-hero { padding: 40px 0 28px; }
  .ks-gita-strip { flex-direction: column; text-align: center; }
}

/* Shared frame — homepage and every inner page. */
body.ks-home,
body.ks-page { background: #f6f3ec; }
body.ks-home .ks-top,
body.ks-page .ks-top {
  background: #fff;
  border-bottom: 1px solid #efe6d8;
  max-width: 1120px;
  margin: 0 auto;
  position: sticky;
}
.ks-safe {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #7d4450;
  white-space: nowrap;
}
.ks-safe::before { content: "♥ "; color: #d4536a; }
.ks-stage { max-width: 1120px; margin: 0 auto 10px; padding: 14px 16px 8px; }
.ks-photo {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  height: min(64vw, 560px);
  min-height: 420px;
  background: #efd3a4;
}
.ks-photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 70% 45%;
}
.ks-photo-copy {
  position: relative;
  z-index: 2;
  max-width: 460px;
  padding: 46px 40px 130px;
}
.ks-photo-copy h1 {
  font-size: clamp(2.15rem, 4.6vw, 3.45rem);
  line-height: 1.02;
  color: #163f3c;
  font-weight: 560;
  text-shadow: 0 1px 0 rgba(255,248,236,.45);
}
.ks-photo-copy p {
  color: #2d403c;
  font-size: 1.05rem;
  max-width: 34em;
  margin-bottom: 18px;
}
.ks-cta-sun {
  background: #e6b325;
  color: #1c1916;
}
.ks-cta-sun:hover { filter: brightness(1.04); }
.ks-whispers {
  position: absolute;
  z-index: 2;
  left: 48%;
  top: 28px;
  width: 150px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  color: #4e3d2e;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.4;
}
.ks-scene-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: -78px;
  position: relative;
  z-index: 3;
  padding: 0 8px;
}
.ks-scene {
  display: flex;
  flex-direction: column;
  background: #fff;
  color: #1c1916;
  text-decoration: none;
  border-radius: 18px;
  overflow: hidden;
  min-height: 230px;
  box-shadow: 0 12px 28px rgba(50, 36, 12, 0.12);
}
.ks-scene img { width: 100%; height: 148px; object-fit: cover; }
.ks-scene strong {
  display: block;
  padding: 12px 14px 0;
  font-size: 1.2rem;
  font-family: "Iowan Old Style", Georgia, serif;
}
.ks-scene span {
  display: block;
  padding: 4px 14px 16px;
  color: #6b635a;
  font-size: 14px;
}
.ks-scene:hover { transform: translateY(-2px); }
.ks-poss {
  text-align: center;
  margin: 26px 0 4px;
  font-family: "Iowan Old Style", Georgia, serif;
  font-size: 1.45rem;
  color: #1a4f4a;
}
body.ks-home .ks-lanes { justify-content: center; margin: 8px 0 18px; }
@media (max-width: 860px) {
  .ks-whispers { display: none; }
  .ks-scene-row { grid-template-columns: 1fr 1fr; margin-top: -36px; }
  .ks-photo {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    background: #f4ecdf;
  }
  .ks-photo img {
    position: relative;
    order: 2;
    height: 250px;
    object-position: 72% 22%;
  }
  .ks-photo-copy {
    order: 1;
    max-width: none;
    padding: 18px 16px 6px;
  }
  .ks-photo-copy h1 { font-size: 2rem; text-shadow: none; }
  .ks-safe { display: none; }
}
@media (max-width: 560px) {
  .ks-scene-row { grid-template-columns: 1fr; }
  .ks-scene { min-height: 0; }
  .ks-photo-copy h1 { font-size: 2.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ks-scene { transition: none; }
  .ks-scene:hover { transform: none; }
}

/* Inner pages — same house as the homepage, with a wide picture banner. */
.ks-banner {
  position: relative;
  max-width: 1120px;
  margin: 14px auto 0;
  min-height: 240px;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  background: #efd3a4;
}
.ks-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ks-banner-watch img { object-position: 50% 32%; }
.ks-banner-practice img { object-position: 50% 72%; }
.ks-banner-color img { object-position: 50% 45%; }
.ks-banner-learn img { object-position: 50% 35%; }
.ks-banner-gita img { object-position: 55% 32%; }
.ks-banner-grown img { object-position: 28% 45%; }
.ks-banner-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 72px 32px 22px;
  background: linear-gradient(transparent, rgba(255, 248, 236, 0.94) 58%);
}
.ks-banner-copy h1 {
  color: #163f3c;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.05;
  margin-bottom: 6px;
}
.ks-banner-copy p {
  max-width: 38em;
  margin: 0;
  color: #2d403c;
  font-size: 1.05rem;
}
body.ks-page .wrap { max-width: 1120px; }
body.ks-page .ks-card {
  border: none;
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(50, 36, 12, 0.08);
}
a.ks-card { display: block; text-decoration: none; color: inherit; }
a.ks-card:hover { transform: translateY(-2px); }
body.ks-page .ks-section h2,
body.ks-page .ks-card h3 { color: #163f3c; }
body.ks-page .ks-focus-btn.primary {
  background: #e6b325;
  color: #1c1916;
  border-color: #e6b325;
}
.ks-back {
  margin: 16px 0 0;
  font-weight: 700;
}
.ks-back a { color: #1a4f4a; text-decoration: none; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; margin-top: 18px; }
.ch-tile {
  background: #fff;
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(50, 36, 12, 0.08);
  min-height: 84px;
}
.ch-tile .num { font-weight: 800; color: #1a4f4a; display: block; margin-bottom: 6px; font-family: "Iowan Old Style", Georgia, serif; font-size: 1.15rem; }
@media (max-width: 860px) {
  .ks-banner { min-height: 168px; margin: 10px 12px 0; border-radius: 18px; }
  .ks-banner-copy { padding: 36px 16px 14px; }
  .ks-banner-copy h1 { font-size: 1.85rem; }
  .ks-focus-img { width: 96px; height: 96px; }
  .ks-focus-card { padding: 14px 16px 10px; }
  body.ks-pack .ks-focus-card h2 { display: none; }
  body.ks-pack .ks-back { margin-top: 8px; }
  body.ks-pack .ks-banner { min-height: 0; background: transparent; }
  body.ks-pack .ks-banner img { display: none; }
  body.ks-pack .ks-banner-copy { background: transparent; padding: 12px 4px 0; }
}

/* ---- clean Episode 1 player ---- */
.ks-player-wrap { max-width: 640px; margin: 0 auto; }
.ks-player-video { width: 100%; border-radius: var(--radius-md); display: block; background: #000; }
.ks-player-status { text-align: center; font-size: 14px; color: var(--muted); padding: 10px 0; }
.ks-player-status.ks-player-error { color: #a33; }
.ks-transcript { max-width: 640px; margin: 14px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px 18px; }
.ks-transcript summary { cursor: pointer; font-weight: 700; padding: 12px 0; color: var(--gold); }
.ks-transcript-lines { padding: 4px 0 16px; }
.ks-transcript-lines p { font-size: 14px; color: var(--ink); margin: 0 0 8px; }

/* ---- printable coloring pages ---- */
.ks-print-ui { max-width: 720px; margin: 0 auto; padding: 22px 16px 0; text-align: center; }
.ks-print-ui h1 { font-family: "Iowan Old Style", Georgia, serif; font-size: 2.2rem; color: #163f3c; margin: 6px 0 8px; }
.ks-print-ui p { color: #3c3832; font-size: 1.05rem; }
.ks-print-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 16px 0 8px; }
.ks-print-actions .ks-focus-btn { flex: 0 1 auto; min-height: 48px; min-width: 180px; }
.ks-sheet {
  max-width: 720px; margin: 8px auto 28px; background: #fff;
  border-radius: 18px; box-shadow: 0 10px 28px rgba(50, 36, 12, 0.08); overflow: hidden;
}
.ks-sheet img { width: 100%; height: auto; display: block; background: #fff; }
.ks-print-picks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
button.ks-nextwhen { font-family: inherit; cursor: pointer; background: #fff; }
@media (max-width: 860px) {
  .ks-print-ui h1 { font-size: 1.85rem; }
  .ks-sheet { margin: 8px 12px 24px; border-radius: 14px; }
}
@media print {
  @page { size: letter; margin: 0.45in; }
  body.ks-print { background: #fff !important; }
  body.ks-print * { visibility: hidden; }
  body.ks-print .ks-sheet,
  body.ks-print .ks-sheet * { visibility: visible; }
  body.ks-print .ks-sheet {
    position: absolute; left: 0; top: 0; width: 100%; max-width: none;
    margin: 0; border-radius: 0; box-shadow: none; overflow: visible;
  }
}

/* ---- storytime library feature (portrait artwork + live HTML copy) ---- */
.ks-story {
  display: grid; gap: 24px; align-items: center; margin: 30px 0;
  grid-template-columns: 1fr; text-align: center;
}
@media (min-width: 760px) {
  .ks-story { grid-template-columns: 280px 1fr; text-align: left; }
}
.ks-story img {
  width: 100%; max-width: 280px; margin: 0 auto; display: block;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); object-fit: cover;
}
.ks-story .txt h2 { margin-bottom: 8px; }
.ks-story .txt p { color: var(--muted); }

/* ---- page-title icon (consistent with the homepage door icons) ---- */
.ks-page-title { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.ks-page-title img { width: 48px; height: 48px; flex: 0 0 auto; }
.ks-page-title h2 { margin-bottom: 0; }

/* ---- respect reduced-motion preference (accessibility gate 5) ---- */
@media (prefers-reduced-motion: reduce) {
  .ks-door, .ks-focus-dot { transition: none !important; }
  .ks-door:hover { transform: none; }
}
