/* Reference-led intro only. The quiz, result and photo intake keep their own layouts. */
html:has(> body[data-match-screen="intro"]) {
  /* Account for desktop scrollbars even in a 320px browser viewport. */
  min-width: 0;
}

body[data-match-screen="intro"] {
  min-width: 0;
  min-height: 100svh;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 243, 230, .65), transparent 50%),
    radial-gradient(ellipse at 100% 40%, rgba(234, 244, 238, .55), transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 240, 229, .5), transparent 65%),
    var(--oat);
}

body[data-match-screen="intro"] .match-header,
body[data-match-screen="intro"] .match-stage,
body[data-match-screen="intro"] .match-footer {
  width: min(440px, calc(100% - 48px));
}

body[data-match-screen="intro"] .match-header {
  min-height: 80px;
  padding: 16px 0 8px;
  gap: 12px;
}

body[data-match-screen="intro"] .brand {
  min-height: 44px;
  gap: 8px;
}

body[data-match-screen="intro"] .brand img {
  width: 32px;
  height: 32px;
  padding: 2px;
  border: 1px solid rgba(61, 64, 91, .05);
  box-shadow: 0 2px 5px rgba(61, 64, 91, .06);
}

body[data-match-screen="intro"] .brand strong {
  font-size: .875rem;
}

body[data-match-screen="intro"] .brand small {
  display: none;
}

body[data-match-screen="intro"] .language-switch {
  flex: 0 0 auto;
  padding: 2px;
  border-color: rgba(61, 64, 91, .07);
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 2px 5px rgba(61, 64, 91, .04);
}

body[data-match-screen="intro"] .language-switch button {
  width: 44px;
  min-height: 44px;
  color: var(--muted);
  font-size: .6875rem;
}

body[data-match-screen="intro"] .language-switch button[aria-pressed="true"] {
  background: var(--terracotta-pale);
  color: var(--terracotta-dark);
}

body[data-match-screen="intro"] .match-main {
  min-height: 0;
}

body[data-match-screen="intro"] .match-stage {
  padding: 8px 0 20px;
}

body[data-match-screen="intro"] .intro-screen {
  display: block;
  min-height: 0;
  padding: 0 0 8px;
  animation: none;
}

body[data-match-screen="intro"] .intro-blobs,
body[data-match-screen="intro"] .intro-badge {
  display: none;
}

body[data-match-screen="intro"] .intro-blobs span {
  animation: none;
}

body[data-match-screen="intro"] .intro-copy {
  width: 100%;
  text-align: center;
}

body[data-match-screen="intro"] .intro-visual {
  position: relative;
  width: min(256px, 100%);
  margin: 16px auto 36px;
  isolation: isolate;
  animation: intro-reference-appear .6s ease both;
}

body[data-match-screen="intro"] .intro-photo-wrap {
  position: relative;
  width: 192px;
  max-width: 100%;
  height: 192px;
  margin: 0 auto;
  border: 4px solid white;
  border-radius: 40px 40px 40px 15px;
  background: white;
  box-shadow: 0 8px 30px -10px rgba(61, 64, 91, .1);
}

body[data-match-screen="intro"] .intro-visual::before {
  position: absolute;
  z-index: -1;
  top: -18px;
  left: 50%;
  width: 240px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(242, 204, 143, .7), rgba(242, 204, 143, 0) 70%);
  filter: blur(16px);
  transform: translateX(-50%);
  content: "";
  pointer-events: none;
}

body[data-match-screen="intro"] .intro-photo {
  width: 100%;
  height: 100%;
  border-radius: 36px 36px 36px 11px;
  object-fit: cover;
  object-position: 50% 50%;
}

body[data-match-screen="intro"] .intro-spark {
  position: absolute;
  top: -8px;
  right: calc(50% - 104px);
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: white;
  color: var(--terracotta);
  box-shadow: 0 2px 5px rgba(61, 64, 91, .08);
  pointer-events: none;
}

body[data-match-screen="intro"] .intro-photo-wrap > .intro-spark {
  top: -12px;
  right: -12px;
}

body[data-match-screen="intro"] .intro-spark svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Keep the overlap in flow: translated labels and browser zoom cannot cover the heading. */
body[data-match-screen="intro"] .intro-meter {
  position: relative;
  z-index: 1;
  width: 100%;
  /* The approved portrait's mouth and chin remain visible above the meter. */
  margin: -58px auto 0;
  padding: 14px 15px 12px;
  border: 2px solid white;
  border-radius: 24px;
  background: rgba(255, 255, 255, .97);
  box-shadow: 0 20px 40px -5px rgba(61, 64, 91, .15);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

body[data-match-screen="intro"] .intro-meter-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .09em;
  line-height: 1.4;
  text-transform: uppercase;
}

body[data-match-screen="intro"] .intro-meter-label svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  fill: var(--terracotta);
}

body[data-match-screen="intro"] .intro-meter-score {
  display: flex;
  margin: 4px 0 10px;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  color: var(--terracotta-dark);
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -.04em;
  line-height: 1;
}

body[data-match-screen="intro"] .intro-meter-score > span {
  font-size: 1.5rem;
}

body[data-match-screen="intro"] .intro-meter-track {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(61, 64, 91, .06);
  border-radius: 999px;
  background: var(--oat);
  box-shadow: inset 0 2px 4px rgba(61, 64, 91, .04);
}

body[data-match-screen="intro"] .intro-meter-fill {
  position: relative;
  display: block;
  width: 86%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--terracotta) 65%, #d6684a);
  transform-origin: left center;
  animation: intro-reference-meter 1.8s cubic-bezier(.2, .8, .2, 1) .3s both;
}

body[data-match-screen="intro"] .intro-meter-fill::after {
  position: absolute;
  top: 50%;
  right: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 8px rgba(255, 255, 255, .9);
  transform: translateY(-50%);
  content: "";
}

body[data-match-screen="intro"] .intro-meter-example {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.5;
}

body[data-match-screen="intro"] .intro-paws {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

body[data-match-screen="intro"] .intro-paws svg {
  position: absolute;
  width: 32px;
  height: 32px;
  fill: var(--terracotta);
  opacity: .1;
}

body[data-match-screen="intro"] .intro-paws svg:first-child {
  top: 15%;
  left: 0;
  transform: rotate(-12deg);
}

body[data-match-screen="intro"] .intro-paws svg:last-child {
  right: 0;
  bottom: 23%;
  width: 38px;
  height: 38px;
  opacity: .07;
  transform: rotate(35deg);
}

body[data-match-screen="intro"] .intro-copy h1 {
  max-width: 400px;
  margin: 0 auto;
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body[data-match-screen="intro"] .intro-lead {
  max-width: 370px;
  margin: 12px auto 0;
  padding-inline: 6px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  line-height: 1.6;
}

body[data-match-screen="intro"] .intro-facts {
  max-width: none;
  margin: 28px auto;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

body[data-match-screen="intro"] .intro-facts li {
  min-height: 74px;
  padding: 15px 16px;
  gap: 16px;
  border: 1px solid rgba(61, 64, 91, .06);
  border-radius: 19px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 2px 4px rgba(61, 64, 91, .04);
}

body[data-match-screen="intro"] .intro-facts li > div {
  min-width: 0;
}

body[data-match-screen="intro"] .fact-icon {
  width: 40px;
  height: 40px;
  background: rgba(242, 204, 143, .3);
  color: #9d611b;
}

body[data-match-screen="intro"] .intro-facts li:nth-child(2) .fact-icon {
  background: rgba(129, 178, 154, .2);
  color: var(--sage-dark);
}

body[data-match-screen="intro"] .intro-facts strong {
  font-size: .875rem;
  line-height: 1.4;
}

body[data-match-screen="intro"] .intro-facts small {
  margin-top: 3px;
  color: var(--muted);
  font-size: .6875rem;
  line-height: 1.45;
}

body[data-match-screen="intro"] .intro-copy > .button {
  width: 100%;
  min-height: 58px;
  padding: 16px;
  border-radius: 24px;
  /* White on this terracotta is 4.58:1; the reference's lighter orange is 2.95:1. */
  background: #b85a42;
  color: white;
  box-shadow: 0 10px 25px -5px rgba(224, 122, 95, .4);
  font-size: 1.0625rem;
  font-weight: 700;
}

body[data-match-screen="intro"] .intro-copy > .button:hover:not(:disabled) {
  background: var(--terracotta-dark);
  box-shadow: 0 12px 28px -5px rgba(224, 122, 95, .4);
}

body[data-match-screen="intro"] .intro-copy > .button svg {
  width: 21px;
  height: 21px;
}

body[data-match-screen="intro"] .fine-print {
  max-width: 370px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .035em;
  line-height: 1.6;
  text-transform: uppercase;
}

body[data-match-screen="intro"] .intro-privacy {
  max-width: none;
  margin: 0 auto;
  color: var(--muted);
  font-size: .6875rem;
}

body[data-match-screen="intro"] .intro-privacy summary {
  min-height: 44px;
  padding: 13px 6px;
  line-height: 1.6;
}

body[data-match-screen="intro"] .intro-privacy p {
  margin-top: 0;
  padding: 14px 16px;
  text-align: left;
}

body[data-match-screen="intro"] .match-footer {
  padding: 20px 0 28px;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  font-size: .625rem;
  text-align: center;
}

body[data-match-screen="intro"] .footer-brand,
body[data-match-screen="intro"] .match-footer nav {
  justify-content: center;
}

body[data-match-screen="intro"] .match-footer nav {
  gap: 0 16px;
}

body[data-match-screen="intro"] .match-footer nav a,
body[data-match-screen="intro"] .match-footer nav button {
  min-height: 44px;
}

@keyframes intro-reference-appear {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes intro-reference-meter {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (min-width: 600px) {
  body[data-match-screen="intro"] .match-header {
    padding-top: 24px;
    min-height: 92px;
  }

  body[data-match-screen="intro"] .intro-visual {
    margin-top: 20px;
    margin-bottom: 40px;
  }

  body[data-match-screen="intro"] .intro-copy h1 {
    max-width: 430px;
    font-size: 2.5rem;
  }

  body[data-match-screen="intro"] .intro-lead {
    max-width: 390px;
  }
}

@media (max-width: 359px) {
  body[data-match-screen="intro"] .match-header,
  body[data-match-screen="intro"] .match-stage,
  body[data-match-screen="intro"] .match-footer {
    width: calc(100% - 32px);
  }

  body[data-match-screen="intro"] .match-header {
    gap: 8px;
  }

  body[data-match-screen="intro"] .brand {
    gap: 6px;
  }

  body[data-match-screen="intro"] .brand strong {
    font-size: .8125rem;
  }

  body[data-match-screen="intro"] .intro-facts li {
    padding-inline: 13px;
    gap: 12px;
  }

  body[data-match-screen="intro"] .intro-facts strong {
    font-size: .8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-match-screen="intro"] .intro-visual,
  body[data-match-screen="intro"] .intro-meter-fill {
    animation: none;
    transform: none;
  }

  body[data-match-screen="intro"] .intro-copy > .button {
    transition: none;
  }
}

@media (forced-colors: active) {
  body[data-match-screen="intro"] .intro-visual::before,
  body[data-match-screen="intro"] .intro-paws,
  body[data-match-screen="intro"] .intro-spark,
  body[data-match-screen="intro"] .intro-meter-fill::after {
    display: none;
  }

  body[data-match-screen="intro"] .intro-meter,
  body[data-match-screen="intro"] .intro-facts li,
  body[data-match-screen="intro"] .intro-copy > .button {
    border-color: ButtonText;
  }

  body[data-match-screen="intro"] .intro-meter-fill {
    background: Highlight;
    forced-color-adjust: none;
  }
}
