/* ==========================================================================
   H&W Alarm - Homepage-only enhancements
   Loaded after style.css. Reuses design-system tokens (--brand, --ink-*,
   --radius-*, --shadow-*, --section-y, --gap-content, etc.) and existing
   component classes (card, grid, icon-tile, feature-list, testimonial-card,
   cta-band, stat-row). Does not modify style.css itself.
   ========================================================================== */

/* ---------- Accessibility: visible keyboard focus ---------- */
a:focus-visible,
button:focus-visible,
.card:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Eyebrow icons added on this page have no intrinsic size - without this they
   render at the SVG default (~300x150 -> scales to ~97px here) */
#main .eyebrow svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Decorative background blobs for alt sections ---------- */
.section-decorated { position: relative; }
.section-decorated::before,
.section-decorated::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--brand-300), transparent 72%);
  opacity: 0.16;
  filter: blur(6px);
  pointer-events: none;
}
.section-decorated::before { width: 420px; height: 420px; top: -120px; right: -140px; }
.section-decorated::after { width: 280px; height: 280px; bottom: -100px; left: -100px; opacity: 0.12; }
.section-decorated > .container { position: relative; z-index: 1; }

/* ---------- Hero: trust badges + scroll cue ---------- */
.hero { padding-bottom: calc(var(--section-y) + 34px); }
.hero-badges .hero-badge { cursor: default; }

.hero-scroll-cue {
  position: absolute; left: 50%; bottom: 22px; z-index: 2;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-dark); color: var(--ink-100);
  background: rgba(255, 255, 255, 0.06);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
  animation: hw-bob 2.2s ease-in-out infinite;
}
.hero-scroll-cue svg { width: 18px; height: 18px; }
.hero-scroll-cue:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255,255,255,0.5); }
@keyframes hw-bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ---------- Services overview: asymmetric "bento" grid ---------- */
.bento-services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-content);
}
.bento-tile { display: flex; flex-direction: column; }
.bento-feature {
  grid-column: 1 / 3; grid-row: 1 / 3;
  min-height: 460px; position: relative; overflow: hidden;
  padding: 0; justify-content: flex-end; color: #fff; border-color: transparent;
}
.bento-feature .bento-photo {
  position: absolute; inset: 0; z-index: 0;
}
.bento-feature .bento-photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.bento-feature:hover .bento-photo img,
.bento-feature:focus-visible .bento-photo img { transform: scale(1.06); }
.bento-feature .bento-photo::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,20,15,0.15) 0%, rgba(16,20,15,0.92) 88%),
              linear-gradient(90deg, rgba(16,20,15,0.55) 0%, transparent 55%);
}
.bento-feature .bento-content { position: relative; z-index: 1; padding: var(--pad-card); }
.bento-feature .icon-tile {
  background: rgba(255, 255, 255, 0.14); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.bento-feature h3 { color: #fff; }
.bento-feature p { color: var(--ink-200); }
.bento-b { grid-column: 3 / 4; grid-row: 1 / 2; min-height: 218px; }
.bento-c { grid-column: 4 / 5; grid-row: 1 / 2; min-height: 218px; }
.bento-d { grid-column: 3 / 5; grid-row: 2 / 3; min-height: 218px; flex-direction: row; align-items: center; gap: 20px; }
.bento-d .icon-tile { margin-bottom: 0; }

.bento-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14); color: #fff;
  margin-top: 14px; transition: transform .2s ease, background-color .2s ease;
}
.bento-arrow svg { width: 16px; height: 16px; }
.bento-feature:hover .bento-arrow, .bento-feature:focus-visible .bento-arrow {
  background: var(--brand); transform: translateX(4px);
}
.bento-tile:not(.bento-feature) .tile-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: auto; padding-top: 14px; color: var(--brand-700); font-weight: 600; font-size: 0.9rem;
}
.bento-tile:not(.bento-feature) .tile-arrow svg { width: 16px; height: 16px; transition: transform .2s ease; }
.bento-tile:not(.bento-feature):hover .tile-arrow svg { transform: translateX(4px); }

@media (max-width: 900px) {
  .bento-services { grid-template-columns: repeat(2, 1fr); }
  .bento-feature { grid-column: 1 / 3; grid-row: 1 / 2; min-height: 320px; }
  .bento-b { grid-column: 1 / 2; grid-row: 2 / 3; min-height: 200px; }
  .bento-c { grid-column: 2 / 3; grid-row: 2 / 3; min-height: 200px; }
  .bento-d { grid-column: 1 / 3; grid-row: 3 / 4; min-height: auto; }
}
@media (max-width: 620px) {
  .bento-services { grid-template-columns: 1fr; }
  .bento-feature, .bento-b, .bento-c, .bento-d { grid-column: 1 / 2; grid-row: auto; min-height: auto; }
  .bento-d { flex-direction: column; align-items: flex-start; }
  .bento-feature { min-height: 340px; }
}

/* ---------- About: floating credential badge over photo ---------- */
.about-media { position: relative; }
.about-badge {
  position: absolute; left: -22px; bottom: -22px; z-index: 1;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 16px 22px; text-align: center; min-width: 140px;
}
.about-badge-figure { font-size: 1.8rem; font-weight: 800; color: var(--brand); line-height: 1; margin-bottom: 4px; }
.about-badge-label { font-size: 0.82rem; color: var(--ink-600); font-weight: 600; }
@media (max-width: 620px) {
  .about-badge {
    position: static; margin-top: -28px; margin-left: 20px; display: inline-flex;
    align-items: center; gap: 10px; padding: 12px 18px; box-shadow: var(--shadow);
  }
  .about-badge-figure { margin-bottom: 0; }
}

/* ---------- What We Do: numbered step cards ---------- */
.step-card { position: relative; overflow: hidden; }
.step-index {
  position: absolute; top: 14px; right: 20px; z-index: 0;
  font-size: 3rem; font-weight: 800; color: var(--mist);
  -webkit-text-stroke: 1px var(--line);
  line-height: 1;
}
.step-card .icon-tile, .step-card h3, .step-card p { position: relative; z-index: 1; }
.step-card .icon-tile { transition: transform .25s ease, background-color .25s ease, color .25s ease; }
.step-card:hover .icon-tile.navy { background: var(--brand); color: #fff; transform: scale(1.08) rotate(-4deg); }

/* ---------- Trust strip: iconized, staggered stats ---------- */
.stats-strip .stat-row { row-gap: 32px; }
.stat-item { display: flex; flex-direction: column; align-items: center; }
.stat-icon {
  width: 46px; height: 46px; border-radius: 50%; margin-bottom: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line-dark);
  color: var(--brand-300);
  transition: transform .25s ease, background-color .25s ease, color .25s ease;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-item:hover .stat-icon { background: var(--brand); color: #fff; transform: translateY(-3px); }
.stats-strip [data-reveal]:nth-child(1) { transition-delay: 0s; }
.stats-strip [data-reveal]:nth-child(2) { transition-delay: .08s; }
.stats-strip [data-reveal]:nth-child(3) { transition-delay: .16s; }
.stats-strip [data-reveal]:nth-child(4) { transition-delay: .24s; }

/* ---------- Why choose us: two-column checklist + photo spotlight ---------- */
.why-list { row-gap: 16px; }
.why-list li { align-items: center; }
.why-list li svg {
  width: 34px; height: 34px; padding: 8px; box-sizing: border-box; flex-shrink: 0;
  background: var(--brand-tint); color: var(--brand-700); border-radius: 50%;
}
@media (min-width: 720px) {
  .why-list { grid-template-columns: repeat(2, 1fr); column-gap: 24px; }
}
.why-spotlight { position: relative; overflow: hidden; padding: 0; min-height: 360px; display: flex; align-items: flex-end; border-color: transparent; }
.why-spotlight-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.why-spotlight:hover .why-spotlight-img { transform: scale(1.05); }
.why-spotlight-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,20,15,0.25) 0%, rgba(16,20,15,0.95) 85%),
              linear-gradient(120deg, rgba(54,82,51,0.5), transparent 60%);
}
.why-spotlight-content { position: relative; z-index: 1; padding: var(--pad-card); }
.why-spotlight-content h3 { color: #fff; }

/* ---------- Testimonials: featured quote + supporting grid ---------- */
.testimonial-stars { color: var(--brand); letter-spacing: 3px; font-size: 1.1rem; margin-bottom: 10px; }
.testimonials-layout { display: grid; gap: var(--gap-content); }
.testimonial-featured {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: start;
  padding: calc(var(--pad-card) + 8px);
}
.testimonial-featured .testimonial-quote-mark { margin-bottom: 0; }
.testimonial-featured .testimonial-quote-mark svg { width: 44px; height: 44px; }
.testimonial-featured .testimonial-quote { font-size: 1.08rem; }
@media (max-width: 620px) {
  .testimonial-featured { grid-template-columns: 1fr; }
}
.testimonials-grid .testimonial-card:hover,
.testimonial-featured:hover { box-shadow: var(--shadow); transform: translateY(-3px); transition: box-shadow .2s ease, transform .2s ease; }

/* ---------- CTA band: subtle dotted texture + icon watermark ---------- */
.cta-band { position: relative; overflow: hidden; }
.cta-band::before {
  content: "";
  position: absolute; inset: 0; z-index: 0;
  background-image: radial-gradient(rgba(255,255,255,0.14) 1px, transparent 1px);
  background-size: 18px 18px;
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 65%);
          mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 65%);
}
.cta-band-watermark {
  position: absolute; right: -40px; bottom: -40px; z-index: 0;
  width: 220px; height: 220px; opacity: 0.08; color: #fff; pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero-scroll-cue { animation: none; }
  .bento-feature .bento-photo img,
  .why-spotlight-img,
  .step-card .icon-tile,
  .stat-icon { transition: none; }
}
