/* ==========================================================
   style.css — hand-written styles layered on top of Tailwind.
   Covers: accessibility helpers, the signature "code-tab" card
   shape used for courses, blob illustrations, and motion.
   ========================================================== */

/* ---------- Accessibility ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #1B2A4E;
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.75rem 0;
  z-index: 100;
  font-weight: 600;
}
.skip-link:focus {
  left: 0;
}

/* Consistent, visible keyboard focus ring everywhere (WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #FFC13B;
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}

/* ---------- Signature element: the "code-tab" card ----------
   Every course / product card reads like a little editor tab —
   a nod to the subject matter (kids writing real code) that's
   distinct from a generic rounded shadow card. The colored top
   edge maps 1:1 to the course category color from config.php. */
.dd-card {
  position: relative;
  background: #fff;
  border-radius: 1.75rem;
  border: 2px solid rgba(27, 42, 78, 0.08);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.dd-card:hover {
  transform: translateY(-6px) rotate(-0.4deg);
  box-shadow: 0 18px 30px -12px rgba(27, 42, 78, 0.25);
  border-color: rgba(27, 42, 78, 0.15);
}
.dd-card__tab {
  height: 8px;
  width: 100%;
}
.dd-card__dots {
  display: inline-flex;
  gap: 5px;
}
.dd-card__dots span {
  width: 7px; height: 7px; border-radius: 999px; background: currentColor; opacity: .25;
}

/* ---------- Hero "editor window" ---------- */
.dd-window {
  background: #1B2A4E;
  border-radius: 1.75rem;
  box-shadow: 0 30px 60px -20px rgba(27, 42, 78, 0.45);
}
.dd-window__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dd-window__bar span { width: 11px; height: 11px; border-radius: 999px; }

/* Typing caret used in the hero code block */
.dd-caret {
  display: inline-block;
  width: 2px;
  background: #FFC13B;
  animation: dd-blink 1s steps(1) infinite;
}
@keyframes dd-blink { 50% { opacity: 0; } }

/* ---------- Soft blob shapes for illustration backdrops ---------- */
.dd-blob {
  border-radius: 42% 58% 65% 35% / 45% 40% 60% 55%;
}

/* ---------- Gentle float animation for mascot / decorative icons ---------- */
@keyframes dd-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.dd-float { animation: dd-float 4.5s ease-in-out infinite; }

/* ---------- Scroll-reveal (progressive enhancement via main.js) ---------- */
.dd-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.dd-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Toast (flash message) ---------- */
#dd-toast-wrap {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.dd-toast {
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1B2A4E;
  background: #fff;
  border: 2px solid rgba(27,42,78,0.1);
  border-left: 6px solid #3EC9B0;
  border-radius: 1rem;
  padding: 0.75rem 1.1rem;
  box-shadow: 0 12px 24px -10px rgba(27,42,78,0.3);
  max-width: 320px;
  animation: dd-toast-in 0.3s ease;
}
.dd-toast.error { border-left-color: #FF6B6B; }
@keyframes dd-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Age-track pill ---------- */
.dd-age-pill {
  font-family: 'JetBrains Mono', monospace;
}

/* Lazy-loaded image fade-in */
img[loading="lazy"] {
  transition: opacity 0.4s ease;
}
img.dd-img-loading {
  opacity: 0;
}
