/* =====================================================
   MASTER.CSS — RankBoost Agency
   Global styles shared across ALL pages.
   Brand: --primary-purple #7B5DFF | --accent-lime #D4FF12

   ▸ DESIGN SYSTEM REFERENCE
   ─────────────────────────────────────────────────────
   Typography scale (use these, never raw px values):
     --fs-eyebrow : 13px  — section kickers / labels
     --fs-h1      : clamp(36px, 4.2vw, 58px)
     --fs-h2      : clamp(30px, 3.2vw, 46px)
     --fs-h3-lg   : clamp(22px, 2vw, 28px)  — card/block headings
     --fs-body-lg : 18px  — hero lede / section intro paragraphs
     --fs-body    : 16px  — default body
     --fs-body-sm : 15px  — secondary body copy

   Section spacing:
     .section-space : 112px top/bottom  (72px mobile)

   Heading wrappers (use ONE of these everywhere):
     .section-heading        — centred, max-width 790px  (homepage standard)
     .section-heading.left   — left-aligned variant
     .section-heading.narrow — max-width 640px for tighter layouts

   Eyebrow / kicker class: .eyebrow  (single authoritative definition)
   ─────────────────────────────────────────────────────
   ===================================================== */

/* ===== CSS VARIABLES ===== */
:root {
  /* ── Brand colours ── */
  --primary-purple: #7B5DFF;
  --accent-lime: #D4FF12;
  --premium-black: #000000;
  --ink: #111111;
  --muted: #63636b;
  --muted-alpha: rgba(0, 0, 0, 0.62);
  --soft-gray: #f7f7fa;
  --line: rgba(0, 0, 0, 0.1);

  /* ── Typography scale ── */
  --fs-eyebrow: 13px;
  --fs-h1: clamp(36px, 4.2vw, 58px);
  --fs-h2: clamp(30px, 3.2vw, 46px);
  --fs-h3-lg: clamp(22px, 2vw, 28px);
  --fs-body-lg: 18px;
  --fs-body: 16px;
  --fs-body-sm: 15px;

  /* ── Section spacing ── */
  --section-gap: 112px;
  --section-gap-mobile: 72px;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* prevent horizontal scroll from any overflowing child */
}

body.nav-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  height: auto;
  display: block;
}

/* =====================================================
   GLOBAL CTA BUTTONS
   Defined in master.css so every page can use them.
   ===================================================== */
.primary-cta,
.secondary-cta {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 8px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 900;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  cursor: pointer;
  border: none;
  line-height: 1;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.primary-cta {
  background: var(--primary-purple);
  color: #ffffff;
  box-shadow: 0 22px 45px rgba(123, 93, 255, 0.26);
}

.primary-cta .arrow-icon {
  color: var(--accent-lime);
}

.primary-cta.light {
  background: var(--accent-lime);
  color: #000000;
  box-shadow: 0 12px 32px rgba(212, 255, 18, 0.22);
}

.primary-cta.light .arrow-icon {
  color: #000000;
}

.secondary-cta {
  background: #ffffff;
  color: #000000;
  border: 1.5px solid rgba(0, 0, 0, 0.14);
}

.primary-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 50px rgba(123, 93, 255, 0.32);
}

.primary-cta.light:hover {
  transform: translateY(-2px);
  background: #c8f000;
  box-shadow: 0 16px 36px rgba(212, 255, 18, 0.28);
}

.secondary-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 0, 0, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

.primary-cta:active,
.secondary-cta:active {
  transform: translateY(0px);
}

.primary-cta:focus-visible,
.secondary-cta:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 3px;
}

/* ===== ICON HELPERS ===== */
.arrow-icon,
.chevron-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.arrow-icon svg,
.chevron-icon svg {
  width: 100%;
  height: 100%;
}

/* =====================================================
   GLOBAL DESIGN SYSTEM
   Single source of truth for typography & spacing.
   Use these classes on every page — never redefine
   them in page-level CSS files.
   ===================================================== */

/* ── Eyebrow / section kicker ──────────────────────── */
.eyebrow,
.section-kicker {
  display: block;
  color: var(--primary-purple);
  font-size: var(--fs-eyebrow);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

/* ── Section heading wrapper ────────────────────────
   Default: centred, max-width 790px (homepage standard)
   Modifier .left  → left-aligned
   Modifier .narrow → tighter max-width (640px)
   ─────────────────────────────────────────────────── */
.section-heading {
  max-width: 790px;
  margin: 0 auto;
  text-align: center;
}

.section-heading.left {
  margin: 0;
  text-align: left;
}

.section-heading.narrow {
  max-width: 640px;
}

/* ── H1 (page heroes) ───────────────────────────────  */
.section-heading h1,
.hero-h1 {
  color: #000000;
  font-size: var(--fs-h1);
  font-weight: 800;
  line-height: 1.12;
  margin-top: 18px;
}

/* ── H2 (section headings) ──────────────────────────  */
.section-heading h2,
.section-title {
  color: #000000;
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.16;
  margin-top: 16px;
}

/* ── Section intro paragraph ────────────────────────  */
.section-heading p,
.section-lede {
  color: var(--muted-alpha);
  font-size: var(--fs-body-lg);
  line-height: 1.8;
  margin-top: 20px;
}

/* ── Section spacing utility ────────────────────────  */
.section-space {
  padding-top: var(--section-gap);
  padding-bottom: var(--section-gap);
}

@media (max-width: 767px) {
  .section-space {
    padding-top: var(--section-gap-mobile);
    padding-bottom: var(--section-gap-mobile);
  }
}

/* ── Dark section overrides (on black backgrounds) ── */
.section-heading.on-dark h2,
.section-heading.on-dark .eyebrow {
  color: #ffffff;
}

.section-heading.on-dark p {
  color: rgba(255, 255, 255, 0.62);
}

/* ── .section-head — left-aligned alias used by growth/ai/seo pages ─
   Identical typography to .section-heading but left-aligned and
   no auto-centering margin. Keeps HTML backward-compatible.
   ─────────────────────────────────────────────────────────────────── */
.section-head {
  max-width: 790px;
  margin-bottom: 56px;
  text-align: left;
}

.section-head .eyebrow {
  /* inherits from .eyebrow */
}

.section-head h2 {
  color: #000000;
  font-size: var(--fs-h2);
  font-weight: 800;
  line-height: 1.16;
  margin: 16px 0 0;
}

.section-head p {
  color: var(--muted-alpha);
  font-size: var(--fs-body-lg);
  line-height: 1.8;
  margin-top: 20px;
}

/* Centered variant when inside a center-layout section */
.section-head.centered {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ── Hero lede paragraph ─────────────────────────────
   Large intro copy beneath the H1 on hero sections.
   Used by: home, growth-services, ai-solutions, about.
   ─────────────────────────────────────────────────── */
.hero-lede {
  color: var(--muted-alpha);
  font-size: var(--fs-body-lg);
  line-height: 1.8;
  max-width: 620px;
  margin-top: 24px;
  margin-bottom: 0;
}

/* On dark hero backgrounds */
.hero-lede.on-dark {
  color: rgba(255, 255, 255, 0.68);
}

/* ── Unified breadcrumb ──────────────────────────────
   Single class used on every page (hero breadcrumb nav).
   Previously scattered as .services-breadcrumb,
   .gs-breadcrumb, .ais-breadcrumb — all unified here.
   ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: rgba(0, 0, 0, 0.45);
  transition: color 160ms ease;
}

.breadcrumb a:hover {
  color: var(--primary-purple);
}

/* Separator slash — keep faint */
.breadcrumb .bc-sep {
  color: rgba(0, 0, 0, 0.25);
  font-weight: 400;
  user-select: none;
}

/* Current / active page label — clearly readable */
.breadcrumb .bc-current {
  color: #000000;
  font-weight: 800;
}

/* On dark hero backgrounds */
.breadcrumb.on-dark,
.breadcrumb.on-dark a {
  color: rgba(255, 255, 255, 0.5);
}

.breadcrumb.on-dark a:hover {
  color: #ffffff;
}

.breadcrumb.on-dark .bc-current {
  color: #ffffff;
}

/* ===== SITE HEADER ===== */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: box-shadow 220ms ease, background 220ms ease;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.08);
}

/* ===== BRAND LOGO ===== */
.brand-mark {
  display: inline-flex;
  align-items: center;
  color: #000000;
  /* Always on top of the mobile overlay */
  position: relative;
  z-index: 300;
}

.brand-mark img {
  width: 148px;
  max-height: 58px;
  height: auto;
}

/* ===== DESKTOP MENU ===== */
.desktop-menu {
  display: none;
  align-items: center;
  gap: 24px;
  color: rgba(0, 0, 0, 0.68);
  font-size: 14px;
  font-weight: 700;
}

.desktop-menu a {
  transition: color 180ms ease;
  white-space: nowrap;
}

.desktop-menu a:hover {
  color: var(--primary-purple);
}

.desktop-menu a.nav-active {
  color: var(--primary-purple);
  position: relative;
}

.desktop-menu a.nav-active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-purple);
  border-radius: 2px;
}

/* ===== SPLIT CTA (header, desktop only) ===== */
.split-cta {
  display: none;           /* hidden on mobile by default */
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.11);
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  font-family: "Poppins", ui-sans-serif, system-ui, sans-serif;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
  transition: box-shadow 180ms ease, transform 180ms ease;
  -webkit-tap-highlight-color: transparent;
}

.split-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.18);
}

.split-cta span {
  display: inline-flex;
  align-items: center;
  padding: 13px 18px;
  line-height: 1;
}

/* Lime icon block — explicit class avoids span:last-child collisions */
.split-cta .split-cta-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-lime);
  color: #000000;
  padding: 13px 12px;
  flex-shrink: 0;
}

.split-cta .split-cta-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

/* ===== HAMBURGER BUTTON ===== */
.nav-toggle {
  /* Visible on mobile, hidden on desktop via media query */
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 7px;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  /* Stays on top of mobile overlay */
  position: relative;
  z-index: 300;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 180ms ease;
}

.nav-toggle:hover {
  border-color: rgba(0, 0, 0, 0.24);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: #000000;
  border-radius: 2px;
  transition: transform 220ms ease;
  transform-origin: center;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(4.5px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  transform: translateY(-4.5px) rotate(-45deg);
}

/* ===== MOBILE NAV OVERLAY ===== */
/*
  Visibility is toggled via opacity/visibility/transform (not display)
  so CSS transitions animate smoothly. JS adds/removes .is-open.
*/
.nav-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: rgba(255, 255, 255, 0.99);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  /* Closed (default) */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 240ms;
}

.nav-menu.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
  transition: opacity 240ms ease, transform 240ms ease, visibility 0s linear 0s;
}

/* Nav panel inner layout */
.nav-panel {
  display: grid;
  gap: 28px;
  padding: 0 24px 48px; /* no top padding — nav-header handles that */
  max-width: 540px;
  margin: 0 auto;
  width: 100%;
}

/* ── Nav header: logo + close button (sticky at top of overlay) ── */
.nav-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 16px;
  background: rgba(255, 255, 255, 0.99);
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  margin-bottom: 8px;
}

.nav-header-logo {
  display: inline-flex;
  align-items: center;
}

.nav-header-logo img {
  width: 130px;
  height: auto;
}

/* Close (×) button inside the nav overlay */
.nav-close {
  display: inline-flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 160ms ease, background 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-close:hover {
  border-color: rgba(0, 0, 0, 0.26);
  background: #f5f5f5;
}

.nav-close:focus-visible {
  outline: 2px solid var(--primary-purple);
  outline-offset: 2px;
}

.nav-group {
  display: grid;
  gap: 0;
}

/* Section label (e.g. "Company", "SEO Services") */
.nav-group p {
  margin: 0 0 10px;
  color: var(--primary-purple);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Individual nav links */
.nav-group a {
  display: flex;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  color: #000000;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  transition: color 160ms ease, padding-left 160ms ease;
}

.nav-group a:last-child {
  border-bottom: none;
}

.nav-group a:hover,
.nav-group a:active {
  color: var(--primary-purple);
  padding-left: 5px;
}

/* ===== DESKTOP: show desktop menu, hide mobile controls ===== */
@media (min-width: 1024px) {
  .desktop-menu {
    display: flex;
  }

  .nav-toggle {
    display: none;
  }

  /* Force-hide the mobile overlay at desktop regardless of JS state */
  .nav-menu {
    display: none !important;
  }

  /* Show the header CTA button only on desktop */
  .split-cta {
    display: inline-flex;
  }
}

/* ===== FOOTER ===== */
.site-footer {
  background: #000000;
  color: #ffffff;
}

.site-footer p,
.site-footer a,
.footer-bottom {
  color: rgba(255, 255, 255, 0.68);
}

.site-footer p {
  max-width: 520px;
  margin-top: 22px;
  line-height: 1.8;
}

.site-footer h2 {
  margin-bottom: 18px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer a:not(.brand-mark):not(.footer-brand) {
  display: block;
  margin-bottom: 13px;
  transition: color 180ms ease;
}

.site-footer a:hover {
  color: var(--accent-lime);
}

.footer-brand {
  display: inline-flex;
  width: fit-content;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}

.footer-brand img {
  width: 140px;
  height: auto;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* ===== SCROLL ANIMATION HELPERS ===== */
.gsap-ready .reveal-up,
.gsap-ready .reveal-scale,
.gsap-ready .pricing-card-anim {
  visibility: hidden;
  will-change: transform, opacity;
}

/* CSS fallback if GSAP is unavailable */
.reveal-up.in-view {
  animation: fadeSlideUp 0.7s ease forwards;
}
.reveal-scale.in-view {
  animation: fadeScaleUp 0.8s ease forwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeScaleUp {
  from { opacity: 0; transform: scale(0.95) translateY(18px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===== SHARED COMPONENT STYLES ===== */

.growth-bars i,
.cta-graph i {
  transform-origin: bottom center;
  transition: transform 0.4s ease;
}

.service-row {
  transition: background 180ms ease;
}
.service-row:hover {
  background: #fafafa;
}

.process-step {
  transition: background 200ms ease, box-shadow 200ms ease;
}
.process-step:hover {
  background: #fafafa;
  box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}

.pricing-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.pricing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(0,0,0,0.11);
}
.pricing-card.featured:hover {
  box-shadow: 0 28px 70px rgba(123,93,255,0.22);
}

.pricing-card-anim.in-view {
  animation: fadeSlideUp 0.7s ease forwards;
}

/* ===== GLOBAL FAQ ACCORDION STYLES =====
   Shared across home, seo-services, growth-services, ai-solutions.
   JS in master.js enforces single-open-at-a-time behaviour.
   ======================================= */
.faq-list details,
.gs-faq-list details {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.faq-list summary,
.gs-faq-list summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: #000;
  list-style: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.faq-list summary::-webkit-details-marker,
.gs-faq-list summary::-webkit-details-marker {
  display: none;
}

.faq-list .chevron-icon,
.gs-faq-list .chevron-icon {
  flex-shrink: 0;
  color: rgba(0, 0, 0, 0.4);
  transition: transform 240ms ease;
}

.faq-list details[open] > summary .chevron-icon,
.gs-faq-list details[open] > summary .chevron-icon {
  transform: rotate(180deg);
}

.faq-list details p,
.gs-faq-list details p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.78;
  color: rgba(0, 0, 0, 0.62);
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

.gs-hero-orb,
.ais-hero-orb {
  will-change: transform;
  transform: translateZ(0);
}

.reveal-up.is-revealed,
.reveal-scale.is-revealed,
.pricing-card-anim.is-revealed {
  will-change: auto;
}

main > section {
  contain: layout;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ais-hero-orb-purple,
  .ais-hero-orb-lime {
    animation: none !important;
  }
}
