/* ==========================================================
   CINEMATIC LAYER — surreal billion-dollar polish.
   Marquee, live racing strip, orbital rings, mask reveals,
   aerospace brackets, stacking sections, glitch brand.
   Loaded after mega-upgrade.css.
   ========================================================== */

/* ── Brand marquee — large moving text strip ─────────── */
.cm-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 36px 0;
  margin: 60px 0;
  background: linear-gradient(180deg, transparent, rgba(0,230,240,0.04), transparent);
  border-block: 1px solid rgba(255,255,255,0.05);
  --cm-marquee-speed: 38s;
}
.cm-marquee-track {
  display: flex;
  gap: 60px;
  align-items: center;
  width: max-content;
  animation: cm-marquee-scroll var(--cm-marquee-speed) linear infinite;
  will-change: transform;
}
.cm-marquee-item {
  font-family: 'Geist', 'Titillium Web', sans-serif;
  font-size: clamp(48px, 7vw, 96px);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,0.18);
  white-space: nowrap;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 60px;
}
.cm-marquee-item::after {
  content: "•";
  -webkit-text-stroke: 0;
  color: var(--rd-accent, #00e6f0);
  font-size: 0.4em;
  text-shadow: 0 0 16px var(--rd-accent, #00e6f0);
}
@keyframes cm-marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-50% - 30px)); }
}

/* ── Live racing strip — pinned data ticker ─────────── */
.cm-livestrip {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  max-width: 1240px;
  margin: 60px auto;
  background: linear-gradient(180deg, rgba(8,10,16,0.7), rgba(4,5,8,0.85));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  overflow: hidden;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 30px 80px -40px rgba(0,230,240,0.18);
}
.cm-livestrip::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,230,240,0.6), transparent);
}
.cm-live-item {
  padding: 22px 26px;
  border-right: 1px solid rgba(255,255,255,0.05);
  display: flex; flex-direction: column; gap: 6px;
  position: relative;
}
.cm-live-item:last-child { border-right: none; }
.cm-live-label {
  font-family: 'Geist Mono', monospace;
  font-size: 9px; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--rd-accent, #00e6f0);
  display: flex; align-items: center; gap: 6px;
}
.cm-live-label::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%;
  background: #00e6a0;
  box-shadow: 0 0 0 0 rgba(0,230,160,0.6);
  animation: mu-pulse-ring 2s ease-out infinite;
}
.cm-live-value {
  font-family: 'Geist Mono', monospace;
  font-size: 22px; font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  transition: color .3s ease;
}
.cm-live-value.cm-flash {
  color: var(--rd-accent, #00e6f0);
  text-shadow: 0 0 18px rgba(0,230,240,0.6);
}
.cm-live-sub {
  font-family: 'Geist Mono', monospace;
  font-size: 10px;
  color: var(--rd-text-mute, #5a5d66);
  letter-spacing: 0.06em;
}

/* ── Orbital rings around hero tagline ──────────────── */
.cm-orbit {
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  border: 1px solid rgba(0,230,240,0.18);
  animation: cm-orbit-spin 24s linear infinite;
  inset: -40%;
}
.cm-orbit::before, .cm-orbit::after {
  content: "";
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rd-accent, #00e6f0);
  box-shadow: 0 0 18px var(--rd-accent, #00e6f0);
}
.cm-orbit::before { top: -4px; left: 50%; transform: translateX(-50%); }
.cm-orbit::after  { bottom: -4px; left: 50%; transform: translateX(-50%); }
.cm-orbit.alt {
  inset: -30%;
  border-color: rgba(180,90,255,0.18);
  animation-duration: 18s;
  animation-direction: reverse;
}
.cm-orbit.alt::before, .cm-orbit.alt::after {
  background: #b85aff;
  box-shadow: 0 0 16px #b85aff;
}
@keyframes cm-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ── Mask reveal — headline wipe-in on enter ─────── */
[data-cm-reveal] {
  --cm-reveal-progress: 0;
  background-image: linear-gradient(110deg,
    var(--rd-accent, #00e6f0) 0%,
    #ffffff 35%, #ffffff 65%,
    var(--rd-accent, #00e6f0) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.1s cubic-bezier(.7,0,.2,1),
              background-position 1.4s ease;
}
[data-cm-reveal].cm-revealed {
  clip-path: inset(0 0 0 0);
  background-position: -100% 0;
}

/* ── Aerospace corner brackets — premium tile look ─ */
.cm-bracketed {
  position: relative;
}
.cm-bracketed::before, .cm-bracketed::after,
.cm-bracketed > .cm-br-tl, .cm-bracketed > .cm-br-tr,
.cm-bracketed > .cm-br-bl, .cm-bracketed > .cm-br-br {
  content: "";
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(0,230,240,0.45);
  border-style: solid;
  pointer-events: none;
  transition: all .3s cubic-bezier(.2,.7,.2,1);
}
.cm-bracketed::before { top: -6px; left: -6px; border-width: 1px 0 0 1px; }
.cm-bracketed::after  { bottom: -6px; right: -6px; border-width: 0 1px 1px 0; }
.cm-bracketed:hover::before { width: 28px; height: 28px; border-color: var(--rd-accent, #00e6f0); }
.cm-bracketed:hover::after  { width: 28px; height: 28px; border-color: var(--rd-accent, #00e6f0); }

/* ── Glitch hover on brand title ─────────────────── */
.brand-title:hover, header.top-bar .brand-title:hover {
  animation: cm-glitch .35s steps(2) 1;
}
@keyframes cm-glitch {
  0%   { text-shadow: 0 0 0 transparent; transform: skewX(0); }
  20%  { text-shadow: -2px 0 #00e6f0, 2px 0 #ff5da0; transform: skewX(-1deg); }
  40%  { text-shadow:  2px 0 #00e6f0, -2px 0 #ff5da0; transform: skewX( 1deg); }
  60%  { text-shadow: -1px 0 #00e6f0, 1px 0 #ff5da0; transform: skewX(0); }
  100% { text-shadow: 0 0 0 transparent; transform: skewX(0); }
}

/* ── Stacking sections — sticky scroll stack ─────── */
[data-cm-stack] {
  --cm-stack-gap: 8vh;
  position: relative;
}
[data-cm-stack] > section, [data-cm-stack] > .cm-stack-step {
  position: sticky;
  top: var(--cm-stack-gap);
  margin-bottom: 22vh;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(22,24,32,0.8), rgba(8,10,16,0.85));
  border: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(20px) saturate(1.1);
  -webkit-backdrop-filter: blur(20px) saturate(1.1);
  padding: 60px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.06),
    0 30px 80px -36px rgba(0,0,0,0.7);
}

/* ── Premium upgrade — global headline shimmer-strong ─ */
h1.hero-title, h1.hero-tagline {
  filter: drop-shadow(0 0 30px rgba(0,230,240,0.18));
}

/* ── Page progress orb (bottom-right) ─────────────── */
#cm-progress-orb {
  position: fixed;
  right: 24px; bottom: 24px;
  width: 44px; height: 44px;
  z-index: 99997;
  pointer-events: auto;
  cursor: pointer;
  display: none;
  align-items: center; justify-content: center;
  font-family: 'Geist Mono', monospace;
  font-size: 10px; font-weight: 600;
  color: var(--rd-accent, #00e6f0);
  background: rgba(8,10,16,0.7);
  border-radius: 50%;
  border: 1px solid rgba(0,230,240,0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform .25s ease, box-shadow .25s ease;
  letter-spacing: 0.04em;
}
#cm-progress-orb.visible { display: flex; }
#cm-progress-orb:hover {
  transform: scale(1.08);
  box-shadow: 0 0 28px rgba(0,230,240,0.45);
}
#cm-progress-orb svg {
  position: absolute; inset: -1px;
  width: calc(100% + 2px); height: calc(100% + 2px);
  transform: rotate(-90deg);
  pointer-events: none;
}
#cm-progress-orb svg circle {
  fill: none;
  stroke: var(--rd-accent, #00e6f0);
  stroke-width: 2;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--rd-accent, #00e6f0));
}

/* ── Spotlight on section in view (ambient highlight) ─ */
section[data-cm-spotlight] {
  transition: transform .6s cubic-bezier(.2,.7,.2,1);
}
section[data-cm-spotlight].cm-active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 50% at 50% 0%, rgba(0,230,240,0.06), transparent 70%);
  z-index: -1;
}

@media (prefers-reduced-motion: reduce) {
  .cm-marquee-track { animation-play-state: paused; }
  .cm-orbit, .cm-orbit.alt { animation: none; }
  [data-cm-reveal] {
    clip-path: none !important;
    -webkit-text-fill-color: #fff !important;
  }
}

/* Mobile toning */
@media (max-width: 768px) {
  .cm-marquee { padding: 24px 0; margin: 36px 0; }
  .cm-livestrip { grid-template-columns: 1fr 1fr; }
  .cm-live-item:nth-child(2n) { border-right: none; }
  .cm-live-item { border-bottom: 1px solid rgba(255,255,255,0.04); }
  [data-cm-stack] > section, [data-cm-stack] > .cm-stack-step {
    padding: 36px 24px;
  }
}
