@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans Arabic";
  src: url("fonts/IBMPlexSansArabic-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

:root {
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif;
  color: #232447;
  background: #f8f6ef;
  color-scheme: light;
  --indigo: #29284d;
  --muted: #605d70;
  --line: #d9d4c9;
  --gold: #f2cd8f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { margin: 0; }
p, h1, h2, figure { margin: 0; }
.shell { width: min(1120px, calc(100% - 2 * clamp(20px, 5vw, 64px))); margin-inline: auto; }
.skip { position: absolute; inset-inline-start: 20px; z-index: 1; padding: 10px; background: white; color: var(--indigo); }
.skip:not(:focus) { clip-path: inset(50%); }
.masthead, .footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.masthead { padding-block: 23px; border-bottom: 1px solid var(--line); }
.imprint { display: flex; align-items: center; gap: 11px; font-weight: 600; color: inherit; text-decoration: none; }
.mark { color: #fffdf7; background: var(--indigo); border-radius: 12px 12px 2px 2px; flex: none; }
.site-nav { display: flex; gap: clamp(14px, 3vw, 32px); flex-wrap: wrap; }
.site-nav a { padding-block: 7px; color: var(--muted); font-size: .9rem; text-decoration: none; }
.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer { color: var(--muted); font-size: .875rem; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(20px, 3vw, 44px);
  margin-block-start: 14px;
  padding: clamp(20px, 4vw, 52px);
  background: #e6dff3;
  border: 1px solid #dcd1ed;
  border-radius: 20px;
}
.eyebrow { font-size: .875rem; color: #564686; font-weight: 600; margin-block-end: 13px; }
.hero-kicker { display: inline-block; border: 1px solid #cbbde3; border-radius: 99px; padding: 5px 11px; }
.eyebrow span, .chapter span { margin-inline: 5px; opacity: .8; }
h1 { font-size: clamp(2.5rem, 5.2vw, 4.75rem); font-weight: 600; line-height: 1.17; }
.english-title {
  margin-block-start: 16px;
  text-align: right;
  font: italic clamp(1.3rem, 2.75vw, 2rem)/1.2 Georgia, serif;
  color: var(--muted);
}
.description { font-size: clamp(1.08rem, 2vw, 1.25rem); line-height: 1.8; max-width: 24em; margin-block: 24px; }
.start {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  min-height: 52px;
  padding: 9px 20px;
  border-radius: 5px;
  background: var(--indigo);
  color: white;
  text-decoration: none;
  font-weight: 600;
}
.start:hover { background: #433b73; }
.hero-actions { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
.hero-actions .text-link { margin-block-start: 0; }
:is(.start, #sample-play):focus-visible { outline: 2px solid currentColor; outline-offset: 3px; box-shadow: 0 0 0 5px #7868b3; }
:is(a, button, summary):focus-visible { outline: 2px solid #7868b3; outline-offset: 4px; }

.hero-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
  align-items: center;
  gap: clamp(8px, 1.6vw, 22px);
}
.phone {
  position: relative;
  width: min(100%, 248px);
  margin-inline: auto;
  padding: 19px 6px 6px;
  border: 1px solid #615a77;
  border-radius: 28px;
  background: #292641;
  box-shadow: 0 18px 27px -16px #30254695;
}
.phone::before {
  content: "";
  position: absolute;
  top: 7px;
  left: calc(50% - 18px);
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: #141325;
}
.phone img { display: block; width: 100%; height: auto; border-radius: 12px 12px 21px 21px; background: #f5f6fc; }
.app-preview figcaption { margin-block-start: 10px; text-align: center; color: var(--muted); font-size: .75rem; }
.dialogue-kicker { font-size: .8rem; font-weight: 600; color: #564686; margin-block-end: 8px; }
.dialogue-card { background: #fffaf3; border: 1px solid #d5c7e8; border-radius: 10px; padding: clamp(8px, 1.25vw, 15px); }
.dialogue-card.reply { margin-block-start: 8px; background: #f2eafa; }
.dialogue-card.active { border-color: #6551a1; box-shadow: inset 0 0 0 1px #6551a1; }
.dialogue-card > span { color: #564686; font-size: .75rem; font-weight: 600; }
.dialogue-card [lang="en"] { font: 400 clamp(.95rem, 1.6vw, 1.4rem)/1.24 Georgia, serif; text-align: right; margin-block: 4px; }
.dialogue-card p:last-child { color: var(--muted); font-size: .84rem; }
.hero-play { display: inline-flex; align-items: center; gap: 7px; background: transparent; color: #463478; border: 0; padding: 5px 1px; min-height: 44px; text-align: start; font: 600 .85rem "IBM Plex Sans Arabic", system-ui, sans-serif; cursor: pointer; }
.hero-play::before { content: ""; width: 8px; height: 10px; flex: none; background: currentColor; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.hero-play.playing::before { width: 8px; height: 10px; clip-path: none; background: linear-gradient(to right, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }
.hero-play:hover { text-decoration: underline; }
#hero-audio-status { font-size: .78rem; color: #682b44; }
.course-strip { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 26px; list-style: none; margin-block: 0; padding: 22px 0; color: var(--muted); font-size: .875rem; }
.course-strip li { display: flex; align-items: center; gap: 8px; }
.course-strip li::before { content: ""; width: 5px; height: 5px; background: #675395; border-radius: 50%; }

.lesson-feature { color: #fffdf7; background: #27233d; }
.lesson-feature .eyebrow { color: var(--gold); }
.lesson-feature .section-copy > p:not(.eyebrow) { color: #e1d9ee; }
.lesson-feature .text-link { color: #f2cd8f; }
#lesson-1:focus { outline: none; }
#lesson-1, #method, #sample-title, #about, #questions, #app { scroll-margin-top: 20px; }
.lesson-layout, .book-story, .questions {
  display: grid;
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  align-items: center;
  gap: clamp(25px, 7vw, 100px);
  padding-block: clamp(44px, 6vw, 86px);
}
.section-copy h2, .continue h2 { font-size: clamp(2rem, 4.3vw, 3.75rem); line-height: 1.22; font-weight: 600; }
.section-copy > p:not(.eyebrow), .step-panel > div:first-child > p:not(.eyebrow) { max-width: 36ch; margin-block-start: 16px; color: var(--muted); font-size: 1.08rem; line-height: 1.85; }
.text-link { display: inline-block; margin-block-start: 16px; color: #514178; font-weight: 600; text-decoration-thickness: 1px; text-underline-offset: 4px; }

.sample {
  color: var(--indigo);
  background: #fffaf3;
  border-radius: 10px;
  padding: clamp(20px, 3vw, 36px);
}
.sample-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: .88rem;
  color: #514178;
  border-bottom: 1px solid #ded5e6;
  padding-block-end: 15px;
}
.chapter { color: var(--muted); }
.transcript { padding-block: 12px 16px; }
.phrase { padding: 13px 11px; margin-inline: -11px; border-inline-start: 2px solid transparent; }
.phrase + .phrase { border-top: 1px solid #ded5e6; }
.phrase.active { background: #ece4f8; border-inline-start-color: #6551a1; }
.phrase.active .sample-en { color: #463478; }
.sample-en { font: 400 clamp(1.85rem, 3.45vw, 3.05rem)/1.15 Georgia, serif; text-align: right; }
.sample-ar { font-size: 1.16rem; color: var(--muted); margin-block-start: 5px; }
#sample-audio { display: block; width: 100%; }
.transport { display: flex; align-items: center; gap: 16px; }
#sample-play {
  border: 0;
  padding: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 50%;
  color: white;
  background: var(--indigo);
  cursor: pointer;
}
#sample-play:hover { background: #433b73; }
#sample-play .pause-icon, #sample-play.playing .play-icon { display: none; }
#sample-play.playing .pause-icon { display: block; }
.audio-readout { flex: 1; min-width: 0; }
.waveform { display: block; width: 100%; height: 35px; direction: ltr; }
.waveform use { fill: none; stroke-width: 2.5; stroke-linecap: round; }
.wave-rest { stroke: #9188b1; }
.wave-played { stroke: #463478; clip-path: inset(0 calc(100% - var(--played, 0%)) 0 0); }
.play-label, #sample-status { color: var(--muted); font-size: .8rem; }
#sample-status:not(:empty) { margin-block-start: 12px; }

.method { padding-block: clamp(44px, 6vw, 86px); }
.method-heading { margin-block-end: 28px; }
.step-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.step-tabs button {
  min-height: 50px;
  border: 0;
  padding: 8px;
  border-radius: 7px 7px 0 0;
  color: var(--indigo);
  background: #e0d9ed;
  font: 600 1rem "IBM Plex Sans Arabic", system-ui, sans-serif;
  cursor: pointer;
}
.step-tabs button span { margin-inline-end: 5px; font-size: .78rem; }
.step-tabs [aria-selected="true"] { background: var(--indigo); color: white; }
.step-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(18px, 5vw, 65px);
  align-items: center;
  min-height: 255px;
  padding: clamp(20px, 4vw, 46px);
  background: #fcfaf6;
  border: 1px solid #d8cfe7;
  border-radius: 0 0 8px 8px;
}
.step-panel + .step-panel { border-top-width: 0; }
.step-panel h3 { font-size: clamp(1.5rem, 2.7vw, 2.35rem); font-weight: 600; line-height: 1.3; }
.exercise-box { background: #f1eaf8; padding: clamp(15px, 3vw, 28px); border-radius: 5px; }
.exercise-box .example, .examples dt, .answer p { font-size: 1.35rem; text-align: right; }
.exercise-box [lang="en"] { font-family: Georgia, serif; }
.exercise-box p + p, .examples dd { margin-block-start: 5px; color: var(--muted); }
.examples { margin: 0; }
.examples dd { margin-inline-start: 0; }
.examples > div + div { margin-block-start: 12px; padding-block-start: 12px; border-top: 1px solid #d8cfe7; }
.answer { margin-block-start: 12px; }
.answer summary { color: #514178; font-weight: 600; cursor: pointer; padding-block: 6px; }
.answer p { margin-block-start: 8px; }

.book-story { background: #ece5d9; border-radius: 14px; padding: clamp(22px, 5vw, 64px); }
.edition-card { color: #fffdf7; background: var(--indigo); border-inline-start: 7px solid #62577f; border-radius: 5px 9px 9px 5px; padding: clamp(16px, 3vw, 38px); box-shadow: -5px 6px 0 #cec3ad; }
.edition-meta { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; color: #e0d9ee; font-size: .84rem; }
.edition-meta:first-child { border-block-end: 1px solid #62577f; padding-block-end: 10px; }
.edition-meta:last-child { border-block-start: 1px solid #62577f; padding-block-start: 10px; }
.edition-title { margin-block-start: 20px; font-size: clamp(1.85rem, 3.4vw, 3.1rem); line-height: 1.18; font-weight: 600; }
.edition-author { color: var(--gold); margin-block: 10px 20px; }
.questions { align-items: start; }
.faq-list details { border-bottom: 1px solid var(--line); padding-block: 14px; }
.faq-list details:first-child { border-top: 1px solid var(--line); }
.faq-list summary { font-size: 1.05rem; font-weight: 600; cursor: pointer; }
.faq-list p { margin-block-start: 9px; color: var(--muted); line-height: 1.8; }
.continue { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 18px 30px; background: #e6dff3; border-radius: 14px; padding: clamp(20px, 5vw, 44px); }
.continue h2 { font-size: clamp(1.65rem, 3.1vw, 2.65rem); }
.release-note { color: var(--muted); line-height: 1.8; margin-block-start: 12px; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.platforms li { border: 1px solid #cbbde3; border-radius: 99px; background: #f6f1fb; padding: 9px 16px; font: 600 .875rem system-ui, sans-serif; }
.footer { margin-block-start: 35px; border-top: 1px solid var(--line); padding-block: 20px 25px; flex-wrap: wrap; }
.analytics-settings {
  padding: 8px 0;
  border: 0;
  color: #514178;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  font: inherit;
  cursor: pointer;
}
.analytics-notice {
  position: fixed;
  z-index: 3;
  inset-inline-end: 16px;
  inset-block-end: max(16px, env(safe-area-inset-bottom));
  width: min(440px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 16px;
  color: var(--indigo);
  background: #fffaf3;
  border: 1px solid #cbbde3;
  border-radius: 10px;
  box-shadow: 0 10px 30px #29284d26;
}
.analytics-notice h2 { font-size: 1rem; }
.analytics-notice p { margin-block: 5px; color: var(--muted); font-size: .875rem; line-height: 1.65; }
.analytics-notice a { color: #514178; font-size: .8rem; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 12px; }
.analytics-actions button { flex: 1 1 auto; min-height: 44px; border: 1px solid var(--indigo); border-radius: 5px; padding: 6px 10px; background: transparent; color: var(--indigo); font: 600 .875rem "IBM Plex Sans Arabic", system-ui, sans-serif; cursor: pointer; }
.analytics-actions button:hover { background: #eee8f6; }

@media (max-width: 720px) {
  .masthead { padding-block: 15px; flex-wrap: wrap; }
  .hero { grid-template-columns: 1fr; }
  .hero-stage { max-width: 450px; width: 100%; margin-inline: auto; border-block-start: 1px solid #ccbedf; padding-block-start: 20px; }
  h1 { font-size: clamp(2.5rem, 9vw, 4.25rem); }
  .lesson-layout, .book-story, .questions, .step-panel { grid-template-columns: 1fr; }
  .sample-en { font-size: clamp(1.8rem, 6.5vw, 3rem); }
}
