/* ============================================================
   Keyside — rolling 3D disc, inline section under Rex's World.
   Additive. Does NOT touch Rex's World (world.js / #section-world).
   ============================================================ */

.disc-section {
  position: relative;
  width: 100%;
  min-height: 88vh;
  overflow: hidden;
  border-bottom: 1px solid var(--border, #151515);
  background:
    radial-gradient(120% 90% at 50% 40%, rgba(10,4,6,0.55) 0%, rgba(8,3,2,0.7) 55%, rgba(0,0,0,0.92) 100%),
    #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

/* Boer War snippet, dimmed, playing behind the Explore card-ring */
.disc-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  opacity: 0.6;
  filter: saturate(1.05) brightness(0.5) contrast(1.05);
}
.disc-bg-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(0,0,0,0) 25%, rgba(0,0,0,0.55) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.2) 45%, rgba(0,0,0,0.6) 100%);
}

.disc-sky {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 2;
}

/* Slim brand divider banner between Explore and the rails */
.rt-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px 22px;
  background: linear-gradient(180deg, #000 0%, rgba(12,7,4,0.96) 100%);
  border-top: 1px solid rgba(255,85,0,0.22);
  border-bottom: 1px solid rgba(255,85,0,0.22);
}
.rt-banner-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(0.95rem, 2.4vw, 1.5rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--off-white, #f0ede8);
  white-space: nowrap;
}
.rt-banner-text .orange { color: var(--orange, #ff5500); }
.rt-banner-line {
  height: 1px;
  flex: 1 1 auto;
  max-width: 220px;
  background: linear-gradient(90deg, transparent, rgba(255,85,0,0.55), transparent);
}

.disc-head {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  padding: 30px 26px 0;
  text-align: center;
  pointer-events: none;
}
.disc-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.7rem, 4.5vmin, 2.8rem);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--off-white, #f0ede8);
}
.disc-title .orange { color: var(--orange, #ff5500); }

.disc-hint {
  position: absolute;
  bottom: 26px; left: 0; right: 0;
  z-index: 4;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(240,237,232,.45);
  pointer-events: none;
}

/* ---- Animated Three-Body nav logo — three planets orbiting each other ---- */
.tb3-link { display: inline-flex; align-items: center; gap: 8px; }
.tb3-logo { position: relative; width: 22px; height: 22px; display: inline-block; flex: 0 0 auto; }
.tb3-orb { position: absolute; top: 50%; left: 50%; width: 0; height: 0; }
.tb3-orb::before { content: ''; position: absolute; border-radius: 50%; }
.tb3-o1 { animation: tb3spin 2.8s linear infinite; }
.tb3-o2 { animation: tb3spin 3.6s linear infinite reverse; animation-delay: -1.2s; }
.tb3-o3 { animation: tb3spin 2.1s linear infinite; animation-delay: -0.7s; }
.tb3-o1::before { width: 6px; height: 6px; left: 5px; top: -3px; background: #ff5500; box-shadow: 0 0 7px #ff5500; }
.tb3-o2::before { width: 5px; height: 5px; left: 7px; top: -2.5px; background: #33b6ff; box-shadow: 0 0 7px #33b6ff; }
.tb3-o3::before { width: 4px; height: 4px; left: 3px; top: -2px; background: #b06bff; box-shadow: 0 0 7px #b06bff; }
@keyframes tb3spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tb3-orb { animation: none; } }

/* ---- Rolling 3D disc ------------------------------------------------ */
.disc-stage {
  position: relative;
  z-index: 3;
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  perspective-origin: 50% 47%;
}
.disc-ring {
  position: relative;
  width: var(--card-w, 250px);
  height: var(--card-h, 355px);
  transform-style: preserve-3d;
  transform: translateY(-2%) rotateX(-7deg) rotateY(var(--spin, 0deg));
  will-change: transform;
  touch-action: pan-y;      /* vertical swipes scroll the page; horizontal swipes spin the wheel */
  cursor: grab;
}
.disc-ring:active { cursor: grabbing; }

.disc-card {
  position: absolute;
  inset: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  background: #0c0a09 center/cover no-repeat;
  border: 1px solid rgba(255,85,0,.22);
  box-shadow: 0 18px 50px rgba(0,0,0,.6);
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: box-shadow .35s ease, border-color .35s ease, filter .45s ease;
  filter: brightness(.5) saturate(.85);
}
.disc-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.1) 0%, rgba(0,0,0,.15) 45%, rgba(5,3,2,.9) 100%);
}
.disc-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(125deg, rgba(255,255,255,.14) 0%, rgba(255,255,255,0) 38%);
  mix-blend-mode: screen;
  opacity: .55;
}
.disc-card.is-music {
  background: linear-gradient(135deg, #1a0a02 0%, #3a1402 55%, #ff5500 220%);
}

.disc-card .card-label {
  position: absolute;
  left: 18px; right: 18px; bottom: 20px;
  z-index: 2;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: .05em;
  color: #fff;
  text-transform: uppercase;
  text-shadow: 0 2px 14px rgba(0,0,0,.7);
}
.disc-card .card-kicker {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: .6rem;
  letter-spacing: .26em;
  color: var(--orange, #ff5500);
  margin-bottom: 7px;
}
.disc-card .card-enter {
  position: absolute;
  top: 16px; left: 16px;
  z-index: 2;
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #000;
  background: var(--orange, #ff5500);
  padding: 5px 10px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
}

.disc-card.active {
  filter: brightness(1.05) saturate(1.1);
  border-color: var(--orange, #ff5500);
  box-shadow: 0 0 0 1px rgba(255,85,0,.5),
              0 22px 60px rgba(0,0,0,.7),
              0 0 60px rgba(255,85,0,.35);
}
.disc-card.active .card-enter { opacity: 1; transform: translateY(0); }

.disc-floor {
  position: absolute;
  z-index: 2;
  bottom: 14%;
  left: 50%;
  width: min(70vw, 720px);
  height: 120px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(255,85,0,.22) 0%, rgba(255,85,0,0) 70%);
  filter: blur(6px);
  pointer-events: none;
}

/* "REX TRUEFORM" title — longer than MEDICI, so size to fit and keep
   each word unbreakable (wraps cleanly between words on narrow screens). */
.site-title.title-rex {
  font-size: clamp(56px, 11.8vw, 152px);
  transform: perspective(900px) rotateX(11deg);   /* lean back so the extrusion reads 3D */
  transform-origin: 50% 100%;
}
.hero-word { display: inline-block; white-space: nowrap; }
/* Phones: stack the wordmark (REX over TRUEFORM) and give the block more room so
   nothing overruns the viewport edge — "TRUEFORM" and the sub-name are both wider
   than a 360px screen on one line. */
@media (max-width: 430px) {
  .site-title.title-rex { font-size: clamp(46px, 15vw, 66px); }
  .title-rex .hero-word { display: block; }         /* REX on top, TRUEFORM beneath */
  .site-sub-name { font-size: clamp(20px, 5.4vw, 27px); }
  .hero-orbit .hero-content { padding-left: 14px; padding-right: 14px; }
}

/* ---- Orbit hero (top "first page") --------------------------------- */
.hero-orbit {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;          /* mobile: use the small viewport so the bottom is reachable */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(120% 90% at 50% 42%, rgba(10,4,6,0) 0%, rgba(8,3,2,0.18) 60%, rgba(0,0,0,0.45) 100%);
}
@keyframes holoFlicker {
  0%, 100% { opacity: .85; }
  47% { opacity: .7; }
  50% { opacity: .96; }
  73% { opacity: .76; }
}
/* scrim — light touch for top/bottom text legibility (video is recessed now) */
.hero-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg,
    rgba(0,0,0,.5) 0%, rgba(0,0,0,.12) 30%, rgba(0,0,0,.16) 70%, rgba(0,0,0,.6) 100%);
}

/* Emblem badge behind the title — soft dark vignette so the words read, framed in orange */
.hero-emblem {
  position: absolute;
  left: 50%; top: 7%;
  transform: translateX(-50%);
  width: min(90vw, 640px);
  height: clamp(240px, 40vh, 400px);
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(ellipse 70% 68% at 50% 46%, rgba(6,3,2,.74), rgba(6,3,2,.42) 52%, rgba(6,3,2,0) 100%);
}
/* Neon dot-globe corner accent (globe.js) */
/* Black hole — sits deepest in the hero, centred in the Möbius gap behind the
   title. Heavily dimmed + masked so it's a presence you can feel, not a focal point. */
.hero-blackhole {
  position: absolute;
  top: 34%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(440px, 70vh, 820px);
  height: clamp(440px, 70vh, 820px);
  z-index: 0;                 /* behind globe (z2), Möbius and title — deepest hero layer */
  background: url('/static/blackhole.jpg') center/cover no-repeat;
  opacity: 0.6;
  filter: brightness(0.62) contrast(1.12) saturate(0.9);
  -webkit-mask-image: radial-gradient(closest-side, #000 52%, transparent 80%);
          mask-image: radial-gradient(closest-side, #000 52%, transparent 80%);
  pointer-events: none;
}

.hero-globe {
  position: absolute;
  top: 34%; left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(340px, 50vh, 600px);
  height: clamp(340px, 50vh, 600px);
  z-index: 2;                 /* behind the title (z6) + orbit disc, above the scrim */
  /* The Möbius stage (z4) covers this canvas, so its pointer handlers can never fire —
     but pointer-events:auto + touch-action:none still made it an 86vw scroll trap on
     phones. Let every gesture pass through. */
  pointer-events: none;
  cursor: grab;
  opacity: 0.95;
  filter: drop-shadow(0 0 54px rgba(45, 150, 255, 0.5));
  -webkit-mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 80%, transparent 100%);
}
@media (max-width: 640px) {
  .hero-globe { top: 30%; width: 86vw; height: 86vw; opacity: 0.9; }
  .hero-blackhole { top: 30%; width: 96vw; height: 96vw; }
}
.hero-orbit .disc-sky { position: absolute; inset: 0; z-index: 3; }

.hero-orbit-stage {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1600px;
  perspective-origin: 50% 50%;
}

/* ---- Möbius band (WebGL) — replaces the CSS card ring in the hero ---- */
.hero-mobius {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;                /* loops over the logo medallion (z-index 1) */
  display: block;
  touch-action: pan-y;       /* vertical swipes scroll the page; drag spins the band */
  cursor: grab;
  transform: translateY(-7%);  /* shift the loop up so it sits higher in the hero */
}
.hero-mobius:active { cursor: grabbing; }
.hero-mobius.is-grabbing { cursor: grabbing; }

.mobius-labels {
  position: absolute;
  inset: 0;
  z-index: 5;                /* above the band, below the title */
  pointer-events: none;
}
.mobius-label {
  position: absolute;
  transform: translate(-50%, -130%);
  padding: 9px 16px;
  border: 1px solid var(--orange, #ff5500);
  border-radius: 999px;
  background: rgba(8, 4, 2, .82);
  box-shadow: 0 0 26px rgba(255, 85, 0, .45), inset 0 0 14px rgba(255, 85, 0, .12);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity .18s ease;
}
.mobius-label.show { opacity: 1; }
.mobius-label .kicker {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: .56rem;
  letter-spacing: .24em;
  color: var(--orange, #ff5500);
  margin-bottom: 3px;
}
.mobius-label .enter {
  font-family: 'Space Mono', monospace;
  font-size: .62rem;
  letter-spacing: .14em;
  color: var(--orange, #ff5500);
  margin-left: 8px;
}

/* MEDICI + names overlaid near the top; never blocks the drag */
.hero-orbit .hero-content {
  position: absolute;
  top: 20%;                 /* just above centre, framed in the Möbius loop's gap */
  left: 0; right: 0;
  z-index: 6;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 4px 26px rgba(0,0,0,.8);
}

/* …but the Explore CTA inside it must stay clickable */
.hero-orbit .hero-cta { pointer-events: auto; }

.hero-scroll-cue {
  position: absolute;
  bottom: 24px; left: 0; right: 0;
  z-index: 6;
  text-align: center;
  font-family: 'Space Mono', monospace;
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(240,237,232,.5);
  pointer-events: none;
  animation: heroCueBob 2.4s ease-in-out infinite;
}
@keyframes heroCueBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

@media (max-width: 760px) {
  .disc-section { min-height: 76vh; }
  .disc-stage { perspective: 1100px; }
  .disc-card .card-label { font-size: 1.4rem; }
  .hero-orbit .hero-content { top: 19%; }   /* raised; sits in the upper Möbius gap on phones */
}
@media (prefers-reduced-motion: reduce) {
  .disc-card { transition: none; }
}
