/* HOME page — immersive community globe hero and services band. */

body.home::before { display: block; }

/* ---- Immersive globe hero ---- */
.home-hero {
  --globe-size: min(120vh, 112vw);
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 112px max(24px, calc((100vw - var(--maxw)) / 2)) 50px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 50%, rgba(59, 94, 130, 0.3), transparent 38%),
    radial-gradient(circle at 70% 18%, rgba(134, 32, 52, 0.18), transparent 28%),
    linear-gradient(120deg, #02040a 0%, #07111d 44%, #010207 100%);
  color: #f7f3ec;
}
.home-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 22%, rgba(255,255,255,0.18) 0 1px, transparent 1.5px),
    radial-gradient(circle at 62% 34%, rgba(255,255,255,0.12) 0 1px, transparent 1.5px),
    radial-gradient(circle at 82% 72%, rgba(255,255,255,0.1) 0 1px, transparent 1.5px);
  background-size: 180px 180px, 260px 260px, 320px 320px;
  opacity: 0.48;
}
.home-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background: linear-gradient(90deg, rgba(1, 2, 7, 0.08), rgba(1, 2, 7, 0.26) 52%, rgba(1, 2, 7, 0.72) 100%);
}

.globe-stage {
  position: absolute;
  left: clamp(-34vw, -18vw, -110px);
  top: 50%;
  z-index: 0;
  width: var(--globe-size);
  height: var(--globe-size);
  transform: translateY(-50%);
  opacity: 0.96;
}
.globe-stage [data-community-globe] {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  cursor: grab;
  filter: drop-shadow(0 0 42px rgba(93, 159, 216, 0.28)) drop-shadow(0 36px 110px rgba(0, 0, 0, 0.65));
  touch-action: none;
  user-select: none;
  background: radial-gradient(circle at 38% 34%, rgba(97, 143, 183, 0.2), rgba(2, 5, 11, 0.92) 62%, rgba(1, 2, 7, 1) 100%);
}
.globe-stage [data-community-globe] canvas,
.globe-stage .maplibregl-canvas {
  border-radius: 50%;
  outline: none;
}
.globe-stage .maplibregl-canvas-container.maplibregl-interactive,
.globe-stage .maplibregl-canvas-container.maplibregl-interactive:active {
  cursor: grab;
}
.globe-stage .maplibregl-canvas-container.maplibregl-interactive.maplibregl-touch-drag-pan,
.globe-stage [data-community-globe]:active {
  cursor: grabbing;
}
.globe-stage .maplibregl-control-container,
.globe-stage .maplibregl-ctrl-attrib,
.globe-stage .maplibregl-ctrl-logo {
  display: none;
}
.hero-copy {
  position: relative;
  z-index: 2;
  width: min(590px, 46vw);
  margin-left: auto;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.72);
}
.wb-eyebrow {
  margin: 0 0 12px;
  color: #ff5264;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.35rem, 4.7vw, 5.3rem);
  line-height: 1.02;
  color: #fff8ef;
  letter-spacing: 0;
}
.wb-body {
  margin: 18px 0 0;
  max-width: 56ch;
  color: rgba(238, 244, 249, 0.78);
  font-size: 1.04rem;
  line-height: 1.7;
}
.hero-live {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  grid-column: 1 / -1;
  margin: 0 0 -2px;
  color: #ffd79b;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.hero-live::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  content: "";
  background: #ff243d;
  box-shadow: 0 0 20px rgba(255, 36, 61, 0.8);
}
.home-proof {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 24px) clamp(18px, 3vw, 34px);
  margin-top: 26px;
}
.home-proof--impact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.home-proof > a,
.home-proof > span {
  display: grid;
  gap: 6px;
  min-height: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.home-proof--impact > span:first-child {
  grid-column: auto;
  min-height: 0;
}
.home-proof strong {
  color: #ffffff;
  font-size: clamp(1.85rem, 4vw, 4.25rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(255, 82, 100, 0.26), 0 18px 46px rgba(0, 0, 0, 0.68);
}
.home-proof > span > span,
.home-proof > a > span {
  color: rgba(232, 238, 246, 0.74);
  font-size: clamp(0.74rem, 1vw, 0.9rem);
  font-weight: 800;
  line-height: 1.35;
}
.home-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.home-actions .button.secondary {
  color: #fff8ef;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(18px);
}
.home-boundary {
  margin: 14px 0 0;
  color: rgba(224, 232, 239, 0.62);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .home-hero {
    --globe-size: min(102vh, 136vw);
    align-items: flex-end;
    justify-content: flex-start;
    padding-top: 104px;
    padding-bottom: 36px;
  }
  .globe-stage {
    left: clamp(-46vw, -34vw, -140px);
    top: 42%;
  }
  .hero-copy {
    width: min(760px, 100%);
    margin: 0;
  }
  .home-proof--impact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-proof--impact > span:first-child,
  .home-proof--impact > span:last-child { grid-column: auto; }
}

@media (max-width: 560px) {
  .home-hero {
    --globe-size: min(78vh, 162vw);
    min-height: 100svh;
    padding-top: 96px;
  }
  .globe-stage {
    left: -62vw;
    top: 36%;
  }
  .home-proof--impact { grid-template-columns: 1fr; }
  .home-proof--impact > span:first-child,
  .home-proof--impact > span:last-child { grid-column: auto; }
  .hero-copy h1 { font-size: 2.2rem; }
  .wb-body { font-size: 0.96rem; line-height: 1.55; }
  .home-proof strong { font-size: 2rem; }
}

/* ---- Services band ---- */
.services-band { position: relative; z-index: 2; background: var(--bg); }
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}
.service-card { border-radius: 8px; padding: 26px; }
.service-card::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  content: "";
  background: linear-gradient(var(--red-bright), var(--gold));
}
.service-index { color: var(--gold); font-weight: 900; font-size: 0.8rem; }
.service-card h3 { margin: 10px 0; font-size: 1.3rem; }
.service-card p { color: var(--muted); line-height: 1.7; margin: 0; }
.services-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 30px;
}
.services-cta .button { flex: 0 0 auto; }
.services-cta p {
  flex: 1 1 360px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

/* ---- Home media preview ---- */
.home-media-band {
  position: relative;
  z-index: 2;
  background: var(--bg-soft);
}
.home-media-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}
.home-media-preview .media-vcard {
  border-radius: 8px;
  overflow: hidden;
}
.home-media-preview a.media-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #111;
}
.home-media-preview .media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 0.55s ease, opacity 0.55s ease;
}
.home-media-preview .media-vcard:hover .media-thumb img {
  opacity: 1;
  transform: scale(1.05);
}
.home-media-preview .media-thumb::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.66)),
    linear-gradient(90deg, rgba(143, 9, 21, 0.16), transparent 55%);
}
.home-media-preview .media-platform,
.home-media-preview .media-play {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(18px);
  font-weight: 900;
}
.home-media-preview .media-platform {
  top: 10px;
  right: 10px;
  min-height: 26px;
  border-radius: 13px;
  padding: 0 9px;
  color: var(--silver);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.home-media-preview .media-play {
  left: 10px;
  bottom: 10px;
  min-height: 30px;
  border-radius: 15px;
  padding: 0 11px;
  font-size: 0.78rem;
}
.home-media-preview .media-vcard-body { padding: 14px 14px 16px; }
.home-media-preview .media-vcard-body h4 {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-media-preview .media-watch {
  display: inline-flex;
  margin-top: 12px;
  color: var(--text);
  font-weight: 900;
  font-size: 0.86rem;
  border-bottom: 2px solid var(--red-bright);
}
.home-media-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.home-media-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 24px;
}

@media (max-width: 900px) {
  .wb-eyebrow { margin-bottom: 8px; font-size: 0.7rem; letter-spacing: 0.08em; }
  .wb-body { margin-top: 12px; font-size: 0.96rem; line-height: 1.55; }
  .home-actions { margin-top: 16px; gap: 8px; }
  .home-boundary { font-size: 0.72rem; line-height: 1.45; margin-top: 10px; }
  .services-grid { grid-template-columns: 1fr; }
  .services-cta { align-items: stretch; }
  .services-cta .button { flex: 1 1 auto; }
  .home-media-preview { grid-template-columns: 1fr; }
}

@media (min-width: 901px) and (max-width: 1120px) {
  .home-proof { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .home-proof {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 12px;
  }
  .home-proof > a,
  .home-proof > span {
    min-height: 0;
    padding: 0;
    place-items: start;
    text-align: left;
  }
  .home-actions .button { min-height: 46px; }
}

/* ---------- desktop magnetic paging over the three home screens ----------
   proximity + scroll-snap-stop:always means tall content still scrolls
   freely, but a scroll gesture locks onto the next screen (hero → How MDJ
   helps → media). Footer is intentionally NOT a snap target. Disabled on
   touch, narrow viewports, and for reduced-motion users. */
@media (min-width: 821px) and (pointer: fine) {
  html { scroll-snap-type: y proximity; scroll-padding-top: 78px; }
  .home-hero,
  .services-band,
  .home-media-band {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }
  /* each home screen fills the viewport so the snap reads as full-page paging */
  .services-band,
  .home-media-band { min-height: 100svh; display: flex; align-items: center; }
  /* the flex child must shrink below its content width, or the student strip's
     scroll width pushes the whole page into horizontal overflow */
  .services-band > .section-inner,
  .home-media-band > .section-inner { flex: 1 1 auto; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-snap-type: none; }
}

/* ---------- student clips: seamless auto-scrolling marquee of tappable clips ---------- */
.students-band { margin-top: 32px; }
.students-marquee {
  overflow: hidden;
  /* fade the edges so clips slide in/out instead of hard-cutting */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.students-track {
  display: flex;
  gap: 12px;
  width: max-content;
  animation: students-scroll 60s linear infinite;
}
.students-marquee:hover .students-track,
.students-marquee:focus-within .students-track { animation-play-state: paused; }
@keyframes students-scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .students-track { animation: none; flex-wrap: wrap; justify-content: center; }
}
.student-clip {
  position: relative;
  margin: 0;
  flex: 0 0 150px; /* portrait clip in the marquee */
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--line);
  cursor: pointer;
}
.student-clip:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.student-clip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.student-clip__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff;
  font-size: 0.9rem; opacity: 0; transition: opacity 0.2s ease; pointer-events: none;
}
.student-clip:hover .student-clip__play, .student-clip:focus-visible .student-clip__play { opacity: 1; }
.student-clip figcaption {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.62);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

/* ---------- See real student life: MDJ campus-life clips (portrait, tappable) ---------- */
.home-media-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.life-card {
  position: relative;
  margin: 0;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--line);
  cursor: pointer;
}
.life-card:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.life-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.life-card__play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 48px; height: 48px; display: grid; place-items: center;
  border-radius: 50%; background: rgba(0, 0, 0, 0.5); color: #fff;
  font-size: 1.1rem; transition: background 0.2s ease, transform 0.2s ease;
}
.life-card:hover .life-card__play { background: var(--red-bright); transform: translate(-50%, -50%) scale(1.08); }
.life-card figcaption {
  position: absolute; left: 10px; bottom: 10px;
  padding: 4px 10px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.62); color: #fff;
  font-size: 0.82rem; font-weight: 700;
}
