/* ============================================================
   SERVICES.CSS — Services page specific styles
   ============================================================ */

/* ── SERVICES HERO ────────────────────────────────────────── */
.services-hero {
  position: relative;
  height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 5vw;
  z-index: 10;
  overflow: hidden;
}
/* Gradient bottom fade instead of hard border */
.services-hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 25vh;
  background: linear-gradient(to bottom, transparent 0%, var(--bg) 100%);
  pointer-events: none;
  z-index: 1;
}

.services-hero-heading {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 10vw, 12rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.services-hero-sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.3vw, 1.25rem);
  color: var(--text-secondary);
  font-weight: 300;
  max-width: 46ch;
  margin-bottom: 0;
}

/* Nav indicator showing total service count */
.services-count {
  position: absolute;
  right: 5vw;
  bottom: 3rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.services-count span {
  color: var(--accent);
}

/* ── SERVICES SCROLL ──────────────────────────────────────── */
#services-scroll {
  position: relative;
}

/* ── SERVICE BLOCK ────────────────────────────────────────── */
.service-block {
  position: relative;
  height: 900vh;
}

/* Gradient blend between services — seamless transition */
.service-block + .service-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20vh;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}

/* ── SERVICE CANVAS ───────────────────────────────────────── */
.service-canvas-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.service-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
/* Vignette — animation blends into background at edges */
.service-canvas-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 75% at 50% 50%,
    transparent 45%,
    rgba(6, 6, 10, 0.6) 75%,
    rgba(6, 6, 10, 0.95) 100%
  );
  pointer-events: none;
  z-index: 2;
}

/* ── C.O.R.E. COMING SOON ─────────────────────────────────── */
/* Animation plays at full quality — "Coming Soon" badge handles the messaging */
#block-core .service-canvas-wrap {
  pointer-events: none;
}

/* ── SERVICE TEXT SECTIONS ────────────────────────────────── */
.service-text-sections {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}
.service-section {
  position: absolute;
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 100vh;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.service-section .section-inner {
  pointer-events: auto;
  background: rgba(6, 6, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 2.2rem 2.8rem;
}
.service-section .section-body {
  margin-top: 1rem;
  color: var(--text-primary);
  opacity: 0.88;
  font-weight: 400;
  text-shadow: 0 1px 20px rgba(6, 6, 10, 0.8);
}
.service-section .section-heading {
  text-shadow: 0 2px 40px rgba(6, 6, 10, 0.9);
}
.service-section .section-label {
  text-shadow: 0 1px 12px rgba(6, 6, 10, 0.7);
}
.service-section .cta-button,
.service-section .cta-button-outline {
  pointer-events: auto;
}

/* Service number / index label */
.service-index {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

/* ── SERVICE STATS SECTION ────────────────────────────────── */
.service-stats-section {
  position: absolute;
  width: 100%;
  z-index: 4;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
  opacity: 0;
}

/* ── CSS-ONLY SECTIONS ────────────────────────────────────── */
.css-only-block {
  position: relative;
  height: 200vh;
}

/* Small breathing room between canvas service blocks and CSS-only blocks */
.service-block + .css-only-block {
  margin-top: 8vh;
}
.css-only-block + .css-only-block::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 20vh;
  background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}
.css-visual-wrap {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── SMART WEBSITES — DOT GRID ────────────────────────────── */
.node-grid {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(6, 1fr);
  padding: 8vw;
  gap: 0;
}
.node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.node-dot {
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0);
  transition: opacity 0.4s ease, transform 0.4s var(--ease-spring);
}
.node-dot.hub {
  width: 8px;
  height: 8px;
  background: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(26, 255, 213, 0.4);
}
.css-only-block.is-active .node-dot {
  opacity: 1;
  transform: scale(1);
}
.node-connector {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  transform: scaleX(0);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.6s var(--ease-out), opacity 0.4s ease;
}
.css-only-block.is-active .node-connector {
  transform: scaleX(1);
  opacity: 0.3;
}

/* Hub pulse animation */
@keyframes hubPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(26, 255, 213, 0.3); }
  50% { box-shadow: 0 0 20px rgba(26, 255, 213, 0.7), 0 0 40px rgba(26, 255, 213, 0.2); }
}
.css-only-block.is-active .node-dot.hub {
  animation: hubPulse 2.5s ease-in-out infinite;
  animation-delay: 2.5s;
}

/* ── REPUTATION MANAGEMENT — RADIAL ───────────────────────── */
.radial-visual {
  position: relative;
  width: min(40vmin, 320px);
  height: min(40vmin, 320px);
}
.radial-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 1s var(--ease-out), opacity 0.8s ease, filter 0.8s ease;
}
.radial-ring-outer {
  border: 1px solid rgba(124, 255, 168, 0.08);
  filter: blur(8px);
  transform: scale(1.2);
  opacity: 0;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgba(124, 255, 168, 0.06) 30%,
    transparent 60%,
    rgba(26, 255, 213, 0.04) 90%,
    transparent 100%
  );
  animation: outerSpin 8s linear infinite;
}
@keyframes outerSpin {
  from { transform: scale(1.2) rotate(0deg); }
  to   { transform: scale(1.2) rotate(360deg); }
}
.css-only-block.is-active .radial-ring-outer {
  opacity: 1;
}
.radial-ring-mid {
  inset: 15%;
  border: 1px solid rgba(26, 255, 213, 0.12);
  filter: blur(2px);
  transform: scale(0.6);
  opacity: 0;
}
.css-only-block.is-active .radial-ring-mid {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.3s;
}
.radial-ring-inner {
  inset: 30%;
  border: 1px solid rgba(124, 255, 168, 0.35);
  filter: blur(0);
  transform: scale(0.4);
  opacity: 0;
}
.css-only-block.is-active .radial-ring-inner {
  transform: scale(1);
  opacity: 1;
  transition-delay: 0.6s;
}
.radial-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  opacity: 0;
  transition: opacity 0.6s ease 1s;
  white-space: nowrap;
}
.css-only-block.is-active .radial-center { opacity: 0.8; }

.radial-signal {
  position: absolute;
  width: 5px;
  height: 5px;
  background: var(--accent);
  border-radius: 50%;
  transform: scale(0);
  opacity: 0;
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
}
.css-only-block.is-active .radial-signal {
  transform: scale(1);
  opacity: 0.8;
}

/* ── SERVICES FINAL CTA ───────────────────────────────────── */
.services-final-cta {
  position: relative;
  padding: clamp(3.5rem, 7vh, 7rem) 5vw;
  background: var(--bg);
  display: flex;
  align-items: flex-start;
}
/* Soft top fade into final CTA */
.services-final-cta::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 8vh;
  background: linear-gradient(to bottom, rgba(6, 6, 10, 0.6) 0%, transparent 100%);
  pointer-events: none;
}
.services-final-cta .section-inner {
  max-width: 44vw;
}

/* ── SERVICE MARQUEE ──────────────────────────────────────── */
.service-marquee-wrap {
  position: absolute;
  bottom: 8vh;
  left: 0; right: 0;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.service-marquee-wrap.visible { opacity: 1; }
.service-marquee-text {
  font-family: var(--font-display);
  font-size: clamp(5rem, 10vw, 13rem);
  font-weight: 800;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(237, 234, 229, 0.04);
  letter-spacing: -0.04em;
  will-change: transform;
  display: block;
  line-height: 1;
}

/* ── RESULT METRIC ────────────────────────────────────────── */
.result-metric {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1.8rem;
  padding-top: 1.5rem;
}
.result-metric-value {
  font-family: var(--font-mono);
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.result-metric-label {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── COUNTER MARQUEE (reverse-direction, subordinate) ─────── */
.service-marquee-counter {
  bottom: 1.2vh !important;
}
.service-marquee-counter .service-marquee-text {
  font-size: clamp(2.8rem, 5.5vw, 7.5rem);
  -webkit-text-stroke: 1px rgba(124, 255, 168, 0.05);
  letter-spacing: -0.03em;
}

/* ── MOBILE CANVAS BACKGROUND LAYER ─────────────────────── */
.mobile-bg-wrap {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.mobile-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #06060A 50% 50% / cover no-repeat;
  transition: opacity 0.75s ease;
  will-change: opacity;
  pointer-events: none;
}
.mobile-bg-b { opacity: 0; }

/* ── MOBILE ───────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mobile-bg-wrap { display: block; position: fixed; inset: 0; }

  /* Hero — transparent so canvas shows behind */
  .services-hero {
    background: transparent;
    z-index: 1;
    padding: 0 6vw 7vh;
    justify-content: flex-end;
    min-height: 100svh;
  }
  .services-hero::after { display: none; }
  .services-hero-heading {
    font-size: clamp(3.2rem, 13vw, 5.5rem);
    margin-bottom: 1rem;
  }
  .services-hero-sub {
    font-size: clamp(0.9rem, 3.5vw, 1.05rem);
    max-width: 100%;
  }
  .services-count { display: none; }
  .scroll-indicator { display: none; }

  /* Lift content above fixed canvas layer */
  #services-scroll { position: relative; z-index: 1; }

  /* Hide individual desktop canvases */
  .service-canvas-wrap { display: none; }

  /* ── STACKED LAYOUT — like page 1 mobile ── */
  .service-block {
    height: auto !important;
    z-index: 1;
  }
  /* Kill ALL dividers and block separators */
  .service-block + .service-block::before { display: none !important; }
  .service-block + .service-block { border-top: none !important; }
  .service-block + .css-only-block { margin-top: 0 !important; border-top: none !important; }
  .css-only-block + .css-only-block::before { display: none !important; }

  .service-text-sections { position: static !important; height: auto !important; }

  /* Force full-width stacked sections — override ALL desktop align-left/right padding */
  .service-section {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    opacity: 0;                  /* JS fades in */
    pointer-events: auto !important;
    min-height: 0 !important;
    padding: 0 0 0 0 !important;
    display: block !important;
    width: 100% !important;
    transition: none !important;
  }
  /* Guarantee padding regardless of align-left/align-right desktop overrides */
  .service-section,
  .service-section.align-left,
  .service-section.align-right {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 2.5rem !important;
  }

  /* Full-width text block — no box, no border, dark backing only */
  .service-section .section-inner {
    background: rgba(6, 6, 10, 0.82) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-radius: 0 !important;
    padding: 2rem 6vw !important;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Typography */
  .service-section .section-heading { font-size: clamp(1.7rem, 7vw, 2.6rem); }
  .service-section .section-body    { font-size: clamp(0.88rem, 3.5vw, 1rem); line-height: 1.65; }
  .service-index { font-size: 0.6rem; }

  /* Result metric */
  .result-metric-value { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .result-metric-label { font-size: 0.58rem; }
  .result-metric { border-top: none !important; }

  /* Coming soon badge */
  .coming-soon-badge { font-size: 0.58rem; padding: 0.28rem 0.7rem; }

  /* CTA outline button */
  .cta-button-outline { font-size: 0.65rem; padding: 0.7rem 1.4rem; }

  /* No block bg — mobile canvas handles it */
  #block-front-desk, #block-flo, #block-reach, #block-revolve,
  #block-plot, #block-ai-audit, #block-core, #block-core-vault {
    background: none !important;
  }

  /* CSS-only blocks */
  .css-only-block { height: auto !important; }
  .css-visual-wrap { position: relative; height: 260px; }

  /* Final CTA */
  .services-final-cta { padding: 4rem 6vw; }
  .services-final-cta .section-inner { max-width: 100% !important; border: none !important; }
  .services-final-cta::before { display: none; }

  /* Hide marquees */
  .service-marquee-wrap { display: none; }
}
