/* AI course card on the opening page: idea -> AI -> something real, and the card opens the ad.
   The planet of letters comes from the ad itself; the gold arc under the card is the ad's horizon. */

/* ---------- three cards side by side, on wide screens only ---------- */
@media (min-width: 1051px) {
  .doors { width: min(1260px, calc(100% - 64px)); grid-template-columns: repeat(3, 1fr); gap: 22px; }
  .door { --art-h: 306px; min-height: 0; }
  .door-body { padding: 4px 28px 28px; }
  .door h2 { font-size: clamp(22px, 1.9vw, 27px); }
  .door p { font-size: 14.5px; line-height: 1.9; }
  .door-window.door-login { top: 44px; width: 90%; }
  .fan { inset: 40px 0 0; }
  .fan figure { width: 60%; }
  .door-learn:hover .fan figure:nth-child(1) { transform: translateX(-50%) translateX(-36%) rotate(-15deg) translateY(-4px); }
  .door-learn:hover .fan figure:nth-child(4) { transform: translateX(-50%) translateX(37%) rotate(15deg) translateY(-4px); }
  .door-ai { --door-pad: 28px; }
}

/* ---------- the card ---------- */
.door-ai { --door-pad: 26px; --door-glow: #f3b84a2e; --door-accent: #ffd38a; border-color: #f3c77a66; box-shadow: 0 30px 70px #0006, inset 0 1px 0 #ffe7b42e, 0 0 44px #f3b84a1f; }
.door-ai:hover { border-color: #f3c77ab3; box-shadow: 0 40px 90px #0008, 0 0 70px #f3b84a40; }
.door-ai .door-art { -webkit-mask-image: none; mask-image: none; perspective: none; }
.door-ai .door-body { padding-top: 12px; padding-bottom: 0; }

.ai-flow { position: absolute; inset: 16px 22px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }

/* the idea the child writes */
.ai-prompt { position: relative; z-index: 2; width: 100%; height: 44px; display: flex; align-items: center; gap: 9px; padding-inline: 13px 6px; border-radius: 14px;
  background: #0a1c3af2; border: 1px solid #8fc8ff4d; box-shadow: 0 10px 26px #0007, inset 0 1px 0 #ffffff14; }
.ai-spark { flex: none; width: 17px; height: 17px; color: var(--gold); }
.ai-lines { position: relative; flex: 1; height: 100%; min-width: 0; }
.ai-line { position: absolute; inset: 0; display: flex; align-items: center; color: #eaf3ff; font-size: 14px; font-weight: 600; white-space: nowrap; opacity: 0; }
.ai-line.l1 { opacity: 1; }
.ai-send { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #1d1405; background: linear-gradient(135deg, #f7d58e, var(--gold2)); }
.ai-send svg { width: 16px; height: 16px; }
html[lang="en"] .ai-send svg { transform: scaleX(-1); }

/* the AI in the middle: the ad's planet of letters, the play button is its sun */
.ai-core { position: relative; flex: none; width: 176px; height: 176px; margin-block: -6px; display: grid; place-items: center; }
.ai-core::before { content: ''; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(closest-side, #f3c77a3d, #408dff1f 60%, transparent); }
/* the path of the idea: down from the prompt, through the planet, out to the three results */
.ai-core::after { content: ''; position: absolute; left: 50%; top: -14px; bottom: -14px; width: 2px; margin-left: -1px; z-index: -1; background: linear-gradient(180deg, #f3c77a, #f3c77a00 16%, #f3c77a00 84%, #f3c77a); }
.ai-results::before { content: ''; position: absolute; top: -8px; left: 16.5%; right: 16.5%; height: 8px; border: solid #f3c77a; border-width: 2px 2px 0; border-radius: 8px 8px 0 0; opacity: .75; }
.ai-planet { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle at center, #000 62%, transparent 71%); mask-image: radial-gradient(circle at center, #000 62%, transparent 71%); }
.ai-play { position: relative; width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; color: #10203c; background: linear-gradient(145deg, #ffe6ad, #f3c77a 45%, #e6a83f);
  box-shadow: 0 0 0 7px #f3c77a2e, 0 0 44px #f3c77a99, 0 12px 26px #0009; transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s; }
.ai-play svg { width: 27px; height: 27px; margin-inline-start: 4px; }
html[dir="rtl"] .ai-play svg { margin-inline: 0 4px; }
.door-ai:hover .ai-play { transform: scale(1.1); box-shadow: 0 0 0 10px #f3c77a38, 0 0 64px #f3c77ac4, 0 14px 30px #0009; }

/* what comes out: real things */
.ai-results { position: relative; z-index: 2; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ai-result { height: 44px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: #cfe0f6;
  background: #0d234aeb; border: 1px solid #8fc8ff33; }
.ai-result svg { flex: none; width: 18px; height: 18px; color: var(--cyan); }
.ai-result.r1 { color: #1d1405; background: linear-gradient(135deg, #ffe0a0, #efb95a); border-color: #ffe7b4; box-shadow: 0 0 20px #f3c77a59; }
.ai-result.r1 svg { color: #1d1405; }

/* the gold horizon of the ad carries the button */
.door-ai .door-body p { margin-bottom: 22px; }
.door-ai .door-cta { margin: auto calc(-1 * var(--door-pad)) 0; padding: 26px var(--door-pad) 18px; justify-content: center; gap: 10px; color: #0b1a34; font-size: 17px; font-weight: 800;
  background: linear-gradient(180deg, #ffe3a8, #f3c77a 45%, #e6a83f); border-radius: 50% 50% 0 0 / 26px 26px 0 0; box-shadow: 0 -10px 34px #f3c77a4d; }
.door-ai .door-cta i { width: 36px; height: 36px; color: #ffe0a0; background: #0b1a34; border: 0; font-size: 0; }
.door-ai .door-cta i::after, html[lang="en"] .door-ai .door-cta i::after { content: none; }
.door-ai .door-cta i svg { width: 15px; height: 15px; margin-inline-start: 2px; }
html[dir="rtl"] .door-ai .door-cta i svg { margin-inline: 0 2px; }
.door-ai:hover .door-cta i, html[lang="en"] .door-ai:hover .door-cta i { color: #ffe0a0; background: #0b1a34; transform: scale(1.12); }
.ai-time { padding: 1px 9px; border-radius: 999px; background: #0b1a341f; font: 700 12px Arial, sans-serif; letter-spacing: .5px; direction: ltr; }

/* ---------- motion: each idea is typed, then the thing it makes lights up (only when the visitor allows motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
  .doors .door:nth-child(3) { animation-delay: .59s; }
  .ai-planet { animation: ai-spin 80s linear infinite; }
  .ai-play::before, .ai-play::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid #f3c77a; animation: ai-pulse 3s ease-out infinite; }
  .ai-play::after { animation-delay: 1.5s; }
  .ai-line { animation: ai-type-ar 12s linear infinite; }
  html[lang="en"] .ai-line { animation-name: ai-type-en; }
  .ai-line.l2 { animation-delay: 4s; } .ai-line.l3 { animation-delay: 8s; }
  .ai-line.l1 { opacity: 0; }
  .ai-result, .ai-result.r1 { color: #cfe0f6; background: #0d234aeb; border-color: #8fc8ff33; box-shadow: none; animation: ai-lit 12s linear infinite; }
  .ai-result svg, .ai-result.r1 svg { color: inherit; }
  .ai-result.r2 { animation-delay: 4s; } .ai-result.r3 { animation-delay: 8s; }
}
@keyframes ai-spin { to { transform: rotate(360deg); } }
@keyframes ai-pulse { from { transform: scale(1); opacity: .75; } to { transform: scale(1.75); opacity: 0; } }
@keyframes ai-type-ar { 0% { opacity: 1; clip-path: inset(0 0 0 100%); } 14% { clip-path: inset(0 0 0 0); } 31% { opacity: 1; clip-path: inset(0 0 0 0); } 33.3%, 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes ai-type-en { 0% { opacity: 1; clip-path: inset(0 100% 0 0); } 14% { clip-path: inset(0 0 0 0); } 31% { opacity: 1; clip-path: inset(0 0 0 0); } 33.3%, 100% { opacity: 0; clip-path: inset(0 0 0 0); } }
@keyframes ai-lit {
  0%, 14% { color: #cfe0f6; background: #0d234aeb; border-color: #8fc8ff33; box-shadow: none; }
  17%, 30% { color: #1d1405; background: #f6cd80; border-color: #ffe7b4; box-shadow: 0 0 20px #f3c77a59; }
  34%, 100% { color: #cfe0f6; background: #0d234aeb; border-color: #8fc8ff33; box-shadow: none; }
}

/* ---------- the player ---------- */
.ad-player { width: min(92vw, calc((100svh - 40px) * .8)); max-width: none; max-height: none; padding: 0; overflow: visible; background: #030b1b; color: var(--text); border: 1px solid #f3c77a80; border-radius: 20px; box-shadow: 0 40px 110px #000c, 0 0 80px #f3c77a2e; }
.ad-player::backdrop { background: #020814e0; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ad-player video { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; border-radius: 19px; background: #030b1b; }
/* the button stays outside the frame, so it never covers the ad's corners: beside it on wide screens, above it on upright ones */
.ad-close { position: absolute; top: 0; inset-inline-end: -54px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #f2f7ff; background: #030b1bcc; border: 1px solid #ffffff40; transition: background .2s; }
.ad-close:hover { background: #12305e; }
.ad-close svg { width: 18px; height: 18px; }
@media (max-aspect-ratio: 1 / 1) { .ad-close { top: -52px; inset-inline-end: 0; } }
html:has(.ad-player[open]) { overflow: hidden; }

/* ---------- smaller screens ---------- */
@media (max-width: 1050px) {
  /* the course takes the full width above the other two, its picture beside its words */
  .door-ai { grid-column: 1 / -1; order: -1; flex-direction: row; }
  .door-ai .door-art { flex: 1; height: auto; min-height: 330px; }
  .door-ai .ai-flow { justify-content: center; gap: 16px; }
  .door-ai .door-body { flex: 1; padding-top: 28px; }
}
@media (max-width: 820px) {
  .door-ai { order: -2; flex-direction: column; --art-h: 306px; }
  .door-ai .door-art { flex: none; height: var(--art-h); min-height: 0; }
  .door-ai .ai-flow { justify-content: space-between; gap: 0; }
  .door-ai .door-body { flex: 1; padding-top: 12px; }
}
@media (max-width: 600px) {
  .door-ai { --art-h: 300px; --door-pad: 20px; }
  .door-ai .door-body { padding-bottom: 0; }
  .ai-flow { inset: 14px 16px 8px; }
}

/* ---------- our vision for AI, above the three cards: AI today, AGI tomorrow, and the six ideas behind the course ---------- */
.vision { --door-accent: #8fd3ff; position: relative; isolation: isolate; width: min(1260px, calc(100% - 64px)); margin: 30px auto 0; padding: 34px 34px 26px; border-radius: 30px; overflow: hidden; text-align: start;
  background: linear-gradient(160deg, #0f2a52f0, #071731f5 55%, #061226); border: 1px solid #4f7fbf40; box-shadow: 0 30px 70px #0006, inset 0 1px 0 #ffffff14; }
.vision::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse 50% 70% at 100% 0%, #2f7bff2e, transparent 70%), radial-gradient(ellipse 45% 70% at 0% 100%, #f3b84a24, transparent 70%); }
html[dir="ltr"] .vision::before { transform: scaleX(-1); }
.vision + .doors { margin-top: 22px; }
.vision .door-kicker { display: inline-block; }

.vision-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.vision h1, .vision h2 { margin: 14px 0 6px; font-size: clamp(26px, 2.6vw, 36px); line-height: 1.4; font-weight: 800; }
.vision-intro p { margin: 0; max-width: 620px; color: var(--soft); font-size: 16px; line-height: 2; }
/* the opening: the questions about a child's next five years, then the answer, marked in gold */
.vision-intro .vision-answer { margin-top: 12px; padding-inline-start: 14px; border-inline-start: 3px solid var(--gold); color: #eaf2ff; font-weight: 600; }

/* AI today, AGI tomorrow: a lit path between the two, read in the page's direction */
.vision-path { position: relative; height: 136px; display: flex; align-items: center; justify-content: space-between; padding-inline: 8px; }
.vision-track { position: absolute; top: 50%; inset-inline: 48px; height: 2px; margin-top: -1px; border-radius: 2px; background: linear-gradient(90deg, #70d8ff, #f3c77a); }
html[dir="rtl"] .vision-track { background: linear-gradient(270deg, #70d8ff, #f3c77a); }
.vision-track i { position: absolute; top: 50%; inset-inline-start: 0; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff, 0 0 24px #f3c77a; opacity: 0; }
.vision-node { position: relative; z-index: 1; display: grid; place-items: center; }
.vision-node b { position: relative; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; font: 800 20px/1 Arial, sans-serif; letter-spacing: 1px; direction: ltr; background: #0a1c3a; border: 2px solid; }
.v-ai b { color: #8fe0ff; border-color: #70d8ff; box-shadow: 0 0 0 6px #70d8ff14, 0 0 30px #408dff55; }
.v-agi b { width: 92px; height: 92px; font-size: 22px; color: #1d1405; background: linear-gradient(145deg, #ffe6ad, #f3c77a 45%, #e6a83f); border-color: #ffe7b4; box-shadow: 0 0 0 8px #f3c77a1f, 0 0 54px #f3c77a80; }
.vision-node small { position: absolute; top: 100%; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* the six ideas */
.vision-points { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.vision-points li { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: 18px; background: #ffffff08; border: 1px solid #ffffff14; transition: border-color .3s, background .3s; }
.vision-points li:hover { border-color: #8fc8ff40; background: #ffffff0d; }
.vp-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--gold); background: #f3c77a14; border: 1px solid #f3c77a33; }
.vp-ico svg { width: 21px; height: 21px; }
.vision-points h3 { margin: 0 0 4px; color: #fff; font-size: 16.5px; line-height: 1.5; font-weight: 800; }
.vision-points p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.9; }
.vision bdi { white-space: nowrap; } /* an English term inside Arabic stays whole, so its brackets never flip at a line break */

/* the home card stays short: this card opens the whole vision (the opening and the six ideas) on its own page */
.vision-more { display: flex; margin-top: 18px; align-items: center; gap: 14px; padding: 16px; border-radius: 18px; background: linear-gradient(135deg, #f3c77a17, #f3c77a05); border: 1px solid #f3c77a40; transition: border-color .25s, background .25s; }
.vision-more:hover { border-color: #f3c77a99; background: linear-gradient(135deg, #f3c77a24, #f3c77a0a); }
.vm-copy { flex: 1; min-width: 0; }
.vision-more b { display: block; color: #fff; font-size: 16.5px; font-weight: 800; line-height: 1.5; }
.vision-more small { display: block; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.vm-icons { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.vm-icons span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--gold); background: #f3c77a14; border: 1px solid #f3c77a33; }
.vm-icons svg { width: 16px; height: 16px; }
.vision-more > i { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #1d1405; background: linear-gradient(135deg, #f7d58e, var(--gold2)); font-style: normal; font-size: 20px; font-weight: 800; transition: transform .25s; }
.vision-more > i::after { content: '←'; } html[lang="en"] .vision-more > i::after { content: '→'; }
.vision-more:hover > i { transform: translateX(-4px); } html[lang="en"] .vision-more:hover > i { transform: translateX(4px); }

/* the vision on its own page (/vision/): the same card with the six ideas stacked, and a way back */
.vision-back-row { width: min(1260px, calc(100% - 64px)); margin: 4px auto 0; text-align: start; }
.vision-back { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid #365a86; background: #10264a80; color: #dbe9ff; font-size: 14px; font-weight: 700; transition: background .2s, border-color .2s; }
.vision-back:hover { background: #18386a; border-color: #5f8fd0; }
.vision-back::before { content: '→'; } html[lang="en"] .vision-back::before { content: '←'; }
.vision-back-row + .vision { margin-top: 14px; }

/* the three courses, one for each audience, and the way to ask about them */
.vision-foot { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.vision-courses-title { margin: 0 0 12px; color: #fff; font-size: 16.5px; line-height: 1.6; font-weight: 800; }
.vision-courses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.vision-courses li { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, #f3c77a17, #f3c77a05); border: 1px solid #f3c77a33; }
.vc-ico { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #1d1405; background: linear-gradient(145deg, #ffe6ad, #f3c77a 45%, #e6a83f); box-shadow: 0 6px 16px #e6a83f33; }
.vc-ico svg { width: 21px; height: 21px; }
.vision-courses b { display: block; color: #fff; font-size: 15px; font-weight: 800; line-height: 1.5; }
.vision-courses small { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 1.7; }
.vision-action { margin-top: 16px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; }
.vision-course { margin: 0; color: var(--soft); font-size: 14.5px; font-weight: 700; line-height: 1.7; }
.vision-cta { height: 46px; display: inline-flex; align-items: center; gap: 10px; padding-inline: 7px 20px; border-radius: 999px; color: #1d1405; font-size: 15px; font-weight: 800;
  background: linear-gradient(135deg, #f7d58e, var(--gold2)); box-shadow: 0 10px 26px #e6a83f33; transition: transform .2s, box-shadow .2s; }
.vision-cta:hover { transform: translateY(-2px); box-shadow: 0 14px 32px #e6a83f55; }
.vision-cta-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: #ffe0a0; background: #0b1a34; }
.vision-cta-ico svg { width: 18px; height: 18px; }

@media (prefers-reduced-motion: no-preference) {
  .home-hero .vision { animation: rise .9s cubic-bezier(.2, .8, .2, 1) .3s backwards; }
  .vision-track i { animation: vision-run 4.5s cubic-bezier(.45, 0, .25, 1) infinite; }
  .v-agi b::after { content: ''; position: absolute; inset: -2px; border-radius: 50%; border: 1.5px solid #f3c77a; animation: ai-pulse 3s ease-out infinite; }
}
@keyframes vision-run { 0% { inset-inline-start: 0; opacity: 0; } 12%, 88% { opacity: 1; } 100% { inset-inline-start: calc(100% - 10px); opacity: 0; } }

@media (max-width: 1050px) {
  .vision-head { gap: 24px; }
  .vision-points { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .vision { width: min(560px, calc(100% - 40px)); padding: 28px 24px 22px; }
  .vision-back-row { width: min(560px, calc(100% - 40px)); }
  .vision-head { grid-template-columns: 1fr; gap: 6px; }
  .vision-path { height: 124px; margin-bottom: 14px; }
  .vision-points { grid-template-columns: 1fr; }
  .vision-courses { grid-template-columns: 1fr; }
  .vision-action { flex-direction: column; align-items: stretch; text-align: center; }
  .vision-cta { justify-content: center; }
}
@media (max-width: 600px) {
  .vision { width: calc(100% - 32px); margin-top: 32px; padding: 22px 18px 20px; border-radius: 24px; }
  .vision-back-row { width: calc(100% - 32px); }
  .vision h1, .vision h2 { font-size: 25px; }
  .vision-intro p { font-size: 15px; }
  .vision-path { height: 100px; margin-bottom: 10px; }
  .vision-node b { width: 56px; height: 56px; font-size: 16px; }
  .v-agi b { width: 70px; height: 70px; font-size: 18px; }
  .vision-points { margin-top: 18px; }
  .vision-points li { flex-direction: column; gap: 10px; padding: 16px; }
  .vp-ico { width: 36px; height: 36px; }
}
