/* lessons.css — page-specific styles for typing-lesson.html */

/* ── Lesson hero heading ── */
.lesson-hero {
  padding: 48px 0 32px;
  text-align: center;
}

.lesson__h1 {
  font-size: clamp(28px, 3.8vw, 52px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.5px;
  color: #eef6ff;
}

.lesson__h1 .c-yellow {
  color: var(--yellow);
}

.lesson__sub {
  font-size: clamp(15px, 1.5vw, 18px);
  font-weight: 600;
  color: var(--text-dim);
  margin-top: 14px;
  line-height: 1.9;
  opacity: 0;
  animation: lessonHeadIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.75s forwards;
}

/* H1 fade-up on load */
.lesson__h1--anim {
  opacity: 0;
  transform: translateY(20px);
  animation: lessonHeadIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.1s forwards;
}

/* "Beginners" floats in after the heading — float-in from style.css handles it,
   override delay so it appears just after the H1 */
.lesson__h1--anim .float-in {
  animation-delay: 0.55s;
}

@keyframes lessonHeadIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Level tabs — segmented control ── */
.level-tabs {
  display: flex;
  gap: 0;
  margin: 40px auto 0;
  padding: 6px;
  background: #0f1826;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  width: 720px;
  opacity: 0;
  animation: lessonHeadIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.85s forwards;
}

.level-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.level-tab__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
  transition: transform 0.3s ease-out;
}

/* ── Inactive hover — text brightens, icon lifts ── */
.level-tab:not(.level-tab--active):hover {
  color: #ffffff;
}
.level-tab:not(.level-tab--active):hover .level-tab__icon {
  transform: translateY(-2px);
}

/* Radius on first and last tab only */
.level-tab:first-child { border-radius: 16px 0 0 16px; }
.level-tab:last-child  { border-radius: 0 16px 16px 0; }


/* ── Active — soft powder blue, deep blue text ── */
.level-tab--active {
  background: #d6eaf8;
  color: #1A2238;
  font-weight: 800;
}

/* ── Active hover ── */
.level-tab--active:hover {
  background: #c8e4f8;
}

/* ── Tablet — tabs shrink ── */
@media (max-width: 760px) {
  .level-tabs {
    width: 100%;
    border-radius: 16px;
  }
  .level-tab {
    padding: 14px 4px;
    font-size: 13px;
    white-space: normal;
    text-align: center;
    gap: 6px;
  }
  .level-tab__icon {
    width: 24px;
    height: 24px;
  }
}

/* ── Mobile — further reductions ── */
@media (max-width: 480px) {
  .lesson-hero {
    padding: 28px 0 20px;
  }
  .level-tab {
    font-size: 11px;
    padding: 12px 2px;
    gap: 5px;
  }
  .level-tab__icon {
    width: 20px;
    height: 20px;
  }
  .lesson-card {
    padding: 20px 16px;
  }
  .lesson-card__title {
    font-size: 17px;
  }
  .lesson-guide {
    padding: 20px 16px;
  }
}

/* ══════════════════════════
   LESSON CARDS GRID
══════════════════════════ */
.lesson-grid-section {
  margin-top: 48px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.lesson-card {
  background: var(--card-bg);
  border: 1px solid var(--card-bdr);
  border-radius: var(--r-md);
  padding: 28px 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  opacity: 0;
  animation: lessonHeadIn 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  display: flex;
  flex-direction: column;
}

.lesson-card__btn {
  margin-top: auto;
  align-self: flex-start;
}

/* Stagger each card */
.lesson-card:nth-child(1) { animation-delay: 1.0s; }
.lesson-card:nth-child(2) { animation-delay: 1.1s; }
.lesson-card:nth-child(3) { animation-delay: 1.2s; }
.lesson-card:nth-child(4) { animation-delay: 1.3s; }
.lesson-card:nth-child(5) { animation-delay: 1.4s; }
.lesson-card:nth-child(6) { animation-delay: 1.5s; }
.lesson-card:nth-child(7) { animation-delay: 1.6s; }
.lesson-card:nth-child(8) { animation-delay: 1.7s; }

.lesson-card:hover {
  transform: translateY(-2px);
  border-color: rgba(219, 238, 255, 0.25);
}

.lesson-card__num {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-dim);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.lesson-card__title {
  font-size: 20px;
  font-weight: 700;
  color: rgba(241, 250, 255, 0.85);
  margin: 0;
}

/* ── Lesson button — same style for Start / Continue / Restart ── */
.lesson-card__btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 20px;
  min-width: 130px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #1A2238;
  background: #a8c8e8;
  border-radius: var(--r-pill);
  letter-spacing: 0.3px;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.lesson-card__btn:hover {
  background: transparent;
  color: #a8c8e8;
  box-shadow: inset 0 0 0 1px #a8c8e8;
  transform: translateY(-1px);
}

/* ── Completed count ── */
.lesson-card__count {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 12px;
}

/* ── Progress bar ── */
.lesson-progress {
  display: flex;
  gap: 4px;
  margin-top: 16px;
}

.lesson-progress__seg {
  flex: 1;
  height: 8px;
  border-radius: 3px;
  background: var(--card-bdr);
}

.lesson-progress__seg--done {
  background: #5a9e7c;
}

/* ── Completed card ── */
.lesson-card--completed {
  border-color: rgba(219, 238, 255, 0.2);
}

@media (max-width: 600px) {
  .lesson-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Lesson guidance text ── */
.lesson-guide {
  margin-top: 40px;
  padding: 36px;
  background: var(--card-bg);
  border: 1px solid var(--card-bdr);
  border-radius: var(--r-md);
}

.lesson-guide__text {
  font-size: 15px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.8;
  text-align: center;
  max-width: 680px;
  margin: 0 auto;
}

/* ══════════════════════════════════════════════════════════════
   LESSON DETAIL PAGE — typing-selection.html
   Lesson summary card + "Choose Individual Section" grid.
   The 9 section cards map 1:1 to the 9 progress segments.
══════════════════════════════════════════════════════════════ */

/* ── Back link ── */
.lesson-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.18s ease;
}
.lesson-back:hover { color: #ffffff; }
.lesson-back svg { width: 18px; height: 18px; }

/* ── Lesson summary card ── */
.lesson-detail {
  margin-top: 20px;
  padding: clamp(28px, 4vw, 44px);
  background: var(--card-bg);
  border: 1px solid var(--card-bdr);
  border-radius: var(--r-lg);
  text-align: center;
}

.lesson-detail__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--yellow);
}

.lesson-detail__title {
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: #eef6ff;
  margin-top: 10px;
}

.lesson-detail__sub {
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.7;
  max-width: 540px;
  margin: 12px auto 0;
}

/* Primary CTA — yellow brand action (Start / Continue / Restart) */
.lesson-detail__cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 26px;
  padding: 14px 30px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #1A2238;
  background: var(--yellow);
  border-radius: var(--r-pill);
  box-shadow: 0 0 0 2px var(--yellow), 0 6px 18px rgba(255, 140, 97, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}
.lesson-detail__cta svg { width: 20px; height: 20px; }
.lesson-detail__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px var(--yellow), 0 8px 22px rgba(255, 140, 97, 0.3);
}
.lesson-detail__cta:active { transform: translateY(0); opacity: 0.9; }

.lesson-detail__count {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 28px;
}
.lesson-detail__progress {
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ── "Choose Individual Section" — slim divider header (no card) ── */
.section-picker { margin-top: 44px; }

.section-picker__head {
  text-align: center;
}

/* Title centred between two fading lines */
.section-picker__title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  color: #eef6ff;
  letter-spacing: -0.2px;
}
.section-picker__title::before,
.section-picker__title::after {
  content: "";
  flex: 1;
  max-width: 110px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--card-bdr));
}
.section-picker__title::after {
  background: linear-gradient(to left, transparent, var(--card-bdr));
}

.section-picker__sub {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  line-height: 1.6;
}

/* ══════════════════════════
   SECTION GRID — typing-selection.html
   Icon cards for each lesson section (TypeDojo's own dark style — not a
   typingclub copy). Each card: number (top-left) + status (top-right) +
   a type-based icon + the name. Status by accent only, so every card keeps
   the shared --card-bg + --card-bdr. All cards clickable (no real locks).
══════════════════════════ */
.section-grid {
  margin-top: 30px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.sec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* centre content so every card matches height */
  gap: 16px;
  padding: 26px 22px 20px;   /* slightly less bottom so the name doesn't trail */
  min-height: 158px;
  background: var(--card-bg);
  border: 1px solid var(--card-bdr);
  border-radius: 16px;       /* a touch less round than --r-lg */
  text-align: center;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.sec-card:hover {
  transform: translateY(-3px);
  border-color: rgba(219, 238, 255, 0.25);
  background: rgba(255, 255, 255, 0.07);
}

/* Number — top-left corner */
.sec-card__num {
  position: absolute;
  top: 14px;
  left: 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--text-dim);   /* rgba(255,255,255,0.58) — matches the basic lesson card number */
  font-variant-numeric: tabular-nums;
}

/* Status badge — top-right corner (only the done check renders here) */
.sec-card__state {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  place-items: center;
}
.sec-card__state--done {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.16);
  color: var(--green);
}
.sec-card__state--done svg { width: 15px; height: 15px; }

/* Keyboard icon (plain — no tile) */
.sec-card__icon {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.6);
  transition: transform 0.18s ease;
}
.sec-card__icon svg { width: 60px; height: 45px; }
.sec-card:hover .sec-card__icon { transform: scale(1.06); }

/* Name sits under a divider line (icon → rule → name) */
.sec-card__name {
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--card-bdr);
  font-size: 15px;
  font-weight: 700;
  color: rgba(241, 250, 255, 0.85);
  line-height: 1.45;
  letter-spacing: 0.2px;
}

/* "CURRENT" pill — top-right corner (balances the number top-left);
   absolute so it never changes the card's height */
.sec-card__now {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #1A2238;
  background: var(--yellow);
  padding: 3px 10px;
  border-radius: var(--r-pill);
}

/* Done — green keyboard + green number */
.sec-card--done .sec-card__icon { color: var(--green); }
.sec-card--done .sec-card__num { color: var(--green); }

/* Current — yellow keyboard + yellow number (card colour unchanged) */
.sec-card--current .sec-card__icon { color: var(--yellow); }
.sec-card--current .sec-card__num { color: var(--yellow); }

/* ── Responsive ── */
@media (max-width: 620px) {
  .section-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .sec-card { min-height: 150px; padding: 22px 14px 16px; }
}
@media (max-width: 360px) {
  .section-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════
   ENTRY ANIMATIONS — typing-selection.html
   Content cascades up on load, mirroring the lesson page's flow.
   Reuses the lessonHeadIn keyframe (defined above) — no new animation.
   Order: back link → summary card → divider header → the 9 cards.
══════════════════════════ */
.lesson-back,
.lesson-detail,
.section-picker__head,
.sec-card {
  opacity: 0;
  animation: lessonHeadIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.lesson-back          { animation-delay: 0.10s; }
.lesson-detail        { animation-delay: 0.22s; }
.section-picker__head { animation-delay: 0.38s; }
.section-grid li:nth-child(1) .sec-card { animation-delay: 0.50s; }
.section-grid li:nth-child(2) .sec-card { animation-delay: 0.57s; }
.section-grid li:nth-child(3) .sec-card { animation-delay: 0.64s; }
.section-grid li:nth-child(4) .sec-card { animation-delay: 0.71s; }
.section-grid li:nth-child(5) .sec-card { animation-delay: 0.78s; }
.section-grid li:nth-child(6) .sec-card { animation-delay: 0.85s; }
.section-grid li:nth-child(7) .sec-card { animation-delay: 0.92s; }
.section-grid li:nth-child(8) .sec-card { animation-delay: 0.99s; }
.section-grid li:nth-child(9) .sec-card { animation-delay: 1.06s; }

/* Accessibility — show everything instantly, no motion */
@media (prefers-reduced-motion: reduce) {
  .lesson-back,
  .lesson-detail,
  .section-picker__head,
  .sec-card {
    animation: none;
    opacity: 1;
  }
}

