.discovery {
  --discovery-ink: #101e32;
  --discovery-muted: #495e7a;
  --discovery-edge: #bbcde1;
  --discovery-blue: #164eaf;
  background:
    radial-gradient(ellipse at 74% 50%, #23385a 0%, transparent 64%),
    linear-gradient(180deg, #111e34, #0e192d);
  padding-block: clamp(1.3rem, 3.7vw, 3.5rem);
}

.discovery__panel {
  display: grid;
  align-items: center;
  grid-template-columns: minmax(14rem, .87fr) minmax(19rem, 1.35fr);
  gap: clamp(1.25rem, 4vw, 3.6rem);
  padding: clamp(1.25rem, 3.5vw, 3.2rem);
  border: 1px solid #e1effd;
  border-radius: clamp(1.15rem, 3vw, 2rem);
  background: radial-gradient(ellipse at 91% 17%, #e5efff, transparent 65%), linear-gradient(133deg, #f9fcff, #edf4fc);
  color: var(--discovery-ink);
  box-shadow: inset 0 1px 0 #fff, 0 22px 55px -28px #070f20;
}

.discovery__intro h2 {
  max-inline-size: 13ch;
  margin: 0;
  color: inherit;
  font-size: clamp(1.8rem, 1.2rem + 2vw, 3.1rem);
  font-weight: 800;
  line-height: 1.045;
  letter-spacing: -.059em;
  text-wrap: balance;
}

.discovery__intro p {
  margin: .55rem 0 0;
  color: var(--discovery-muted);
  font-size: clamp(.92rem, .86rem + .31vw, 1.08rem);
  line-height: 1.45;
}

.discovery__controls, .discovery__form, .discovery__form input { min-inline-size: 0; }
.discovery__form { position: relative; }

.discovery__bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .38rem;
  align-items: center;
  min-block-size: 3.75rem;
  padding: .33rem;
  border: 1px solid #93aed0;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 11px 25px -20px #17457c9c;
  transition: border-color var(--ym-motion-quick), box-shadow var(--ym-motion-quick);
}

.discovery__bar:focus-within {
  border-color: #2463bd;
  box-shadow: 0 0 0 3px #306bc62e;
}

.discovery__field {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-inline-size: 0;
  padding-inline-start: .7rem;
}

.discovery__field svg { flex: none; inline-size: 1.15rem; color: #4670a3; }
.discovery__field input {
  inline-size: 100%;
  min-block-size: 44px;
  padding: .25rem 0;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--discovery-ink);
  font: inherit;
  font-weight: 650;
}

.discovery__field input:focus-visible { outline: none; }
.discovery__field input::placeholder { color: #506687; font-weight: 550; }

.discovery__submit,
.discovery__choices a,
.discovery__welcome-trigger,
.welcome-pop :is(a, button) {
  border: 1px solid transparent;
  min-block-size: 44px;
  cursor: pointer;
  touch-action: manipulation;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
}

.discovery__submit {
  padding-inline: clamp(.8rem, 2.6vw, 1.65rem);
  border-radius: .71rem;
  background: linear-gradient(130deg, #205fc3, #133f9b);
  color: #fff;
  box-shadow: inset 0 1px 0 #fff4, 0 5px 9px -6px #194d9e;
}

.discovery__submit:is(:hover, :focus-visible) { background: #103e9d; }
.discovery :is(button, a):focus-visible { outline: 2px solid var(--discovery-blue); outline-offset: 3px; }

.discovery__choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .42rem;
  margin-block-start: .65rem;
}

.discovery__choices a {
  display: grid;
  place-items: center;
  padding-inline: .3rem;
  border-color: var(--discovery-edge);
  border-radius: .72rem;
  background: #f8fbff;
  color: #243c5c;
  font-size: .91rem;
  text-align: center;
}

.discovery__choices a:is(:hover, :focus-visible) {
  border-color: #7a9ecd;
  background: #e2edfc;
  color: #12489b;
}

.discovery__welcome-trigger {
  margin-block-start: .12rem;
  padding: 0;
  background: transparent;
  color: #194b96;
  font-size: .88rem;
  text-underline-offset: .17em;
}

.discovery__welcome-trigger:is(:hover, :focus-visible) { text-decoration: underline; }
.discovery__results {
  position: absolute;
  z-index: 5;
  inset: calc(100% + .4rem) 0 auto;
  display: grid;
  gap: .15rem;
  max-block-size: min(22rem, 47dvh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: .33rem;
  border: 1px solid #9fb6d5;
  border-radius: .9rem;
  background: #fff;
  box-shadow: 0 13px 40px -15px #0e234b85;
}

.discovery__results a {
  display: flex;
  align-items: center;
  min-block-size: 44px;
  gap: .65rem;
  padding: .5rem .72rem;
  border-radius: .6rem;
  color: #164995;
  font-weight: 750;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.discovery__results a:is(:hover, :focus-visible) { background: #eaf2ff; }
.discovery__results a:focus-visible { outline-offset: -2px; }
.discovery__results a > div { display: grid; gap: .125rem; }
.discovery__results a span { color: var(--discovery-muted); font-size: .85rem; font-weight: 550; }
.discovery__results :is([data-discovery-inquiry], [data-discovery-empty]) {
  border-block-start: 1px solid #d7e3f2;
}

.discovery__results [data-discovery-empty] {
  margin: 0;
  padding: .65rem .72rem .2rem;
  border-block-start: 0;
  color: var(--discovery-muted);
  font-size: .875rem;
}

.discovery__status {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.welcome-pop {
  position: fixed;
  z-index: 60;
  inset: auto max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) auto;
  inline-size: min(23rem, calc(100% - 2.5rem));
  max-block-size: calc(100dvh - 6rem);
  overflow-y: auto;
  padding: 1rem;
  border: 1px solid #597bab;
  border-radius: 1.35rem;
  background: radial-gradient(ellipse at 94% 4%, #294b7b, transparent 71%), #111d33;
  color: #f5f8ff;
  box-shadow: inset 0 1px 0 #fff3, 0 19px 55px #07132765;
}

.welcome-pop__head { display: flex; align-items: center; gap: .65rem; margin-block-end: .85rem; }
.welcome-pop__head img { flex: none; inline-size: 2.25rem; block-size: 2.25rem; border-radius: .6rem; }
.welcome-pop__head h2 { margin: 0; font-size: clamp(1.13rem, 1rem + .4vw, 1.35rem); line-height: 1.2; letter-spacing: -.04em; }
.welcome-pop__choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }

.welcome-pop__choices a {
  display: grid;
  align-content: center;
  padding: .38rem .52rem;
  border-color: #7192bd;
  border-radius: .62rem;
  background: #eaf2ff10;
  color: #f0f6ff;
  font-size: .875rem;
  line-height: 1.25;
  text-align: center;
}

.welcome-pop__head button {
  position: relative;
  margin-inline-start: auto;
  flex: 0 0 44px;
  border-color: #8ca8ca88;
  border-radius: .65rem;
  background: #14253e;
  color: #e9f3ff;
}

.welcome-pop__head button::before,
.welcome-pop__head button::after {
  position: absolute;
  inset: calc(50% - 1px) auto auto calc(50% - 7px);
  inline-size: 14px;
  block-size: 2px;
  border-radius: 2px;
  background: currentColor;
  transform: rotate(45deg);
  content: "";
}

.welcome-pop__head button::after { transform: rotate(-45deg); }
.welcome-pop :is(a, button):is(:hover, :focus-visible) { background: #314f7b; border-color: #a7c4e6; }
.welcome-pop :is(a, button):focus-visible { outline: 2px solid #c9e7ff; outline-offset: 2px; }

.discovery [hidden], .welcome-pop[hidden] { display: none; }

@media (max-width: 760px) {
  .discovery__panel { grid-template-columns: minmax(0, 1fr); gap: .45rem; }
  .discovery__intro h2 { max-inline-size: none; }
  .discovery__field { padding-inline-start: .5rem; }
  .discovery__field input { font-size: 1rem; }
  .welcome-pop {
    inset-inline: max(.75rem, env(safe-area-inset-left)) max(.75rem, env(safe-area-inset-right));
    inset-block-end: max(.75rem, env(safe-area-inset-bottom));
    inline-size: auto;
    max-inline-size: 25rem;
    margin-inline-start: auto;
  }
}

@media (max-width: 360px) {
  .discovery__panel { padding-inline: 1rem; }
  .discovery__field { gap: .3rem; padding-inline-start: .22rem; }
  .discovery__field svg { inline-size: 1rem; }
}

@media (prefers-reduced-motion: no-preference) {
  :root[data-ym-motion="on"] .hero-copy > :is(.parent, h1, .lead, .actions, .hero-store-contact) {
    animation: discovery-enter 650ms cubic-bezier(.22, 1, .36, 1) both;
  }
  :root[data-ym-motion="on"] .hero-copy h1 { animation-delay: 45ms; }
  :root[data-ym-motion="on"] .hero-copy .lead { animation-delay: 95ms; }
  :root[data-ym-motion="on"] .hero-copy .actions { animation-delay: 150ms; }
  :root[data-ym-motion="on"] .hero-copy .hero-store-contact { animation-delay: 190ms; }
  :root[data-ym-motion="on"] .hero-copy > :focus-within { animation: none; }
  :root:not([data-ym-motion="off"]) .welcome-pop:not([hidden]) { animation: discovery-enter 390ms cubic-bezier(.16, 1, .3, 1) both; }
  :root:not([data-ym-motion="off"]) .discovery__results:not([hidden]) { animation: discovery-enter 180ms var(--ym-motion-ease) both; }

  :root:not([data-ym-motion="off"]) :is(
    .discovery__submit, .discovery__choices a, .welcome-pop a, .welcome-pop button,
    .hero .actions a, .phone-fan__link, .services .service-card a:first-of-type,
    .model-directory-more, .mobile-store__action, .services-shortcuts a, .inquiry-form .button
  ) {
    transition: transform 240ms var(--ym-motion-ease), background-color 220ms, border-color 220ms, color 180ms;
  }

  :root:not([data-ym-motion="off"]) :is(
    .discovery__submit, .discovery__choices a, .welcome-pop a, .welcome-pop button,
    .hero .actions a, .phone-fan__link, .services .service-card a:first-of-type,
    .model-directory-more, .mobile-store__action, .services-shortcuts a, .inquiry-form .button
  ):active { transform: translateY(1px) scale(.985); }

  @media (hover: hover) and (pointer: fine) {
    :root:not([data-ym-motion="off"]) :is(
      .discovery__submit, .discovery__choices a, .welcome-pop a,
      .hero .actions a, .phone-fan__link, .services .service-card a:first-of-type,
      .model-directory-more, .mobile-store__action, .services-shortcuts a, .inquiry-form .button
    ):hover:not(:active) { transform: translateY(-2px); }
  }
}

@keyframes discovery-enter {
  from { opacity: .45; translate: 0 12px; }
  to { opacity: 1; translate: 0 0; }
}

@media (forced-colors: active) {
  .welcome-pop__head button::before, .welcome-pop__head button::after { background: ButtonText; }
  .discovery__bar:focus-within { outline: 2px solid Highlight; }
  .discovery__submit, .discovery__choices a, .welcome-pop :is(a, button) { border-color: ButtonText; }
}
