/* Life Academy — Lesson Studio (Grades 6–12)
   Serious academic dual-coding. Not Story Studio. */

:root {
  --ink: #0e171c;
  --ink-soft: #243038;
  --muted: #5a6b74;
  --paper: #eef3f1;
  --panel: rgba(252, 253, 252, 0.94);
  --teal: #0d7377;
  --teal-deep: #0a5558;
  --amber: #b8893d;
  --amber-soft: #e8d4a8;
  --line: rgba(14, 23, 28, 0.12);
  --shadow: 0 18px 48px rgba(14, 23, 28, 0.1);
  --touch: 52px;
  --radius: 4px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--ink);
  background-color: #0e171c;
  background-image:
    radial-gradient(ellipse 90% 55% at 8% -5%, rgba(13, 115, 119, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 45% at 95% 5%, rgba(184, 137, 61, 0.18), transparent 50%),
    linear-gradient(165deg, #122028 0%, #1a2a32 42%, #0e171c 100%);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 7.25rem;
}

body.ls-light {
  background-image:
    radial-gradient(ellipse 90% 55% at 0% 0%, rgba(13, 115, 119, 0.14), transparent 50%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(184, 137, 61, 0.1), transparent 45%),
    linear-gradient(165deg, #e8efec 0%, #f4f7f6 45%, #e4ebe8 100%);
  color: var(--ink);
}

.ls-top {
  max-width: 980px;
  margin: 0 auto;
  padding: 0.85rem 1.15rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
}
.ls-brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  color: #f4f7f6;
}
body.ls-light .ls-brand { color: var(--ink); }
.ls-brand span { color: #5eead4; }
body.ls-light .ls-brand span { color: var(--teal); }

.ls-meta {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 247, 246, 0.65);
  border: 1px solid rgba(244, 247, 246, 0.18);
  padding: 0.35rem 0.7rem;
}
body.ls-light .ls-meta {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.6);
}

.ls-back {
  color: #5eead4;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
body.ls-light .ls-back { color: var(--teal-deep); }

.ls-mode {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.15rem 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.ls-mode button {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(244, 247, 246, 0.25);
  background: transparent;
  color: #f4f7f6;
  cursor: pointer;
  border-radius: var(--radius);
}
body.ls-light .ls-mode button {
  border-color: var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
}
.ls-mode button.on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.ls-mode-hint {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(244, 247, 246, 0.6);
  flex: 1 1 160px;
}
body.ls-light .ls-mode-hint { color: var(--muted); }

.ls-stage {
  max-width: 920px;
  margin: 0.35rem auto 1rem;
  padding: 0 1.15rem;
}

.ls-scene {
  display: none;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: ls-rise 0.35s ease;
}
.ls-scene.active { display: block; }
@keyframes ls-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ls-visual {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #152228;
  position: relative;
  overflow: hidden;
}
.ls-visual svg {
  width: 100%;
  height: 100%;
  display: block;
}
.ls-visual::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(transparent, rgba(14, 23, 28, 0.35));
  pointer-events: none;
}

.ls-body { padding: 1.25rem 1.35rem 1.5rem; }
.ls-kicker {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.4rem;
}
.ls-body h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1.4rem, 3.4vw, 1.95rem);
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 0.55rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.ls-line {
  font-size: clamp(1.05rem, 2.4vw, 1.22rem);
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0 1rem;
  max-width: 52ch;
}

.ls-passage {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-weight: 500;
  font-style: italic;
  line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--amber);
  padding: 0.65rem 0 0.65rem 1rem;
  margin: 0 0 1rem;
  background: linear-gradient(90deg, rgba(184, 137, 61, 0.08), transparent);
}
.ls-passage cite {
  display: block;
  font-family: "Source Sans 3", sans-serif;
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.55rem;
}

.ls-coach {
  background: rgba(13, 115, 119, 0.06);
  border-left: 3px solid var(--teal);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.ls-coach strong {
  color: var(--teal-deep);
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ls-coach a { color: var(--teal-deep); font-weight: 700; }

.ls-triad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin: 1rem 0 0.5rem;
}
@media (max-width: 640px) {
  .ls-triad { grid-template-columns: 1fr; }
}
.ls-step {
  border: 1px solid var(--line);
  padding: 0.75rem 0.85rem;
  background: #fff;
}
.ls-step em {
  display: block;
  font-style: normal;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.3rem;
}
.ls-step p {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.4;
}

.ls-vocab {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0;
}
.ls-chip {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  border-radius: var(--radius);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.ls-chip:hover, .ls-chip.speaking {
  border-color: var(--teal);
  background: rgba(13, 115, 119, 0.08);
}
.ls-chip small {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 0.15rem;
}

.ls-diagram-note {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

body.student-mode .ls-coach,
body.student-mode .ls-mode-hint-coach,
body.student-mode .ls-back {
  display: none !important;
}

.ls-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr 1.25fr 1.5fr;
  gap: 0.45rem;
  padding: 0.65rem 1rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(14, 23, 28, 0.94);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
}
body.ls-light .ls-nav {
  background: rgba(244, 247, 246, 0.96);
  border-top-color: var(--line);
}
.ls-nav .progress {
  grid-column: 1 / -1;
  text-align: center;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: rgba(244, 247, 246, 0.55);
}
body.ls-light .ls-nav .progress { color: var(--muted); }
.ls-nav button {
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  min-height: var(--touch);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--teal);
  color: #fff;
}
.ls-nav button:disabled { opacity: 0.35; cursor: not-allowed; }
.ls-nav button.ghost {
  background: transparent;
  color: #f4f7f6;
  border: 1px solid rgba(244, 247, 246, 0.3);
}
body.ls-light .ls-nav button.ghost {
  color: var(--ink);
  border-color: var(--ink);
  background: #fff;
}
.ls-nav button.read {
  background: var(--amber);
  color: #0e171c;
}

.ls-toast {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--teal-deep);
  color: #fff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  letter-spacing: 0.02em;
}
.ls-toast.show { opacity: 1; }

.ls-hub {
  max-width: 880px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3.5rem;
  position: relative;
}
.ls-hub-hero {
  min-height: min(72vh, 560px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 2rem 0 2.5rem;
  position: relative;
}
.ls-hub-hero::before {
  content: "";
  position: absolute;
  inset: -2rem -1.25rem auto;
  height: min(78vh, 620px);
  background:
    radial-gradient(ellipse 80% 60% at 70% 40%, rgba(13, 115, 119, 0.45), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 70%, rgba(184, 137, 61, 0.22), transparent 55%),
    linear-gradient(180deg, transparent 30%, #0e171c 95%);
  z-index: -1;
  pointer-events: none;
}
.ls-hub h1 {
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #f4f7f6;
  margin: 0.4rem 0 0.75rem;
  max-width: 14ch;
  animation: ls-fade-up 0.7s ease both;
}
.ls-hub .ls-brand {
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  animation: ls-fade-up 0.55s ease both;
}
.ls-hub-lead {
  color: rgba(244, 247, 246, 0.72);
  font-weight: 600;
  font-size: 1.08rem;
  max-width: 34ch;
  margin: 0 0 1.5rem;
  animation: ls-fade-up 0.85s ease 0.08s both;
}
.ls-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  animation: ls-fade-up 0.9s ease 0.15s both;
}
.ls-cta {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.65rem 1.15rem;
  font-weight: 700;
  text-decoration: none;
  background: var(--teal);
  color: #fff;
  border-radius: var(--radius);
}
.ls-cta.ghost {
  background: transparent;
  border: 1px solid rgba(244, 247, 246, 0.35);
  color: #f4f7f6;
}
@keyframes ls-fade-up {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.ls-hub-section {
  margin: 2.5rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 247, 246, 0.1);
}
.ls-hub-section h2 {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 600;
  color: #f4f7f6;
  margin: 0 0 0.4rem;
}
.ls-hub-section p {
  color: rgba(244, 247, 246, 0.6);
  font-weight: 600;
  margin: 0 0 1rem;
  max-width: 42ch;
}
.ls-demo-list { display: grid; gap: 0.55rem; }
a.ls-demo {
  display: block;
  text-decoration: none;
  color: #f4f7f6;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(244, 247, 246, 0.12);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease;
}
a.ls-demo:hover {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(13, 115, 119, 0.12);
}
a.ls-demo small {
  display: block;
  color: #5eead4;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
a.ls-demo strong {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.2rem;
  font-weight: 600;
}
a.ls-demo span {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: rgba(244, 247, 246, 0.55);
}

@media (max-width: 600px) {
  .ls-body { padding: 1rem 1.05rem 1.25rem; }
  .ls-nav { grid-template-columns: 1fr 1fr; }
  .ls-nav button.read { grid-column: 1 / -1; }
}
