/* ==========================================================================
   X-UP — theme design system
   Playful EdTech palette (warm orange + electric indigo + soft lavender
   backgrounds), inspired by the visual energy of premium AI-tutoring
   landing pages — bold rounded type, gradient blobs, pill buttons, a hand
   -drawn mascot ("Sparky", named after the KICK & SPARK course) instead of
   stock photography for the hero. BEM-ish class naming.
   ========================================================================== */

:root {
  --xup-ink: #171a3d;
  --xup-muted: #5b5f83;
  --xup-white: #ffffff;
  --xup-bg: #faf9ff;
  --xup-bg-soft: #f1eeff;
  --xup-border: #e7e4fb;

  --xup-orange: #ff7a30;
  --xup-orange-dark: #e05f16;
  --xup-orange-light: #ffe3d1;
  --xup-indigo: #3f4bf5;
  --xup-indigo-dark: #2c34c7;
  --xup-indigo-light: #e4e6ff;
  --xup-yellow: #ffc93c;
  --xup-green: #24b47e;
  --xup-pink: #ff6bb0;

  --font-heading: "Baloo 2", "Be Vietnam Pro", "Segoe UI", sans-serif;
  --font-body: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1220px;
  --container-narrow: 760px;
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;
  --shadow-sm: 0 8px 20px rgba(23, 26, 61, 0.06);
  --shadow-card: 0 20px 50px rgba(63, 75, 245, 0.12);
  --shadow-lg: 0 30px 80px rgba(23, 26, 61, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--xup-ink);
  background: var(--xup-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.5em;
  color: var(--xup-ink);
}

h1 {
  font-size: clamp(2.2rem, 4.2vw, 3.6rem);
}
h2 {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
}
h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1em;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--xup-ink);
  color: var(--xup-white);
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--xup-indigo);
  margin-bottom: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-2px);
}
.btn--primary {
  background: var(--xup-indigo);
  color: var(--xup-white);
  box-shadow: 0 14px 30px rgba(63, 75, 245, 0.35);
}
.btn--primary:hover {
  background: var(--xup-indigo-dark);
}
.btn--outline {
  background: var(--xup-white);
  color: var(--xup-indigo);
  border-color: var(--xup-indigo-light);
}
.btn--outline:hover {
  border-color: var(--xup-indigo);
}
.btn--lg {
  padding: 16px 34px;
  font-size: 1.05rem;
}
.btn--sm {
  padding: 10px 20px;
  font-size: 0.9rem;
}
.btn--block {
  width: 100%;
}

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* Deliberately no backdrop-filter/filter/transform here: any of those on
     an ancestor establishes a new containing block for `position: fixed`
     descendants (the mobile .main-nav panel below), so it would stop being
     positioned against the real viewport and drift to wherever this
     ~72px-tall sticky header happens to be — the exact "menu links scattered
     down the page" bug this comment is here to prevent regressing. */
  background: rgba(255, 255, 255, 0.92);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-sm);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--xup-ink);
}
.brand__x {
  color: var(--xup-indigo);
}
.brand__up {
  color: var(--xup-orange);
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a {
  color: var(--xup-muted);
  transition: color 0.15s ease;
}
.main-nav a:hover,
.main-nav a.is-active {
  color: var(--xup-indigo);
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px;
  height: 2.5px;
  background: var(--xup-ink);
  border-radius: 2px;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  transform-origin: center;
}
.site-header.is-open .menu-toggle span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.site-header.is-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.is-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

.nav-overlay {
  display: none;
}

/* ---------------- Hero ---------------- */
.hero {
  position: relative;
  padding: 64px 0 40px;
  background:
    radial-gradient(circle at 15% 20%, var(--xup-indigo-light) 0%, transparent 45%),
    radial-gradient(circle at 85% 10%, var(--xup-orange-light) 0%, transparent 40%), var(--xup-bg);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 48px;
  align-items: center;
}
.hero__lead {
  font-size: 1.1rem;
  color: var(--xup-muted);
  max-width: 46ch;
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 28px 0 8px;
}
.accent {
  color: var(--xup-orange);
}
.accent--indigo {
  color: var(--xup-indigo);
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 380px;
}
.hero__blob {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--xup-indigo-light), var(--xup-orange-light));
  border-radius: 45% 55% 60% 40% / 50% 45% 55% 50%;
  filter: blur(0px);
  z-index: 0;
}
.hero__mascot {
  position: relative;
  z-index: 1;
  width: min(340px, 80%);
  filter: drop-shadow(0 24px 40px rgba(63, 75, 245, 0.25));
}
.hero__sparkle {
  position: absolute;
  font-size: 1.6rem;
  animation: float 3.2s ease-in-out infinite;
}
.hero__sparkle--1 {
  top: 8%;
  left: 8%;
  animation-delay: 0s;
}
.hero__sparkle--2 {
  bottom: 14%;
  left: 2%;
  animation-delay: 1.1s;
}
.hero__sparkle--3 {
  top: 12%;
  right: 4%;
  animation-delay: 0.6s;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero__float-card {
  position: absolute;
  right: -8px;
  bottom: 4%;
  background: var(--xup-white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 18px 20px;
  width: 240px;
  z-index: 2;
}
.hero__float-card h4 {
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.hero__float-card ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}
.hero__float-card li {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero__float-card .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---------------- Section basics ---------------- */
.section {
  padding: 84px 0;
}
.section--soft {
  background: var(--xup-bg-soft);
}
.section-head {
  max-width: 640px;
  margin: 0 0 44px;
}
.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.section-head__lead {
  color: var(--xup-muted);
  font-size: 1.05rem;
}

/* ---------------- Value props ---------------- */
.value-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.value-card {
  background: var(--xup-white);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.value-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}
.value-card__icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.5rem;
  margin-bottom: 16px;
  background: var(--xup-indigo-light);
}
.value-card p {
  color: var(--xup-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* ---------------- Courses ---------------- */
.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.course-card {
  background: var(--xup-white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  border-top: 6px solid var(--xup-indigo);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.course-card:nth-child(2) {
  border-top-color: var(--xup-orange);
}
.course-card:nth-child(3) {
  border-top-color: var(--xup-green);
}
.course-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}
.course-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xup-indigo);
  background: var(--xup-indigo-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.course-card p {
  color: var(--xup-muted);
  font-size: 0.95rem;
}
.course-card__price {
  font-weight: 700;
  color: var(--xup-ink);
  margin-top: 16px;
}

/* Luyện thi & Giao tiếp — same card language as .course-card, 4-up grid,
   4-color accent cycle (indigo/orange/green/pink) instead of 3. */
.track-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.track-card {
  background: var(--xup-white);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
  border-top: 6px solid var(--xup-indigo);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.track-card:nth-child(2) {
  border-top-color: var(--xup-orange);
}
.track-card:nth-child(3) {
  border-top-color: var(--xup-green);
}
.track-card:nth-child(4) {
  border-top-color: var(--xup-pink);
}
.track-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}
.track-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--xup-indigo);
  background: var(--xup-indigo-light);
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.track-card p {
  color: var(--xup-muted);
  font-size: 0.95rem;
}
.track-card__price {
  font-weight: 700;
  color: var(--xup-ink);
  margin-top: 16px;
}
.track-cta {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* ---------------- Gamification explainer ---------------- */
.gami-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.gami-card {
  background: var(--xup-white);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.gami-card__icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--xup-white);
}
.gami-card__icon--xp {
  background: linear-gradient(135deg, var(--xup-indigo), var(--xup-pink));
}
.gami-card__icon--streak {
  background: linear-gradient(135deg, var(--xup-orange), var(--xup-yellow));
}
.gami-card__icon--badge {
  background: linear-gradient(135deg, var(--xup-green), var(--xup-indigo));
}
.gami-card p {
  color: var(--xup-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* ---------------- Testimonials ---------------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.testimonial-card {
  background: var(--xup-white);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  box-shadow: var(--shadow-sm);
}
.testimonial-card__quote {
  font-size: 0.98rem;
  color: var(--xup-ink);
  margin-bottom: 18px;
}
.testimonial-card__author {
  display: flex;
  align-items: center;
  gap: 12px;
}
.testimonial-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--xup-indigo-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--xup-indigo);
  flex-shrink: 0;
}
.testimonial-card__author strong {
  display: block;
  font-size: 0.9rem;
}
.testimonial-card__author span {
  font-size: 0.8rem;
  color: var(--xup-muted);
}

/* ---------------- FAQ ---------------- */
.faq {
  max-width: var(--container-narrow);
  margin: 0 auto;
}
.faq-item {
  border-bottom: 1px solid var(--xup-border);
}
.faq-item__q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 4px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--xup-ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item__q::after {
  content: "+";
  font-size: 1.4rem;
  color: var(--xup-indigo);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item.is-open .faq-item__q::after {
  transform: rotate(45deg);
}
.faq-item__a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  color: var(--xup-muted);
  font-size: 0.95rem;
}
.faq-item.is-open .faq-item__a {
  max-height: 240px;
  padding-bottom: 20px;
}

/* ---------------- Lead form ---------------- */
.lead-section {
  background: linear-gradient(135deg, var(--xup-indigo), var(--xup-indigo-dark));
  color: var(--xup-white);
  border-radius: var(--radius-lg);
  padding: 56px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: 0 24px 70px rgba(23, 26, 61, 0.22);
}
.lead-section h2 {
  color: var(--xup-white);
}
.lead-section p {
  color: rgba(255, 255, 255, 0.85);
}
.form-panel {
  background: var(--xup-white);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: 0 18px 48px rgba(23, 26, 61, 0.18);
}
.form-row {
  margin-bottom: 14px;
}
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--xup-ink);
  margin-bottom: 6px;
}
.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--xup-border);
  border-radius: var(--radius-sm);
  font: inherit;
  color: var(--xup-ink);
}
.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--xup-indigo);
}
.form-note {
  min-height: 1.2em;
  font-size: 0.85rem;
  color: var(--xup-orange-dark);
  margin: 10px 0 0;
}
.form-note.is-error {
  font-weight: 600;
}

/* ---------------- Footer ---------------- */
.site-footer {
  background: var(--xup-ink);
  color: rgba(255, 255, 255, 0.75);
  padding: 64px 0 24px;
}
.site-footer .brand {
  color: var(--xup-white);
  margin-bottom: 14px;
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 40px;
}
.site-footer h4 {
  color: var(--xup-white);
  font-size: 0.95rem;
  margin-bottom: 16px;
}
.site-footer a {
  display: block;
  padding: 5px 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.9rem;
}
.site-footer a:hover {
  color: var(--xup-white);
}
.site-footer__social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.site-footer__social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-weight: 700;
}
.site-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------------- Scroll reveal ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------- Responsive ---------------- */
@media (max-width: 1080px) {
  .hero__grid {
    grid-template-columns: 1fr;
  }
  .hero__visual {
    order: -1;
    min-height: 320px;
  }
  .value-grid,
  .gami-grid,
  .testimonial-grid,
  .course-grid,
  .track-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .lead-section {
    grid-template-columns: 1fr;
    padding: 40px;
  }
  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {
  .main-nav {
    position: fixed;
    top: var(--header-h, 72px);
    right: 0;
    bottom: 0;
    width: min(320px, 84vw);
    background: var(--xup-white);
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
    gap: 4px;
    transform: translateX(100%);
    visibility: hidden;
    transition:
      transform 0.25s ease,
      visibility 0s linear 0.25s;
    z-index: 90;
    box-shadow: var(--shadow-lg);
  }
  .main-nav a {
    width: 100%;
    padding: 14px 8px;
    border-bottom: 1px solid var(--xup-border);
  }
  .site-header.is-open .main-nav {
    transform: translateX(0);
    visibility: visible;
    transition: transform 0.25s ease;
  }
  .nav-overlay {
    display: block;
    position: fixed;
    top: var(--header-h, 72px);
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(23, 26, 61, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 80;
  }
  .site-header.is-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  .menu-toggle {
    display: flex;
  }
  .site-header__actions .btn--sm {
    display: none;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 56px 0;
  }
  .hero {
    padding: 40px 0 24px;
  }
  .hero__float-card {
    position: static;
    width: 100%;
    margin-top: 20px;
  }
  .value-grid,
  .gami-grid,
  .testimonial-grid,
  .course-grid,
  .track-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-footer__grid {
    grid-template-columns: 1fr;
  }
  .hero__actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    width: 100%;
  }
}
