/* z-index: splash overlay sits above public chrome (nav 10, support 20) */
.brand-splash {
  --splash-ms: 2000ms;
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: start;
  justify-items: center;
  overflow: hidden;
  isolation: isolate;
  background: var(--hero, var(--brand-hero, #c44536));
  color: var(--accent-ink, var(--brand-accent-ink, #fff8f3));
  font-family: "Cairo Brand", "Tajawal Brand", Cairo, Tajawal, system-ui, sans-serif;
}
.brand-splash.is-out {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.03);
  transition: opacity 0.48s cubic-bezier(0.16, 1, 0.3, 1), transform 0.48s cubic-bezier(0.16, 1, 0.3, 1);
}
.splash-glow,
.splash-blob,
.splash-ring,
.splash-tile {
  pointer-events: none;
}
.splash-glow {
  position: absolute;
  inset: -18%;
  background:
    radial-gradient(42% 38% at 72% 18%, rgb(255 255 255 / 0.22), transparent 62%),
    radial-gradient(50% 46% at 18% 78%, rgb(0 0 0 / 0.18), transparent 70%);
  animation: splash-glow 8s ease-in-out infinite alternate;
}
.splash-blob {
  position: absolute;
  inset-inline: 12%;
  bottom: -18%;
  height: 78%;
  border-radius: 46% 54% 48% 52%;
  background: color-mix(in srgb, #000 16%, var(--hero, var(--brand-hero, #c44536)));
  animation: splash-blob 7s ease-in-out infinite;
}
.splash-stage {
  position: relative;
  width: 100%;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.splash-ring {
  position: absolute;
  inset-inline: 28%;
  bottom: 4%;
  aspect-ratio: 1;
  margin-inline: auto;
  max-height: 86%;
  border-radius: 50%;
  border: 1.5px dashed rgb(255 255 255 / 0.42);
  animation: splash-spin 18s linear infinite;
}
.splash-person {
  position: absolute;
  bottom: 0;
  inset-inline: 0;
  margin-inline: auto;
  height: 78%;
  width: auto;
  max-width: 38vw;
  object-fit: contain;
  object-position: bottom center;
  animation: splash-breathe 4.4s ease-in-out infinite;
}
.splash-tile {
  position: absolute;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--paper, var(--brand-paper, #f6f1ea));
  color: var(--accent, var(--brand-accent, #c44536));
  font-weight: 800;
  font-size: 1.2rem;
  box-shadow: 0 10px 24px rgb(0 0 0 / 0.16);
  animation: splash-float 3.6s ease-in-out infinite;
}
.splash-tile-a { top: 12%; inset-inline-end: 16%; animation-delay: 0s; }
.splash-tile-b { top: 38%; inset-inline-start: 12%; animation-delay: 0.4s; }
.splash-tile-c { bottom: 22%; inset-inline-end: 10%; animation-delay: 0.8s; }
.splash-copy {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 3.25rem 1.25rem 0.35rem;
  max-width: 36rem;
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.22);
}
.splash-logo {
  width: auto;
  height: 48px;
  max-width: 168px;
  object-fit: contain;
  object-position: center;
  background: transparent;
  filter: invert(1);
  margin-bottom: 0.7rem;
}
.splash-name {
  margin: 0;
  font-size: clamp(1.45rem, 3.6vw, 2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.splash-tag {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.94;
}
.splash-meter {
  position: relative;
  z-index: 3;
  width: min(56%, 18rem);
  margin: 0 auto 1.4rem;
  height: 4px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.22);
  overflow: hidden;
}
.splash-meter span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: right center;
  transform: scaleX(0);
  background: var(--paper, var(--brand-paper, #f6f1ea));
  animation: splash-fill var(--splash-ms) linear forwards;
}
[dir="ltr"] .splash-meter span { transform-origin: left center; }
.splash-skip {
  position: absolute;
  z-index: 3;
  inset-inline-end: 1rem;
  top: 1rem;
  min-height: 40px;
  padding: 0 0.95rem;
  border: 1px solid rgb(255 255 255 / 0.35);
  border-radius: 999px;
  background: rgb(0 0 0 / 0.18);
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}
.splash-skip:active { transform: scale(0.98); }
html.splash-seen .brand-splash { display: none !important; }
html.splash-on { overflow: hidden; }
@keyframes splash-spin { to { transform: rotate(360deg); } }
@keyframes splash-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes splash-breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes splash-blob {
  0%, 100% { border-radius: 46% 54% 48% 52%; transform: scale(1); }
  50% { border-radius: 54% 46% 58% 42%; transform: scale(1.04); }
}
@keyframes splash-glow {
  from { transform: translate3d(-3%, 2%, 0); }
  to { transform: translate3d(4%, -3%, 0); }
}
@keyframes splash-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes splash-fill {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@media (max-width: 720px) {
  .splash-person { max-width: 72vw; height: 70%; }
  .splash-ring { inset-inline: 8%; }
  .splash-copy { padding-top: 3.75rem; padding-bottom: 0; }
  .splash-tile { width: 40px; height: 40px; font-size: 1rem; }
}
/* Reveal splash: curtains part so the portrait arrives, then the name. */
.brand-splash-reveal .reveal-panel {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  width: 52%;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.16), transparent 28%),
    color-mix(in srgb, #000 22%, var(--hero, var(--brand-hero, #c44536)));
}
.brand-splash-reveal .reveal-panel-start {
  inset-inline-start: 0;
  animation: splash-part-start var(--splash-ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.brand-splash-reveal .reveal-panel-end {
  inset-inline-end: 0;
  animation: splash-part-end var(--splash-ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.brand-splash-reveal .reveal-halo {
  position: absolute;
  inset-inline: 18%;
  bottom: 8%;
  aspect-ratio: 1;
  margin-inline: auto;
  max-height: 78%;
  border-radius: 50%;
  background: radial-gradient(circle, rgb(255 255 255 / 0.22), transparent 68%);
  animation: splash-arrive var(--splash-ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-splash-reveal .splash-person {
  animation: splash-from-bottom var(--splash-ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-splash-reveal .splash-copy {
  animation: splash-rise calc(var(--splash-ms) * 0.72) cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes splash-part-start {
  0%, 16% { transform: translate3d(0, 0, 0); }
  62%, 100% { transform: translate3d(-108%, 0, 0); }
}
@keyframes splash-part-end {
  0%, 16% { transform: translate3d(0, 0, 0); }
  62%, 100% { transform: translate3d(108%, 0, 0); }
}
[dir="rtl"] .brand-splash-reveal .reveal-panel-start {
  animation-name: splash-part-end;
}
[dir="rtl"] .brand-splash-reveal .reveal-panel-end {
  animation-name: splash-part-start;
}
@keyframes splash-arrive {
  0% { opacity: 0; transform: translateY(10%) scale(0.94); }
  30% { opacity: 1; transform: none; }
  100% { opacity: 1; transform: none; }
}
@keyframes splash-from-bottom {
  0% { opacity: 0; transform: translateY(115%); }
  20% { opacity: 1; }
  72%, 100% { opacity: 1; transform: translateY(0); }
}

/* Lesson splash: an English sentence is built, marked, and spoken. */
.lesson-field {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.lesson-rule {
  position: absolute;
  left: 8%;
  right: 8%;
  height: 2px;
  border-radius: 99px;
  background: rgb(255 255 255 / 0.28);
  transform-origin: left center;
  transform: scaleX(0);
  animation: lesson-draw calc(var(--splash-ms) * 0.22) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.lesson-rule:nth-child(1) { top: 22%; }
.lesson-rule:nth-child(2) { top: 46%; animation-delay: calc(var(--splash-ms) * 0.06); }
.lesson-rule:nth-child(3) { top: 70%; animation-delay: calc(var(--splash-ms) * 0.12); }
[dir="rtl"] .lesson-rule { transform-origin: right center; }
.lesson-mark,
.lesson-chip {
  position: absolute;
  display: grid;
  place-items: center;
  font-weight: 800;
  opacity: 0;
}
.lesson-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--paper, var(--brand-paper, #f6f1ea));
  color: var(--accent, var(--brand-accent, #c44536));
  font-size: 1.15rem;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.16);
  animation: lesson-fly calc(var(--splash-ms) * 0.34) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.lesson-mark-q { top: 14%; inset-inline-start: 7%; animation-delay: calc(var(--splash-ms) * 0.08); }
.lesson-mark-a { top: 18%; inset-inline-end: 8%; animation-delay: calc(var(--splash-ms) * 0.16); }
.lesson-mark-the { top: 58%; inset-inline-start: 6%; width: auto; padding: 0 0.7rem; animation-delay: calc(var(--splash-ms) * 0.24); }
.lesson-mark-quote { bottom: 28%; inset-inline-end: 12%; animation-delay: calc(var(--splash-ms) * 0.32); }
.lesson-mark-ex { bottom: 18%; inset-inline-start: 18%; animation-delay: calc(var(--splash-ms) * 0.4); }
.lesson-chip {
  top: 34%;
  min-height: 28px;
  padding: 0 0.7rem;
  border-radius: 999px;
  border: 1px solid rgb(255 255 255 / 0.45);
  background: rgb(0 0 0 / 0.16);
  color: inherit;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  animation: lesson-chip-in calc(var(--splash-ms) * 0.28) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.lesson-chip-article { inset-inline-start: 14%; animation-delay: calc(var(--splash-ms) * 0.18); }
.lesson-chip-verb { inset-inline-start: 42%; animation-delay: calc(var(--splash-ms) * 0.28); }
.lesson-chip-noun { inset-inline-end: 16%; animation-delay: calc(var(--splash-ms) * 0.38); }
.lesson-sentence {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 0.55rem;
  margin: 0.8rem 0 0;
  padding-bottom: 0.45rem;
  font-size: clamp(1.35rem, 4.2vw, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
}
.lesson-sentence span {
  display: inline-block;
  opacity: 0;
  animation: lesson-word calc(var(--splash-ms) * 0.26) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.lesson-sentence span:nth-child(1) { animation-delay: calc(var(--splash-ms) * 0.1); }
.lesson-sentence span:nth-child(2) { animation-delay: calc(var(--splash-ms) * 0.18); }
.lesson-sentence span:nth-child(3) { animation-delay: calc(var(--splash-ms) * 0.26); }
.lesson-sentence span:nth-child(4) { animation-delay: calc(var(--splash-ms) * 0.34); }
.lesson-sentence span:nth-child(5) { animation-delay: calc(var(--splash-ms) * 0.42); }
.lesson-pen {
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: 0;
  height: 3px;
  border-radius: 99px;
  background: currentColor;
  transform-origin: left center;
  transform: scaleX(0);
  animation: lesson-draw calc(var(--splash-ms) * 0.24) calc(var(--splash-ms) * 0.52) cubic-bezier(0.16, 1, 0.3, 1) both;
}
[dir="rtl"] .lesson-pen { transform-origin: right center; }
.lesson-bubble {
  position: absolute;
  z-index: 3;
  top: 16%;
  inset-inline-end: 18%;
  padding: 0.35rem 0.85rem;
  border-radius: 16px 16px 16px 4px;
  background: var(--paper, var(--brand-paper, #f6f1ea));
  color: var(--accent, var(--brand-accent, #c44536));
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.16);
  opacity: 0;
  animation: lesson-pop calc(var(--splash-ms) * 0.28) calc(var(--splash-ms) * 0.48) cubic-bezier(0.16, 1, 0.3, 1) both;
}
[dir="rtl"] .lesson-bubble { border-radius: 16px 16px 4px 16px; }
.brand-splash-lesson .splash-person {
  animation: lesson-from-side var(--splash-ms) cubic-bezier(0.16, 1, 0.3, 1) both;
}
[dir="rtl"] .brand-splash-lesson .splash-person {
  animation-name: lesson-from-side-rtl;
}
@keyframes lesson-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes lesson-word {
  0% { opacity: 0; transform: translateY(-140%) rotate(-8deg); }
  62% { opacity: 1; transform: translateY(10%) rotate(2deg); }
  100% { opacity: 1; transform: none; }
}
@keyframes lesson-fly {
  0% { opacity: 0; transform: translateY(28px) rotate(-18deg) scale(0.6); }
  70% { opacity: 1; transform: translateY(-4px) rotate(4deg) scale(1.05); }
  100% { opacity: 1; transform: none; }
}
@keyframes lesson-chip-in {
  0% { opacity: 0; transform: translateY(16px) scale(0.8); }
  100% { opacity: 1; transform: none; }
}
@keyframes lesson-pop {
  0% { opacity: 0; transform: scale(0.35) translateY(10px); }
  68% { opacity: 1; transform: scale(1.08) translateY(0); }
  100% { opacity: 1; transform: none; }
}
@keyframes lesson-from-side {
  0% { opacity: 0; transform: translateX(48%); }
  32% { opacity: 1; transform: translateX(-3%); }
  46%, 100% { opacity: 1; transform: translateX(0); }
}
@keyframes lesson-from-side-rtl {
  0% { opacity: 0; transform: translateX(-48%); }
  32% { opacity: 1; transform: translateX(3%); }
  46%, 100% { opacity: 1; transform: translateX(0); }
}
@media (max-width: 720px) {
  .lesson-mark { width: 38px; height: 38px; font-size: 1rem; }
  .lesson-chip-verb { inset-inline-start: 36%; }
  .lesson-bubble { inset-inline-end: 8%; }
}

.brand-splash-orbit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.85rem 1rem 2.4rem;
  background:
    radial-gradient(42% 28% at 50% 22%, rgb(255 255 255 / 0.18), transparent 68%),
    var(--hero, var(--brand-hero, #c44536));
}
.brand-splash-orbit .splash-meter {
  position: absolute;
  bottom: 1rem;
  inset-inline: 0;
}
.orbit-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 28rem);
}
.orbit-field {
  --orbit-r: 11.4rem;
  position: relative;
  width: min(96vw, 28rem);
  height: min(96vw, 28rem);
  display: grid;
  place-items: center;
}
.orbit-wheel {
  grid-area: 1 / 1;
  position: relative;
  width: 100%;
  height: 100%;
  animation: splash-spin calc(var(--splash-ms) * 3.4) linear infinite;
}
.orbit-slot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0;
  height: 0;
  opacity: 0;
  transform: rotate(calc(var(--i) * 360deg / var(--n, 8))) translateY(calc(var(--orbit-r) * -1));
  animation: orbit-arrive calc(var(--splash-ms) * 0.38) cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--splash-ms) * 0.035 * var(--i));
}
.orbit-slot span {
  display: grid;
  place-items: center;
  min-width: 2.15rem;
  height: 2.15rem;
  margin: -1.075rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: rgb(255 248 243 / 0.16);
  color: #fff8f3;
  font-family: Palatino, "Iowan Old Style", "Times New Roman", serif;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  transform: rotate(calc(var(--i) * -360deg / var(--n, 8)));
  animation: orbit-face calc(var(--splash-ms) * 3.4) linear infinite;
}
.orbit-logo {
  grid-area: 1 / 1;
  position: relative;
  z-index: 2;
  width: min(64vw, 17rem);
  height: auto;
  object-fit: contain;
  background: transparent;
  filter: drop-shadow(0 12px 18px rgb(0 0 0 / 0.22));
  animation: orbit-logo calc(var(--splash-ms) * 0.48) cubic-bezier(0.16, 1, 0.3, 1) both;
}
.brand-splash-orbit .orbit-person {
  position: relative;
  z-index: 1;
  inset: auto;
  height: min(52vh, 30rem);
  width: auto;
  max-width: min(78vw, 20rem);
  margin: -8.4rem 0 0;
  object-fit: contain;
  object-position: center top;
  animation: splash-from-bottom calc(var(--splash-ms) * 0.62) cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--splash-ms) * 0.16);
}
.orbit-caption {
  position: relative;
  z-index: 4;
  width: 100vw;
  margin-top: -5.2rem;
  padding: 3.1rem 1.15rem 0.95rem;
  text-align: center;
  background: linear-gradient(180deg, rgb(196 69 54 / 0) 0%, rgb(196 69 54 / 0.2) 18%, var(--hero, #c44536) 46%, color-mix(in srgb, #000 28%, var(--hero, #c44536)) 100%);
}
.orbit-name,
.orbit-tag {
  position: relative;
  z-index: 2;
  margin: 0;
  text-align: center;
}
.orbit-name {
  margin-top: 0;
  font-size: clamp(1.25rem, 3.4vw, 1.85rem);
  font-weight: 700;
  opacity: 0;
  animation: splash-rise calc(var(--splash-ms) * 0.36) ease both;
  animation-delay: calc(var(--splash-ms) * 0.42);
}
.orbit-tag {
  margin-top: 0.2rem;
  font-size: clamp(0.95rem, 2.4vw, 1.15rem);
  opacity: 0;
  animation: splash-rise calc(var(--splash-ms) * 0.36) ease both;
  animation-delay: calc(var(--splash-ms) * 0.5);
}
@keyframes orbit-logo {
  0% { opacity: 0; transform: scale(0.62); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes orbit-arrive {
  0% { opacity: 0; transform: rotate(calc(var(--i) * 360deg / var(--n, 8))) translateY(-1.2rem) scale(0.4); }
  100% { opacity: 1; transform: rotate(calc(var(--i) * 360deg / var(--n, 8))) translateY(calc(var(--orbit-r) * -1)) scale(1); }
}
@keyframes orbit-face {
  to { transform: rotate(calc(var(--i) * -360deg / var(--n, 8) - 360deg)); }
}
@media (max-width: 720px) {
  .orbit-field { --orbit-r: 8.2rem; width: min(78vw, 20rem); height: min(78vw, 20rem); }
  .orbit-logo { width: min(46vw, 12rem); }
  .brand-splash-orbit .orbit-person { height: min(48vh, 26rem); margin-top: -5.6rem; }
  .orbit-caption { margin-top: -3.6rem; padding-top: 2.4rem; }
}
@media (max-height: 640px) {
  .orbit-field { --orbit-r: 6.6rem; width: min(72vw, 16rem); height: min(72vw, 16rem); }
  .orbit-logo { width: min(42vw, 9.5rem); }
  .brand-splash-orbit .orbit-person { height: 14rem; margin-top: -4.6rem; }
  .orbit-caption { margin-top: -3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .brand-splash *,
  .brand-splash *::before,
  .brand-splash *::after {
    animation: none !important;
    transition: none !important;
  }
  .splash-meter span { transform: scaleX(1); }
  .lesson-sentence span,
  .lesson-mark,
  .lesson-chip,
  .lesson-bubble { opacity: 1; transform: none; }
  .lesson-rule,
  .lesson-pen { transform: scaleX(1); }
  .orbit-slot,
  .orbit-logo,
  .orbit-name,
  .orbit-tag { opacity: 1; }
  .orbit-slot { transform: rotate(calc(var(--i) * 360deg / var(--n, 8))) translateY(calc(var(--orbit-r) * -1)) scale(1); }
}
