/*
 * Allgood Marketing — bespoke design touches
 * Loaded on every page. Inert on pages without the matching markup.
 * v2 — 2026-09-17
 */

/* ── HTML + BODY DARK BG (kills iPad cream area below the footer) ─────────
   Every content section has its own explicit background (hero/stats/why/etc.
   are cream, comparison/final-CTA/footer are dark), so making the body itself
   dark only affects the "empty" area below the last section — no visual
   regression, and it eliminates the cream-below-footer bug on iPad + tall
   viewports. */
html, body { background: #0d0d0d !important; }

/* ── FILM-GRAIN NOISE OVERLAY (editorial texture on cream sections) ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0.045;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='260' height='260' filter='url(%23n)' opacity='0.85'/></svg>");
  background-size: 260px 260px;
  mix-blend-mode: multiply;
  will-change: transform;
}
@media (prefers-reduced-motion: reduce) {
  body::after { opacity: 0.03; }
}

/* ── MAGNETIC CTA + AMBIENT RED GLOW ── */
/* Applies to major CTA buttons: .btn-primary, .nav-cta-btn, .form-submit, .sticky-cta,
   and href-based CTAs to Calendly. */
.btn-primary,
.nav-cta-btn,
.form-submit,
.sticky-cta,
a[href*="calendly.com"].btn,
a[href*="calendly.com"].pricing-cta,
a[href*="calendly.com"].rc-cta {
  position: relative;
  isolation: isolate;
  will-change: transform;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1),
              box-shadow 0.4s ease;
}
.btn-primary::before,
.nav-cta-btn::before,
.form-submit::before,
a[href*="calendly.com"].pricing-cta::before {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 50%, rgba(200,49,43,0.35), rgba(200,49,43,0) 65%);
  z-index: -1;
  opacity: 0;
  filter: blur(10px);
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.btn-primary:hover::before,
.nav-cta-btn:hover::before,
.form-submit:hover::before,
a[href*="calendly.com"].pricing-cta:hover::before,
.cta-in-viewport::before {
  opacity: 1;
}
.btn-primary:hover,
.nav-cta-btn:hover,
.form-submit:hover {
  transform: translateY(-2px);
  box-shadow:
    0 10px 32px -8px rgba(200,49,43,0.5),
    0 3px 10px -2px rgba(0,0,0,0.15);
}

/* ── NAV POLISH: backdrop-blur, animated underlines ── */
nav.nav,
nav.navbar,
.nav,
.navbar {
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background-color: rgba(255,255,255,0.72) !important;
  transition: box-shadow 0.35s ease, background-color 0.35s ease;
}
.nav.scrolled,
.navbar.scrolled {
  background-color: rgba(255,255,255,0.88) !important;
  box-shadow: 0 6px 24px -18px rgba(10,10,10,0.35);
}
/* Animated underline on top-level nav links */
.nav-links a,
.nav a.nav-link,
nav a[data-nav-link] {
  position: relative;
}
.nav-links a::after,
.nav a.nav-link::after,
nav a[data-nav-link]::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -6px;
  height: 2px;
  background: #c8312b;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.nav-links a:hover::after,
.nav a.nav-link:hover::after,
nav a[data-nav-link]:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

/* ── CLIENT WORDMARKS: grayscale-by-default, color-on-hover ── */
.client-strip .wordmark,
.client-strip .wordmark-logo {
  filter: grayscale(1) opacity(0.55);
  transition: filter 0.5s ease, transform 0.5s ease, opacity 0.5s ease;
}
.client-strip .wordmark:hover,
.client-strip .wordmark-logo:hover {
  filter: grayscale(0) opacity(1);
  transform: scale(1.06);
}

/* ── SCROLL-REVEAL H1 / hero title (word-by-word mask) ── */
.reveal-words .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: baseline;
}
.reveal-words .word > span {
  display: inline-block;
  transform: translateY(110%);
  opacity: 0;
  transition:
    transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 0.8s ease;
}
.reveal-words.in-view .word > span {
  transform: translateY(0);
  opacity: 1;
}
/* Stagger per word — up to 12 words */
.reveal-words .word:nth-child(1) > span  { transition-delay: 0.00s; }
.reveal-words .word:nth-child(2) > span  { transition-delay: 0.06s; }
.reveal-words .word:nth-child(3) > span  { transition-delay: 0.12s; }
.reveal-words .word:nth-child(4) > span  { transition-delay: 0.18s; }
.reveal-words .word:nth-child(5) > span  { transition-delay: 0.24s; }
.reveal-words .word:nth-child(6) > span  { transition-delay: 0.30s; }
.reveal-words .word:nth-child(7) > span  { transition-delay: 0.36s; }
.reveal-words .word:nth-child(8) > span  { transition-delay: 0.42s; }
.reveal-words .word:nth-child(9) > span  { transition-delay: 0.48s; }
.reveal-words .word:nth-child(10) > span { transition-delay: 0.54s; }
.reveal-words .word:nth-child(11) > span { transition-delay: 0.60s; }
.reveal-words .word:nth-child(12) > span { transition-delay: 0.66s; }
@media (prefers-reduced-motion: reduce) {
  .reveal-words .word > span {
    transform: none !important;
    opacity: 1 !important;
    transition: none !important;
  }
}

/* ── EDITORIAL PULL-QUOTE (in-body) ── */
.pull-quote {
  margin: 56px auto;
  padding: 0 40px;
  max-width: 780px;
  position: relative;
  border-left: 3px solid #c8312b;
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.32;
  letter-spacing: -0.01em;
  color: inherit;
  text-wrap: balance;
}
.pull-quote::before {
  content: '\201C';
  position: absolute;
  top: -20px;
  left: 18px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 96px;
  line-height: 1;
  color: #c8312b;
  opacity: 0.12;
}
.pull-quote cite {
  display: block;
  margin-top: 14px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: #6b6b6b;
}
@media (max-width: 768px) {
  .pull-quote { padding: 0 20px; margin: 40px auto; }
  .pull-quote::before { font-size: 72px; top: -12px; left: 6px; }
}

/* Sparklines under counters — removed. Belt-and-suspenders hide any leftover DOM. */
.counter-spark { display: none !important; }

/* ── SIGNATURE SECTION HAIRLINE ── */
.section-hairline {
  display: block;
  width: 0;
  max-width: 96px;
  height: 1px;
  background: #c8312b;
  margin: 0 auto;
  opacity: 0;
  transition: width 1.1s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.7s ease;
}
.section-hairline.in-view {
  width: 96px;
  opacity: 0.65;
}

/* ── HERO ITALIC ACCENT (Fraunces on one word) ── */
.hero-italic,
h1 em.hero-italic,
.hero-italic em {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  letter-spacing: -0.02em;
}

/* ── EDITORIAL TESTIMONIAL BLOCK ── */
.editorial-testimonial {
  padding: 120px 40px 128px;
  background: #f7f3ec;
}
.editorial-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 56px;
  align-items: center;
}
.editorial-portrait {
  align-self: start;
  padding-top: 8px;
}
.editorial-portrait img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
  box-shadow: 0 12px 32px -12px rgba(0,0,0,0.25);
}
.editorial-stars {
  display: flex;
  gap: 3px;
  margin-top: 18px;
}
.editorial-quote {
  margin: 0;
  padding: 0;
  border: 0;
  position: relative;
}
.editorial-quote p {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: #0a0a0a;
  margin: 0 0 32px;
  text-wrap: balance;
}
.editorial-dropcap {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.35em;
  color: #c8312b;
  float: left;
  line-height: 0.9;
  padding: 0.08em 0.08em 0 0;
}
.editorial-attribution {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Inter', sans-serif;
  font-style: normal;
}
.editorial-attribution-rule {
  width: 40px;
  height: 1px;
  background: #c8312b;
  display: inline-block;
}
.editorial-attribution-name {
  font-size: 15px;
  font-weight: 800;
  color: #0a0a0a;
  letter-spacing: 0.01em;
}
.editorial-attribution-title {
  font-size: 13px;
  color: #6b6b6b;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .editorial-testimonial { padding: 72px 24px 80px; }
  .editorial-inner {
    grid-template-columns: 1fr;
    gap: 32px;
    text-align: left;
  }
  .editorial-portrait {
    padding-top: 0;
    justify-self: center;
    text-align: center;
  }
  .editorial-portrait img {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }
  .editorial-stars {
    justify-content: center;
  }
}

/* ── PREMIUM ICON TILES (dimensional, dynamic) ── */
/* Applies to feature-card icon tiles across the site. Leaves .advantage-icon,
   nav-icon, faq-icon, check-icon, and megamenu-icon untouched (different UX contexts). */
.why-icon,
.industry-icon,
.tool-icon,
.service-icon,
.card-icon,
.advantage-icon {
  position: relative !important;
  isolation: isolate;
  background:
    radial-gradient(120% 120% at 20% 15%, rgba(255,255,255,0.55) 0%, rgba(255,255,255,0) 45%),
    linear-gradient(135deg, rgba(200,49,43,0.14) 0%, rgba(200,49,43,0.03) 55%, rgba(200,49,43,0.16) 100%) !important;
  border: 1px solid rgba(200,49,43,0.18) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.75),
    inset 0 -1px 0 rgba(200,49,43,0.08),
    inset 0 0 0 1px rgba(255,255,255,0.35),
    0 10px 24px -12px rgba(200,49,43,0.28),
    0 2px 6px -2px rgba(0,0,0,0.06) !important;
  transition:
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    box-shadow 0.55s ease,
    border-color 0.55s ease !important;
  animation: agmIconBreath 5.5s ease-in-out infinite;
  will-change: transform;
}
/* Staggered breathing per card slot so they don't all pulse in unison */
.why-card:nth-child(2) .why-icon,
.industry-card:nth-child(2) .industry-icon,
.tool-card:nth-child(2) .tool-icon,
.service-card:nth-child(2) .service-icon,
.advantage-card:nth-child(2) .advantage-icon,
.card-grid .card:nth-child(2) .card-icon { animation-delay: 0.9s; }
.why-card:nth-child(3) .why-icon,
.industry-card:nth-child(3) .industry-icon,
.tool-card:nth-child(3) .tool-icon,
.service-card:nth-child(3) .service-icon,
.advantage-card:nth-child(3) .advantage-icon,
.card-grid .card:nth-child(3) .card-icon { animation-delay: 1.8s; }
.why-card:nth-child(4) .why-icon,
.industry-card:nth-child(4) .industry-icon,
.tool-card:nth-child(4) .tool-icon,
.service-card:nth-child(4) .service-icon,
.advantage-card:nth-child(4) .advantage-icon,
.card-grid .card:nth-child(4) .card-icon { animation-delay: 2.7s; }
.why-card:nth-child(5) .why-icon,
.industry-card:nth-child(5) .industry-icon,
.tool-card:nth-child(5) .tool-icon,
.service-card:nth-child(5) .service-icon,
.advantage-card:nth-child(5) .advantage-icon,
.card-grid .card:nth-child(5) .card-icon { animation-delay: 3.6s; }
.why-card:nth-child(6) .why-icon,
.industry-card:nth-child(6) .industry-icon,
.tool-card:nth-child(6) .tool-icon,
.service-card:nth-child(6) .service-icon,
.advantage-card:nth-child(6) .advantage-icon,
.card-grid .card:nth-child(6) .card-icon { animation-delay: 4.5s; }

/* Soft ambient glow layer — visible on hover */
.why-icon::before,
.industry-icon::before,
.tool-icon::before,
.service-icon::before,
.card-icon::before,
.advantage-icon::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 60%, rgba(200,49,43,0.35), rgba(200,49,43,0) 60%);
  z-index: -1;
  opacity: 0;
  filter: blur(6px);
  transition: opacity 0.55s ease;
  pointer-events: none;
}

/* SVG inside — thicker premium stroke + smooth transform */
.why-icon svg,
.industry-icon svg,
.tool-icon svg,
.service-icon svg,
.card-icon svg,
.advantage-icon svg {
  stroke-width: 1.75 !important;
  overflow: visible;
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  filter: drop-shadow(0 1px 0 rgba(255,255,255,0.6));
}

/* Hover: lift, glow, and gentle icon rotation */
.why-card:hover .why-icon,
.industry-card:hover .industry-icon,
.tool-card:hover .tool-icon,
.service-card:hover .service-icon,
.card-grid .card:hover .card-icon,
.advantage-card:hover .advantage-icon,
.why-icon:hover,
.industry-icon:hover,
.tool-icon:hover,
.service-icon:hover,
.card-icon:hover,
.advantage-icon:hover {
  transform: translateY(-3px) scale(1.045);
  border-color: rgba(200,49,43,0.28) !important;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.85),
    0 16px 34px -12px rgba(200,49,43,0.42),
    0 4px 10px -4px rgba(0,0,0,0.08) !important;
}
.why-card:hover .why-icon::before,
.industry-card:hover .industry-icon::before,
.tool-card:hover .tool-icon::before,
.service-card:hover .service-icon::before,
.card-grid .card:hover .card-icon::before,
.advantage-card:hover .advantage-icon::before,
.why-icon:hover::before,
.industry-icon:hover::before,
.tool-icon:hover::before,
.service-icon:hover::before,
.card-icon:hover::before,
.advantage-icon:hover::before {
  opacity: 1;
}
.why-card:hover .why-icon svg,
.industry-card:hover .industry-icon svg,
.tool-card:hover .tool-icon svg,
.service-card:hover .service-icon svg,
.card-grid .card:hover .card-icon svg,
.advantage-card:hover .advantage-icon svg {
  transform: rotate(-4deg) scale(1.08);
}

/* Very subtle idle breathing */
@keyframes agmIconBreath {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.75),
      inset 0 -1px 0 rgba(200,49,43,0.08),
      inset 0 0 0 1px rgba(255,255,255,0.35),
      0 10px 24px -12px rgba(200,49,43,0.28),
      0 2px 6px -2px rgba(0,0,0,0.06);
  }
  50% {
    transform: translateY(-1px) scale(1.012);
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.85),
      inset 0 -1px 0 rgba(200,49,43,0.08),
      inset 0 0 0 1px rgba(255,255,255,0.4),
      0 12px 28px -12px rgba(200,49,43,0.36),
      0 2px 6px -2px rgba(0,0,0,0.06);
  }
}

/* Reduced motion — kill breathing + hover scale */
@media (prefers-reduced-motion: reduce) {
  .why-icon, .industry-icon, .tool-icon, .service-icon, .advantage-icon, .card-icon { animation: none !important; }
}

/* ── SERVICE-PAGE CASE STUDY BLOCK (real client testimonial) ── */
.svc-case {
  margin: 56px 0 40px;
  padding: 40px 44px;
  background: #f7f3ec;
  border: 1px solid rgba(200,49,43,0.10);
  border-radius: 16px;
  box-shadow: 0 20px 40px -24px rgba(0,0,0,0.10);
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 40px;
  align-items: center;
}
.svc-case-photo {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 12px 32px -12px rgba(200,49,43,0.35);
  flex-shrink: 0;
}
.svc-case-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.svc-case-quote {
  font-family: 'Fraunces', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(18px, 1.7vw, 22px);
  line-height: 1.36;
  letter-spacing: -0.01em;
  color: #0a0a0a;
  margin: 0 0 22px;
  text-wrap: balance;
}
.svc-case-attr {
  font-family: 'Inter', sans-serif;
  font-weight: 800;
  font-size: 15px;
  color: #0a0a0a;
  letter-spacing: 0.01em;
  margin: 0;
}
.svc-case-title {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: #6b6b6b;
  letter-spacing: 0.02em;
  margin: 2px 0 22px;
}
.svc-case-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0 0 20px;
}
.svc-case-stats > div {
  min-width: 0;
}
.svc-case-stat-num {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 800;
  font-variation-settings: 'opsz' 144, 'wght' 800;
  font-size: clamp(24px, 2.4vw, 30px);
  color: #c8312b;
  letter-spacing: -0.8px;
  line-height: 1.05;
}
.svc-case-stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #6b6b6b;
  margin-top: 4px;
  line-height: 1.35;
}
.svc-case-more {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #c8312b;
  text-decoration: none;
  border-bottom: 1px solid rgba(200,49,43,0.35);
  padding-bottom: 2px;
  transition: border-color 0.3s ease;
}
.svc-case-more:hover { border-color: #c8312b; }
@media (max-width: 768px) {
  .svc-case {
    grid-template-columns: 1fr;
    padding: 32px 24px;
    gap: 24px;
    text-align: left;
  }
  .svc-case-photo {
    width: 140px;
    height: 140px;
    margin: 0 auto;
  }
  .svc-case-stats {
    gap: 12px;
  }
}
