:root {
  --ink: #202947;
  --ink-soft: #2f4268;
  --ink-strong: #151e33;
  --plum: #4c3b62;
  --plum-deep: #332248;
  --lavender: #d6d0e5;
  --lavender-quiet: #dfdaeb;
  --soft-blue: #ccd9ed;
  --blue-deep: #54679a;
  --peach: #f3ba95;
  --peach-deep: #a56f56;
  --warm-white: #f0e6d6;
  --warm-offwhite: #f5edde;
  --line-soft: rgba(76, 59, 98, 0.24);
  --line-strong: #9f8db8;
  --shadow-1: 0 18px 36px rgba(28, 36, 65, 0.11);
  --shadow-2: 0 12px 28px rgba(28, 36, 65, 0.08);
  --focus: #b47e4f;
  --success-bg: #d8f0da;
  --success-ink: #1d5338;
  --error-bg: #fde2e4;
  --error-ink: #6f2f40;
  --selected-bg: #e2dbf4;
  --selected-ink: #31265a;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Cairo, Arial, sans-serif;
  color: var(--ink);
  line-height: 1.75;
  background: #c9cfda;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 84% 26%, rgba(255, 255, 255, 0.28) 0 1px, transparent 2px);
}

body::after {
  content: "";
  position: fixed;
  z-index: -1;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(236, 240, 254, 0.08), rgba(255, 246, 233, 0.08));
}

:focus-visible,
button:focus-visible,
select:focus-visible,
.option-btn:focus-visible,
.stage-tab:focus-visible,
.creative-lab button:focus-visible,
.alphabet-card:focus-visible,
.kg1-language-switch button:focus-visible {
  outline: 3px solid var(--blue-deep);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  top: -10rem;
  left: 12px;
  background: var(--plum-deep);
  color: #ffffff;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  z-index: 30;
}

.skip-link:focus-visible {
  top: 12px;
}

body .container {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #292b45;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #555772;
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 0.65rem 0;
}

.brand {
  flex-shrink: 0;
  text-decoration: none;
  color: var(--ink);
  font-size: 1.12rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--peach);
  padding: 5px;
  object-fit: cover;
}

.nav {
  margin-inline-start: auto;
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  min-width: 0;
  gap: 0.45rem;
  align-items: center;
}

.nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 0.45rem 0.8rem;
  border-radius: 12px;
  white-space: nowrap;
  font-size: 0.9rem;
}

body .language-toggle {
  flex-shrink: 0;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--lavender);
  color: var(--plum-deep);
}

.menu-button {
  margin-inline-start: auto;
  display: none;
  background: var(--plum);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.58rem 0.9rem;
  min-height: 44px;
  min-width: 44px;
}

body main {
  overflow: hidden;
  padding-top: 0;
}

body .section {
  padding: 3.7rem 0;
  position: relative;
}

body .section:nth-of-type(odd) {
  background: #c8cfdf;
}

body .section:nth-of-type(even) {
  background: #dad2d0;
}

body .hero.section {
  padding: 4.5rem 0;
  position: relative;
  min-height: 650px;
  background: linear-gradient(90deg, rgba(26, 35, 55, .24), rgba(29, 32, 52, .65)), url('assets/learning-garden-v2.webp') center 52% / cover;
}

body .hero:after {
  content: "✦  ✧  ✦";
  position: absolute;
  inset-inline-start: 7%;
  top: 2rem;
  color: rgba(255, 250, 243, 0.78);
  letter-spacing: 1rem;
  font-size: 1.4rem;
}

body .hero-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 3rem;
  align-items: center;
}

body h1,
body h2,
body h3,
body h4 {
  color: var(--ink);
  margin-top: 0;
}

body h1 {
  font-size: clamp(2.2rem, 5vw, 4.3rem);
  line-height: 1.22;
  letter-spacing: -0.03em;
  margin-bottom: 0.7rem;
}

body .eyebrow {
  margin: 0;
  color: var(--plum);
  font-weight: 800;
  letter-spacing: 0.02em;
}

body .section-intro,
body .note,
body .hero-copy > p:not(.eyebrow):not(.note),
body .practice-top p {
  color: var(--ink-soft);
}

body .hero-copy h1 {
  color: #fff5e1;
  max-width: 21ch;
  font-size: clamp(2.2rem, 4vw, 3.5rem);
  line-height: 1.45;
}

body .hero-copy .note { color: #d5dcea; font-size: .87rem; }
body .hero-copy {
  background: rgba(29, 34, 55, .91);
  border: 1px solid rgba(237, 207, 161, .3);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 0 20px 60px #131b3033;
}
body .hero-copy .eyebrow { color: #f1c188; }
body .hero-copy > p:not(.eyebrow):not(.note) { color: #e0e5ef; font-size: 1rem; }
body .hero-copy .btn-primary { background: #edbb7c; color: #242b42; border-color: #edbb7c; }
body .hero-copy .btn-secondary { background: #566581; color: #fff7eb; border-color: #7f8ca7; }
body .hero-copy .btn-ghost { background: transparent; color: #e4c39d; border: 0; padding-inline: 0; min-height: 36px; font-size: .88rem; }

body .hero-copy p {
  margin: 0.5rem 0 1rem;
}

.cta-row {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

body .btn {
  appearance: none;
  border: none;
  border-radius: 14px;
  padding: 0.75rem 1.05rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  cursor: pointer;
  font-family: inherit;
  min-height: 44px;
  min-width: 44px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease;
}

body .btn:hover,
body .btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}

body .btn-primary {
  background: var(--plum);
  color: #ffffff;
  border: 1px solid var(--plum);
}

body .btn-secondary {
  background: var(--peach);
  color: var(--plum-deep);
  border: 1px solid rgba(165, 111, 86, 0.38);
}

body .btn-ghost {
  background: rgba(255, 250, 243, 0.72);
  color: var(--plum);
  border: 1px solid var(--line-soft);
}

body .hero-art {
  margin: 0;
  background: var(--warm-white);
  border: 1px solid #ddba8c;
  border-radius: 30px;
  padding: .65rem;
  box-shadow: var(--shadow-1);
  transform: rotate(0.8deg);
}

body .hero-art img {
  width: 100%;
  display: block;
  border-radius: 18px;
  background: var(--soft-blue);
}

body .hero-art figcaption {
  margin-top: 0.6rem;
  color: var(--ink-soft);
  font-weight: 700;
}

body #stage-explorer,
body #kg1-beginnings,
body #course-module,
body #local-practice {
  background: #c8cfdf;
}

body .grid {
  display: grid;
  gap: 1rem;
}

body .cards,
body .two-col,
body .three-col,
body .four-col,
body .stage-selector {
  display: grid;
}

body .cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body .two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body .three-col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body .four-col {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body .card,
body .module-card,
body .practice-shell,
body .kg1-letter-card,
body .faq details,
body .kg1-parent-guide {
  background: var(--warm-white);
  border: 1px solid var(--line-soft);
  border-radius: 24px;
  padding: 1.05rem;
  box-shadow: var(--shadow-2);
  color: var(--ink);
}

body .card h1,
body .card h2,
body .card h3,
body .card h4,
body .module-card h1,
body .module-card h2,
body .module-card h3,
body .module-card h4,
body .practice-shell h1,
body .practice-shell h2,
body .practice-shell h3,
body .practice-shell h4,
body .kg1-letter-card h1,
body .kg1-letter-card h2,
body .kg1-letter-card h3,
body .kg1-letter-card h4,
body .faq details h1,
body .faq details h2,
body .faq details h3,
body .faq details h4,
body .kg1-parent-guide h1,
body .kg1-parent-guide h2,
body .kg1-parent-guide h3,
body .kg1-parent-guide h4 {
  color: var(--ink);
}

body .card p,
body .card li,
body .module-card p,
body .module-card li,
body .practice-shell p,
body .practice-shell label,
body .practice-shell .note,
body .practice-shell .muted,
body .practice-shell .practice-top p,
body .practice-shell .meta-row,
body .kg1-letter-card p,
body .faq details p,
body .kg1-parent-guide p,
body .meta-row {
  color: var(--ink-soft);
}

body .step-badge {
  background: var(--peach);
  color: var(--plum-deep);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

body .module-card ul,
body .faq p {
  margin: 0.55rem 0 0;
  padding-inline-start: 1.1rem;
}

body .meta-row {
  color: var(--blue-deep);
  margin-bottom: 0.6rem;
  font-weight: 700;
}

body .question-box {
  background: #fff5ea;
  border: 1px solid rgba(214, 168, 128, 0.45);
  border-radius: 12px;
  padding: 1rem;
  min-height: 110px;
  margin-bottom: 0.8rem;
  color: var(--ink);
}

body .question-box p {
  margin: 0;
  font-size: 1.05rem;
}

body .options {
  display: grid;
  gap: 0.55rem;
}

body .option-btn {
  text-align: start;
  width: 100%;
  padding: 0.72rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  background: var(--warm-offwhite);
  color: var(--ink);
  font-size: 1rem;
  cursor: pointer;
  min-height: 54px;
  min-width: 44px;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background-color 140ms ease;
}

body .option-btn:hover:not(:disabled) {
  border-color: var(--blue-deep);
  transform: translateX(-2px);
}

body .option-btn[aria-pressed="true"] {
  background: var(--selected-bg);
  color: var(--selected-ink);
  border-color: var(--plum);
}

body .option-btn.correct {
  background: var(--success-bg);
  border-color: var(--success-ink);
  color: var(--success-ink);
}

body .option-btn.incorrect {
  background: var(--error-bg);
  border-color: var(--error-ink);
  color: var(--error-ink);
}

body .feedback {
  min-height: 74px;
  margin-top: 0.8rem;
  border-inline-start: 4px solid transparent;
  padding-inline-start: 0.8rem;
  border-radius: 8px;
}

body .feedback.correct {
  background: var(--success-bg);
  border-inline-start-color: var(--success-ink);
  color: var(--success-ink);
}

body .feedback.incorrect {
  background: var(--error-bg);
  border-inline-start-color: var(--error-ink);
  color: var(--error-ink);
}

body .practice-shell .feedback {
  color: var(--ink);
}

body .practice-actions {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

body .review-panel {
  margin-top: 1rem;
  border-top: 1px solid rgba(76, 59, 98, 0.14);
  padding-top: 1rem;
  color: var(--ink);
}

body .review-panel h4 {
  margin-bottom: 0.5rem;
}

body .result-categories {
  margin-bottom: 0.7rem;
  font-size: 0.98rem;
}

body .review-panel ul {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

body .review-panel li {
  margin-bottom: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: var(--lavender-quiet);
  color: var(--ink);
}

body .kg1-card-grid {
  margin-top: 1rem;
}

body .kg1-letter-card {
  text-align: center;
  padding: 0.9rem 0.75rem 0.95rem;
  transition: transform 220ms ease;
  overflow: hidden;
}

body .kg1-letter-card:hover {
  transform: translateY(-6px) rotate(1deg);
}

body .kg1-letter-card h3 {
  margin: 0.3rem 0 0.5rem;
}

body .kg1-letter-card img,
body .kg1-animal-view img {
  border-radius: 12px;
  display: block;
  max-width: 100%;
}

body .kg1-letter-card img {
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  object-fit: cover;
  background: var(--soft-blue);
}

body .kg1-large-letter,
body .alphabet-letter {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
  font-weight: 800;
  color: var(--plum);
}

body .kg1-animal-view {
  margin: 0.7rem 0 0.95rem;
  background: var(--soft-blue);
  border: 1px solid rgba(84, 103, 154, 0.22);
  border-radius: 12px;
  padding: 0.8rem;
}

body .kg1-animal-view figcaption {
  margin: 0.55rem 0 0;
  color: var(--ink-soft);
  font-weight: 700;
}

body .kg1-shell .question-box {
  margin-top: 0.4rem;
  margin-bottom: 0.7rem;
}

body .speech-controls {
  margin-top: 0.8rem;
  display: grid;
  gap: 0.5rem;
}

body .kg1-note,
body .kg1-result-note,
body .kg1-local-progress,
body .speech-controls label {
  margin: 0.4rem 0 0.85rem;
  color: var(--ink-soft);
}

body .kg1-note {
  font-size: 0.92rem;
}

body .kg1-parent-guide {
  margin-top: 1.1rem;
  background: #fff3df;
  border: 1px dashed rgba(165, 111, 86, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

body .kg1-parent-guide h4 {
  margin: 0 0 0.45rem;
  color: var(--ink);
}

body .stage-selector {
  margin-top: 0.7rem;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 0.55rem;
}

body .stage-tab {
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--line-soft);
  background: var(--warm-offwhite);
  color: var(--ink);
  font-size: 1rem;
  white-space: nowrap;
}

body .stage-tab[aria-selected="true"],
body .stage-tab.active {
  background: var(--plum);
  color: #ffffff;
  border-color: var(--plum);
}

body #stage-question {
  min-height: 118px;
}

body #stage-result ul,
body #stage-result li,
body .faq {
  list-style: none;
  padding: 0;
  margin: 0;
}

body #stage-result li,
body .review-panel li {
  margin-bottom: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: var(--lavender-quiet);
}

body .faq details {
  background: var(--warm-white);
  border-color: rgba(76, 59, 98, 0.18);
}

body .faq summary {
  cursor: pointer;
  color: var(--plum);
  font-weight: 700;
}

body .faq p {
  margin: 0.8rem 0 0;
}

.site-footer {
  margin-top: 1.6rem;
  background: var(--ink-strong);
  color: #ffffff;
  padding: 2rem 0;
}

body .site-footer a {
  color: var(--peach);
}

body .site-footer h1,
body .site-footer h2,
body .site-footer h3,
body .site-footer h4 {
  color: var(--warm-offwhite);
}

body select {
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(76, 59, 98, 0.2);
  border-radius: 12px;
  background: var(--warm-offwhite);
  color: var(--ink);
  font: inherit;
  padding-inline: 0.55rem;
}

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

body .section-status,
body .stage-lessons,
body .result-categories,
body .review-panel {
  color: var(--ink);
}

body .reveal,
body .scroll-reveal {
  opacity: 1;
  transform: none;
}

body .scroll-reveal.is-visible {
  opacity: 1;
  transform: none;
}

body .creative-lab {
  --creative-ink: var(--ink);
  --creative-deep: var(--plum-deep);
  --creative-paper: #fff8ef;
  --creative-cream: var(--warm-white);
  --creative-gold: #f3b58a;
  --creative-ink-soft: var(--ink-soft);
  background: linear-gradient(180deg, #d6e0f7, var(--soft-blue));
  color: var(--ink);
  padding: clamp(3rem, 6vw, 5rem) 1rem;
  font-family: inherit;
}

body .creative-shell {
  width: min(1180px, 100%);
  margin: auto;
}

body .creative-heading {
  text-align: center;
  max-width: 760px;
  margin-inline: auto;
}

body .creative-heading h2 {
  color: var(--plum-deep);
  font-size: clamp(2rem, 5vw, 3.8rem);
  margin: 0.35rem 0;
}

body .creative-heading p {
  color: var(--ink-soft);
  margin: 0.4rem 0;
}

body .creative-kicker {
  color: var(--plum);
  font-weight: 850;
}

body .creative-language {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 1.35rem 0 1.6rem;
}

body .creative-lab button {
  min-height: 44px;
  border-radius: 14px;
  padding: 0.62rem 0.9rem;
  background: var(--creative-cream);
  color: var(--creative-ink);
  border: 2px solid rgba(76, 59, 98, 0.18);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 180ms ease, background-color 180ms ease;
}

body .creative-lab button:hover,
body .creative-lab button:focus-visible {
  transform: translateY(-1px);
  background: #f8efe2;
}

body .creative-lab button.is-active {
  background: var(--peach);
  border-color: var(--peach-deep);
  color: var(--ink-strong);
}

body .creative-grid {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

body .creative-panel,
body .creative-workspace,
body .creative-footer {
  background: var(--warm-white);
  color: var(--ink);
  border: 1px solid rgba(76, 59, 98, 0.18);
  border-radius: 24px;
  box-shadow: 0 16px 30px rgba(28, 36, 65, 0.12);
}

body .creative-panel,
body .creative-workspace {
  padding: 1rem;
}

body .creative-panel h3,
body .creative-footer h3 {
  color: var(--ink);
  margin: 0.25rem 0 0.75rem;
}

body .creative-letters,
body .creative-animals {
  display: grid;
  gap: 0.42rem;
}

body .creative-letters {
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  max-height: 310px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 3px;
}

body .creative-letters button {
  min-width: 44px;
}

body .creative-letters button[aria-selected="true"] {
  background: var(--selected-bg);
  border-color: var(--plum);
}

body .creative-example {
  min-height: 2.5rem;
  margin: 0.85rem 0;
  font-weight: 850;
  color: var(--plum);
}

body .creative-animals button[aria-pressed="true"] {
  background: var(--soft-blue);
  border-color: var(--blue-deep);
}

body .creative-workspace {
  padding: clamp(0.7rem, 2vw, 1.15rem);
}

body .creative-toolbar {
  display: grid;
  gap: 0.72rem;
  margin-bottom: 0.85rem;
}

body .creative-palette {
  display: grid;
  grid-template-columns: repeat(8, 44px);
  gap: 0.4rem;
  max-width: 100%;
  overflow-x: auto;
  padding: 3px;
}

body .creative-swatch {
  width: 44px;
  min-width: 44px;
  padding: 0;
  border-radius: 50%;
  background: var(--creative-swatch);
  border: 2px solid rgba(76, 59, 98, 0.3);
  box-shadow:
    inset 0 0 0 3px rgba(255, 250, 240, 0.55),
    0 2px 0 rgba(28, 36, 65, 0.12);
}

body .creative-swatch.is-selected {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
}

body .creative-color-label,
body .creative-size-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  font-weight: 750;
}

body .creative-color {
  width: 52px;
  height: 44px;
  padding: 2px;
  border: 2px solid rgba(76, 59, 98, 0.34);
  border-radius: 11px;
  background: var(--warm-white);
}

body .creative-size {
  width: min(300px, 55vw);
  height: 44px;
  accent-color: var(--blue-deep);
}

body .creative-tools,
body .creative-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body .creative-tools button[aria-pressed="true"] {
  color: white;
  background: var(--plum);
  border-color: var(--plum);
}

body .creative-tools button[aria-pressed="false"] {
  color: var(--ink);
  background: var(--warm-white);
}

body .creative-canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  border: 3px solid rgba(76, 59, 98, 0.28);
  border-radius: 18px;
  overflow: hidden;
  background: var(--warm-white);
  box-shadow: inset 0 0 0 5px rgba(255, 250, 240, 0.8);
}

body .creative-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--warm-white);
  touch-action: none;
  cursor: crosshair;
}

body .creative-keyboard-cursor {
  position: absolute;
  z-index: 2;
  display: none;
  min-width: 12px;
  transform: translate(-50%, -50%);
  border: 3px solid var(--plum-deep);
  border-radius: 50%;
  background: rgba(249, 228, 204, 0.42);
  pointer-events: none;
}

body .creative-keyboard-cursor.is-visible {
  display: block;
}

body .creative-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: rgba(32, 41, 71, 0.88);
  color: #fff;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 800;
}

body .creative-help {
  margin: 0.75rem 0 0.25rem;
  color: #35476f;
  font-size: 0.92rem;
  line-height: 1.75;
}

body .creative-status {
  min-height: 1.5em;
  margin: 0.25rem 0 0;
  color: var(--plum-deep);
  font-weight: 800;
}

body .creative-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
}

body .creative-footer p {
  margin: 0.25rem 0;
  color: var(--ink);
}

body .creative-print,
body .btn-secondary {
  white-space: nowrap;
}

body .alphabet-gallery {
  background: rgba(237, 231, 250, 0.72);
}

body .alphabet-gallery .container {
  width: min(1120px, calc(100% - 1.4rem));
}

body .alphabet-gallery .section-intro,
body .alphabet-gallery .eyebrow {
  color: #3b4970;
}

body .alphabet-language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin: 0.9rem 0 1rem;
}

body .alphabet-language-switch-label {
  width: 100%;
  text-align: center;
  font-weight: 800;
  color: #2e3d61;
}

body .alphabet-language-switch button {
  min-height: 44px;
  min-width: 44px;
  padding: 0.45rem 0.8rem;
  border: 2px solid rgba(76, 59, 98, 0.25);
  border-radius: 12px;
  background: var(--warm-offwhite);
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

body .alphabet-language-switch button:hover,
body .alphabet-language-switch button:focus-visible,
body .alphabet-language-switch button.is-active {
  background: #d6f0e4;
  border-color: #95b1e3;
  color: #202947;
  transform: translateY(-1px);
}

body .alphabet-gallery .alphabet-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1.2rem;
}

body .alphabet-card {
  min-width: 0;
  padding: 0.55rem;
  border: 2px solid rgba(76, 59, 98, 0.2);
  border-radius: 18px;
  background: var(--warm-offwhite);
  color: var(--ink);
  display: grid;
  gap: 0.15rem;
  justify-items: center;
  font: inherit;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

body .alphabet-card:hover,
body .alphabet-card:focus-visible,
body .alphabet-card.is-selected {
  transform: translateY(-4px);
  border-color: #b2c4f8;
  box-shadow: 0 10px 20px rgba(28, 36, 65, 0.18);
}

body .alphabet-card[data-locale="ar"] {
  text-align: center;
}

body .alphabet-card[data-locale="en"] {
  text-align: center;
}

body .alphabet-card .alphabet-letter {
  font-size: clamp(1.45rem, 2.8vw, 1.65rem);
  font-weight: 800;
  color: var(--blue-deep);
  line-height: 1;
}

body .alphabet-card .alphabet-word {
  font-size: clamp(0.77rem, 1.7vw, 0.92rem);
  font-weight: 700;
  color: #2a3d61;
}

body .alphabet-card .atlas-art {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background-repeat: no-repeat;
  background-image: var(--atlas-image, url('assets/arabic-alphabet-atlas.png'));
  background-size: var(--atlas-size, 700% 400%);
  background-position: calc((var(--atlas-col, 0) / var(--atlas-x, 6)) * 100%) calc((var(--atlas-row, 0) / var(--atlas-y, 3)) * 100%);
}

body .alphabet-gallery .section-status {
  min-height: 1.55em;
}

body .alphabet-gallery[data-locale="ar"] .section-intro,
body .alphabet-gallery[data-locale="ar"] .section-status,
body .alphabet-gallery[data-locale="ar"] .section-intro-head {
  direction: rtl;
}

body .alphabet-gallery[data-locale="en"] .section-intro,
body .alphabet-gallery[data-locale="en"] .section-status,
body .alphabet-gallery[data-locale="en"] .section-intro-head {
  direction: ltr;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer h4 {
  color: #f6f4fe;
}

body .card p,
body .module-card p,
body .faq p,
body .question-box p {
  color: var(--ink);
}

body .header-inner { width: min(1320px, calc(100% - 2rem)); }
body .brand, body .nav a { color: #f5ebdc; }
body .nav { order: 2; flex: 1; margin-inline-start: 0; gap: .1rem; }
body .nav a, .nav-more summary { font-size: .84rem; padding: .6rem .7rem; }
body .nav a:hover, body .nav a:focus-visible, .nav-more summary:hover { background: #42455f; color: #ffdaa1; }
body .language-toggle, body .language-toggle[aria-pressed="true"] { order: 3; margin: 0; background: #3b3e59; color: #fff1db; border: 1px solid #8686a1; font-family: inherit; }
body .menu-button { order: 4; margin-inline-start: 0; background: #edbb7c; color: #242b42; font-family: inherit; }
.nav-more { position: relative; color: #f5ebdc; }
.nav-more summary { cursor: pointer; border-radius: 12px; white-space: nowrap; min-height: 44px; }
.nav-dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 14px); width: 250px; padding: .6rem; border: 1px solid #686b85; border-radius: 16px; background: #30344e; box-shadow: 0 16px 36px #11162644; display: grid; }
body .hero-art figcaption { text-align: center; font-size: .88rem; }
body .creative-animals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
body .creative-animals button { display: flex; flex-direction: column; gap: .3rem; padding: .45rem; font-size: .85rem; }
body .creative-template-thumb { border-radius: 10px; background-color: #fff; }

section[id] {
  scroll-margin-top: 100px;
}

[hidden] {
  display: none;
}

@media (max-width: 1100px) {
  body .menu-button {
    display: inline-flex;
  }

  body .nav {
    visibility: hidden;
    position: absolute;
    top: 75px;
    inset-inline: 0.9rem;
    background: #30344e;
    border: 1px solid rgba(76, 59, 98, 0.22);
    border-radius: 16px;
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
  }

  body .nav.open {
    visibility: visible;
    max-height: 75vh;
    opacity: 1;
    overflow: auto;
  }
  body .header-inner { gap: .6rem; }
  body .brand { margin-inline-end: auto; }
  .nav-dropdown { position: static; width: 100%; margin-top: .3rem; background: #252941; box-shadow: none; }
  body .nav a, .nav-more summary { font-size: .94rem; }

  body .cards,
  body .two-col,
  body .three-col,
  body .four-col {
    grid-template-columns: 1fr;
  }

  body .hero-grid {
    grid-template-columns: 1fr;
  }

  body .hero-art {
    order: -1;
    max-width: 650px;
    margin-inline: auto;
    border-radius: 24px;
  }

  body .hero-art img {
    aspect-ratio: 3 / 2;
    object-fit: cover;
  }
}

@media (max-width: 960px) {
  body .hero.section {
    padding: 1.5rem 0 2.5rem;
    background-position: 34% center;
  }
  body .hero-copy { padding: 1.3rem; border-radius: 22px; }

  body .hero-grid {
    gap: 1.5rem;
  }

  body .hero-art {
    order: 0;
    max-width: 620px;
  }

  body .four-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body .stage-selector {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  body .creative-grid {
    grid-template-columns: 1fr;
  }

  body .creative-panel {
    order: 2;
  }

  body .creative-animals {
    grid-template-columns: repeat(3, 1fr);
  }

  body .creative-letters {
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    max-height: 230px;
  }

  body .creative-tools button,
  body .creative-actions button {
    flex: 1 1 130px;
  }

  body .creative-canvas-wrap {
    border-radius: 14px;
  }
}

@media (max-width: 700px) {
  body .section {
    padding: 3rem 0;
  }

  body .hero-copy h1 {
    font-size: 2.2rem;
  }

  body .option-btn,
  body .btn,
  body .stage-tab,
  body .creative-lab button,
  body .alphabet-language-switch button {
    min-height: 56px;
  }

  body .option-btn,
  body .btn,
  body .cta-row .btn {
    width: 100%;
  }

  body .stage-tab {
    font-size: 0.9rem;
  }
}

@media (max-width: 540px) {
  body .container {
    width: calc(100% - 1.1rem);
  }

  body .creative-lab {
    padding-inline: 0.55rem;
  }

  body .creative-language button {
    flex: 1;
    max-width: 150px;
  }

  body .creative-workspace,
  body .creative-canvas-wrap {
    border-radius: 18px;
  }

  body .creative-color-label,
  body .creative-size-label {
    justify-content: space-between;
  }

  body .creative-size {
    width: min(230px, 56vw);
  }

  body .creative-animals {
    grid-template-columns: 1fr;
  }

  body .creative-letters {
    grid-template-columns: repeat(5, minmax(44px, 1fr));
  }

  body .creative-footer {
    display: block;
  }

  body .creative-print {
    width: 100%;
    margin-top: 0.8rem;
  }

  body .alphabet-gallery {
    padding-top: 3.4rem;
  }

  body .alphabet-gallery .container {
    width: calc(100% - 0.95rem);
  }

  body .alphabet-gallery .alphabet-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  body .alphabet-card {
    padding: 0.42rem;
  }

  body .alphabet-card .alphabet-letter {
    font-size: 1.35rem;
  }

  body .alphabet-card .alphabet-word {
    font-size: 0.77rem;
  }

  body .alphabet-language-switch button {
    flex: 1 1 calc(50% - 0.3rem);
  }
}

@media (max-width: 480px) {
  body .section {
    padding: 2.5rem 0;
  }

  body .hero-copy h1 {
    font-size: 2.1rem;
  }

  body .hero-art {
    padding: 0.65rem;
  }

  body .cta-row {
    align-items: stretch;
  }

  body .cta-row .btn {
    width: 100%;
  }

  body .kg1-letter-card {
    padding: 0.6rem;
  }

  body .practice-shell {
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body *,
  body *::before,
  body *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  body .hero-art,
  body .hero:after,
  body .creative-lab button,
  body .alphabet-card,
  body .option-btn,
  body .card,
  body .creative-swatch,
  body .creative-lab {
    transform: none !important;
  }
}
