/* =========================================================
   SAG TECH — Design System
   Dark theme • Purple/Blue gradient • Search Growth Agency
   ========================================================= */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ---------- Design Tokens ---------- */
:root {
  /* Backgrounds */
  --bg:            #07070d;
  --bg-2:          #0b0b14;
  --surface:       #0f0f1a;
  --surface-2:     #14141f;
  --surface-3:     #1a1a28;
  --card:          rgba(255, 255, 255, 0.025);
  --card-hover:    rgba(255, 255, 255, 0.045);

  /* Borders */
  --border:        rgba(255, 255, 255, 0.07);
  --border-2:      rgba(255, 255, 255, 0.12);
  --border-glow:   rgba(139, 92, 246, 0.35);

  /* Text */
  --text:          #eef0f6;
  --text-2:        #b6b9c9;
  --text-3:        #7c8199;
  --text-4:        #565b70;

  /* Accents */
  --purple:        #8b5cf6;
  --purple-2:      #a78bfa;
  --purple-3:      #6d4bff;
  --blue:          #4f7bff;
  --blue-2:        #3b82f6;
  --cyan:          #38bdf8;
  --green:         #34d399;
  --green-2:       #22c55e;
  --pink:          #d946ef;
  --red:           #f43f5e;

  /* Gradients */
  --grad-primary:  linear-gradient(135deg, #8b5cf6 0%, #6366f1 55%, #4f7bff 100%);
  --grad-purple:   linear-gradient(135deg, #a855f7 0%, #6d28d9 100%);
  --grad-text:     linear-gradient(90deg, #a78bfa 0%, #60a5fa 100%);
  --grad-cta:      linear-gradient(120deg, #7c3aed 0%, #4f46e5 50%, #2563eb 100%);
  --grad-card:     linear-gradient(160deg, rgba(139,92,246,0.10), rgba(79,123,255,0.02));

  /* Effects */
  --shadow:        0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --shadow-glow:   0 0 60px -15px rgba(139, 92, 246, 0.5);
  --radius:        18px;
  --radius-sm:     12px;
  --radius-lg:     26px;

  /* Layout */
  --maxw:          1200px;
  --nav-h:         74px;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
svg { display: block; }

/* Ambient background glows */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(700px 500px at 78% -5%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(600px 500px at 8% 8%, rgba(37, 99, 235, 0.10), transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Layout Helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
.section { padding: 68px 0; position: relative; z-index: 1; }
.section-sm { padding: 44px 0; }

/* ---------- Kicker / Eyebrow ---------- */
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--purple-2);
  margin-bottom: 16px;
}
.kicker.pill {
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

.section-title {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.section-title .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.section-sub { color: var(--text-2); max-width: 620px; margin-top: 14px; }
.center { text-align: center; }
.center .section-sub { margin-left: auto; margin-right: auto; }

.big-num {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space: nowrap;
}
.btn .arrow {
  width: 24px; height: 24px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.16);
  transition: transform .18s ease;
}
.btn-primary {
  background: var(--grad-cta);
  color: #fff;
  box-shadow: 0 10px 30px -8px rgba(109, 40, 217, 0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -10px rgba(109, 40, 217, 0.75); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-2);
  color: var(--text);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); transform: translateY(-2px); }
.btn-ghost .arrow { background: rgba(255,255,255,0.08); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(7, 7, 13, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-size: 18px; letter-spacing: 0.4px; }
.brand .logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--grad-primary);
  display: grid; place-items: center;
  box-shadow: 0 6px 18px -6px rgba(139, 92, 246, 0.7);
}
.brand .logo svg { width: 20px; height: 20px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: color .16s ease;
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  bottom: -26px; left: 0; right: 0;
  height: 2px;
  background: var(--grad-text);
  border-radius: 2px;
}
.nav-cta { display: flex; align-items: center; gap: 12px; }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--border-2); background: rgba(255,255,255,0.03); align-items: center; justify-content: center; }
.nav-toggle svg { width: 20px; height: 20px; }

/* ---------- Generic Card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.card:hover { border-color: var(--border-glow); background: var(--card-hover); transform: translateY(-3px); }

/* ---------- Stat / KPI card ---------- */
.kpi {
  background: linear-gradient(160deg, rgba(255,255,255,0.045), rgba(255,255,255,0.01));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.kpi .kpi-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.kpi .kpi-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.kpi .kpi-value .unit { font-size: 14px; color: var(--text-3); font-weight: 600; }
.kpi .kpi-delta { font-size: 12px; font-weight: 700; margin-top: 3px; display: inline-flex; align-items: center; gap: 4px; }
.delta-up { color: var(--green); }
.delta-down { color: var(--red); }
.kpi .kpi-note { font-size: 11px; color: var(--text-4); margin-top: 3px; }

/* ---------- Chip check-list ---------- */
.check-list { display: grid; gap: 15px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; }
.check-item .ic { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 2px; }
.check-item .ic svg { width: 12px; height: 12px; }
.check-item.ok .ic { background: rgba(52, 211, 153, 0.14); color: var(--green); }
.check-item.bad .ic { background: rgba(244, 63, 94, 0.14); color: var(--red); }
.check-item p { color: var(--text-2); font-size: 14px; line-height: 1.5; }

/* ---------- Icon tile ---------- */
.icon-tile {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: rgba(139, 92, 246, 0.10);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: var(--purple-2);
  flex-shrink: 0;
}
.icon-tile svg { width: 22px; height: 22px; }

/* ---------- FAQ ---------- */
.faq-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color .2s ease;
}
.faq-item.open { border-color: var(--border-glow); }
.faq-q {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px;
  font-size: 14.5px; font-weight: 600; text-align: left;
  color: var(--text);
}
.faq-q .plus {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border-2);
  display: grid; place-items: center;
  color: var(--purple-2);
  transition: transform .25s ease, background .2s ease;
}
.faq-item.open .faq-q .plus { transform: rotate(45deg); background: rgba(139,92,246,0.18); }
.faq-a { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.faq-a p { padding: 0 20px 18px; color: var(--text-2); font-size: 13.5px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 26px; position: relative; z-index: 1; background: var(--bg-2); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.2fr; gap: 34px; }
.footer-brand p { color: var(--text-3); font-size: 13.5px; margin-top: 16px; max-width: 260px; }
.footer-social { display: flex; gap: 10px; margin-top: 18px; }
.footer-social a {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--card);
  display: grid; place-items: center; color: var(--text-2);
  transition: all .18s ease;
}
.footer-social a:hover { color: #fff; border-color: var(--border-glow); background: rgba(139,92,246,0.12); }
.footer-social svg { width: 16px; height: 16px; }
.footer-col h4 { font-size: 13px; font-weight: 700; margin-bottom: 16px; letter-spacing: 0.3px; }
.footer-col ul { display: grid; gap: 11px; }
.footer-col a { color: var(--text-3); font-size: 13.5px; transition: color .16s ease; }
.footer-col a:hover { color: var(--text); }
.footer-col .contact-row { display: flex; gap: 9px; color: var(--text-3); font-size: 13.5px; align-items: flex-start; }
.footer-col .contact-row svg { width: 15px; height: 15px; margin-top: 3px; color: var(--purple-2); flex-shrink: 0; }
.footer-bottom {
  margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  color: var(--text-4); font-size: 12.5px;
}
.footer-bottom .links { display: flex; gap: 22px; }
.footer-bottom a:hover { color: var(--text-2); }

/* ---------- Sticky bottom bar (mobile CTA) ---------- */
.sticky-cta {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 90;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px;
  background: var(--grad-cta);
  border-radius: 999px;
  box-shadow: 0 18px 40px -12px rgba(79, 70, 229, 0.7);
  max-width: calc(100% - 32px);
}
.sticky-cta .txt strong { display: block; font-size: 14px; font-weight: 700; }
.sticky-cta .txt span { font-size: 11.5px; color: rgba(255,255,255,0.78); }
.sticky-cta .go { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.18); display: grid; place-items: center; flex-shrink: 0; }
.sticky-cta .avatars { display: flex; }
.sticky-cta .avatars span { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #6d28d9; margin-left: -10px; background: var(--grad-primary); }
.sticky-cta .avatars span:first-child { margin-left: 0; }

/* ---------- Mini SVG chart wrappers ---------- */
.spark { width: 100%; height: auto; overflow: visible; }

/* ---------- Grid utils ---------- */
.grid { display: grid; gap: 20px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-6 { grid-template-columns: repeat(6, 1fr); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1080px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .g-6 { grid-template-columns: repeat(3, 1fr); }
  .g-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .section { padding: 46px 0; }
  .container { padding: 0 18px; }
  .g-3, .g-4, .g-6 { grid-template-columns: repeat(2, 1fr); }
  .g-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .g-3, .g-4, .g-6 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ---------- Mobile drawer ---------- */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(7,7,13,0.96);
  backdrop-filter: blur(10px);
  display: none; flex-direction: column;
  padding: 22px;
}
.mobile-drawer.open { display: flex; }
.mobile-drawer .md-head { display: flex; align-items: center; justify-content: space-between; }
.mobile-drawer nav { display: grid; gap: 6px; margin-top: 34px; }
.mobile-drawer nav a { padding: 15px 6px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--border); }
.mobile-drawer .btn { margin-top: 28px; justify-content: center; }
.md-close { width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--border-2); display: grid; place-items: center; }

/* =========================================================
   MOTION & ANIMATION
   All hiding is gated behind html.motion (added by an inline
   <head> script only when the user hasn't asked for reduced
   motion), so with JS off / reduced-motion the page stays
   fully visible and static.
   ========================================================= */

/* ---- Scroll progress bar ---- */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0; height: 3px;
  transform: scaleX(0); transform-origin: 0 50%;
  background: var(--grad-primary);
  box-shadow: 0 0 14px rgba(139, 92, 246, 0.75);
  z-index: 300; pointer-events: none;
  will-change: transform;
}

/* ---- Header condense on scroll ---- */
.site-header { transition: background .35s ease, border-color .35s ease, box-shadow .35s ease; }
.site-header.scrolled {
  background: rgba(7, 7, 13, 0.9);
  border-bottom-color: var(--border-2);
  box-shadow: 0 10px 34px -14px rgba(0, 0, 0, 0.85);
}

/* ---- Reveal on scroll ---- */
html.motion .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s cubic-bezier(.16, .84, .44, 1),
              transform .75s cubic-bezier(.16, .84, .44, 1);
  transition-delay: var(--reveal-d, 0ms);
  will-change: opacity, transform;
}
html.motion .reveal.reveal-left  { transform: translateX(-32px); }
html.motion .reveal.reveal-right { transform: translateX(32px); }
html.motion .reveal.reveal-scale { transform: scale(.93); }
html.motion .reveal.reveal-fade  { transform: none; }
html.motion .reveal.in {
  opacity: 1;
  transform: none;
}

/* ---- Number count-up: avoid width jitter ---- */
html.motion [data-counting] { font-variant-numeric: tabular-nums; }

/* ---- SVG chart draw prep (set by JS) ---- */
html.motion .spark .bar-anim {
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transform-box: fill-box;
}

/* ---- Ambient / looping micro-motion ---- */
@media (prefers-reduced-motion: no-preference) {

  /* Floating dashboard badge */
  html.motion .float-badge { animation: sag-bob 3.6s ease-in-out infinite; }
  @keyframes sag-bob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
  }

  /* Primary button light sweep */
  .btn-primary { position: relative; overflow: hidden; }
  .btn-primary > * { position: relative; z-index: 1; }
  .btn-primary::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -75%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    transform: skewX(-18deg);
    animation: sag-shine 4.2s ease-in-out infinite;
    z-index: 0;
  }
  @keyframes sag-shine {
    0%        { left: -75%; }
    35%, 100% { left: 145%; }
  }

  /* Framework node pulse ring */
  html.motion .frame-step .node { isolation: isolate; }
  html.motion .frame-step .node::after {
    content: ""; position: absolute; inset: -2px; border-radius: 50%;
    border: 1px solid rgba(139, 92, 246, 0.55);
    animation: sag-pulse 3s ease-out infinite;
    z-index: -1;
  }
  html.motion .frame-step:nth-child(2) .node::after { animation-delay: .5s; }
  html.motion .frame-step:nth-child(3) .node::after { animation-delay: 1s; }
  html.motion .frame-step:nth-child(4) .node::after { animation-delay: 1.5s; }
  html.motion .frame-step:nth-child(5) .node::after { animation-delay: 2s; }
  html.motion .frame-step:nth-child(6) .node::after { animation-delay: 2.5s; }
  @keyframes sag-pulse {
    0%        { transform: scale(1);   opacity: .8; }
    70%, 100% { transform: scale(1.6); opacity: 0; }
  }

  /* Animated gradient text shimmer on headline accents */
  html.motion .hero h1 .grad {
    background-size: 220% 100%;
    animation: sag-grad 7s ease-in-out infinite;
  }
  @keyframes sag-grad {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
  }

  /* Nav underline grow on hover */
  .nav-links a::after {
    content: ""; position: absolute; left: 0; right: 100%;
    bottom: -26px; height: 2px; border-radius: 2px;
    background: var(--grad-text);
    transition: right .28s cubic-bezier(.16, .84, .44, 1);
  }
  .nav-links a:hover::after { right: 0; }
  .nav-links a.active::after { right: 0; content: none; } /* keep existing active bar */

  /* Card lift gets a soft glow */
  .feat-card, .out-card, .skill-card, .blog-card, .card { transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease; }
  .feat-card:hover, .out-card:hover, .blog-card:hover, .card:hover {
    box-shadow: 0 24px 50px -28px rgba(139, 92, 246, 0.55);
  }

  /* Sticky CTA gentle attention pulse */
  html.motion .sticky-cta { animation: sag-cta 5s ease-in-out infinite; }
  @keyframes sag-cta {
    0%, 100% { box-shadow: 0 18px 40px -12px rgba(79, 70, 229, 0.7); }
    50%      { box-shadow: 0 18px 52px -10px rgba(139, 92, 246, 0.85); }
  }
}

/* ---- Respect reduced motion explicitly ---- */
@media (prefers-reduced-motion: reduce) {
  .scroll-progress { display: none; }
  * { scroll-behavior: auto !important; }
}
