@font-face {
  font-family: Plex;
  src: url('./ibm-plex-sans-300-600-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
}
@font-face {
  font-family: Plex;
  src: url('./ibm-plex-sans-300-600-latin-ext.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  unicode-range: U+0100-024F, U+1E00-1EFF;
}
@font-face {
  font-family: Naskh;
  src: url('./NotoNaskhArabic-Regular.woff2') format('woff2');
  font-display: swap;
}
:root {
  color-scheme: dark;
  --paper: #0a1512;
  --panel: #11211d;
  --ink: #e6ede8;
  --muted: #aebcb5;
  --line: #2a4037;
  --accent: #7fd1be;
  --gold: #f7c97a;
  font-family: Plex, system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.75;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--accent);
  text-underline-offset: 5px;
}
a:hover {
  color: var(--gold);
}
button,
input {
  font: inherit;
}
button,
a,
input,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
summary {
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
header {
  max-width: 1200px;
  margin: auto;
  padding: 24px 5vw;
  display: flex;
  gap: 26px;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  font-size: 1.35rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  gap: 14px;
  align-items: center;
}
.brand span {
  font-family: Naskh;
  font-size: 1.6rem;
  color: var(--gold);
}
header nav {
  margin-left: auto;
}
.preview {
  font-size: 0.7rem;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 3px 9px;
  border-radius: 4px;
}
main {
  max-width: 800px;
  margin: auto;
  padding: 38px 28px 60px;
}
.languages {
  display: flex;
  gap: 20px;
  justify-content: flex-end;
  font-size: 0.85rem;
}
.languages a[aria-current] {
  color: var(--ink);
  text-decoration: none;
}
.eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  font-weight: 600;
  color: var(--gold);
  margin-top: 50px;
}
h1 {
  font-size: clamp(2.1rem, 5vw, 3.5rem);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 500;
  margin: 20px 0 26px;
  text-wrap: balance;
}
.lead {
  font-size: 1.2rem;
  color: var(--muted);
  line-height: 1.65;
}
.actions {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin: 30px 0 55px;
  font-size: 0.85rem;
}
.print {
  border: 0;
  background: none;
  color: var(--muted);
  padding: 12px 0;
  text-decoration: underline;
  text-underline-offset: 5px;
}
h2 {
  font-size: 1.55rem;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.number {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 400;
  margin-right: 16px;
  vertical-align: middle;
}
article section {
  margin: 0 0 58px;
}
p {
  margin: 1em 0;
}
bdi[lang='ar'] {
  font-family: Naskh;
  font-size: 1.25em;
  line-height: 1.8;
  unicode-bidi: isolate;
}
figure {
  margin: 24px 0;
  padding: 26px 30px;
  background: var(--panel);
  border-left: 2px solid var(--gold);
}
.arabic {
  font-size: 2rem !important;
  display: inline-block;
  line-height: 1.9 !important;
  font-weight: 400;
}
figure > .arabic {
  display: block;
  text-align: right;
  color: var(--gold);
  font-size: 2.4rem !important;
  margin-bottom: 10px;
}
figcaption strong {
  font-weight: 500;
}
figcaption p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 5px 0 0;
}
.practice {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  scroll-margin-top: 20px;
}
.progress {
  color: var(--gold);
  font-size: 0.9rem;
}
.question {
  margin: 32px 0;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
fieldset {
  border: 0;
  margin: 0 0 15px;
  padding: 0;
  min-width: 0;
}
legend {
  font-weight: 500;
  padding: 0 0 16px;
  max-width: 100%;
}
label {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  margin: 10px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  min-height: 64px;
}
label:has(input:checked) {
  border-color: var(--accent);
}
input[type='radio'] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--accent);
}
button.check,
button.reset,
.cta {
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 12px 20px;
  min-height: 48px;
  background: var(--accent);
  color: var(--paper);
  font-weight: 500;
  display: inline-block;
  text-decoration: none;
}
button.reset {
  background: transparent;
  color: var(--accent);
}
.feedback:empty,
.completion:empty {
  display: none;
}
.feedback[data-result='correct'] {
  color: #7fc49b;
}
.feedback[data-result='wrong'] {
  color: #f0ad91;
}
.explanation {
  color: var(--muted);
}
.completion {
  color: var(--gold);
  font-weight: 500;
}
.answer-key,
.sources {
  margin: 30px 0;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}
summary {
  color: var(--accent);
  min-height: 44px;
  display: list-item;
}
.answer-key li {
  padding: 14px 0;
}
.answer-key p {
  margin-top: 4px;
}
.next {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.next > p:last-child {
  font-size: 0.85rem;
  color: var(--muted);
}
.sources {
  font-size: 0.85rem;
}
.lesson-list {
  list-style: none;
  padding: 0;
  margin: 50px 0;
}
.lesson-list li {
  display: flex;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 28px 0;
}
.lesson-list .number {
  margin-top: 8px;
}
.lesson-list h2 {
  margin-top: 0;
}
.lesson-list p {
  color: var(--muted);
}
footer {
  max-width: 800px;
  margin: auto;
  padding: 20px 28px 45px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
  color: var(--muted);
}
.skip {
  position: absolute;
  top: -100px;
  left: 20px;
  background: var(--panel);
  padding: 12px;
  z-index: 2;
}
.skip:focus {
  top: 10px;
}
@media (max-width: 550px) {
  header {
    padding: 18px 20px;
    gap: 15px;
    flex-wrap: wrap;
  }
  .preview {
    display: none;
  }
  header nav {
    font-size: 0.8rem;
  }
  .brand {
    font-size: 1.1rem;
  }
  main {
    padding: 25px 22px 45px;
  }
  .eyebrow {
    margin-top: 30px;
  }
  figure {
    padding: 20px;
  }
  .arabic {
    font-size: 1.8rem !important;
  }
  figure > .arabic {
    font-size: 2.15rem !important;
  }
  h2 {
    font-size: 1.35rem;
  }
  label {
    padding: 10px 14px;
  }
  .actions {
    gap: 10px;
    align-items: flex-start;
    flex-direction: column;
  }
  .languages {
    justify-content: flex-start;
  }
}
@media print {
  :root {
    color-scheme: light;
    background: #fff;
    color: #111;
    font-size: 12pt;
    --ink: #111;
    --muted: #333;
    --accent: #164b3e;
    --gold: #111;
    --panel: #fff;
    --line: #aaa;
  }
  header,
  footer,
  .languages,
  .actions,
  .next,
  .preview,
  .check,
  .reset,
  .feedback,
  .explanation,
  .completion,
  .progress,
  noscript {
    display: none !important;
  }
  main {
    max-width: none;
    padding: 0;
  }
  h1 {
    font-size: 26pt;
  }
  .eyebrow {
    margin-top: 0;
  }
  article section {
    margin-bottom: 20px;
  }
  h2 {
    break-after: avoid;
  }
  figure,
  .question {
    break-inside: avoid;
  }
  figure {
    padding: 12px 18px;
    margin: 14px 0;
  }
  label {
    min-height: 0;
    padding: 4px 12px;
    margin: 5px 0;
  }
  .question {
    margin: 18px 0;
    padding-bottom: 15px;
  }
  .arabic,
  figure > .arabic {
    font-size: 22pt !important;
    line-height: 1.6 !important;
  }
  .answer-key li {
    break-inside: avoid;
    padding: 6px 0;
  }
  details.answer-key {
    display: block;
  }
  details.answer-key::details-content {
    display: block;
  }
  details.answer-key > summary {
    display: block;
    font-weight: 600;
  }
  details.answer-key > ol {
    display: block;
  }
  a {
    color: #111;
  }
  .sources {
    display: none;
  }
}
