/*
 * 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. Used by the services grid (6 cards
 * → 3×2) and the benefits section (3 cards → 1 row). Breaks to 2
 * cols at <980px and 1 col at <600px.
 * ============================================================ */
.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;
}

/* Tiny copy-paste affordance under the hero CTAs. Visible mailto fallback
 * for users whose default mail handler isn't configured (mailto: just dies
 * on those machines; plain text + link gives them an address to copy). */
.hero--mesh .hero__altcontact {
  margin-top: var(--space-3);
  font-size: var(--type-size-sm);
  color: rgba(248, 250, 252, 0.5);
  text-align: center;
}
.hero--mesh .hero__altcontact a {
  color: rgba(248, 250, 252, 0.8);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color var(--motion-base);
}
.hero--mesh .hero__altcontact a:hover {
  color: var(--color-accent);
}

/* ============================================================
 * 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);
}

/* ============================================================
 * Fit panel — "Is Qidaya right for your team?"
 *
 * A two-column card. Each column is its own sub-card so the contrast
 * holds in dark mode (where the outer panel and the page bg are close
 * in tone). Yes/No tinting via accent + muted strips at the top edge.
 *
 * Markup uses <div role="list"> / <div role="listitem"> instead of
 * <ul>/<li> so we sidestep any Bootstrap or browser default bullet
 * styling and keep the icon-only visual.
 * ============================================================ */
.qd-fit {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: 1040px;
  margin: 0 auto;
}
@media (min-width: 820px) {
  .qd-fit { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
  /* Single-column variant: undo the 2-col rule so the lone Good-fit
   * card stays centered at a comfortable width instead of stretching
   * to half the content area. */
  .qd-fit--single { grid-template-columns: 1fr; max-width: 720px; }
}

.qd-fit__col {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8) var(--space-7, var(--space-6));
  transition: transform var(--motion-base), box-shadow var(--motion-base), border-color var(--motion-base);
}
.qd-fit__col:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
/* Top accent strip — tinted by yes/no */
.qd-fit__col::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
}
.qd-fit__col--yes::before { background: var(--color-success); }
.qd-fit__col--no::before  { background: var(--color-border-strong); }
.qd-fit__col--yes:hover { border-color: var(--color-success); }

/* Eyebrow — small chip-style label above the heading */
.qd-fit__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--type-size-xs);
  font-weight: var(--type-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-success);
  background: var(--color-success-soft);
  padding: 4px var(--space-3);
  border-radius: var(--radius-pill);
  margin: 0 0 var(--space-4);
}
.qd-fit__eyebrow--muted {
  color: var(--color-text-muted);
  background: var(--color-surface-muted);
}
.qd-fit__eyebrow i { font-size: 11px; }

.qd-fit__heading {
  font-size: var(--type-size-xl);
  font-weight: var(--type-weight-semibold);
  color: var(--color-text);
  margin: 0 0 var(--space-5);
  letter-spacing: -0.015em;
  line-height: var(--type-leading-tight);
}

.qd-fit__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.qd-fit__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}

.qd-fit__icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--type-weight-bold);
}
.qd-fit__icon--yes {
  background: var(--color-success-soft);
  color: var(--color-success);
}
.qd-fit__icon--no {
  background: var(--color-surface-muted);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.qd-fit__text {
  color: var(--color-text);
  line-height: var(--type-leading-base);
  font-size: var(--type-size-base);
}
.qd-fit__col--no .qd-fit__text {
  color: var(--color-text-muted);
}

@media (max-width: 600px) {
  .qd-fit__col { padding: var(--space-6) var(--space-5); }
  .qd-fit__heading { font-size: var(--type-size-lg); }
}

/* ============================================================
 * Leadership grid — home-page variant of .qd-team. The leadership
 * roster is small (1–4 members in practice, never more), so we lock
 * to 4 columns at desktop. With 4 cards that's one balanced row; with
 * 3 the cards stretch a touch wider but stay aligned; with 2 they
 * center as a balanced pair; with 1 the card sits centered.
 * Cascades to 2 cols at <980px and 1 col at <600px.
 * .qd-team itself stays auto-fit for the team-index page, which has
 * many members and benefits from elastic layout.
 * ============================================================ */
.qd-team--home {
  grid-template-columns: repeat(4, 1fr);
  justify-content: center;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 980px) {
  .qd-team--home { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .qd-team--home { grid-template-columns: 1fr; }
}

/* ============================================================
 * Anatomy of an engagement — numbered four-step panel.
 *
 * Visual rhyme with the Methodology section directly below: both use
 * 01/02/03/04 numerals, but Anatomy describes the *shape* (what an
 * engagement is made of) while Methodology describes the *cadence*
 * (how the work moves). The matching numerals tie them as a pair.
 *
 * Panel sits at full content width (no max-width clamp) so it doesn't
 * float as an island between Leadership and Methodology — it occupies
 * the same horizontal real estate as the sections around it.
 * ============================================================ */
.qd-anatomy {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-10) var(--space-10) var(--space-6);
}
.qd-anatomy__list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-10);
  counter-reset: anatomy;
}
.qd-anatomy__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
}
.qd-anatomy__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
  font-size: var(--type-size-sm);
  font-weight: var(--type-weight-bold);
  letter-spacing: 0.04em;
  font-feature-settings: "tnum";
}
.qd-anatomy__body { flex: 1 1 auto; min-width: 0; }
.qd-anatomy__title {
  font-size: var(--type-size-lg);
  font-weight: var(--type-weight-semibold);
  color: var(--color-text);
  margin: 4px 0 var(--space-2);
  letter-spacing: -0.01em;
  line-height: var(--type-leading-tight);
}
.qd-anatomy__copy {
  margin: 0;
  color: var(--color-text-muted);
  line-height: var(--type-leading-base);
  font-size: var(--type-size-base);
}
.qd-anatomy__footer {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  margin: 0;
  font-size: var(--type-size-sm);
  color: var(--color-text-muted);
  font-style: italic;
  text-align: center;
}
@media (max-width: 820px) {
  .qd-anatomy__list { grid-template-columns: 1fr; gap: var(--space-5); }
}
@media (max-width: 600px) {
  .qd-anatomy {
    padding: var(--space-6) var(--space-5) var(--space-5);
  }
  .qd-anatomy__num { width: 36px; height: 36px; }
}

/* ============================================================
 * Sticky mobile CTA bar.
 *
 * Hidden by default at all widths. JS adds .is-visible once the user
 * scrolls past the hero. CSS hides the bar entirely above 768px so
 * the desktop layout never sees it.
 *
 * Sits at z-index 1000 — below the sticky nav (1020) so a sticky-top
 * + sticky-bottom layout never has the bar occlude the nav. Uses
 * env(safe-area-inset-bottom) so iOS home-indicator devices get extra
 * padding instead of the bar floating under the gesture line.
 * ============================================================ */
.qd-stickybar {
  display: none;
}
@media (max-width: 768px) {
  .qd-stickybar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
    background: var(--color-nav-bg);
    -webkit-backdrop-filter: saturate(140%) blur(8px);
    backdrop-filter: saturate(140%) blur(8px);
    border-top: 1px solid var(--color-border);
    transform: translateY(100%);
    opacity: 0;
    transition: transform var(--motion-base), opacity var(--motion-base);
    pointer-events: none;
  }
  .qd-stickybar.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  /* Make room for the bar so the page's bottom-most CTA isn't occluded */
  body { padding-bottom: 72px; }
  /* Honour reduced-motion: skip the slide, just toggle opacity */
  @media (prefers-reduced-motion: reduce) {
    .qd-stickybar { transform: none; transition: opacity var(--motion-fast); }
  }
}
.qd-stickybar__btn {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--type-size-sm);
  font-weight: var(--type-weight-semibold);
  text-decoration: none;
  transition: background var(--motion-base), color var(--motion-base);
  min-height: 44px; /* Apple HIG tap target */
}
.qd-stickybar__btn--primary {
  background: var(--color-accent);
  color: #fff;
}
.qd-stickybar__btn--primary:hover { background: var(--color-accent-hover); color: #fff; }
.qd-stickybar__btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
}
.qd-stickybar__btn--secondary:hover { background: var(--color-surface-muted); color: var(--color-text); }

/* ============================================================
 * Testimonials section — quote cards with author attribution.
 * 1-col mobile, 2-col at >=820px (matches the old fit-panel
 * breakpoint so the page has a consistent two-up rhythm).
 * ============================================================ */
.qd-testimonials {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  max-width: 1040px;
  margin: 0 auto;
}
@media (min-width: 820px) {
  .qd-testimonials { grid-template-columns: 1fr 1fr; gap: var(--space-6); }
}
.qd-testimonial {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-8);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
/* Decorative open-quote glyph in the corner. Big, accented, low opacity. */
.qd-testimonial::before {
  content: "“";
  position: absolute;
  top: -12px;
  left: var(--space-5);
  font-size: 64px;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.35;
  font-family: Georgia, "Times New Roman", serif;
  pointer-events: none;
}
.qd-testimonial__quote {
  margin: 0;
  font-size: var(--type-size-lg);
  line-height: var(--type-leading-base);
  color: var(--color-text);
  font-style: italic;
  letter-spacing: -0.005em;
  position: relative; /* sits above the ::before glyph */
}
.qd-testimonial__author {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
}
.qd-testimonial__photo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  object-fit: cover;
  flex-shrink: 0;
}
.qd-testimonial__meta {
  display: flex;
  flex-direction: column;
  line-height: var(--type-leading-tight);
}
.qd-testimonial__name {
  font-weight: var(--type-weight-semibold);
  color: var(--color-text);
  font-size: var(--type-size-sm);
}
.qd-testimonial__title {
  color: var(--color-text-muted);
  font-size: var(--type-size-xs);
  margin-top: 2px;
}
@media (max-width: 600px) {
  .qd-testimonial { padding: var(--space-6) var(--space-5); }
  .qd-testimonial__quote { font-size: var(--type-size-base); }
}

/* ============================================================
 * Recently shipped — tight one-line stream between services and the
 * fit panel. Quiet by design: small eyebrow, monochrome list, no
 * card surface. Reads as a sidebar even though it's full-width.
 * ============================================================ */
.qd-shipstream {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  border-left: 3px solid var(--color-accent);
  background: var(--color-surface);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.qd-shipstream__eyebrow {
  font-size: var(--type-size-xs);
  font-weight: var(--type-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent-hover);
  margin: 0 0 var(--space-3);
}
.qd-shipstream__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.qd-shipstream__item {
  display: flex;
  gap: var(--space-4);
  align-items: baseline;
  font-size: var(--type-size-sm);
  line-height: var(--type-leading-base);
}
.qd-shipstream__date {
  flex-shrink: 0;
  width: 100px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  font-size: var(--type-size-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.qd-shipstream__body {
  color: var(--color-text);
}
@media (max-width: 600px) {
  .qd-shipstream { padding: var(--space-4) var(--space-5); }
  .qd-shipstream__item { flex-direction: column; gap: 0; }
  .qd-shipstream__date { width: auto; margin-bottom: 2px; }
}
