:root {
  --bg: #f4efe4;
  --bg-strong: #e8dcc7;
  --surface: rgba(255, 250, 241, 0.86);
  --surface-strong: #fff9f0;
  --ink: #1c1a18;
  --muted: #605a52;
  --accent: #0d7c66;
  --accent-strong: #074c40;
  --accent-soft: #d8f1e9;
  --gold: #d4a64a;
  --border: rgba(28, 26, 24, 0.12);
  --shadow: 0 20px 60px rgba(28, 26, 24, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(13, 124, 102, 0.16), transparent 26%),
    radial-gradient(circle at top right, rgba(212, 166, 74, 0.18), transparent 22%),
    linear-gradient(180deg, #f7f1e7 0%, #f2eadb 42%, #efe5d4 100%);
}

body::before {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 40px 40px;
  content: "";
  pointer-events: none;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 85%);
}

.page-shell {
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 24px 56px;
}

.hero,
.layout {
  display: grid;
  gap: 24px;
}

.hero {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-panel,
.sidebar,
.lesson-card {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero-copy {
  padding: 40px;
  border-radius: var(--radius-xl);
}

.hero-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-xl);
  align-content: start;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
}

h1,
.lesson-heading,
.sidebar h2 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  letter-spacing: -0.03em;
}

h1 {
  font-size: clamp(3rem, 7vw, 5.5rem);
  line-height: 0.95;
  max-width: 10ch;
}

.hero-text,
.lesson-summary,
.concept-copy,
.eli5-text,
.feedback-text,
.hint-text,
.resource-copy,
.lesson-button-copy {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.exercise-actions,
.lesson-footer {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 999px;
  font: inherit;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease,
    background 180ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-button,
.ghost-button {
  padding: 14px 20px;
  font-weight: 800;
}

.primary-button {
  color: #f6fff8;
  background: linear-gradient(135deg, var(--accent) 0%, #0a5a4a 100%);
  box-shadow: 0 14px 30px rgba(13, 124, 102, 0.26);
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(28, 26, 24, 0.12);
}

.stat-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.64);
  border: 1px solid rgba(28, 26, 24, 0.08);
}

.stat-label,
.lesson-time,
.exercise-type {
  color: var(--muted);
  font-size: 0.9rem;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.progress-bar {
  flex: 1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(13, 124, 102, 0.12);
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--accent));
  transition: width 280ms ease;
}

.layout {
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 22px;
  border-radius: var(--radius-xl);
}

.lesson-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.lesson-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px;
  text-align: left;
  border-radius: 18px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.58);
}

.lesson-button.active {
  border-color: rgba(13, 124, 102, 0.34);
  background: #fffef9;
}

.lesson-button.locked {
  opacity: 0.62;
}

.lesson-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  background: linear-gradient(135deg, #111f1c, #235c4f);
  flex-shrink: 0;
}

.lesson-button.locked .lesson-badge {
  color: var(--ink);
  background: rgba(28, 26, 24, 0.08);
}

.lesson-button-title {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
}

.lesson-view {
  min-height: 70vh;
}

.lesson-card {
  padding: 32px;
  border-radius: var(--radius-xl);
}

.lesson-topline {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.lesson-tag {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.86rem;
  font-weight: 800;
}

.lesson-heading {
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1;
  margin-bottom: 12px;
}

.info-block,
.exercise-block,
.eli5-block {
  margin-top: 26px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
}

.bullet-list,
.concept-stack,
.resource-list {
  display: grid;
  gap: 14px;
  margin: 16px 0 0;
  padding: 0;
}

.bullet-list {
  padding-left: 18px;
}

.concept-card,
.resource-card {
  padding: 18px;
  border-radius: 16px;
  background: rgba(244, 239, 228, 0.8);
  border: 1px solid rgba(28, 26, 24, 0.08);
}

.concept-card h4,
.resource-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.eli5-block {
  display: grid;
  gap: 12px;
  background:
    linear-gradient(120deg, rgba(13, 124, 102, 0.1), transparent 55%),
    rgba(255, 250, 241, 0.9);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.exercise-form {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.exercise-option {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 14px;
  border-radius: 14px;
  background: #fffdf8;
  border: 1px solid rgba(28, 26, 24, 0.08);
}

.exercise-option input {
  margin-top: 3px;
}

.exercise-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(28, 26, 24, 0.16);
  background: #fffdf8;
  font: inherit;
}

.feedback-text[data-state="success"] {
  color: var(--accent-strong);
  font-weight: 700;
}

.feedback-text[data-state="error"] {
  color: #9a3f2f;
  font-weight: 700;
}

.resource-card a {
  color: var(--accent-strong);
  font-weight: 800;
  text-decoration: none;
}

.resource-card a:hover {
  text-decoration: underline;
}

.lesson-footer {
  margin-top: 28px;
  justify-content: flex-end;
}

@media (max-width: 1040px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .page-shell {
    padding: 18px 14px 40px;
  }

  .hero-copy,
  .hero-panel,
  .sidebar,
  .lesson-card {
    padding: 22px;
  }

  .lesson-topline,
  .exercise-header {
    flex-direction: column;
  }

  .hero-actions,
  .exercise-actions,
  .lesson-footer {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
