@font-face {
  font-family: Nunito;
  src: url("/fonts/nunito-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: Nunito;
  src: url("/fonts/nunito-latin-ext.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: Nunito;
  src: url("/fonts/nunito-cyrillic.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Vazirmatn;
  src: url("/fonts/vazirmatn-arabic.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: "Readex Pro";
  src: url("/fonts/readex-pro-arabic.woff2") format("woff2");
  font-style: normal;
  font-weight: 160 700;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

:root {
  color-scheme: light;
  --paper: #f8f5ed;
  --ink: #29332b;
  --muted: #545a4e;
  --line: #c9c7b9;
  --accent: #a63a2b;
  --accent-hover: #862e22;
  --section: #222b24;
  --light-text: #f7f1e5;
  --gutter: clamp(1.2rem, 3.8vw, 3.7rem);
  --ui-font: Nunito, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: var(--ui-font);
  font-family: var(--display);
  font-synthesis: none;
  line-height: 1.62;
  background: var(--paper);
  color: var(--ink);
}

[lang] {
  --display: var(--ui-font);
  font-family: var(--display);
}

[lang]:lang(fa) { --display: Vazirmatn, var(--ui-font); }
[lang]:lang(ar) { --display: "Readex Pro", var(--ui-font); }

html[dir="rtl"] :is(h1, h2, h3, .brand, .eyebrow) {
  letter-spacing: normal;
}

html[dir="rtl"] :is(.hero h1, .level-lead h2, .series-promo h2, .page-intro h1) {
  font-weight: 580;
  line-height: 1.34;
}

html[dir="rtl"] .hero h1 {
  font-size: clamp(2rem, 1.55rem + 1.85vw, 3rem);
}

html[dir="rtl"] .hero h1 em {
  font-weight: 560;
}

html[dir="rtl"] :is(.level-lead h2, .series-promo h2) {
  font-size: clamp(1.5rem, 1.2rem + 1.45vw, 2.45rem);
}

html[dir="rtl"] .page-intro h1 {
  font-size: clamp(1.625rem, 1.2rem + 1.65vw, 2.5rem);
}

html[dir="rtl"] .page-body h2:not(:where(.lesson-navigation h2, .member-root h2)) {
  font-size: clamp(1.27rem, 1.075rem + .8vw, 1.8rem);
  font-weight: 580;
  line-height: 1.4;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
h1, h2, h3, p, figure { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input { font: inherit; }
::selection { color: var(--ink); background: #e7c696; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

#main:focus, #levels:focus { outline: none; }

.shell {
  width: min(100% - var(--gutter) * 2, 75rem);
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  z-index: 3;
  top: .6rem;
  inset-inline-start: var(--gutter);
  padding: .55rem .85rem;
  transform: translateY(-150%);
  border: 1px solid currentColor;
  background: var(--paper);
  font-weight: 650;
}

.skip-link:focus { transform: none; }

.site-header { border-bottom: 1px solid var(--line); }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  column-gap: 1.4rem;
}

.brand {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  gap: .55rem;
  white-space: nowrap;
  font-size: 1.16rem;
  font-weight: 740;
  letter-spacing: -.025em;
  text-decoration: none;
}

.brand img {
  flex: none;
  width: 2rem;
  height: auto;
  border-radius: .25rem;
}

.site-nav,
.footer-inner nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.85rem, 2.8vw, 2.1rem);
}

.site-nav a,
.footer-inner nav a {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  white-space: nowrap;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: .32em;
}

.site-nav a[aria-current],
.site-nav a:hover,
.footer-inner nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.fixture-notice {
  padding: .45rem var(--gutter);
  border-top: 1px solid #d5bd98;
  background: #f2e5ce;
  color: #463420;
  text-align: center;
  font-size: .88rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .65rem 1.2rem;
}

.button {
  display: inline-flex;
  min-height: 2.9rem;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: .4rem;
  font-size: .9375rem;
  font-weight: 650;
  line-height: 1.38;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: #fffaf3;
}

.button-primary:hover { background: var(--accent-hover); }

.button-secondary {
  border-color: var(--line);
  background: transparent;
  color: var(--ink);
}

.button-secondary:hover { border-color: currentColor; }

.text-link {
  display: inline-block;
  padding-block: .45rem;
  color: var(--accent-hover);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: .075em;
  text-underline-offset: .21em;
}

.text-link:hover { text-decoration-thickness: .12em; }

.eyebrow {
  color: var(--muted);
  font-size: .86rem;
  font-weight: 650;
  line-height: 1.45;
  letter-spacing: .015em;
}

.muted { color: var(--muted); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(2.2rem, 6vw, 5rem);
  padding-block: clamp(2.9rem, 7vw, 6.25rem);
}

.hero-copy { min-width: 0; }

.hero h1,
.level-lead h2,
.series-promo h2 {
  font-family: var(--display);
  font-weight: 660;
  line-height: 1.1;
  letter-spacing: -.036em;
}

.hero h1 { font-size: clamp(2.85rem, 5.1vw, 5.1rem); }

.hero h1 em {
  display: block;
  color: var(--accent);
  font-style: normal;
  font-weight: 620;
}

.hero-copy > p {
  max-width: 39ch;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.125rem);
}

.hero-copy .actions { margin-top: 1.65rem; }

.hero-visual { min-width: 0; }

.hero-visual img,
.series-promo-image {
  width: 100%;
  height: auto;
}

.level-section {
  display: grid;
  grid-template-columns: minmax(11rem, .68fr) minmax(0, 1.7fr);
  align-items: start;
  gap: clamp(2rem, 6.3vw, 5.15rem);
  padding-block: clamp(2.1rem, 4vw, 3.7rem) clamp(3.2rem, 6vw, 5.2rem);
  border-top: 1px solid var(--ink);
  scroll-margin-top: .75rem;
}

.level-lead h2,
.series-promo h2 {
  font-size: clamp(2.2rem, 4.35vw, 4.15rem);
}

.level-lead > p {
  max-width: 27ch;
  margin-block: .85rem .65rem;
  color: var(--muted);
}

.level-index { min-width: 0; }

.level-list {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.level-list > li { border-bottom: 1px solid var(--line); }

.level-entry {
  display: grid;
  grid-template-columns: 3.55rem minmax(0, 1fr) max-content;
  min-height: 4.8rem;
  align-items: center;
  gap: .3rem .9rem;
  padding: .7rem .45rem .7rem 0;
  text-decoration: none;
}

.level-entry:hover { background: #ede8dc; }
.level-entry:hover strong { text-decoration: underline; }

.level-code {
  color: var(--accent);
  font-family: var(--display);
  font-size: 1.64rem;
  font-weight: 640;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.level-entry-copy {
  display: grid;
  gap: .12rem;
  min-width: 0;
  line-height: 1.4;
}

.level-entry-copy strong {
  font-size: 1.03rem;
  font-weight: 680;
  text-underline-offset: .2em;
}

.level-entry-copy > span {
  color: var(--muted);
  font-size: .94rem;
}

.level-action {
  align-self: center;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 600;
}

.level-help {
  margin-top: 1.55rem;
  border: 1px solid var(--line);
  background: #f2eee4;
}

.level-help summary {
  padding: .8rem 1.05rem;
  font-weight: 670;
  cursor: pointer;
}

.level-help summary:hover { text-decoration: underline; }

.help-inner {
  display: grid;
  gap: .85rem;
  padding: .15rem 1.05rem 1.05rem;
  color: var(--muted);
}

.help-inner fieldset {
  margin: 0 0 .85rem;
  padding: 0;
  border: 0;
}

.help-inner legend {
  margin: 0 0 .25rem;
  color: var(--ink);
  font-weight: 680;
}

.level-choice {
  display: flex;
  min-height: 2.6rem;
  align-items: baseline;
  gap: .55rem;
  padding-block: .4rem;
}

.level-choice input {
  flex: none;
  margin: 0;
  accent-color: var(--accent);
}

.help-result:not(:empty) { margin-top: .9rem; }

.series-promo {
  background: var(--section);
  color: var(--light-text);
}

.series-promo-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  align-items: center;
  gap: clamp(2.2rem, 8vw, 7.5rem);
  padding-block: clamp(2.7rem, 6vw, 5.25rem);
}

.series-promo .eyebrow {
  margin-bottom: .7rem;
  color: #b8c5ac;
}

.series-promo-copy > p:not(.eyebrow) {
  max-width: 33ch;
  margin-block: .9rem .65rem;
  color: #dedfd2;
}

.series-promo .text-link { color: #f5b69d; }
.series-promo :focus-visible { outline-color: #f5b69d; }

.site-footer { border-top: 1px solid var(--line); }
.footer-inner { min-height: 6rem; padding-block: .75rem; }

@media (max-width: 50rem) {
  .hero { gap: 1.6rem; }
  .hero h1 { font-size: clamp(2.7rem, 6.2vw, 4rem); }
  .level-section { gap: 2rem; }
}

@media (max-width: 42rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.55rem;
    padding-block: 2.2rem 2.6rem;
  }
  .hero h1 { font-size: clamp(2.55rem, 8.6vw, 4.35rem); }
  .hero-copy > p { margin-top: .85rem; }
  .hero-copy .actions { margin-top: 1.15rem; }
  .level-section,
  .series-promo-inner {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
  .level-entry {
    grid-template-columns: 2.6rem minmax(0, 1fr);
    min-height: 4.3rem;
  }
  .level-action { display: none; }
}

@media (max-width: 24rem) {
  .site-nav { column-gap: .65rem; }
  .site-nav a { font-size: .83rem; }
  .brand { font-size: 1.06rem; }
  .brand img { width: 1.7rem; }
}

@media (forced-colors: active) {
  .button, .level-help { border-color: ButtonText; }
}
