/* atcodexschool.com home (2026-12-03): the entrance gate. The page opens on the brand and two doors: ATCODEX Hub
   (/hub/) and ATCODEX SCHOOL, which opens #school on the same page: the vision card and the school system, learning
   programs, AI course and smart CCTV cards. Any link into #school (such as /#ai-course) opens it too, and Back returns
   to the gate. Browsers without :has() show both parts one after the other. Hub door picture: hub-card.css. */

/* which part shows: the gate, unless the address points into ATCODEX SCHOOL */
@supports selector(:has(*)) {
  main:not(:has(#school:target, #school :target)) #school { display: none; }
  main:has(#school:target, #school :target) #gate { display: none; }
}

/* ---------- the gate ---------- */
/* the whole gate fits a laptop screen: a smaller logo, then the two doors */
.gate { padding-top: 96px; padding-bottom: 64px; }
.gate .home-brand { width: min(200px, 50%); }
.gate .home-title { font-size: clamp(32px, 4vw, 54px); }
.gate-lead { margin: 14px 0 0; color: var(--soft); font-size: clamp(16px, 1.5vw, 19px); font-weight: 700; }
.gate-doors { width: min(1180px, calc(100% - 64px)); margin: 20px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
.portal { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: min(500px, calc(100svh - 300px)); 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;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s, border-color .45s; }
.portal:hover { transform: translateY(-8px); }
.portal-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.portal-body { position: relative; display: flex; flex-direction: column; padding: 0 34px 32px; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 10px 12px; flex-wrap: wrap; }
.portal .door-kicker { align-self: auto; }
.portal h2 { margin: 14px 0 6px; font: 800 clamp(34px, 3.4vw, 48px)/1.12 Arial, sans-serif; letter-spacing: .4px; }
.portal h2 bdi, .world-title bdi { direction: ltr; unicode-bidi: isolate; }
.portal p { margin: 0; max-width: 500px; color: var(--soft); font-size: 15.5px; line-height: 1.95; }
.portal-cta { align-self: flex-start; margin-top: 22px; display: inline-flex; align-items: center; gap: 12px; height: 50px; padding-inline: 22px 7px; border-radius: 999px; font-size: 16px; font-weight: 800; }
.portal-cta i { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 18px; transition: transform .3s; }
.portal-cta i::after { content: '←'; } html[lang="en"] .portal-cta i::after { content: '→'; }
.portal:hover .portal-cta i { transform: translateX(-5px); } html[lang="en"] .portal:hover .portal-cta i { transform: translateX(5px); }

/* the ATCODEX SCHOOL door: the school system, a learning program, a camera and an AI prompt */
.portal-school { --door-accent: #ffd98f; border-color: #f3c77a4d; }
.portal-school:hover { border-color: #f3c77aa6; box-shadow: 0 40px 90px #0008, 0 0 70px #e6a83f2e; }
.gs-art { background: radial-gradient(ellipse 70% 50% at 50% 28%, #2f7bff30, transparent 70%), radial-gradient(ellipse 45% 35% at 85% 8%, #f3c77a1f, transparent 70%); }
.gs-art::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(0deg, #061226 0%, #061226f5 46%, #061226a6 56%, #06122600 72%); }
.gs-stage { position: absolute; left: 50%; top: 30px; width: 80%; max-width: 470px; height: 260px; translate: -50% 0; direction: ltr; }
.gs-win { position: absolute; margin: 0; border-radius: 12px; overflow: hidden; background: #0a1730; border: 1px solid #6fa2e04d; box-shadow: 0 24px 50px #000b; }
.gs-win img { display: block; width: 100%; height: auto; }
.gs-sys { left: 11%; top: 0; width: 78%; }
.gs-bar { display: flex; align-items: center; gap: 5px; height: 18px; padding: 0 8px; background: #0d1d3b; border-bottom: 1px solid #6fa2e026; }
.gs-bar i { width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; } .gs-bar i:nth-child(2) { background: #ffc94d; } .gs-bar i:nth-child(3) { background: #4fd18b; }
.gs-cam { left: -1%; top: 100px; width: 42%; transform: rotate(-6deg); }
.gs-cam img { aspect-ratio: 16 / 10; object-fit: cover; }
.gs-cam figcaption { position: absolute; left: 8px; top: 8px; display: flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; font: 700 10px/1 Arial, sans-serif; letter-spacing: 1px; color: #fff; background: #000000a6; }
.gs-cam figcaption i { width: 6px; height: 6px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; }
.gs-prog { right: -1%; top: 88px; width: 47%; transform: rotate(5deg); }
.gs-prog b { position: absolute; right: 8px; bottom: 8px; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; box-shadow: 0 6px 14px #0008; }
.gs-ai { position: absolute; right: 3%; top: -16px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; direction: rtl;
  font: 700 13px/1.4 Cairo, Arial, sans-serif; color: #ffe2a6; background: #0b1a34f2; border: 1px solid #f3c77a66; box-shadow: 0 12px 28px #0009, 0 0 24px #f3c77a26; }
html[lang="en"] .gs-ai { direction: ltr; }
.gs-ai svg { width: 15px; height: 15px; color: #f3c77a; }
.portal-school h2 bdi, .world-title bdi { background: linear-gradient(100deg, #ffffff 0%, #d8ecff 45%, #8fdcff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal-school h2 b, .world-title b { font-weight: inherit; background: linear-gradient(135deg, #ffe6ad, #f3c77a 50%, #e6a83f); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal-school .portal-cta { color: #1d1405; background: linear-gradient(135deg, #f7d58e, #e6a83f); box-shadow: 0 10px 30px #e6a83f40; }
.portal-school .portal-cta i { color: #ffe0a0; background: #0b1a34; }

/* ---------- ATCODEX SCHOOL, after the gate ---------- */
.school-world { padding-top: 110px; }
.world-bar { width: min(1260px, calc(100% - 64px)); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.world-title { order: -1; margin: 0; font: 800 clamp(22px, 2.4vw, 30px)/1.2 Arial, sans-serif; letter-spacing: 2px; }
.world-back { display: inline-flex; align-items: center; gap: 8px; height: 40px; 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; }
.world-back:hover { background: #18386a; border-color: #5f8fd0; }
.world-back::before { content: '→'; } html[lang="en"] .world-back::before { content: '←'; }
.school-world .vision { margin-top: 22px; }

@media (max-width: 1050px) { .portal-body { padding: 0 26px 28px; } }
@media (min-width: 821px) { .portal { min-height: max(440px, min(500px, calc(100svh - 300px))); } }
/* short laptop screens: the header already shows the logo, so the gate drops its large copy and the doors fit */
@media (min-width: 821px) and (max-height: 840px) { .gate .home-brand { display: none; } .gate { padding-top: 104px; } }
@media (max-width: 820px) {
  .gate-doors { grid-template-columns: 1fr; width: min(560px, calc(100% - 40px)); gap: 20px; }
  .portal { min-height: 500px; }
  .world-bar { width: min(560px, calc(100% - 40px)); }
}
@media (max-width: 600px) {
  .gate-doors { width: calc(100% - 32px); }
  .gate .home-title { font-size: 28px; letter-spacing: 3px; }
  .portal { min-height: 470px; border-radius: 24px; }
  .portal-body { padding: 0 20px 22px; }
  .portal p { font-size: 14.5px; }
  .portal .door-kicker { letter-spacing: 1px; }
  .gs-stage { top: 30px; width: 96%; height: 250px; }
  .gs-cam { top: 96px; } .gs-prog { top: 88px; }
  .world-bar { width: calc(100% - 32px); }
  .school-world { padding-top: 96px; }
}

/* motion: the doors rise in, the pictures float, the camera's dot blinks, ATCODEX SCHOOL rises when it opens */
@media (prefers-reduced-motion: no-preference) {
  .gate-lead { animation: gate-rise .9s cubic-bezier(.2, .8, .2, 1) .25s backwards; }
  .gate-doors .portal { animation: gate-rise .9s cubic-bezier(.2, .8, .2, 1) .35s backwards; }
  .gate-doors .portal + .portal { animation-delay: .47s; }
  .gs-sys { animation: gate-float 7s ease-in-out infinite; }
  .gs-cam { animation: gate-float-cam 6s ease-in-out -2s infinite; }
  .gs-prog { animation: gate-float-prog 6.5s ease-in-out -4s infinite; }
  .gs-ai { animation: gate-float 5s ease-in-out -1s infinite; }
  .gs-cam figcaption i { animation: gate-blink 1.2s steps(1) infinite; }
  .world-bar { animation: gate-rise .7s cubic-bezier(.2, .8, .2, 1) backwards; }
}
@keyframes gate-rise { from { opacity: 0; transform: translateY(28px); } }
@keyframes gate-float { 50% { translate: 0 -8px; } }
@keyframes gate-float-cam { 50% { translate: 0 -6px; } }
@keyframes gate-float-prog { 50% { translate: 0 -10px; } }
@keyframes gate-blink { 50% { opacity: .2; } }
