/* ============================================================================
   URL finder — hero variant B + readout. (The Blueprint card stack is in
   site.css + /blueprint.js, shipped separately.)
   Loaded on the homepage only. Uses tokens from colors_and_type.css.
   Variant switching: an inline snippet in <head> stamps data-hero="a"|"b"
   on <html> before paint. Default (no JS at all) shows hero A.
   ============================================================================ */

/* The finder hero is hero A's photographic hero (same crossfading photo
   stack, same marks, same glow) with a different call to action. Variant
   switching hides whichever hero isn't chosen. */
.hero--finder { display: none; }
html[data-hero="b"] .hero--a:not(.hero--finder) { display: none; }
html[data-hero="b"] .hero--finder { display: flex; }

.hero--finder {
  position: relative;
  min-height: 68vh;
  flex-direction: column; justify-content: center;
  padding: 96px 24px 72px;
}
.hero--finder .hero__inner { position: relative; z-index: 2; }
.hero--finder .hero__inner { max-width: min(760px, 100%); width: 100%; min-width: 0; margin: 0 auto; }
.hero--finder .hero__title .line { white-space: normal; }
.hero--finder .hero__title { font-size: clamp(40px, 6.4vw, 72px); }
.hero--finder .hero__lede { margin: 20px auto 30px; max-width: 34em; }

.uf-form {
  display: flex; gap: 8px;
  max-width: 560px; margin: 0 auto;
  background: var(--wl-paper); border-radius: 14px;
  padding: 6px 6px 6px 16px;
  box-shadow: var(--shadow-glow);
  text-align: left;
}
.uf-form .uf-scheme { font: 400 15px var(--font-mono); color: var(--wl-grey-600); align-self: center; }
.uf-form input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: 500 16px var(--font-body); color: var(--wl-ink); padding: 12px 4px;
}
.uf-form input::placeholder { color: var(--wl-grey-500); font-weight: 400; }
.uf-form .btn { border-radius: 10px; box-shadow: none; }
.uf-form input:focus-visible, .uf-alt a:focus-visible, .uf-chip:focus-visible { outline: 2px solid var(--wl-citron); outline-offset: 2px; }

.uf-alt { margin: 14px 0 0; font-size: 14px; color: var(--fg-muted); }
.uf-alt a { color: var(--accent); }
.uf-try { margin: 22px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.uf-try .wl-eyebrow { color: var(--fg-muted); }
.uf-chip {
  font: 500 13px var(--font-body); border: 1px solid var(--border-strong);
  background: transparent; color: var(--fg-muted);
  border-radius: var(--r-pill); padding: 7px 12px; cursor: pointer;
}
.uf-chip:hover { border-color: var(--accent); color: var(--fg); }

/* v1.4: one warm working brief, with motion used only to explain arrival and choice. */
.uf-readout { scroll-margin-top: 80px; }
#ufResult { scroll-margin-top: 80px; }
.uf-alt[hidden], .uf-readout[hidden], .uf-progress[hidden] { display: none; }

/* The result is one purposeful paper tableau over the cinematic hero, not a
   dark panel containing a second wall of dark cards. */
.uf-readout {
  position: relative; left: 50%; isolation: isolate; overflow: hidden;
  width: min(840px, calc(100vw - 48px)); max-width: none;
  margin: 38px 0 0; padding: 30px 32px 28px;
  transform: translateX(-50%); text-align: left;
  border: 1px solid rgba(26,20,13,0.14); border-radius: var(--r-xl);
  background: linear-gradient(145deg, var(--wl-paper-card), var(--wl-paper-canvas) 66%, var(--wl-paper-2));
  box-shadow: 0 34px 90px -30px rgba(0,0,0,0.78), inset 0 1px 0 rgba(255,255,255,0.8);
}
.uf-readout::before {
  content: ""; position: absolute; z-index: -1; inset: -180px -120px auto auto;
  width: 420px; height: 360px; pointer-events: none;
  background: radial-gradient(circle, rgba(165,108,255,0.20), rgba(152,63,178,0.07) 42%, transparent 70%);
  filter: blur(10px);
}
.uf-readout::after {
  content: ""; position: absolute; z-index: -1; right: -58px; top: -46px;
  width: 230px; height: 230px; pointer-events: none; opacity: 0.035;
  background: url("/assets/logo-mark.svg") center / contain no-repeat;
}

.uf-top {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 18px;
  margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--border);
}
.uf-identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.uf-mark {
  width: 44px; height: 44px; flex: none; border-radius: var(--r-md);
  display: grid; place-items: center; overflow: hidden;
  background: var(--wl-purple); color: var(--wl-bone);
  font: 700 20px var(--font-display); letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(77,14,136,0.22), inset 0 1px 0 rgba(255,255,255,0.18);
}
.uf-mark--icon { background: #fff; }
.uf-mark img { width: 100%; height: 100%; object-fit: contain; display: block; padding: 5px; box-sizing: border-box; }
.uf-who { display: flex; flex-direction: column; min-width: 0; }
.uf-name { font: 700 22px/1.15 var(--font-display); letter-spacing: -0.02em; color: var(--fg); overflow-wrap: anywhere; }
.uf-name[hidden], .uf-dom[hidden] { display: none; }
.uf-dom { font: 500 12px var(--font-mono); color: var(--fg-muted); margin-top: 3px; }
.uf-status { display: flex; align-items: center; gap: 8px; padding-top: 5px; font: 500 11px var(--font-mono); color: var(--fg-muted); white-space: nowrap; }
.uf-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.uf-dot.off { background: var(--success); }
.uf-dot.on { animation: uf-pulse 1.2s infinite; }
@keyframes uf-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .4; transform: scale(.78); } }

.uf-progress { max-width: 58ch; margin: 0 0 6px; }
.uf-progress strong { display: block; margin-bottom: 6px; font: 650 20px/1.3 var(--font-display); color: var(--fg); }
.uf-progress p { margin: 0; font-size: 14px; color: var(--fg-muted); }

.uf-eyebrow {
  display: block; margin: 0 0 8px;
  font: 600 11px/1.2 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
}
.uf-finding { max-width: 700px; }
.uf-verdict { font: 650 clamp(25px, 3.2vw, 32px)/1.18 var(--font-display); letter-spacing: -0.025em; margin: 0 0 10px; color: var(--fg); }
.uf-verdict:focus { outline: none; }
.uf-verdict em { font-style: normal; color: var(--accent); }
.uf-sub { max-width: 68ch; font-size: 14px; line-height: 1.55; color: var(--fg-muted); margin: 0; }
.uf-partial { font-size: 14px; color: var(--fg-muted); margin: 0 0 18px; padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: var(--r-sm); }

.uf-opportunities { margin-top: 28px; }
.uf-opportunity-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 12px; }
.uf-opportunity-head h3 { max-width: 32em; margin: 0; font: 600 17px/1.35 var(--font-display); color: var(--fg); }
.uf-count { flex: none; padding-bottom: 2px; font: 500 11px var(--font-mono); color: var(--fg-faint); }
.uf-workstream {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, .88fr);
  overflow: hidden; border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: rgba(255,252,246,0.72); box-shadow: var(--shadow-md);
}
.uf-choice-list { border-right: 1px solid var(--border); }
.uf-choice {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr) 22px;
  gap: 12px; align-items: center; min-height: 86px; padding: 15px 16px;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 180ms cubic-bezier(0.22,1,0.36,1), color 180ms;
}
.uf-choice:last-child { border-bottom: 0; }
.uf-choice::after {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent); transform: scaleY(0);
  transform-origin: center; transition: transform 180ms cubic-bezier(0.22,1,0.36,1);
}
.uf-choice:hover { background: rgba(110,60,220,0.045); }
.uf-choice:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
.uf-choice.picked { background: rgba(110,60,220,0.09); }
.uf-choice.picked::after { transform: scaleY(1); }
.uf-choice-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.uf-choice-no { font: 500 13px var(--font-mono); color: var(--accent); }
.uf-choice-copy { display: flex; min-width: 0; flex-direction: column; align-items: flex-start; gap: 5px; }
.uf-choice-copy strong { font: 650 15px/1.3 var(--font-display); color: var(--fg); }
.uf-fit {
  display: inline-flex; align-items: center; padding: 3px 7px; border-radius: var(--r-pill);
  background: rgba(110,60,220,0.09); color: var(--accent);
  font: 500 10px/1.2 var(--font-mono); white-space: nowrap;
}
.uf-choice:nth-child(2) .uf-fit { background: rgba(110,102,86,0.09); color: var(--fg-muted); }
.uf-choice:nth-child(3) .uf-fit { background: transparent; box-shadow: inset 0 0 0 1px var(--border-strong); color: var(--fg-muted); }
.uf-choice-tick { opacity: 0; transform: scale(.7); color: var(--accent); font-weight: 700; transition: opacity 120ms, transform 180ms cubic-bezier(0.22,1,0.36,1); }
.uf-choice.picked .uf-choice-tick { opacity: 1; transform: scale(1); }
.uf-choice-detail { display: none; }

.uf-detail {
  display: flex; flex-direction: column; justify-content: center; padding: 26px 24px;
  background: linear-gradient(150deg, rgba(110,60,220,0.075), rgba(255,252,246,0.36));
}
.uf-detail h4 { margin: 0 0 10px; font: 650 19px/1.28 var(--font-display); color: var(--fg); }
.uf-detail p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--fg-muted); }
.uf-detail-note { display: block; margin-top: 18px; font: 500 10px/1.4 var(--font-mono); color: var(--fg-faint); }
.uf-detail.is-updated { animation: uf-detail-in 220ms cubic-bezier(0.22,1,0.36,1) both; }
@keyframes uf-detail-in { from { opacity: .45; transform: translateX(6px); } to { opacity: 1; transform: none; } }

.uf-followup {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 28px;
  margin-top: 18px; padding: 22px 24px; border: 1px solid rgba(110,60,220,0.16);
  border-radius: var(--r-lg); background: linear-gradient(125deg, rgba(165,108,255,0.14), rgba(255,252,246,0.84) 72%);
}
.uf-followup h3 { margin: 0 0 6px; font: 650 20px/1.25 var(--font-display); color: var(--fg); }
.uf-followup p { max-width: 44ch; margin: 0; font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
.uf-followup-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 250px; }
.uf-followup-actions .btn { justify-content: center; width: 100%; }
.uf-followup-actions small { max-width: 34ch; font-size: 11px; line-height: 1.4; color: var(--fg-faint); }
.uf-correct { font-size: 13px; font-weight: 600; color: var(--accent); }
.uf-correct:focus-visible, .uf-trust summary:focus-visible, .uf-chip2:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.uf-trust { display: flex; justify-content: space-between; gap: 22px; margin-top: 16px; padding: 0 2px; }
.uf-trust > p { max-width: 46ch; margin: 0; font-size: 12px; line-height: 1.45; color: var(--fg-muted); }
.uf-trust details { flex: none; font-size: 12px; color: var(--fg-muted); }
.uf-trust summary { cursor: pointer; color: var(--accent); }
.uf-trust details p { max-width: 38ch; margin: 8px 0 0; line-height: 1.45; }
.uf-ref { font: 400 10px var(--font-mono); color: var(--fg-faint); white-space: nowrap; }
.uf-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Fallback result reuses the same warm tableau. */
.uf-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.uf-chip2 { font: 500 13px var(--font-body); border: 1px solid var(--border-strong); background: transparent; color: var(--fg-muted); border-radius: var(--r-pill); padding: 9px 12px; cursor: pointer; }
.uf-chip2:hover { border-color: var(--accent); color: var(--fg); }
.uf-cta { margin-top: 18px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.uf-cta small { color: var(--fg-faint); font-size: 13px; flex-basis: 100%; }
.uf-textarea {
  width: 100%; min-height: 90px; border: 1px solid var(--border-strong);
  border-radius: var(--r-sm); background: var(--bg-elev); color: var(--fg);
  font: 400 15px var(--font-body); padding: 12px; resize: vertical;
}

.uf-reveal { animation: uf-up 320ms cubic-bezier(0.22,1,0.36,1) both; animation-delay: var(--uf-delay, 0ms); }
@keyframes uf-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (max-width: 860px) {
  .hero--finder { padding: 64px 20px 56px; min-height: 0; }
  .uf-readout { width: min(720px, calc(100vw - 40px)); padding: 26px 24px; }
  .uf-workstream { grid-template-columns: 1fr; }
  .uf-choice-list { border-right: 0; }
  .uf-detail { min-height: 190px; border-top: 1px solid var(--border); }
  .uf-followup { grid-template-columns: 1fr; gap: 18px; }
  .uf-followup-actions { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .hero--finder { padding-inline: 12px; }
  .uf-readout { width: calc(100vw - 24px); margin-top: 30px; padding: 20px 16px; border-radius: 24px; }
  .uf-readout::after { width: 150px; height: 150px; right: -45px; top: -35px; }
  .uf-top { display: block; margin-bottom: 22px; padding-bottom: 16px; }
  .uf-status { margin: 10px 0 0 54px; padding: 0; white-space: normal; }
  .uf-name { font-size: 19px; }
  .uf-mark { width: 40px; height: 40px; border-radius: 10px; }
  .uf-verdict { font-size: 24px; }
  .uf-opportunity-head { display: block; }
  .uf-count { display: block; margin-top: 6px; }
  .uf-choice { grid-template-columns: 28px minmax(0, 1fr) 18px; gap: 10px; min-height: 76px; padding: 14px 12px; }
  .uf-choice-copy strong { font-size: 14px; }
  .uf-choice-detail { margin-top: 8px; font-size: 13px; line-height: 1.5; color: var(--fg-muted); }
  .uf-choice.picked .uf-choice-detail { display: block; }
  .uf-detail { display: none; }
  .uf-followup { padding: 19px 16px; }
  .uf-followup h3 { font-size: 18px; }
  .uf-trust { flex-direction: column; gap: 10px; }
  .uf-trust details { align-self: flex-start; }
}

@media (hover: none) { .uf-choice:hover { background: transparent; } .uf-choice.picked:hover { background: rgba(110,60,220,0.09); } }

@media (prefers-reduced-motion: reduce) {
  .uf-reveal, .uf-detail.is-updated, .uf-dot.on { animation: none; }
  .uf-choice, .uf-choice::after, .uf-choice-tick { transition: none; }
}
