@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=Playfair+Display:ital,wght@1,600&display=swap');

:root {
  --ink: #243229;
  --muted: #69756d;
  --paper: #f6f1e8;
  --cream: #fffdf8;
  --sage: #dbe3d7;
  --sage-dark: #526b5a;
  --rose: #d59b8f;
  --line: rgba(36,50,41,.13);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 15%, rgba(213,155,143,.2), transparent 27rem),
    radial-gradient(circle at 92% 70%, rgba(168,183,163,.32), transparent 32rem),
    var(--paper);
  font-family: "DM Sans", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

button, input { font: inherit; }

.site-nav {
  display: flex;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand, .nav-link {
  color: var(--ink);
  text-decoration: none;
}

.brand { font-size: 14px; font-weight: 600; letter-spacing: .06em; }
.brand span { color: var(--rose); }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
}

.nav-link:hover { color: var(--ink); }

.page {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(50px, 7vw, 90px) 0 60px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: 60px;
  align-items: end;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--sage-dark);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.eyebrow::before { width: 34px; height: 1px; content: ""; background: currentColor; }

h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(48px, 7.5vw, 94px);
  font-weight: 500;
  letter-spacing: -.06em;
  line-height: .92;
}

h1 em {
  color: var(--rose);
  font-family: "Playfair Display", serif;
  font-weight: 600;
  letter-spacing: -.025em;
}

.intro-copy { padding-bottom: 7px; }
.intro-copy p { margin: 0 0 24px; color: var(--muted); font-size: 17px; line-height: 1.7; }

.stats { display: flex; gap: 30px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 24px; font-weight: 500; }
.stat span { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }

.toolbar {
  display: flex;
  margin: clamp(48px, 7vw, 80px) 0 24px;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
}

.toolbar h2 { margin: 0; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }

.search { position: relative; width: min(100%, 330px); }
.search svg { position: absolute; top: 50%; left: 15px; width: 17px; transform: translateY(-50%); }
.search input {
  width: 100%;
  padding: 12px 15px 12px 44px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 100px;
  outline: none;
  background: rgba(255,253,248,.66);
}
.search input:focus { border-color: var(--sage-dark); box-shadow: 0 0 0 3px rgba(82,107,90,.1); }

.lessons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.lesson-card {
  position: relative;
  display: flex;
  min-height: 178px;
  padding: 22px;
  overflow: hidden;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255,253,248,.77);
  cursor: pointer;
  text-align: left;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.lesson-card:hover, .lesson-card:focus-visible {
  z-index: 1;
  transform: translateY(-4px);
  background: var(--cream);
  box-shadow: 0 18px 45px rgba(42,54,46,.11);
}

.lesson-card:focus-visible { outline: 3px solid rgba(82,107,90,.45); outline-offset: 2px; }
.lesson-card[hidden] { display: none; }

.lesson-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #e6e0d6;
}

.has-thumbnails .lesson-card {
  display: grid;
  min-height: 295px;
  padding: 0;
  grid-template-rows: auto auto 1fr;
  gap: 0;
}

.has-thumbnails .lesson-top { padding: 15px 18px 0; }

.has-thumbnails .lesson-bottom {
  padding: 14px 18px 18px;
  align-self: end;
}

.lesson-top { display: flex; width: 100%; align-items: center; justify-content: space-between; }
.lesson-no { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .12em; }
.lesson-category {
  padding: 5px 9px;
  color: var(--sage-dark);
  border-radius: 30px;
  background: var(--sage);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.lesson-bottom { display: flex; width: 100%; gap: 14px; align-items: end; justify-content: space-between; }
.lesson-title { max-width: 260px; font-size: 18px; font-weight: 500; letter-spacing: -.025em; line-height: 1.25; }
.play {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: white;
  border-radius: 50%;
  background: var(--ink);
}
.play svg { width: 12px; margin-left: 2px; }

.empty { display: none; padding: 50px 0; color: var(--muted); text-align: center; }
.empty.is-visible { display: block; }

.player {
  width: min(920px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
  color: white;
  border: 0;
  border-radius: 6px;
  background: #152019;
  box-shadow: 0 30px 100px rgba(9,14,11,.45);
}
.player::backdrop { background: rgba(18,25,20,.78); backdrop-filter: blur(6px); }
.player-head { display: flex; padding: 17px 20px; gap: 18px; align-items: center; justify-content: space-between; }
.player-head strong { font-size: 15px; font-weight: 500; }
.player-close { display: grid; width: 34px; height: 34px; padding: 0; place-items: center; color: white; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; background: transparent; cursor: pointer; }
.player-close:hover { background: rgba(255,255,255,.12); }
.player video { display: block; width: 100%; max-height: calc(100vh - 120px); background: #000; }

footer { padding: 35px 0 5px; color: var(--muted); font-size: 12px; text-align: center; }

@media (max-width: 900px) {
  .intro { grid-template-columns: 1fr; gap: 28px; }
  .intro-copy { max-width: 610px; }
  .lessons { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 590px) {
  .site-nav, .page { width: min(100% - 28px, 520px); }
  .site-nav { padding: 18px 0; }
  .nav-link span { display: none; }
  .page { padding-top: 42px; }
  h1 { font-size: clamp(45px, 14vw, 66px); }
  .intro-copy p { font-size: 15px; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .lessons { grid-template-columns: 1fr; }
  .lesson-card { min-height: 150px; }
  .has-thumbnails .lesson-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lesson-card { transition: none; }
}
