/* ATCODEX Hub's door in the entrance gate of atcodexschool.com ("the wall of creativity", 2026-12-02; moved into the
   gate 2026-12-03). A tilted wall of example projects from every stage, subject and game scrolls down without end
   behind the words, which sit on the dark lower part of the door. The door's frame and button: gate.css.
   hub-card.js repeats the tiles so the loop has no seam and pauses the wall while the door is off screen;
   motion only when the visitor allows it. */
.portal-hub { --door-accent: #d9cfff; border-color: rgba(167, 139, 250, .38); }
.portal-hub:hover { border-color: rgba(167, 139, 250, .7); box-shadow: 0 40px 90px #0008, 0 0 70px #7c5cff38; }

/* the wall */
.hxw::after { content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, #061226 0%, #061226f5 46%, #061226b8 58%, transparent 80%), linear-gradient(180deg, #0a1d3c99 0%, transparent 14%); }
.hxw-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.hxw-wall { position: absolute; top: -40%; bottom: -12%; left: -14%; width: 128%; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start;
  direction: ltr; transform: perspective(1500px) rotateX(18deg) rotateZ(10deg); transform-origin: 50% 40%; }
.hxw-col { min-width: 0; will-change: transform; }
.hxw-tile { display: block; margin-bottom: 14px; padding: 8px 8px 10px; border-radius: 16px; direction: rtl; text-align: start;
  background: linear-gradient(160deg, #13294f, #0a1836); border: 1px solid #6f9fe02e; box-shadow: 0 14px 30px #0009; }
html[lang="en"] .hxw-tile { direction: ltr; }
.hxw-cover { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 11px; font-style: normal; color: var(--ink, #fff);
  background: radial-gradient(circle at 28% 22%, #ffffff4d, transparent 52%), linear-gradient(145deg, var(--c1), var(--c2)); box-shadow: inset 0 1px 0 #ffffff55, 0 8px 20px var(--cg); }
/* square covers at a period of five, so every copy of a column matches and the loop has no jump */
.hxw-col:nth-child(odd) .hxw-tile:is(:nth-child(5n+2), :nth-child(5n+4)) .hxw-cover, .hxw-col:nth-child(even) .hxw-tile:is(:nth-child(5n+1), :nth-child(5n+3)) .hxw-cover { aspect-ratio: 1 / 1; }
.hxw-cover svg { width: 42%; height: auto; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hxw-cover.t { font: 800 30px/1 Cairo, Arial, sans-serif; } .hxw-cover.en { font-family: Arial, sans-serif; } .hxw-cover.s { font-size: 20px; }
.hxw-tile b { display: block; margin-top: 7px; font-size: 12.5px; font-weight: 800; line-height: 1.45; color: #eef3ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hxw-tile small { display: block; font-size: 10.5px; line-height: 1.6; color: #8ea2c1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hxw .k-coral { --c1: #ff9f7d; --c2: #e0553b; --cg: #ff7b5a59; }
.hxw .k-blue { --c1: #74adff; --c2: #2f6fe0; --cg: #3f86ff59; }
.hxw .k-cyan { --c1: #86dcff; --c2: #1f9ad6; --cg: #38bdf859; }
.hxw .k-violet { --c1: #bba2ff; --c2: #7048f0; --cg: #8b5cf659; }
.hxw .k-green { --c1: #7debc0; --c2: #149a68; --cg: #34d39959; }
.hxw .k-teal { --c1: #6aeedd; --c2: #0e9384; --cg: #2dd4bf59; }
.hxw .k-gold { --c1: #ffe0a0; --c2: #e6a83f; --cg: #e6a83f66; --ink: #2a1a05; }
.hxw .k-amber { --c1: #fdd36a; --c2: #d98a0b; --cg: #f59e0b59; --ink: #2a1a05; }
.hxw .k-pink { --c1: #ffa8d4; --c2: #db4f97; --cg: #ec489959; }
.hxw .k-rose { --c1: #ff93a5; --c2: #d33b5c; --cg: #f43f5e59; }
.hxw .k-indigo { --c1: #9aaaff; --c2: #4352d8; --cg: #6366f159; }

/* the words */
.portal-free { flex: none; padding: 3px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; line-height: 1.6;
  color: #f3c77a; background: rgba(243, 199, 122, .07); border: 1px solid rgba(243, 199, 122, .42); }
.portal-hub h2 bdi { background: linear-gradient(100deg, #ffffff 0%, #e4ecff 55%, #c3d2ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal-hub h2 b { font-weight: inherit; background: linear-gradient(100deg, #efe9ff 0%, #b49cff 40%, #70d8ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.portal-hub .portal-cta { color: #160e33; background: linear-gradient(135deg, #efe9ff, #b49cff); box-shadow: 0 10px 30px #7c5cff55; }
.portal-hub .portal-cta i { color: #e2d9ff; background: #160e33; }

@media (max-width: 600px) {
  .hxw-wall { left: -18%; width: 136%; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hxw-col:nth-child(5) { display: none; }
}

/* motion: the columns fall at different speeds; paused while the door is off screen */
@media (prefers-reduced-motion: no-preference) {
  .hxw-wall[data-loop] .hxw-col { animation: hub-wall-fall 30s linear infinite; }
  .hxw-wall[data-loop] .hxw-col:nth-child(2) { animation-duration: 24s; animation-delay: -9s; }
  .hxw-wall[data-loop] .hxw-col:nth-child(3) { animation-duration: 33s; animation-delay: -4s; }
  .hxw-wall[data-loop] .hxw-col:nth-child(4) { animation-duration: 26s; animation-delay: -15s; }
  .hxw-wall[data-loop] .hxw-col:nth-child(5) { animation-duration: 29s; animation-delay: -11s; }
  .hxw[data-idle] *, .hxw[data-idle] *::before { animation-play-state: paused !important; }
}
@keyframes hub-wall-fall { from { transform: translateY(-50%); } to { transform: translateY(0); } }
