:root {
  color-scheme: light;
  font-family: "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
  scroll-behavior: smooth;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: #16435c;
  background: linear-gradient(180deg, #eaf5f8 0, #f7fbf9 390px, #fffdf8 100%);
}
button { font: inherit; cursor: pointer; }
video { display: block; max-width: 100%; }
.wrap { width: min(1080px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 80px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #f08b53; outline-offset: 3px; }
.sound-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 25px;
  padding: 11px 16px;
  border: 1px solid #c9e4e9;
  border-radius: 12px;
  background: rgba(255,255,255,.78);
  color: #4a7080;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.4;
}
.sound-tip span { color: #e7975d; font-size: 21px; line-height: 1; }
.letter-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
}
.letter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 161px;
  padding: 21px 8px 12px;
  border: 1.5px solid #b9dfec;
  border-radius: 16px;
  background: #f3fbff;
  color: #16435c;
  text-align: center;
  box-shadow: 0 3px 0 #edf3f2;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.letter-card:hover {
  transform: translateY(-3px);
  border-color: #8ac9dc;
  box-shadow: 0 10px 20px rgba(42,102,133,.12);
}
.letter-card[aria-current="true"] {
  border-color: #288fbe;
  box-shadow: 0 0 0 3px rgba(40,143,190,.14);
}
.letter-number {
  position: absolute;
  top: 11px;
  left: 12px;
  color: #9bb4ba;
  font-size: 10px;
  font-weight: 850;
}
.glyph {
  display: block;
  color: #215987;
  font: 700 59px/.98 "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", Arial, sans-serif;
}
.letter-name { font-size: 13px; font-weight: 800; }
.lesson-card {
  width: min(650px, 100%);
  margin: 58px auto 0;
  padding: 28px;
  border: 1px solid #d4e9eb;
  border-radius: 24px;
  background: white;
  box-shadow: 0 18px 50px rgba(31,75,107,.12);
  scroll-margin-top: 24px;
}
.lesson-card-top { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.lesson-index { color: #8ba4ae; font-size: 11px; font-weight: 850; letter-spacing: .12em; }
.lesson-title-row { display: flex; align-items: center; gap: 18px; margin: 18px 0; }
.lesson-glyph {
  display: grid;
  place-items: center;
  flex: 0 0 88px;
  width: 88px;
  height: 88px;
  padding-bottom: 12px;
  border-radius: 18px;
  background: #e7f6fc;
  color: #206399;
  font: 700 62px/.9 "Geeza Pro", "Noto Naskh Arabic", "Traditional Arabic", Arial, sans-serif;
}
.lesson-name-wrap h2 { margin: 0 0 3px; color: #194762; font-size: 30px; line-height: 1.1; letter-spacing: -.04em; }
.video-container { overflow: hidden; border-radius: 16px; background: #899889; }
.video-container[hidden], .coming-soon[hidden] { display: none; }
.video-container video { width: 100%; max-height: 410px; aspect-ratio: 1.28; object-fit: contain; background: #899889; }
.coming-soon {
  margin: 0;
  padding: 40px 18px;
  border-radius: 16px;
  background: #f1f7f5;
  color: #66818a;
  font-size: 15px;
  text-align: center;
}
.lesson-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.lesson-nav button { width: 39px; height: 39px; border: 1.5px solid #d7e5e9; border-radius: 10px; background: white; color: #2a6995; font-size: 21px; }
.lesson-nav button:hover:not(:disabled) { background: #eaf7fb; }
.lesson-nav button:disabled { opacity: .38; cursor: not-allowed; }
@media (max-width: 960px) { .letter-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 680px) {
  .wrap { width: min(100% - 28px, 520px); padding: 20px 0 50px; }
  .sound-tip { font-size: 13px; }
  .letter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .letter-card { min-height: 135px; padding: 20px 5px 9px; border-radius: 13px; }
  .glyph { font-size: 49px; }
  .letter-name { font-size: 11px; }
  .lesson-card { margin-top: 37px; padding: 20px; }
}
@media (max-width: 410px) {
  .letter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .letter-card { min-height: 137px; }
}
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .letter-card { transition: none; }
}
