@font-face {
  font-family: "Renduva cifras";
  src: url("manrope-regular.woff2") format("woff2"),
       url("manrope-regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "Renduva cifras";
  src: url("manrope-bold.woff2") format("woff2"),
       url("manrope-bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

#cifras {
  margin-block: clamp(.75rem, 1.5vw, 1.75rem);
  padding-block: clamp(3rem, 5vw, 6rem);
  color: #eff3ff;
  font: 400 1rem "Renduva cifras", Arial, sans-serif;
  letter-spacing: normal;
}

#cifras:focus { outline: none; }

.stats-scene {
  width: min(92.4%, 109rem);
  margin-inline: auto;
  container-type: inline-size;
}

.stats-titling {
  padding-inline: 0;
  margin-bottom: clamp(1.6rem, 2.8cqw, 2.85rem);
}

.stats-titling .eyebrow {
  margin-bottom: .7rem;
}

#cifras .stats-title {
  color: #f7fbff;
  font-size: clamp(2.4rem, 4.7cqw, 4.9rem);
}

#cifras .stats-note {
  grid-column: 1 / -1;
  margin: .55rem 0 0;
  font-family: var(--renduva-font, Manrope, sans-serif);
}

@media (min-width: 1001px) and ((min-width: 1101px) or (hover: hover) or (pointer: fine)) {
  .stats-titling {
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(31%, 31.5rem);
    column-gap: clamp(1.25rem, 3vw, 3rem);
  }

  #cifras .stats-note {
    grid-area: 1 / 2 / span 2;
    align-self: end;
    justify-self: end;
    margin: 0 clamp(0px, 25vw - 21rem, 7.5rem) .25em 0;
  }
}

@media (max-width: 760px), (max-width: 1100px) and (hover: none) and (pointer: coarse) {
  #cifras .stats-titling .stats-note {
    max-width: 41ch;
    font-size: clamp(.875rem, 4vw, 1.05rem);
    line-height: 1.35;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(.875rem, 1.65cqw, 1.85rem);
  --badge-size: clamp(2.6rem, 3.18vw, 3.7rem);
  --card-radius: clamp(1.125rem, 1.62cqw, 1.8rem);
}

.metric {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  min-height: 15.05cqw;
  padding: clamp(1rem, 1.15cqw, 1.45rem) clamp(1.2rem, 2.7cqw, 3rem);
  border: 1px solid transparent;
  border-radius: var(--card-radius);
  background:
    radial-gradient(ellipse at 0% 0%, #005697 0%, #003f6f94 25%, transparent 55%) padding-box,
    radial-gradient(ellipse at 100% 105%, #0076c5 0%, #004982ba 29%, transparent 62%) padding-box,
    linear-gradient(157deg, #002d52, #011a32 51%, #002e54) padding-box,
    linear-gradient(133deg, #d3f5ff 0%, #32bcff 5%, #276496 33%, #18476e 53%, #099ded 81%, #a9efff 99%) border-box;
  box-shadow: inset 0 1px 5px #31aaff40, inset 0 -4px 12px -8px #32c6ff, 0 5px 15px #010c1b66;
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .stats-grid > .metric {
    transition: transform 180ms ease-out, box-shadow 180ms ease-out;
  }

  .stats-grid > .metric:hover {
    transform: translateY(-5px);
    box-shadow: inset 0 1px 12px #5acdff80, inset 0 -7px 24px -11px #35caffaa, 0 8px 20px #010c1b80, 0 0 20px #30baff48;
  }
}

/* The curved reflection is brightest where it meets the lower bevel. */
.metric::before,
.metric::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  border-radius: inherit;
}

.metric::before {
  background: url("reflejo-zafiro.webp") right bottom / 68% 130% no-repeat;
  mix-blend-mode: screen;
}

.metric::after {
  background:
    radial-gradient(ellipse 46% 2.5% at var(--shine-x, 15%) 0%, #c8f6ffbc, #22acff73 27%, transparent 79%),
    radial-gradient(ellipse 56% 4.5% at 78% 101%, #46daff9c, #008bff66 35%, transparent 83%);
}

.metric--1, .metric--2 {
  grid-column: span 2;
  min-height: 18.25cqw;
  padding-inline: clamp(1.35rem, 3cqw, 3.35rem);
}

.metric--1::before {
  background: radial-gradient(ellipse 100% 104% at 0% -43%, #0064a445 32%, #003e6d18 80%, #00518d 96%, #0065ae 99.8%, transparent 100%);
  mask-image: linear-gradient(33deg, #0004 6%, #0008 46%, #000 84%);
  mix-blend-mode: normal;
}

.metric--2 { --shine-x: 64%; }
.metric--2::before {
  background-size: 78% 108%;
  opacity: .8;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: clamp(.7rem, 1.4vw, 1.7rem);
  color: #f8fcff;
  font-family: inherit;
  font-size: clamp(.875rem, 5.85cqw, 1.25rem);
  font-weight: 700;
  letter-spacing: -.024em;
  line-height: 1.13;
  text-transform: uppercase;
}
.metric--1 .metric-label, .metric--2 .metric-label { font-size: clamp(1rem, 3cqw, 1.5rem); }

.metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 var(--badge-size);
  width: var(--badge-size);
  height: var(--badge-size);
  border: 1px solid transparent;
  border-radius: 25%;
  background:
    radial-gradient(ellipse at 0 0, #007fca, transparent 52%) padding-box,
    radial-gradient(ellipse at 102% 106%, #005a98, transparent 40%) padding-box,
    linear-gradient(141deg, #00548d, #03243f 72%, #00213d) padding-box,
    linear-gradient(140deg, #c4f6ff, #098bd5 18%, #00416b 46%, #003154 69%, #1ac0ff) border-box;
  box-shadow: inset 0 0 5px #0086cd24;
  color: #f2fbff;
}

.metric-glyph { display: block; width: 62%; height: 62%; }

.metric-value {
  position: relative;
  margin: .12em 0 .12em;
  font-size: clamp(2.35rem, 24.6cqw, 5rem);
  font-weight: 700;
  font-variant-numeric: lining-nums proportional-nums;
  line-height: .99;
  letter-spacing: -.058em;
  white-space: nowrap;
  color: #f6faff;
  text-shadow: 0 1px 1px #023152;
}
.metric--1 .metric-value, .metric--2 .metric-value { font-size: clamp(2.65rem, 15.35cqw, 7.25rem); }
.metric--2 .metric-value { font-size: clamp(2.45rem, 14.7cqw, 7.05rem); }
.metric-value .unit, .metric-value .sign { font-size: .93em; }

@media (min-width: 1101px), (min-width: 761px) and (hover: hover), (min-width: 761px) and (pointer: fine) {
  #cifras .metric-value { font-weight: 800; }

  @media (forced-colors: none) {
    @supports ((background-clip: text) or (-webkit-background-clip: text)) {
      #cifras .metric-value {
        background-image: linear-gradient(175deg, #e0efff 8%, #fff 31%, #f6fbff 45%, #bedaef 65%, #93b6e3 83%, #daeafa 98%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        text-shadow: none;
        filter: drop-shadow(0 1px 0 #517aad) drop-shadow(0 .06em .055em #00142aca);
      }
    }
  }
}

.metric-desc {
  position: relative;
  max-width: 12em;
  color: #eef7ff;
  font-size: clamp(1rem, 6.45cqw, 1.39rem);
  font-family: var(--renduva-font);
  font-weight: 500;
  letter-spacing: -.022em;
  line-height: 1.25;
}
.metric--1 .metric-desc, .metric--2 .metric-desc {
  max-width: min(56%, 14.4em);
  font-size: clamp(1.05rem, 3.55cqw, 1.72rem);
}
.metric--4 .metric-desc { display: grid; }
.metric--4 .metric-desc > span { grid-area: 1 / 1; }
.metric-desc-full { opacity: 0; }

.metric-art {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  right: 5.8%;
  bottom: 14%;
  width: 30%;
  height: 61%;
}

/* Light scattered onto the card extends beyond the artwork's silhouette. */
.metric-art::before {
  content: "";
  position: absolute;
  inset: -14% -16% -24%;
  background: var(--surface-light);
}

.metric-bars {
  --glass-image: url("barras-zafiro.webp");
  --surface-light:
    radial-gradient(ellipse 39% 2.5% at 51% 82%, #001326c4, transparent),
    radial-gradient(ellipse 47% 5.5% at 53% 82.8%, #28bbff70, transparent),
    radial-gradient(ellipse 50% 42% at 53% 73%, #0b8bd854, transparent);
}

.metric-plates {
  transform: scale(.8);
  --glass-image: url("capas-zafiro.webp");
  --surface-light:
    radial-gradient(ellipse 29% 5.5% at 55% 86%, #001327bd, transparent),
    radial-gradient(ellipse 39% 9% at 47% 85%, #22b0ff69, transparent),
    radial-gradient(ellipse 47% 41% at 48% 55%, #228bda4d, transparent);
}

.metric-glass, .metric-art::after {
  position: absolute;
  inset: 0;
  background: var(--glass-image) center / 100% 100% no-repeat;
}

.metric-glass {
  z-index: 1;
  filter: url("cristal.svg#translucido") brightness(1.24) drop-shadow(2px 3px 2px #00182a80) drop-shadow(3px 6px 5px #00172c48);
}

.metric-plates .metric-glass {
  filter: url("cristal.svg#translucido") brightness(1.24) drop-shadow(3px 6px 3px #00162b73) drop-shadow(4px 10px 7px #0013265c);
}

/* Mirror the actual glass into the surface, fading away from the contact line. */
.metric-art::after {
  content: "";
  inset: 97.5% 0 auto;
  height: 48%;
  transform: scaleY(-1);
  mask-image: linear-gradient(to top, #000 1%, #0009 20%, transparent 65%);
  filter: blur(.75px) brightness(1.45);
  opacity: .48;
}

#cifras .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (forced-colors: active) {
  .metric, .metric-icon { border-color: CanvasText; }
  .metric-icon { color: CanvasText; }
}

@media (min-width: 1001px) and ((min-width: 1101px) or (hover: hover) or (pointer: fine)) {
  .stats-grid > .metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    row-gap: clamp(.6rem, .95cqw, 1.05rem);
  }

  #cifras .metric-label { display: none; }

  #cifras .metric-value {
    margin: 0;
    font-size: 36.6cqi;
    line-height: 1;
  }

  #cifras .metric--1 .metric-value { font-size: 22.3cqi; }
  #cifras .metric--2 .metric-value { font-size: 16.65cqi; }

  #cifras .metric-desc {
    margin: 0;
    max-width: 100%;
    font-size: clamp(1rem, 8cqi, 1.69rem);
    line-height: 1.2;
  }

  #cifras :is(.metric--1, .metric--2) .metric-desc {
    max-width: 68%;
    font-size: clamp(1.14rem, 4.37cqi, 2.14rem);
  }

  #cifras .metric--2 .metric-art {
    right: 3%;
    width: 24%;
  }
}

@media (max-width: 1000px) {
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(2, 1.2fr) repeat(2, 1fr);
  }
  .metric { min-height: 12rem; }
  .metric--1, .metric--2 { min-height: clamp(12rem, 36cqw, 19rem); }
}

@media (max-width: 560px) {
  .stats-scene { width: calc(100% - 2rem); }
  .stats-grid { --badge-size: 2.5rem; gap: .8rem; grid-template-rows: none; grid-auto-rows: 1fr; }
  .metric { padding: 1rem clamp(.75rem, 3.6vw, 1.15rem); min-height: 12.25rem; }
  .metric-label { flex-direction: column; align-items: flex-start; gap: .62rem; font-size: .875rem; }
  .metric--1, .metric--2 { min-height: 10.85rem; padding-inline: 1.15rem; }
  .metric--1 .metric-label, .metric--2 .metric-label { flex-direction: row; align-items: center; gap: .8rem; }
  .metric-value { margin-block: .16em .12em; }
  .metric--1 .metric-value { font-size: clamp(2.65rem, 14.8cqw, 4rem); }
  .metric--2 .metric-value { font-size: clamp(2.35rem, 13.4cqw, 3.75rem); }
  .metric--1 .metric-desc, .metric--2 .metric-desc { max-width: 63%; font-size: 1rem; }
  .metric-art { width: 27%; height: auto; aspect-ratio: 244 / 204; bottom: 22%; right: 4.5%; }
}

@media (max-width: 760px), (orientation: landscape) and (max-width: 1100px) and (max-height: 540px) and (hover: none) and (pointer: coarse) {
  #cifras .metric--1 { order: -2; }
  #cifras .metric--6 { order: -1; }
  #cifras .metric--2 { order: 1; }
}

@media (max-width: 599px), (max-width: 999px) and (max-height: 500px) and (orientation: landscape) and (pointer: coarse) {
  main > #cifras.stats {
    padding-block: clamp(2.5rem, 8.5vw, 4rem) clamp(2rem, 6vw, 3.25rem);
  }

  #cifras .stats-scene {
    width: min(91%, 37rem, calc(100% - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }

  #cifras .stats-titling {
    display: block;
    margin-block-end: clamp(1.5rem, 6vw, 2.4rem);
    padding-inline: .25rem;
  }

  #cifras .stats-titling .eyebrow {
    margin-block-end: .75rem;
    font-size: clamp(.76rem, 3.15cqi, .95rem);
  }

  #cifras .stats-titling .eyebrow::before {
    background: #00d9f4;
    border-radius: 50%;
  }

  #cifras .stats-titling .stats-title {
    font-size: clamp(1.34rem, 8.3cqi, 3.1rem);
    text-wrap: balance;
  }

  #cifras .stats-titling .hero-accent {
    font-size: 1.1em;
  }

  #cifras .stats-grid {
    --badge-size: clamp(1.2rem, 6.15vw, 2rem);
    --card-radius: clamp(.85rem, 3.8cqi, 1.4rem);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto repeat(2, 1fr) auto;
    gap: clamp(.55rem, 2.3cqi, .9rem);
  }

  #cifras .metric {
    grid-column: auto;
    min-height: clamp(8.7rem, 37cqw, 12.5rem);
    padding: clamp(.7rem, 3cqw, 1.15rem) clamp(.6rem, 3.75cqw, 1.5rem)
      clamp(.95rem, 4.15cqw, 1.65rem);
  }

  #cifras .metric:is(.metric--1, .metric--2) {
    grid-column: 1 / -1;
    --badge-size: clamp(1.5rem, 7.35vw, 2.2rem);
    min-height: clamp(9.5rem, 39cqw, 13.75rem);
    padding-inline: clamp(1rem, 5.3cqw, 2rem);
  }

  #cifras .metric--1::before {
    background: url("reflejo-zafiro.webp") right bottom / 54% 115% no-repeat;
    mask-image: none;
    mix-blend-mode: screen;
  }

  #cifras .metric--2::before {
    background-size: 54% 115%;
  }

  #cifras .metric--2 {
    background:
      radial-gradient(ellipse at 100% 0%, #8535cbdb, transparent 40%) padding-box,
      radial-gradient(ellipse at 0% 0%, #005697, transparent 52%) padding-box,
      radial-gradient(ellipse at 100% 105%, #0076c5, #004982ba 31%, transparent 62%) padding-box,
      linear-gradient(157deg, #002d52, #011a32 51%, #002e54) padding-box,
      linear-gradient(133deg, #d3f5ff, #32bcff 7%, #276496 38%, #a362e1 60%, #099ded 88%, #a9efff) border-box;
  }

  #cifras .metric-art {
    display: none;
  }

  #cifras .metric-icon {
    display: grid;
  }

  #cifras .metric-label {
    flex-direction: row;
    align-items: center;
    gap: clamp(.25rem, 1.45vw, .65rem);
    font-size: clamp(.685rem, 3.15vw, .98rem);
    line-height: 1.16;
    overflow-wrap: anywhere;
  }

  #cifras .metric:is(.metric--1, .metric--2) .metric-label {
    font-size: clamp(.8rem, 3.4vw, 1.07rem);
  }

  #cifras .metric-value {
    margin-block: .35rem .15rem;
    font-size: min(28cqi, 3.7rem);
    line-height: min(28cqi, 3.7rem);
  }

  #cifras .metric--2 .metric-value {
    font-size: min(22.7cqi, 3.1rem);
  }

  #cifras .metric:is(.metric--1, .metric--2) .metric-value {
    margin-block: .16em .1em;
    font-size: min(20.3cqi, 5.6rem);
    line-height: .99;
  }

  #cifras .metric-desc {
    max-width: none;
    font-size: clamp(.9rem, 3.6vw, 1.12rem);
    line-height: 1.24;
    overflow-wrap: anywhere;
  }

  #cifras .metric:is(.metric--1, .metric--2) .metric-desc {
    font-size: clamp(.95rem, 3.7vw, 1.2rem);
  }

  #cifras .metric--4 .metric-desc > [aria-hidden] {
    display: none;
  }

  #cifras .metric-desc-full {
    opacity: 1;
  }
}

@media (max-width: 349px) {
  #cifras .metric--2 .metric-label {
    font-size: clamp(.625rem, 3.125vw, .67rem);
    letter-spacing: -.045em;
  }
}
