:root {
  color-scheme: light;
  --ink: #09262d;
  --muted: #61787e;
  --teal: #0b9687;
  --line: #cce1df;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 8% 0%, #daf6f1, transparent 34%), #edf4f4;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.library-shell { width: min(1240px, calc(100% - 40px)); margin: 30px auto 60px; }

.library-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 22px;
  padding: 30px 34px;
  border: 1px solid rgba(18, 112, 105, 0.2);
  border-top: 4px solid var(--teal);
  border-radius: 22px;
  background: linear-gradient(115deg, rgba(232, 251, 247, .96), rgba(244, 249, 252, .96));
  box-shadow: 0 22px 60px rgba(7, 58, 65, .1);
}

.library-head span,
.lesson-card span { color: var(--teal); font-size: 11px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.library-head h1 { margin: 7px 0 5px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.05em; }
.library-head p { margin: 0; color: var(--muted); }
.library-head a { flex: none; padding: 12px 16px; border: 1px solid #a9d5d0; border-radius: 12px; background: white; color: #075f57; font-weight: 900; text-decoration: none; }

.library-section { margin-top: 24px; }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 0 2px 14px;
  padding: 0 2px 12px;
  border-bottom: 1px solid rgba(18, 112, 105, .18);
}
.section-heading span { color: var(--teal); font-size: 10px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.section-heading h2 { margin: 3px 0 0; font-size: 28px; letter-spacing: -.035em; }
.section-heading p { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.lesson-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lesson-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(7, 58, 65, .08);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.lesson-card:hover { transform: translateY(-4px); border-color: #75c9bf; box-shadow: 0 22px 44px rgba(7, 58, 65, .14); }
.lesson-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #09262d; }
.lesson-card div { position: relative; min-height: 174px; padding: 19px 20px 20px; }
.lesson-card h2 { margin: 6px 0 7px; font-size: 22px; letter-spacing: -.03em; }
.lesson-card p { margin: 0 50px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.lesson-card strong { position: absolute; right: 18px; bottom: 18px; padding: 6px 8px; border-radius: 999px; background: #e4f8f4; color: #087166; font-size: 11px; }

@media (max-width: 900px) { .lesson-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .library-shell { width: 100%; margin: 0; }
  .library-head { align-items: flex-start; flex-direction: column; border-radius: 0; padding: 24px 20px; }
  .library-section { padding: 0 14px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-heading p { text-align: left; }
  .lesson-grid { grid-template-columns: 1fr; }
}
