/*
 * Clever Prep — NBEO Tutoring page
 * Aeline-style hero: full-bleed rounded sky card + curved 3D image marquee.
 */

.brxe-section.cp-nbeo-hero {
  align-items: stretch !important;
  width: 100%;
  padding: 0;
  background: var(--cp-cream-bg);
}
.brxe-container.cp-nbeo-hero__inner {
  width: 100% !important;
  max-width: none !important;
  padding: 12px !important;
}

/* The rounded "card" stage holding bg + copy + marquee */
.brxe-block.cp-nbeo-hero__stage {
  position: relative;
  width: 100% !important;
  min-height: clamp(640px, 90vh, 980px);
  border-radius: 28px;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #66b6f5 0%, #4f9bdf 60%, #6ea7d6 100%);
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  padding: clamp(80px, 12vh, 160px) 24px 0 !important;
}

/* Background image — covers stage, slight darken at top for header legibility */
.brxe-image.cp-nbeo-hero__bg {
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100%;
  z-index: 0;
}
.brxe-image.cp-nbeo-hero__bg img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block;
}
.brxe-block.cp-nbeo-hero__stage::after {
  /* gentle vignette so headline reads cleanly on bright sky */
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(255,255,255,0) 0%, rgba(255,255,255,0) 50%, rgba(80,140,200,0.18) 100%),
    linear-gradient(180deg, rgba(20,40,80,0.04) 0%, rgba(20,40,80,0) 30%);
  z-index: 1;
}

/* Copy block centered over bg */
.brxe-block.cp-nbeo-hero__copy {
  position: relative;
  z-index: 3;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center;
  gap: 22px !important;
  width: auto !important;
  max-width: 760px;
  margin-top: clamp(40px, 8vh, 100px);
}
.cp-nbeo-hero__label {
  letter-spacing: .14em;
  color: rgba(255,255,255,0.85);
  text-shadow: 0 1px 2px rgba(0,0,0,.15);
}
.cp-nbeo-hero__title {
  font-family: var(--cp-font-heading);
  font-weight: 400;
  font-size: clamp(44px, 6.4vw, 88px);
  line-height: 1.02;
  letter-spacing: -.02em;
  color: #fff;
  margin: 0;
  max-width: 18ch;
  text-shadow: 0 2px 24px rgba(20,40,80,.18);
}
.cp-nbeo-hero__body {
  font-family: var(--cp-font-body);
  font-weight: 400;
  font-size: clamp(15px, 1.15vw, 18px);
  line-height: 1.55;
  color: rgba(255,255,255,0.92);
  margin: 0;
  max-width: 56ch;
  text-shadow: 0 1px 12px rgba(20,40,80,.12);
}
.brxe-block.cp-nbeo-hero__ctas {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  width: auto !important;
  margin-top: 4px;
}
.cp-nbeo-hero__cta {
  padding: 14px 28px !important;
  border-radius: var(--cp-radius-lg) !important;
  font-family: var(--cp-font-body);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -.005em;
  transition: transform .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.cp-nbeo-hero__cta--ghost {
  background: rgba(255,255,255,0.18) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.35) !important;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cp-nbeo-hero__cta--ghost:hover {
  background: rgba(255,255,255,0.28) !important;
  transform: translateY(-1px);
}
.cp-nbeo-hero__cta--primary {
  background: var(--cp-orange, #e88a3c) !important;
  color: #fff !important;
  border: 1px solid var(--cp-orange, #e88a3c) !important;
}
.cp-nbeo-hero__cta--primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* ───── 3D carousel marquee — cards orbit a vertical axis ─────
 * Markup: .marquee (perspective viewport) → .ring (transform-style preserve-3d,
 *         animated rotateY) → 16 .card (each rotateY(i*22.5deg) translateZ(R))
 */
.brxe-block.cp-nbeo-hero__marquee {
  position: absolute !important;
  left: 50%;
  bottom: -120px;
  transform: translateX(-50%);
  width: min(1100px, 100%) !important;
  height: 380px;
  z-index: 2;
  pointer-events: none;
  /* 3D camera — pulled back so cards have visible depth */
  perspective: 1200px;
  perspective-origin: 50% 35%;
  overflow: hidden;
  /* Soft fade as cards enter/exit on the left and right edges */
  -webkit-mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,.4) 6%, #000 16%, #000 84%, rgba(0,0,0,.4) 94%, transparent 100%);
          mask-image: linear-gradient(to right,
    transparent 0%, rgba(0,0,0,.4) 6%, #000 16%, #000 84%, rgba(0,0,0,.4) 94%, transparent 100%);
}

.brxe-block.cp-nbeo-hero__ring {
  --n: 20;                          /* slots around ring — MUST equal builder N */
  --r: 340px;                       /* fixed orbit so look is consistent */
  position: absolute !important;
  inset: 0;
  width: 100% !important;
  height: 100%;
  margin: 0 !important;
  display: block !important;
  transform-style: preserve-3d;
  transform: rotateX(8deg);
  transform-origin: 50% 50%;
  animation: cp-nbeo-spin 90s linear infinite;
  will-change: transform;
}
@keyframes cp-nbeo-spin {
  from { transform: rotateX(8deg) rotateY(0deg); }
  to   { transform: rotateX(8deg) rotateY(360deg); }
}

.brxe-block.cp-nbeo-hero__card {
  --size: 120px;                    /* fixed card size so look is consistent */
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--size) !important;
  height: var(--size);
  aspect-ratio: 1 / 1;
  margin: 0 !important;
  /* Each card is rotated around the ring's vertical (Y) axis to its slot,
     then pushed outward along Z by the radius. The cards face outward, so
     when one is in front of the camera we see its face; backs are hidden. */
  transform:
    translate(-50%, -50%)
    rotateY(calc(var(--i) * (360deg / var(--n))))
    translateZ(var(--r));
  border-radius: 22px;
  overflow: hidden;
  box-shadow:
    0 18px 44px rgba(20, 40, 80, .25),
    0 4px 12px rgba(20, 40, 80, .14);
  background: #fff;
  backface-visibility: hidden;
  border-radius: 10px;
}

/* The <img> itself carries the class (Bricks renders it directly, no wrapper) */
img.brxe-image.cp-nbeo-hero__card-img,
.brxe-image.cp-nbeo-hero__card-img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  border-radius: 10px;
}

@media (max-width: 900px) {
  .brxe-block.cp-nbeo-hero__stage {
    border-radius: 22px;
    min-height: 680px;
    padding-top: 100px !important;
  }
  .cp-nbeo-hero__title { font-size: clamp(38px, 9vw, 56px); }
  .brxe-block.cp-nbeo-hero__marquee {
    height: 280px;
    bottom: -100px;
  }
  /* 420 (was 360): wider orbit so 20 cards don't overlap at the smaller
     tablet/mobile card size. Keeps a ~30px gap, matching desktop. */
  .brxe-block.cp-nbeo-hero__ring { --r: 420px; }
  .brxe-block.cp-nbeo-hero__card {
    --size: 100px;
    width: 100px !important;
    height: 100px;
  }
}

/* Desktop (>900px) only — match the rounded corners + soft blurred edges
   that already read well on tablet/mobile. Desktop cards are larger
   (120px vs 100px), so the shared 10px radius looked comparatively square
   and the fixed edge-mask faded too late on the wider marquee. These
   overrides scale both to the same *proportions* the ≤900px rules give,
   leaving the (good) tablet/mobile rules untouched. */
@media (min-width: 901px) {
  /* Larger orbit radius on desktop — the ring the cards travel along is
     wider, so the visible bottom arc is flatter/broader and cards are
     spaced further apart. (Base/desktop was 340px.) */
  .brxe-block.cp-nbeo-hero__ring { --r: 480px; }

  /* 120px card → 16px keeps the ~0.10 radius:size ratio that looks right
     on mobile (10px / 100px), nudged slightly rounder for the bigger,
     perspective-viewed desktop cards. */
  .brxe-block.cp-nbeo-hero__card { border-radius: 16px; }
  img.brxe-image.cp-nbeo-hero__card-img,
  .brxe-image.cp-nbeo-hero__card-img { border-radius: 16px; }

  /* Pull the solid band inward and add a wider translucent ramp so the
     edge cards dissolve with the same soft blur the narrower mobile
     marquee produces, instead of staying crisp until ~16%. */
  .brxe-block.cp-nbeo-hero__marquee {
    -webkit-mask-image: linear-gradient(to right,
      transparent 0%, rgba(0,0,0,.18) 9%, #000 20%, #000 80%,
      rgba(0,0,0,.18) 91%, transparent 100%);
            mask-image: linear-gradient(to right,
      transparent 0%, rgba(0,0,0,.18) 9%, #000 20%, #000 80%,
      rgba(0,0,0,.18) 91%, transparent 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brxe-block.cp-nbeo-hero__ring { animation: none !important; }
}
