/* ════════════════════════════════════════════════════════════════
   IMMERSIVE HOME HERO — WebGL aurora + glass search
   Fully theme-aware: every color derives from --theme-* variables,
   so each tenant's data-theme automatically restyles the hero.
   ════════════════════════════════════════════════════════════════ */

body.page-home .page-main-home {
  margin-top: 0;
  padding-top: 0;
}

.home-hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(580px, 88vh, 860px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(130% 100% at 50% -10%,
      color-mix(in srgb, var(--theme-accent) 8%, var(--theme-hero-from)) 0%,
      var(--theme-hero-via) 45%,
      var(--theme-hero-to) 100%);
  border-bottom: 1px solid var(--theme-hero-border);
}

/* WebGL canvas sits behind everything */
.home-hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  display: block;
  opacity: 0;
  transition: opacity 1.1s ease;
}

.home-hero.webgl-ready .home-hero__canvas {
  opacity: 1;
}

.home-hero.no-webgl .home-hero__canvas {
  display: none;
}

/* Soft scrim keeps text crisp over the animated field */
.home-hero__scrim {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(80% 60% at 50% 38%,
      color-mix(in srgb, #ffffff 55%, transparent) 0%,
      transparent 70%),
    linear-gradient(to bottom,
      transparent 40%,
      color-mix(in srgb, var(--theme-hero-to) 75%, transparent) 100%);
}

/* Decorative grid mesh — adds depth, very subtle */
.home-hero__grid {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(color-mix(in srgb, var(--theme-accent) 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--theme-accent) 7%, transparent) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(72% 60% at 50% 30%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(72% 60% at 50% 30%, #000 0%, transparent 75%);
}

.home-hero__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 58rem;
  margin: 0 auto;
  padding: 5.5rem 1.5rem 6rem;
  text-align: center;
}

/* ── Eyebrow badge ── */
.home-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--theme-badge-text);
  background: color-mix(in srgb, #ffffff 65%, transparent);
  border: 1px solid var(--theme-badge-border);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.home-hero__eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--theme-accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--theme-accent) 70%, transparent);
  animation: heroPulse 2.4s ease-in-out infinite;
}

@keyframes heroPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--theme-accent) 55%, transparent); }
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--theme-accent) 0%, transparent); }
}

/* ── Headline ── */
.home-hero__title {
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--theme-heading);
  margin: 0 auto 1.25rem;
  max-width: 18ch;
}

.home-hero__title .hero-accent {
  background: linear-gradient(100deg,
    var(--theme-accent) 0%,
    var(--theme-primary-light) 50%,
    var(--theme-accent) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: heroShimmer 6s linear infinite;
}

@keyframes heroShimmer {
  to { background-position: 220% 0; }
}

/* Word-by-word reveal */
.home-hero__title .hero-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em) rotate(2deg);
  animation: heroWordIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--wd, 0s);
}

@keyframes heroWordIn {
  to { opacity: 1; transform: none; }
}

.home-hero__subtitle {
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.55;
  color: color-mix(in srgb, var(--theme-heading) 70%, #6b7280);
  max-width: 40rem;
  margin: 0 auto 2.25rem;
}

/* ── Reveal-up utility (staggered) ── */
.home-hero .reveal-up {
  opacity: 0;
  transform: translateY(22px);
  animation: heroRevealUp 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes heroRevealUp {
  to { opacity: 1; transform: none; }
}

/* ── Glass search ── */
.home-hero__search {
  max-width: 44rem;
  margin: 0 auto;
}

.hero-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem;
  border-radius: 1rem;
  background: color-mix(in srgb, #ffffff 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--theme-accent) 16%, #ffffff);
  box-shadow:
    0 24px 60px -24px var(--theme-cta-shadow),
    0 2px 10px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.35s ease, transform 0.35s ease, border-color 0.35s ease;
}

.hero-search-form:focus-within {
  border-color: var(--theme-accent);
  transform: translateY(-2px);
  box-shadow:
    0 32px 70px -22px var(--theme-cta-shadow),
    0 0 0 4px color-mix(in srgb, var(--theme-accent) 16%, transparent);
}

.hero-search-icon {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  color: color-mix(in srgb, var(--theme-accent) 80%, #6b7280);
}

.hero-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0.95rem 0.5rem;
  font-size: 1.0625rem;
  color: var(--theme-heading);
  outline: none;
}

.hero-search-input::placeholder {
  color: color-mix(in srgb, var(--theme-heading) 45%, #9ca3af);
  transition: opacity 0.25s ease;
}

.hero-search-input.ph-fade::placeholder {
  opacity: 0;
}

.hero-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: none;
  cursor: pointer;
  padding: 0.85rem 1.6rem;
  border-radius: 0.75rem;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--theme-cta-text);
  background: linear-gradient(135deg, var(--theme-cta-from) 0%, var(--theme-cta-to) 100%);
  box-shadow: 0 8px 20px -8px var(--theme-cta-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.hero-search-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px -8px var(--theme-cta-shadow);
}

.hero-search-btn:active {
  transform: translateY(0);
}

.hero-search-btn svg {
  width: 1rem;
  height: 1rem;
}

/* ── Quick actions row (explore + recent) ── */
.home-hero__quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1.4rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.hero-chip--primary {
  color: var(--theme-cta-text);
  background: color-mix(in srgb, var(--theme-primary) 92%, #000);
  box-shadow: 0 6px 16px -6px var(--theme-cta-shadow);
}

.hero-chip--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -6px var(--theme-cta-shadow);
  color: var(--theme-cta-text);
}

.hero-chip--ghost {
  color: var(--theme-badge-text);
  background: color-mix(in srgb, #ffffff 70%, transparent);
  border: 1px solid var(--theme-badge-border);
}

.hero-chip--ghost:hover {
  transform: translateY(-2px);
  background: #ffffff;
  box-shadow: var(--theme-shadow);
  color: var(--theme-primary);
}

.home-hero__quick #recent-searches {
  display: contents;
}

/* ── Stats ── */
.home-hero__stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1.25rem 2rem;
  margin-top: 2.5rem;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}

.hero-stat__value {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--theme-heading);
  font-variant-numeric: tabular-nums;
}

.hero-stat__value .hero-stat__plus,
.hero-stat__value .hero-stat__star {
  color: var(--theme-accent);
}

.hero-stat__label {
  font-size: 0.8rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--theme-heading) 55%, #6b7280);
  margin-top: 0.2rem;
}

.hero-stat__divider {
  width: 1px;
  height: 2.6rem;
  background: color-mix(in srgb, var(--theme-accent) 22%, transparent);
}

/* ── Trust strip (kept, restyled spacing) ── */
.home-hero .premium-trust-strip {
  margin-top: 2.25rem;
}

/* ── Footnote ── */
.home-hero__note {
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: color-mix(in srgb, var(--theme-heading) 50%, #9ca3af);
}

/* ── Scroll cue ── */
.home-hero__scroll {
  position: absolute;
  left: 50%;
  bottom: 1.4rem;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  color: color-mix(in srgb, var(--theme-heading) 55%, #6b7280);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  animation: heroRevealUp 0.8s ease forwards;
  animation-delay: 1.1s;
}

.home-hero__scroll-mouse {
  width: 22px;
  height: 34px;
  border: 2px solid currentColor;
  border-radius: 12px;
  position: relative;
}

.home-hero__scroll-mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: var(--theme-accent);
  animation: heroScrollDot 1.6s ease-in-out infinite;
}

@keyframes heroScrollDot {
  0% { opacity: 0; transform: translate(-50%, 0); }
  35% { opacity: 1; }
  70% { opacity: 0; transform: translate(-50%, 10px); }
  100% { opacity: 0; }
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .home-hero {
    min-height: clamp(520px, 92vh, 740px);
  }
  .home-hero__inner {
    padding: 4rem 1.25rem 5rem;
  }
  .hero-search-form {
    flex-wrap: wrap;
    padding: 0.6rem;
  }
  .hero-search-icon { display: none; }
  .hero-search-input { width: 100%; flex-basis: 100%; padding: 0.75rem 0.85rem; }
  .hero-search-btn { width: 100%; justify-content: center; }
  .home-hero__stats { gap: 1rem 1.25rem; }
  .hero-stat__divider { display: none; }
  .home-hero__scroll { display: none; }
}

/* ── Reduced motion: kill all hero animation ── */
@media (prefers-reduced-motion: reduce) {
  .home-hero__canvas { opacity: 1 !important; transition: none; }
  .home-hero .reveal-up,
  .home-hero__title .hero-word,
  .home-hero__scroll {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .home-hero__eyebrow-dot,
  .home-hero__title .hero-accent,
  .home-hero__scroll-mouse::after {
    animation: none !important;
  }
}
