/* ==========================================================================
   CredSide hero cinematic upgrade — layered readiness stage + motion
   ========================================================================== */

.cs-hero-cinematic {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: clamp(2.25rem, 1.5rem + 3vw, 4.25rem) clamp(2.5rem, 1.7rem + 3vw, 4.5rem);
}

.cs-hero-atmosphere {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.cs-hero-mesh {
  position: absolute;
  inset: -10% -5%;
  background:
    radial-gradient(40% 50% at 78% 35%, rgba(27, 158, 117, 0.18), transparent 70%),
    radial-gradient(35% 45% at 18% 20%, rgba(32, 120, 180, 0.12), transparent 65%),
    radial-gradient(50% 40% at 55% 90%, rgba(11, 27, 43, 0.08), transparent 70%),
    linear-gradient(160deg, #F5F8FC 0%, #E7EEF7 48%, #DCE7F2 100%);
  animation: cs-mesh-drift 18s ease-in-out infinite alternate;
}

.cs-hero-gridlines {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(11, 27, 43, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 27, 43, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 70% 70% at 70% 40%, #000 20%, transparent 75%);
}

.cs-hero-orbs .cs-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
}

.cs-orb-a {
  width: 22rem;
  height: 22rem;
  right: -4rem;
  top: 8%;
  background: rgba(27, 158, 117, 0.22);
  animation: cs-orb-float 14s ease-in-out infinite;
}

.cs-orb-b {
  width: 14rem;
  height: 14rem;
  right: 28%;
  bottom: 8%;
  background: rgba(45, 110, 180, 0.16);
  animation: cs-orb-float 17s ease-in-out infinite reverse;
}

.cs-orb-c {
  width: 10rem;
  height: 10rem;
  left: 42%;
  top: 12%;
  background: rgba(27, 158, 117, 0.1);
  animation: cs-orb-float 12s ease-in-out infinite 1s;
}

.cs-hero-paths {
  position: absolute;
  inset: 12% 8% 18% 45%;
  background:
    linear-gradient(115deg, transparent 0%, rgba(27, 158, 117, 0.12) 42%, transparent 58%),
    linear-gradient(155deg, transparent 20%, rgba(11, 27, 43, 0.06) 50%, transparent 70%);
  opacity: 0.7;
  mask-image: linear-gradient(90deg, transparent, #000 30%, #000 80%, transparent);
  animation: cs-path-shift 10s linear infinite;
}

.cs-hero-cinematic > .cs-container {
  position: relative;
  z-index: 1;
}

.cs-access-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 var(--cs-space-md);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(27, 158, 117, 0.28);
  background: rgba(255, 255, 255, 0.72);
  color: var(--cs-ink-soft);
  font-size: var(--cs-text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cs-access-badge::before {
  content: "";
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--cs-accent);
  box-shadow: 0 0 0 0 rgba(27, 158, 117, 0.45);
  animation: cs-badge-pulse 2.8s ease-out infinite;
}

.cs-hero-cinematic .cs-hero-title {
  font-size: clamp(2.5rem, 1.7rem + 2.8vw, 4rem);
  max-width: 12ch;
}

.cs-hero-cinematic .cs-hero-lead {
  max-width: 34rem;
}

/* Motion enhances, never hides — content visible on first paint / PDF / delayed JS */
.cs-hero-reveal > * {
  opacity: 1;
  transform: none;
  animation: cs-hero-rise 0.65s var(--cs-ease);
}

.cs-hero-reveal > *:nth-child(1) { animation-delay: 0.02s; }
.cs-hero-reveal > *:nth-child(2) { animation-delay: 0.06s; }
.cs-hero-reveal > *:nth-child(3) { animation-delay: 0.1s; }
.cs-hero-reveal > *:nth-child(4) { animation-delay: 0.14s; }
.cs-hero-reveal > *:nth-child(5) { animation-delay: 0.18s; }
.cs-hero-reveal > *:nth-child(6) { animation-delay: 0.22s; }
.cs-hero-reveal > *:nth-child(7) { animation-delay: 0.26s; }

.cs-hero-stage {
  position: relative;
  /* Do not stretch to the taller copy column — that created a blank media void */
  align-self: center;
  width: 100%;
  min-height: 0;
  height: fit-content;
  display: block;
  transform-style: preserve-3d;
  will-change: transform;
  padding: 0;
}

.cs-hero-media {
  position: absolute;
  inset: 0;
  border-radius: 1.5rem;
  overflow: hidden;
  background: #0B1B2B;
  box-shadow:
    0 30px 80px rgba(11, 27, 43, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.35) inset;
}

.cs-hero-poster,
.cs-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cs-hero-video {
  opacity: 0;
  transition: opacity 0.6s var(--cs-ease);
}

.cs-hero-video.is-ready {
  opacity: 1;
}

.cs-hero-media-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(245, 248, 252, 0.55) 0%, rgba(11, 27, 43, 0.18) 42%, rgba(11, 27, 43, 0.42) 100%),
    radial-gradient(60% 70% at 70% 40%, transparent 0%, rgba(11, 27, 43, 0.35) 100%);
  pointer-events: none;
}

.cs-dashboard-layered {
  position: relative;
  z-index: 2;
  margin: 0;
  width: 100%;
  max-width: 27rem;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow:
    0 2px 8px rgba(11, 27, 43, 0.05),
    0 28px 70px rgba(11, 27, 43, 0.14),
    0 0 0 1px rgba(27, 158, 117, 0.08);
}

.cs-dashboard-layered::after {
  content: "";
  position: absolute;
  inset: -18% -12% auto auto;
  width: 12rem;
  height: 12rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(27, 158, 117, 0.28), transparent 70%);
  z-index: -1;
  filter: blur(8px);
  pointer-events: none;
}

.cs-dash-main {
  position: relative;
}

.cs-dash-card {
  display: block;
}

.cs-dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.cs-dash-kicker,
.cs-dash-section-label {
  font-size: var(--cs-text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-steel-light);
  margin-bottom: 0.35rem;
}

.cs-dash-goal {
  font-family: var(--font-display);
  font-size: var(--cs-text-xl);
  font-weight: 500;
  line-height: 1.25;
  color: var(--cs-ink);
}

.cs-dash-factors {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0 0 1rem;
  padding: 0.85rem 0.95rem;
  border-radius: var(--cs-radius-lg);
  background: rgba(245, 248, 252, 0.9);
  border: 1px solid var(--cs-border);
}

.cs-dash-factors li {
  font-size: var(--cs-text-sm);
  color: var(--cs-ink-soft);
  font-weight: 600;
}

.cs-dash-action {
  padding: 0.9rem 1rem;
  border-radius: var(--cs-radius-lg);
  background: rgba(27, 158, 117, 0.08);
  border: 1px solid rgba(27, 158, 117, 0.16);
}

.cs-dash-action p:last-child {
  font-size: var(--cs-text-sm);
  color: var(--cs-ink);
  line-height: 1.5;
  margin: 0;
}

.cs-connector {
  height: 1px;
  margin: 0.85rem 0 1rem;
  background: linear-gradient(90deg, rgba(27, 158, 117, 0.55), rgba(27, 158, 117, 0.05));
  position: relative;
}

.cs-connector::after {
  content: "";
  position: absolute;
  top: -3px;
  left: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cs-accent);
  box-shadow: 0 0 0 4px rgba(27, 158, 117, 0.15);
  animation: cs-connector-travel 4.5s ease-in-out infinite;
}

.cs-dash-factors li {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cs-factor-dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--cs-accent);
  opacity: 0.75;
  flex-shrink: 0;
}

.cs-status-pulse {
  position: relative;
}

.cs-status-pulse::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 1px solid rgba(27, 158, 117, 0.35);
  animation: cs-status-ring 2.6s ease-out infinite;
  pointer-events: none;
}

.cs-float-chip {
  position: absolute;
  z-index: 3;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(11, 27, 43, 0.08);
  box-shadow: 0 8px 24px rgba(11, 27, 43, 0.08);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cs-ink-soft);
}

.cs-float-chip-a { top: 0.35rem; right: 0.5rem; animation: cs-chip-float 5.5s ease-in-out infinite; }
.cs-float-chip-b { top: 42%; left: -0.65rem; animation: cs-chip-float 6.2s ease-in-out infinite 0.4s; }
.cs-float-chip-c { bottom: 1.4rem; right: -0.4rem; animation: cs-chip-float 5.8s ease-in-out infinite 0.8s; }

.cs-mini-card {
  position: absolute;
  z-index: 3;
  width: 8.5rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(11, 27, 43, 0.08);
  box-shadow: 0 14px 36px rgba(11, 27, 43, 0.1);
  backdrop-filter: blur(10px);
}

.cs-mini-card span {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cs-steel-light);
  margin-bottom: 0.2rem;
}

.cs-mini-card strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--cs-ink);
}

.cs-mini-card-a {
  left: -0.75rem;
  bottom: 34%;
  animation: cs-chip-float 6.5s ease-in-out infinite 0.2s;
}

.cs-mini-card-b {
  right: -0.85rem;
  top: 22%;
  animation: cs-chip-float 7s ease-in-out infinite 0.6s;
}

@keyframes cs-mesh-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-1.5%, 1.5%, 0) scale(1.03); }
}

@keyframes cs-orb-float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(2%, -3%, 0); }
}

@keyframes cs-path-shift {
  from { transform: translateX(-4%); opacity: 0.45; }
  50% { opacity: 0.8; }
  to { transform: translateX(4%); opacity: 0.45; }
}

@keyframes cs-hero-rise {
  from { opacity: 1; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cs-badge-pulse {
  0% { box-shadow: 0 0 0 0 rgba(27, 158, 117, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(27, 158, 117, 0); }
  100% { box-shadow: 0 0 0 0 rgba(27, 158, 117, 0); }
}

@keyframes cs-connector-travel {
  0% { left: 0; opacity: 0.2; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { left: calc(100% - 7px); opacity: 0.2; }
}

@keyframes cs-status-ring {
  0% { transform: scale(0.96); opacity: 0.7; }
  70% { transform: scale(1.08); opacity: 0; }
  100% { opacity: 0; }
}

@keyframes cs-chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* Desktop composition */
@media (min-width: 768px) {
  .cs-hero-cinematic .cs-hero-grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: clamp(1.5rem, 1rem + 1.5vw, 2.75rem);
    align-items: center;
  }

  .cs-hero-stage {
    min-height: 0;
    align-self: center;
  }

  .cs-dashboard-layered {
    /* Slight inset so poster/video frames the interface without a large empty void */
    margin: 1rem 0.9rem 1rem 1.35rem;
    width: auto;
    max-width: none;
  }
}

@media (min-width: 1024px) {
  .cs-dashboard-layered {
    margin: 1.15rem 1rem 1.15rem 1.5rem;
  }
}

/* Mobile: stack, calm, no float collisions */
@media (max-width: 767px) {
  .cs-hero-cinematic {
    padding-block: 1.25rem 1.75rem;
  }

  .cs-hero-cinematic .cs-eyebrow {
    margin-bottom: 0.45rem;
  }

  .cs-hero-cinematic .cs-access-badge {
    margin-bottom: 0.65rem;
  }

  .cs-hero-cinematic .cs-hero-title {
    font-size: clamp(1.85rem, 1.55rem + 2vw, 2.35rem);
    max-width: none;
    margin-bottom: 0.65rem;
  }

  .cs-hero-cinematic .cs-hero-lead {
    margin-bottom: 0.85rem;
    font-size: var(--cs-text-sm);
    line-height: 1.55;
  }

  .cs-hero-cinematic .cs-cta-row {
    gap: 0.5rem;
  }

  .cs-hero-cinematic .cs-trust-line {
    margin-top: 0.75rem;
    padding-top: 0.65rem;
  }

  .cs-hero-cinematic .cs-powered {
    margin-top: 0.45rem;
  }

  .cs-hero-stage {
    min-height: 0;
    margin-top: 0.75rem;
    display: block;
    padding: 0;
    align-self: stretch;
  }

  .cs-hero-media {
    inset: auto;
    height: 5.5rem;
    position: relative;
    margin: 0 0 -2.5rem;
    border-radius: 1.15rem;
    width: 100%;
  }

  .cs-hero-video {
    display: none;
  }

  .cs-float-chip,
  .cs-mini-card {
    display: none;
  }

  .cs-dashboard-layered {
    margin: 0;
    max-width: none;
    width: 100%;
    padding: 0.95rem 1rem 1.05rem;
  }

  .cs-dashboard-layered .cs-dash-goal {
    font-size: var(--cs-text-lg);
  }

  .cs-dashboard-layered .cs-dash-factors {
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.8rem;
  }

  .cs-hero-paths {
    inset: auto 0 0 0;
    height: 40%;
  }

  .cs-orb-a,
  .cs-orb-b {
    opacity: 0.35;
  }
}

@media (max-width: 430px) {
  .cs-hero-cinematic {
    padding-block: 1.15rem 1.5rem;
  }

  .cs-hero-cinematic .cs-hero-title {
    max-width: none;
  }

  .cs-hero-media {
    height: 5.25rem;
    margin-bottom: -2.35rem;
  }
}

/* Reduced motion: poster + static atmosphere only */
@media (prefers-reduced-motion: reduce) {
  .cs-hero-mesh,
  .cs-hero-orbs .cs-orb,
  .cs-hero-paths,
  .cs-float-chip,
  .cs-mini-card,
  .cs-status-pulse::after,
  .cs-connector::after,
  .cs-access-badge::before,
  .cs-hero-reveal > * {
    animation: none !important;
  }

  .cs-hero-reveal > * {
    opacity: 1;
    transform: none;
  }

  .cs-hero-video {
    display: none !important;
  }

  .cs-hero-stage {
    transform: none !important;
  }
}
