
.vy-score {
  --vy-font-display: "Lantern Display", "Manrope Variable", Manrope, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --vy-ink: light-dark(#1D1713, #F8F2EA);
  --vy-ink-soft: light-dark(#615449, #CBBFB2);
  --vy-halo: #FFF1DC;
  --vy-size: 11.5px;
  --vy-wave-o: 1;
  --vy-bloom-o: 0.36;
  --vy-halo-o: 0.55;
  --vy-wave-k: 1;
  --vy-bloom-k: 1;
  --vy-halo-k: 1;
  /* Dark pages: thinner reeds behind the text, so the light label keeps 4.5:1. */
  --vy-wave-night: 0.36;
  --vy-bloom-night: 67%;
  /* The reeds' mask color: opaque in light, thinner in dark. */
  --vy-reeds: light-dark(#000, rgb(0 0 0 / var(--vy-wave-night)));
  all: unset;
  box-sizing: border-box;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3em;
  height: 1.75em;
  padding: 0 0.34em;
  margin: 0;
  font-family: var(--vy-font-display);
  font-size: var(--vy-size);
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.006em;
  font-variant-numeric: tabular-nums;
  color: var(--vy-ink);
  white-space: nowrap;
  cursor: pointer;
  isolation: isolate;
  vertical-align: middle;
  border-radius: 999px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}
.vy-score[data-size="sm"] { --vy-size: 11px; }
.vy-score[data-size="md"] { --vy-size: 11.5px; }
.vy-score[data-size="lg"] { --vy-size: 12.5px; }
.vy-score[data-size="xl"] { --vy-size: 30px; letter-spacing: -0.018em; cursor: default; }
.vy-score[data-static="true"] { cursor: default; }
/* The surface's own scheme, when the renderer has read it from the page. */
.vy-score[data-scheme="light"] { color-scheme: light; }
.vy-score[data-scheme="dark"] { color-scheme: dark; }

/* — layers (default geometry = compact: a small wave tight behind the text) — */
.vy-score__bloom {
  position: absolute;
  inset: 0.16em -0.22em;
  z-index: -3;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(closest-side, light-dark(var(--vy-bloom, #FFE2B8), color-mix(in srgb, var(--vy-bloom, #FFE2B8) var(--vy-bloom-night), transparent)) 0%, transparent 100%);
  opacity: calc(var(--vy-bloom-o) * var(--vy-bloom-k));
  filter: blur(0.35em);
  transition: opacity 220ms ease;
}
.vy-score__wave {
  position: absolute;
  inset: 0.02em -0.5em;
  z-index: -2;
  pointer-events: none;
  opacity: calc(var(--vy-wave-o) * var(--vy-wave-k));
  -webkit-mask-image: radial-gradient(closest-side, var(--vy-reeds) 60%, light-dark(rgba(0, 0, 0, 0.55), rgb(0 0 0 / calc(0.55 * var(--vy-wave-night)))) 82%, transparent 100%);
          mask-image: radial-gradient(closest-side, var(--vy-reeds) 60%, light-dark(rgba(0, 0, 0, 0.55), rgb(0 0 0 / calc(0.55 * var(--vy-wave-night)))) 82%, transparent 100%);
  filter: blur(0.018em) saturate(1.1);
  transition: opacity 220ms ease;
}
.vy-score__wave > svg { display: block; width: 100%; height: 100%; overflow: visible; }
/* A light tint behind the text in light, an ink shadow in dark. */
.vy-score__halo {
  position: absolute;
  inset: 0.3em 0.2em;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  background: radial-gradient(closest-side, light-dark(var(--vy-halo), #0B0806) 0%, transparent 100%);
  opacity: calc(var(--vy-halo-o) * var(--vy-halo-k));
  filter: blur(0.22em);
}
.vy-score__text {
  display: inline-flex;
  align-items: baseline;
  gap: 0.26em;
  /* A white glow keeps dark ink crisp over the reeds; a wider ink glow does it for light ink. */
  text-shadow:
    0 0 0.3em light-dark(rgba(255, 255, 255, 0.85), transparent),
    0 0 0.1em light-dark(rgba(255, 255, 255, 0.9), rgba(11, 8, 6, 0.95)),
    0 0 0.45em light-dark(transparent, rgba(11, 8, 6, 0.9));
}
.vy-score__value { font-weight: 680; }
.vy-score__label { font-weight: 590; opacity: 0.86; }
/* Large scores keep the inline weights, a touch lighter so 30px type doesn't turn heavy. */
.vy-score[data-size="xl"] .vy-score__value { font-weight: 660; }
.vy-score[data-size="xl"] .vy-score__label { font-weight: 570; }

/* — variant: underglow · a slim fluted strip under the baseline — */
/* Nothing sits behind the letters in underglow and glyph, so their reeds stay brighter in dark. */
.vy-score[data-variant="underglow"] { padding: 0 0.1em; --vy-wave-o: 0.95; --vy-bloom-o: 0.5; --vy-halo-o: 0; --vy-wave-night: 0.9; --vy-bloom-night: 68%; }
.vy-score[data-variant="underglow"] .vy-score__wave {
  inset: auto -0.06em;
  top: calc(50% + 0.6em);
  height: 0.34em;
  -webkit-mask-image: linear-gradient(90deg, transparent, var(--vy-reeds) 16%, var(--vy-reeds) 84%, transparent);
          mask-image: linear-gradient(90deg, transparent, var(--vy-reeds) 16%, var(--vy-reeds) 84%, transparent);
  filter: blur(0.2px) saturate(1.15);
}
.vy-score[data-variant="underglow"] .vy-score__bloom { inset: auto 0.05em; top: calc(50% + 0.42em); height: 0.7em; filter: blur(0.26em); }

/* — variant: glyph · a tiny fluted mark before the text ———————— */
.vy-score[data-variant="glyph"] { padding: 0 0.1em 0 0.04em; gap: 0.36em; --vy-wave-o: 1; --vy-bloom-o: 0.55; --vy-halo-o: 0; --vy-wave-night: 0.85; --vy-bloom-night: 62%; }
.vy-score[data-variant="glyph"] .vy-score__wave {
  position: relative;
  inset: auto;
  flex: none;
  width: 0.95em;
  height: 1.06em;
  -webkit-mask-image: linear-gradient(var(--vy-reeds), var(--vy-reeds));
          mask-image: linear-gradient(var(--vy-reeds), var(--vy-reeds));
  filter: saturate(1.15);
}
.vy-score[data-variant="glyph"] .vy-score__bloom { inset: 0.12em auto 0.12em -0.26em; width: 1.5em; filter: blur(0.3em); }

/* — variant: echo · short reeds either side, the text at the peak — */
.vy-score[data-variant="echo"] { padding: 0 1em; --vy-wave-o: 0.95; --vy-bloom-o: 0.3; --vy-wave-night: 0.85; --vy-bloom-night: 73%; }
.vy-score[data-variant="echo"] .vy-score__wave {
  inset: 0.3em 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, var(--vy-reeds) 0.26em, var(--vy-reeds) 0.72em, transparent 0.92em, transparent calc(100% - 0.92em), var(--vy-reeds) calc(100% - 0.72em), var(--vy-reeds) calc(100% - 0.26em), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, var(--vy-reeds) 0.26em, var(--vy-reeds) 0.72em, transparent 0.92em, transparent calc(100% - 0.92em), var(--vy-reeds) calc(100% - 0.72em), var(--vy-reeds) calc(100% - 0.26em), transparent 100%);
  filter: blur(0.3px) saturate(1.12);
}
.vy-score[data-variant="echo"] .vy-score__bloom { inset: 0.22em 0.3em; filter: blur(0.43em); }
.vy-score[data-variant="echo"] .vy-score__halo { inset: 0.24em 0.9em; }

/* — variant: diamond · weighted reeds in a small diamond before plain text (default) —
   indicatorReeds() draws three to five reeds whose ends trace a ◆, taller and warmer as
   the score rises, and sizes the mark. They sit beside the text, not behind it, so
   nothing softens the letters and the reeds keep their color at night. */
.vy-score[data-variant="diamond"] { padding: 0 0.12em 0 0.06em; gap: 0.38em; --vy-wave-o: 1; --vy-bloom-o: 0; --vy-halo-o: 0; }
.vy-score[data-variant="diamond"] .vy-score__wave {
  position: relative;
  inset: auto;
  /* Above the capsule over media (the halo, at -1). */
  z-index: 0;
  flex: none;
  -webkit-mask-image: none;
          mask-image: none;
  filter: none;
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

/* — over images / video: a small frosted lens keeps text legible (smoked in dark) — */
.vy-score[data-surface="media"] { --vy-wave-o: 1; --vy-bloom-o: 0.7; --vy-halo-o: 1; --vy-wave-night: 1; --vy-bloom-night: 100%; }
.vy-score[data-surface="media"] .vy-score__halo {
  inset: 0 -0.3em;
  background: radial-gradient(closest-side, light-dark(rgba(255, 255, 255, 0.74), rgba(18, 14, 11, 0.6)), light-dark(rgba(255, 255, 255, 0.3), rgba(18, 14, 11, 0.3)) 64%, transparent 100%);
  filter: none;
  -webkit-backdrop-filter: blur(0.52em) saturate(1.1);
          backdrop-filter: blur(0.52em) saturate(1.1);
  -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 55%, transparent 100%);
}
.vy-score[data-surface="media"][data-variant="underglow"] .vy-score__halo { inset: -0.05em -0.3em -0.4em; }
/* The diamond over photos and video: the whole score on a small capsule of the header's
   liquid glass, frosted in light and smoked in dark, so it reads on any picture. */
.vy-score[data-variant="diamond"][data-surface="media"] { height: 1.95em; padding: 0 0.72em 0 0.58em; gap: 0.38em; --vy-bloom-o: 0; }
.vy-score[data-variant="diamond"][data-surface="media"] .vy-score__halo {
  inset: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, light-dark(rgba(255, 255, 255, 0.8), rgba(36, 28, 22, 0.86)) 0%, light-dark(rgba(255, 255, 255, 0.66), rgba(22, 17, 13, 0.8)) 100%);
  filter: none;
  -webkit-backdrop-filter: blur(12px) saturate(1.7);
          backdrop-filter: blur(12px) saturate(1.7);
  -webkit-mask-image: none;
          mask-image: none;
  box-shadow:
    inset 0 0.6px 0.3px light-dark(rgba(255, 255, 255, 0.95), rgba(255, 235, 210, 0.22)),
    inset 0 -0.6px 0.6px light-dark(rgba(255, 255, 255, 0.4), rgba(255, 235, 210, 0.06)),
    0 0 0 0.5px light-dark(rgba(70, 45, 20, 0.12), rgba(0, 0, 0, 0.35)),
    0 4px 12px -6px light-dark(rgba(110, 60, 20, 0.42), rgba(0, 0, 0, 0.65));
}

/* — states ———————————————————————————————————————————— */
.vy-bar { transform-box: fill-box; transform-origin: 50% 50%; }
.vy-score[data-state="ready"]:not([data-noanim="true"]) .vy-bar {
  animation: vy-rise 900ms cubic-bezier(0.2, 0.9, 0.25, 1) both;
  animation-delay: calc(var(--i) * 14ms);
}
.vy-score[data-state="ready"]:not([data-noanim="true"]) .vy-score__text { animation: vy-in 420ms ease-out both; }
.vy-score[data-state="ready"][data-static="false"]:hover .vy-bar {
  animation: vy-eq 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * -70ms);
}
/* With its card open it moves a few times and then rests, so nothing keeps moving beside the card. */
.vy-score[data-state="ready"][data-open="true"] .vy-bar {
  animation: vy-eq 1.8s ease-in-out 3;
  animation-delay: calc(var(--i) * -70ms);
}
.vy-score[data-static="false"]:hover,
.vy-score[data-open="true"] { --vy-wave-k: 1.14; }

.vy-score[data-state="pending"] { --vy-bloom-k: 0; }
.vy-score[data-state="pending"] .vy-score__wave { animation: vy-breathe 1.6s ease-in-out infinite; }
.vy-score[data-state="pending"] .vy-score__value { color: var(--vy-ink-soft); letter-spacing: 0.1em; font-weight: 600; }

.vy-score[data-state="idle"],
.vy-score[data-state="error"] { --vy-wave-k: 0; --vy-bloom-k: 0; --vy-halo-k: 0; }
.vy-score[data-state="idle"]:hover { --vy-wave-k: 0.45; }
.vy-score[data-state="idle"] .vy-score__value,
.vy-score[data-state="error"] .vy-score__value { color: var(--vy-ink-soft); font-weight: 560; }
/* The glyph stays as a muted mark, so “Scan” still reads as Lantern's. */
.vy-score[data-variant="glyph"][data-state="idle"],
.vy-score[data-variant="glyph"][data-state="error"] { --vy-wave-k: 0.5; }
.vy-score[data-variant="glyph"][data-state="idle"]:hover { --vy-wave-k: 0.8; }
.vy-score[data-variant="echo"][data-state="idle"],
.vy-score[data-variant="echo"][data-state="error"] { padding: 0 0.36em; }
.vy-score[data-variant="echo"][data-state="idle"]:hover { --vy-wave-k: 0; }

/* The diamond: it rises from its heart outward; pointing at it (or with its card open) it beats
   like the hero's diamond instead of swaying; while Lantern checks, its reeds breathe; without
   a score it stays as a muted mark, so "Scan" still reads as Lantern's. */
.vy-score[data-variant="diamond"][data-state="ready"]:not([data-noanim="true"]) .vy-bar {
  animation-duration: 760ms;
  animation-delay: calc(var(--i) * 80ms);
}
.vy-score[data-variant="diamond"][data-state="ready"][data-static="false"]:hover .vy-bar,
.vy-score[data-variant="diamond"][data-state="ready"][data-open="true"] .vy-bar { animation: none; }
.vy-score[data-variant="diamond"][data-state="ready"][data-static="false"]:hover .vy-score__wave { animation: vy-beat 2.6s ease-in-out infinite; }
.vy-score[data-variant="diamond"][data-state="ready"][data-open="true"] .vy-score__wave { animation: vy-beat 2.6s ease-in-out 3; }
.vy-score[data-variant="diamond"][data-state="pending"] .vy-score__wave { animation: none; }
.vy-score[data-variant="diamond"][data-state="pending"] .vy-bar {
  animation: vy-reed-breathe 1.8s ease-in-out infinite;
  animation-delay: calc(var(--i) * 200ms);
}
.vy-score[data-variant="diamond"][data-state="idle"],
.vy-score[data-variant="diamond"][data-state="error"] { --vy-wave-k: 0.55; }
.vy-score[data-variant="diamond"][data-state="idle"]:hover { --vy-wave-k: 0.85; }

.vy-score[data-insufficient="true"] { --vy-wave-k: 0.6; --vy-bloom-k: 0.5; }
.vy-score[data-insufficient="true"] .vy-score__value,
.vy-score[data-insufficient="true"] .vy-score__label { color: var(--vy-ink-soft); }

/* Over photos and video the lens stays on in every state, and quiet states take full ink:
   soft ink over a busy image fell under 4.5:1 ("Scan", "Not enough evidence"). */
.vy-score[data-surface="media"][data-state="idle"],
.vy-score[data-surface="media"][data-state="error"] { --vy-halo-k: 1; }
.vy-score[data-surface="media"][data-state="idle"] .vy-score__value,
.vy-score[data-surface="media"][data-state="error"] .vy-score__value,
.vy-score[data-surface="media"][data-insufficient="true"] .vy-score__value,
.vy-score[data-surface="media"][data-insufficient="true"] .vy-score__label { color: var(--vy-ink); }

.vy-score:focus-visible { outline: 2px solid light-dark(#A8481A, #FFB26B); outline-offset: 2px; }
/* Still estimating: there's no card to open yet (aria-disabled on the button). */
.vy-score[aria-disabled="true"] { cursor: default; }

@keyframes vy-rise {
  from { transform: scaleY(0.06); opacity: 0; }
  55% { opacity: 1; }
  to { transform: scaleY(1); opacity: 1; }
}
@keyframes vy-eq {
  0%, 100% { transform: scaleY(1); }
  50% { transform: scaleY(0.58); }
}
@keyframes vy-breathe {
  0%, 100% { opacity: 0.18; }
  50% { opacity: 0.46; }
}
@keyframes vy-in {
  from { opacity: 0; transform: translateY(1px); }
  to { opacity: 1; transform: none; }
}
@keyframes vy-beat {
  0%, 55%, 100% { transform: scale(1); }
  25% { transform: scale(1.12); }
}
@keyframes vy-reed-breathe {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.95; }
}
@media (prefers-reduced-motion: reduce) {
  .vy-score, .vy-score * { animation: none !important; transition: none !important; }
  .vy-score[data-state="pending"] .vy-score__wave { opacity: 0.32; }
  .vy-score[data-variant="diamond"][data-state="pending"] .vy-score__wave { opacity: 0.7; }
}
