/*
 * home.css — page-scoped styles for the Qidaya marketing landing page.
 * Loaded only on /. All visual treatments here are token-driven; no hex.
 * Reusable primitives live in system.css; this file is for hero mesh,
 * section spacing modifiers, and feature-grid layout variants.
 */

/* ============================================================
 * Hero mesh — animated radial gradient layers
 * ============================================================ */
.hero--mesh {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--space-24);
  padding-bottom: var(--space-20);
}

/* Full-bleed: cancel .qd-main's horizontal padding and pull a bottom margin
 * to keep distance from the next section. Replaces the inline style that
 * used to live on the hero <section>. */
.hero--bleed {
  margin-left: calc(-1 * var(--space-6));
  margin-right: calc(-1 * var(--space-6));
  margin-bottom: var(--space-12);
}
.hero--mesh .hero__inner {
  position: relative;
  z-index: 2;
}

/* Soft fade at the bottom edge so the dark hero dissolves into the light
 * page background instead of cutting hard. */
.hero--mesh::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--color-bg));
  pointer-events: none;
  z-index: 1;
}

.hero__mesh {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hero__mesh-blob {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  will-change: transform;
}
.hero__mesh-blob--a {
  width: 560px; height: 560px;
  left: -10%; top: -20%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.55), transparent 60%);
  animation: qd-blob-a 18s ease-in-out infinite alternate;
}
.hero__mesh-blob--b {
  width: 480px; height: 480px;
  right: -8%; top: 10%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.45), transparent 60%);
  animation: qd-blob-b 22s ease-in-out infinite alternate;
}
.hero__mesh-blob--c {
  width: 420px; height: 420px;
  left: 30%; bottom: -25%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.30), transparent 60%);
  animation: qd-blob-c 26s ease-in-out infinite alternate;
}

@keyframes qd-blob-a {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(40px, 30px, 0) scale(1.08); }
}
@keyframes qd-blob-b {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-30px, 40px, 0) scale(1.12); }
}
@keyframes qd-blob-c {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(20px, -40px, 0) scale(1.05); }
}

/* Subtle grid overlay so the dark surface has texture */
.hero__mesh-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  opacity: 0.5;
}

@media (prefers-reduced-motion: reduce) {
  .hero__mesh-blob { animation: none !important; }
}

/* Hero title gets a subtle gradient (white → slate-300) on a key word — pure CSS, no JS */
.hero--mesh .hero__title {
  background: linear-gradient(180deg, #FFFFFF 0%, #CBD5E1 100%);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Hero CTAs sit tighter on mobile */
@media (max-width: 560px) {
  .hero--mesh { padding-top: var(--space-20); padding-bottom: var(--space-16); }
  .hero--mesh .hero__actions { flex-direction: column; width: 100%; }
  .hero--mesh .hero__actions .btn { width: 100%; justify-content: center; }
}

/* ============================================================
 * Section spacing modifier (marquee + proof have less vertical breathing)
 * ============================================================ */
.section--tight { padding: var(--space-8) 0; }

/* Stack two marquees tighter: kill the second one's top padding entirely
 * and drop the inner .qd-marquee top/bottom padding so the strips sit
 * close enough to read as a pair, not as two separate bands. */
.section--no-top { padding-top: 0; }
.section--no-bottom { padding-bottom: var(--space-2); }
.qd-marquee--no-pad { padding-top: 0; padding-bottom: 0; }

/* ============================================================
 * Page-scoped tightening — home page only (compact level).
 * home.css is loaded only on /, so these don't leak elsewhere.
 *   Section gap     48 → 24px (~50% denser)
 *   Header margin   32 → 20px
 *   Hero bottom     80 → 48px
 *   Card padding    24 → 20px (services + benefits + leadership + process)
 * ============================================================ */
body .section { padding: var(--space-6) 0; }
body .section-header { margin: 0 auto var(--space-5); }
.hero--mesh { padding-bottom: var(--space-12); }

body .feature-card,
body .qd-benefit,
body .qd-process__step,
body .qd-team__card {
  padding: var(--space-5);
}
body .qd-proof { padding: var(--space-8) var(--space-5); }
body .qd-cta-band { padding: var(--space-8) var(--space-6); margin: var(--space-8) 0; }

/* ============================================================
 * Narrow-viewport fixes (home page only — home.css is page-scoped)
 *  - CTA band: stack instead of justify-between; full-width button.
 *  - Hero CTAs: already stack at <560px (system rule).
 *  - Proof band, marquees, footer: existing breakpoints handle these.
 *  - Outer .qd-main gutter: tightened to 16px on mobile so sections
 *    don't waste 48px of a 375px viewport.
 * ============================================================ */
@media (max-width: 600px) {
  body .qd-cta-band__inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  body .qd-cta-band__inner > a.btn {
    align-self: stretch;
    justify-content: center;
  }
  body .qd-cta-band__title {
    font-size: var(--type-size-xl);
  }
  body .qd-cta-band {
    padding: var(--space-6) var(--space-5);
    margin: var(--space-6) 0;
  }
  /* Tighten outer gutter so the narrow viewport gets more usable width */
  .qd-main { padding-left: var(--space-4); padding-right: var(--space-4); }
  /* Hero bleed has to follow the gutter change */
  .hero--bleed {
    margin-left: calc(-1 * var(--space-4));
    margin-right: calc(-1 * var(--space-4));
  }
  /* Section vertical padding tightens further at mobile */
  body .section { padding: var(--space-5) 0; }
}

/* Hero proof line: at very narrow widths, drop the divider middots —
 * inline middots with margin can leave odd gaps when text wraps. */
@media (max-width: 480px) {
  body .hero__proof {
    flex-direction: column;
    gap: var(--space-1);
  }
  body .hero__proof > span[aria-hidden] { display: none; }
}

/* ============================================================
 * Feature grid — 3-column lock for the benefits section
 * ============================================================ */
.feature-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 980px) {
  .feature-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .feature-grid--3 { grid-template-columns: 1fr; }
}

/* ============================================================
 * Hero internal layering — cue + proof line
 * ============================================================ */
.hero--mesh .hero__cue {
  margin-top: var(--space-12);
}
@media (max-width: 560px) {
  .hero--mesh .hero__cue { display: none; }
}

.hero--mesh .hero__proof {
  margin-top: var(--space-5);
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

/* ============================================================
 * Magnetic-hover affordance — let transforms compose smoothly
 * ============================================================ */
.btn-magnetic { will-change: transform; }

/* ============================================================
 * Linked feature cards (services) — anchor that looks like a card
 * ============================================================ */
.feature-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.feature-card--link:hover { color: inherit; }
.feature-card--link:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-color: var(--color-accent);
}
