/* /code landing front door (templates/code/landing.html, code-landing-fun.js): playful hero with
   the robot mascot, quick-win tiles, cheer line. Dark by default, light theme below. */
.cx-hero {
  position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 1.5rem;
  margin: 1.25rem 0 1.5rem; padding: 1.75rem 1.75rem 1.5rem; border-radius: 1.75rem; overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(250, 204, 21, .22), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(236, 72, 153, .25), transparent 40%),
    radial-gradient(circle at 70% 100%, rgba(34, 211, 238, .22), transparent 45%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 45%, #0c4a6e 100%);
  border: 1px solid rgba(165, 180, 252, .35);
  box-shadow: 0 18px 50px -20px rgba(99, 102, 241, .55);
}
.cx-hi { margin: 0 0 .35rem; font-weight: 700; font-size: 1.05rem; color: #fde68a; }
.cx-wave { display: inline-block; transform-origin: 70% 80%; animation: cx-wave 2.4s ease-in-out infinite; }
@keyframes cx-wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(16deg); } 20%, 40% { transform: rotate(-10deg); } }
.cx-hero h1 { margin: 0; font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.cx-pop { display: inline-block; background: linear-gradient(90deg, #facc15, #f472b6, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; animation: cx-bob 3s ease-in-out infinite; }
@keyframes cx-bob { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-4px) rotate(1deg); } }
.cx-sub { margin: .75rem 0 .6rem; max-width: 36rem; color: #e0e7ff; font-size: 1.02rem; line-height: 1.55; }
.cx-cheer { display: inline-block; margin: 0 0 1rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(255, 255, 255, .12); color: #fef9c3; font-weight: 650; font-size: .92rem; }
.cx-cheer.is-cheering { background: rgba(250, 204, 21, .2); animation: cx-pulse 1.6s ease-out 2; }
@keyframes cx-pulse { 0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, .6); } 100% { box-shadow: 0 0 0 14px rgba(250, 204, 21, 0); } }
.cx-cta { display: flex; flex-wrap: wrap; gap: .55rem; }
.cx-btn { display: inline-flex; align-items: center; gap: .35rem; padding: .6rem 1.05rem; border-radius: 999px; font-weight: 700; font-size: .95rem; color: #fff; text-decoration: none; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); transition: transform .15s, background .15s; }
.cx-btn:hover, .cx-btn:focus-visible { transform: translateY(-2px); background: rgba(255, 255, 255, .18); }
.cx-btn-go { background: linear-gradient(90deg, #f59e0b, #ec4899); border-color: transparent; box-shadow: 0 8px 20px -8px rgba(236, 72, 153, .8); }
.cx-btn-go:hover, .cx-btn-go:focus-visible { background: linear-gradient(90deg, #fbbf24, #f472b6); }
.cx-hero-art { position: relative; display: flex; flex-direction: column; align-items: center; gap: .5rem; }
/* The robot's floor: a dotted grid, like squared paper, so the box reads as a stage even
   before the rainbow trail has grown (a dashed empty box looked unfinished, 12-02). */
.cx-bot { width: 100%; max-width: 340px; aspect-ratio: 4 / 3; height: auto; border-radius: 1.25rem; cursor: pointer;
  border: 1px solid rgba(165, 180, 252, .35); box-shadow: inset 0 0 40px rgba(99, 102, 241, .25), 0 14px 30px -20px rgba(0, 0, 0, .9);
  background: radial-gradient(circle, rgba(199, 210, 254, .28) 1.2px, transparent 1.6px) 0 0 / 20px 20px, linear-gradient(160deg, rgba(30, 27, 75, .75), rgba(15, 23, 42, .8)); }
.cx-bot-btn { padding: .35rem .9rem; border-radius: 999px; border: 0; background: #facc15; color: #422006; font-weight: 800; font-size: .88rem; cursor: pointer; box-shadow: 0 4px 0 #ca8a04; transition: transform .1s, box-shadow .1s; }
.cx-bot-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #ca8a04; }

.cx-wins { margin: 0 0 1.75rem; }
.cx-wins h2 { margin: 0 0 .75rem; font-size: 1.2rem; font-weight: 800; color: #f8fafc; }
.cx-win-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.cx-win {
  --h1: #22c55e; --h2: #15803d;
  display: flex; flex-direction: column; align-items: flex-start; gap: .2rem; padding: .95rem .9rem; border-radius: 1.1rem;
  text-decoration: none; color: #fff; background: linear-gradient(150deg, var(--h1), var(--h2));
  box-shadow: 0 6px 0 rgba(0, 0, 0, .25); transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), box-shadow .18s;
}
.cx-win:nth-child(odd) { transform: rotate(-1.2deg); }
.cx-win:nth-child(even) { transform: rotate(1.2deg); }
.cx-win:hover, .cx-win:focus-visible { transform: translateY(-5px) rotate(0) scale(1.04); box-shadow: 0 12px 0 rgba(0, 0, 0, .2); }
.cx-win:hover .cx-win-icon { animation: cx-wiggle .5s ease-in-out; }
@keyframes cx-wiggle { 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.cx-win-icon { display: flex; width: 2.6rem; height: 2.6rem; align-items: center; justify-content: center; border-radius: .8rem; background: rgba(255, 255, 255, .22); margin-bottom: .35rem; }
.cx-win-icon svg { width: 1.5rem; height: 1.5rem; }
.cx-win strong { font-size: 1rem; line-height: 1.2; }
.cx-win span:last-child { font-size: .8rem; opacity: .9; }
.cx-win[data-hue="lime"] { --h1: #84cc16; --h2: #15803d; }
.cx-win[data-hue="sky"] { --h1: #38bdf8; --h2: #1d4ed8; }
.cx-win[data-hue="teal"] { --h1: #2dd4bf; --h2: #0f766e; }
.cx-win[data-hue="amber"] { --h1: #fbbf24; --h2: #c2410c; }
.cx-win[data-hue="pink"] { --h1: #f472b6; --h2: #be185d; }
.cx-win[data-hue="violet"] { --h1: #a78bfa; --h2: #6d28d9; }

@media (max-width: 1024px) { .cx-win-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .cx-hero { grid-template-columns: 1fr; padding: 1.25rem 1rem 1.1rem; gap: 1rem; border-radius: 1.25rem; }
  .cx-bot { max-width: 230px; }
  .cx-cheer { font-size: .85rem; }
  .cx-win-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cx-wave, .cx-pop, .cx-cheer.is-cheering { animation: none; }
  .cx-win, .cx-win:nth-child(odd), .cx-win:nth-child(even), .cx-win:hover { transform: none; transition: none; }
  .cx-win:hover .cx-win-icon { animation: none; }
}
html[data-theme="light"] .cx-wins h2 { color: #1e1b4b; }
