/* ═══════════════════════════════════════════════════════════════
   SMART SEARCH — "Type what you remember." signature hero
   Vertical hero: copy block on top, oversized search field, then a
   14-frame photo wall that re-ranks live. Loads after /css/product.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Stage: no photographic backdrop, carbon + a quiet amber glow ── */
.ss-hero .p-hero-stage {
  padding-top: clamp(5.5rem, 10vh, 6.5rem);
  padding-bottom: clamp(3rem, 6vh, 4.5rem);
}
.ss-hero .p-hero-stage::after { content: none; }

.ss-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 82rem; margin: 0 auto;
  display: grid; gap: clamp(1.8rem, 3.2vh, 2.2rem);
  justify-items: center; text-align: center;
}

/* ── Copy block (centered variant of the shared hero copy) ─── */
.ss-copy { display: grid; justify-items: center; }
.ss-copy .p-eyebrow { margin-bottom: 1rem; }
.ss-copy .p-title { font-size: clamp(2.5rem, 4.4vw, 3.9rem); max-width: 60rem; margin-bottom: 1.1rem; }
.ss-copy .p-tag { margin-left: auto; margin-right: auto; margin-bottom: 1.4rem; }
.ss-copy .p-ctas { justify-content: center; margin-bottom: 1rem; }
.ss-req { color: var(--dim); font-size: 0.82rem; max-width: 38rem; }
.ss-req a { color: var(--amber); }
@media (hover: hover) {
  .ss-req a:hover { text-decoration: underline; }
}

/* ── The demo ────────────────────────────────────────────────── */
.ss-demo { position: relative; width: 100%; max-width: 72rem; margin: 0 auto; display: grid; gap: 1rem; }

/* subtle radial amber glow behind the search bar */
.ss-demo::before {
  content: ''; position: absolute; z-index: 0; pointer-events: none;
  left: 50%; top: -7rem; transform: translateX(-50%);
  width: min(56rem, 96vw); height: 18rem;
  background: radial-gradient(50% 50% at 50% 50%, rgba(232 163 61 / 0.12), transparent 70%);
}

/* ── Oversized search field ──────────────────────────────────── */
.ss-bar {
  position: relative; z-index: 1;
  display: flex; align-items: center; gap: 1rem;
  width: min(46rem, 100%); margin: 0 auto;
  padding: 0.9rem 1.3rem;
  background: rgba(20 17 12 / 0.85);
  border: 1px solid var(--line); border-radius: 4px;
  cursor: text;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.ss-bar:focus-within {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(232 163 61 / 0.22), 0 22px 70px rgba(232 163 61 / 0.08);
}
.ss-ico { width: 21px; height: 21px; color: var(--dim); flex: none; }
.ss-bar:focus-within .ss-ico { color: var(--amber); }
.ss-bar input {
  width: 100%; background: none; border: 0; outline: 0;
  color: var(--highlight); caret-color: var(--amber);
  font-family: var(--f-mono); font-size: 1.3rem; letter-spacing: 0.01em;
}
.ss-bar input::placeholder { color: var(--dim); }
.ss-hint {
  color: var(--amber); font-size: 0.58rem; white-space: nowrap;
  animation: ss-pulse 2s infinite;
}
@keyframes ss-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ── The photo wall: 7-up desktop, ~4-up mobile ──────────────── */
.ss-wall-wrap { position: relative; z-index: 1; }
.ss-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(9.7rem, 20vw), 1fr));
  gap: 0.5rem;
}
.ss-wall figure {
  position: relative; overflow: hidden; border-radius: 3px;
  transition: opacity 0.45s, transform 0.45s var(--ease-out), box-shadow 0.45s;
}
.ss-wall img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.ss-wall .match {
  position: absolute; right: 6px; top: 6px;
  font-size: 0.56rem; letter-spacing: 0.06em;
  background: var(--amber); color: var(--carbon);
  padding: 0.14rem 0.42rem; border-radius: 2px;
  font-variant-numeric: tabular-nums;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.3s, transform 0.3s;
}
.ss-demo.has-query .ss-wall figure.is-dim { opacity: 0.18; transform: scale(0.965); }
.ss-demo.has-query .ss-wall figure.is-hit {
  box-shadow: 0 0 0 1.5px var(--amber), 0 14px 40px rgba(232 163 61 / 0.18);
}
.ss-demo.has-query .ss-wall figure.is-hit .match { opacity: 1; transform: none; }

/* ── Saved-as-keyword toast (the payoff) ─────────────────────── */
.ss-toast {
  position: absolute; z-index: 2;
  left: 50%; bottom: 1rem;
  transform: translate(-50%, 14px);
  display: flex; align-items: baseline; gap: 0.7rem;
  max-width: min(94%, 46rem);
  padding: 0.7rem 1.15rem;
  background: rgba(20 17 12 / 0.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 18px 50px rgba(0 0 0 / 0.55);
  color: var(--silver); font-size: 0.62rem; letter-spacing: 0.08em;
  text-align: left;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s, transform 0.45s var(--ease-out), visibility 0s 0.45s;
}
.ss-toast.is-on {
  opacity: 1; visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 0.45s, transform 0.45s var(--ease-out);
}
.ss-toast-arrow { color: var(--amber); flex: none; }
.ss-toast-check { color: var(--teal); font-size: 0.78rem; flex: none; }

/* caption under the wall */
.ss-demo .p-hero-caption { position: relative; z-index: 1; margin-top: 0; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 760px) {
  .ss-bar { padding: 0.85rem 1.1rem; gap: 0.8rem; }
  .ss-bar input { font-size: 1.05rem; }
  .ss-ico { width: 18px; height: 18px; }
  .ss-wall { gap: 0.4rem; }
  .ss-toast { bottom: 0.7rem; font-size: 0.56rem; letter-spacing: 0.06em; padding: 0.55rem 0.85rem; max-width: 96%; }
  .ss-req { font-size: 0.78rem; }
}

/* ── Page-level tweaks to the shared shell ───────────────────── */
/* the why-different headline is a full sentence pair - give it room */
.p-safelight h2 { max-width: 44rem; }
/* balance the final-cta headline so "photos" never orphans */
.final-cta h2 { text-wrap: balance; }

/* ── Reduced motion: everything settles, nothing pulses ─────── */
@media (prefers-reduced-motion: reduce) {
  .ss-hint { animation: none; }
  .ss-wall figure, .ss-wall .match, .ss-toast { transition: none; }
}
