body {
  --c-glass: #bbbbbc;
  --c-light: #fff;
  --c-dark: #000;

  --c-content: #224;
  --c-action: #0052f5;

  --c-bg: #e8e8e9;

  --glass-reflex-dark: 1;
  --glass-reflex-light: 1;

  --saturation: 150%;

  font-family: "DM Sans", sans-serif;
  font-optical-sizing: auto;
  background: var(--c-bg);
  color: var(--c-content);
}

.switcher {
  position: fixed;
  z-index: 100;
  top: 40px;
  left: 50%;
  translate: -50%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 660px;
  max-width: 90vw;
  height: 70px;
  box-sizing: border-box;
  padding: 8px 20px 10px;
  margin: 0 auto;
  border: none;
  border-radius: 99em;
  font-size: var(--fz);
  background-color: color-mix(in srgb, var(--c-glass) 12%, transparent);
  backdrop-filter: blur(8px) url(#switcher) saturate(var(--saturation));
  -webkit-backdrop-filter: blur(8px) saturate(var(--saturation));
  overflow: hidden;
  box-shadow: inset 0 0 0 1px
      color-mix(
        in srgb,
        var(--c-light) calc(var(--glass-reflex-light) * 10%),
        transparent
      ),
    inset 1.8px 3px 0px -2px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 90%), transparent),
    inset -2px -2px 0px -2px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 80%), transparent),
    inset -3px -8px 1px -6px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 60%), transparent),
    inset -0.3px -1px 4px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 12%),
        transparent
      ),
    inset -1.5px 2.5px 0px -2px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 20%),
        transparent
      ),
    inset 0px 3px 4px -2px color-mix(in srgb, var(--c-dark)
          calc(var(--glass-reflex-dark) * 20%), transparent),
    inset 2px -6.5px 1px -4px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 1px 5px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 6px 16px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 8%),
        transparent
      );
  transition: background-color 400ms cubic-bezier(1, 0, 0.4, 1),
    box-shadow 400ms cubic-bezier(1, 0, 0.4, 1);
}

.switcher__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  white-space: nowrap;
  clip-path: inset(100%);
  clip: rect(0 0 0 0);
  overflow: hidden;
}

.switcher__input {
  clip: rect(0 0 0 0);
  clip-path: inset(100%);
  height: 1px;
  width: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
}

.switcher__icon {
  display: none;
}

.switcher__filter {
  position: absolute;
  width: 0;
  height: 0;
  z-index: -1;
}

.switcher__option {
  --c: var(--c-content);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  height: 100%;
  box-sizing: border-box;
  border-radius: 99em;
  opacity: 1;
  transition: all 160ms;
}

.switcher__option--home {
  flex: 0.5;
}

.switcher__icon--home {
  display: block;
  width: 42px;
  height: 24px;
  filter: brightness(0);
  transition: transform 200ms cubic-bezier(0.5, 0, 0, 1);
}

.switcher__option--home:hover .switcher__icon--home {
  transform: scale(1.1);
}

.switcher__option:nth-child(6) {
  flex: 0.6;
}

.switcher__name {
  position: relative;
  opacity: 1;
  visibility: visible;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c);
  transition: all 0.2s linear;
}

.switcher__option:hover {
  --c: var(--c-action);
  cursor: pointer;
}

.switcher__option:hover .switcher__name{
  transform: scale(1.05);
}

.switcher__option:has(input:checked) {
  --c: var(--c-content);
  cursor: auto;
}


.switcher::after {
  content: "";
  position: absolute;
  left: var(--indicator-left, 8px);
  top: 4px;
  display: block;
  width: var(--indicator-width, calc((100% - 40px) / 4.6));
  height: calc(100% - 10px);
  border-radius: 99em;
  background-color: color-mix(in srgb, var(--c-glass) 36%, transparent);
  z-index: -1;
  box-shadow: inset 0 0 0 1px
      color-mix(
        in srgb,
        var(--c-light) calc(var(--glass-reflex-light) * 10%),
        transparent
      ),
    inset 2px 1px 0px -1px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 90%), transparent),
    inset -1.5px -1px 0px -1px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 80%), transparent),
    inset -2px -6px 1px -5px color-mix(in srgb, var(--c-light)
          calc(var(--glass-reflex-light) * 60%), transparent),
    inset -1px 2px 3px -1px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 20%),
        transparent
      ),
    inset 0px -4px 1px -2px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 10%),
        transparent
      ),
    0px 3px 6px 0px
      color-mix(
        in srgb,
        var(--c-dark) calc(var(--glass-reflex-dark) * 8%),
        transparent
      );
}

.switcher:has(input[c-option="0"]:checked)::after {
  left: 19px;
  width: 52px;
  transform-origin: right;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle 440ms ease;
}

.switcher:has(input[c-option="1"]:checked)::after {
  left: calc(52px + 31px);
  width: 108px;
  transform-origin: right;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle 440ms ease;
}

.switcher:has(input[c-option="2"]:checked)::after {
  left: calc(52px + 108px + 44px);
  width: 115px;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle2 440ms ease;
}

.switcher[c-previous="1"]:has(input[c-option="2"]:checked)::after {
  transform-origin: left;
}

.switcher[c-previous="3"]:has(input[c-option="2"]:checked)::after {
  transform-origin: right;
}

.switcher:has(input[c-option="3"]:checked)::after {
  left: calc(52px + 108px + 115px + 60px);
  width: 95px;
  transform-origin: left;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle3 440ms ease;
}

.switcher:has(input[c-option="4"]:checked)::after {
  left: calc(52px + 108px + 115px + 95px + 86px);
  width: 60px;
  transform-origin: left;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle3 440ms ease;
}

.switcher:has(input[c-option="5"]:checked)::after {
  left: calc(52px + 108px + 115px + 95px + 60px + 92px);
  width: 125px;
  transform-origin: left;
  transition: all 400ms cubic-bezier(1, 0, 0.4, 1);
  animation: scaleToggle3 440ms ease;
}

/* Spanish navbar indicator positions */
.switcher.lang-es:has(input[c-option="0"]:checked)::after {
  left: 17px;
  width: 52px;
}

.switcher.lang-es:has(input[c-option="1"]:checked)::after {
  left: calc(52px + 16px);
  width: 120px;
}

.switcher.lang-es:has(input[c-option="2"]:checked)::after {
  left: calc(52px + 90px + 40px);
  width: 120px;
}

.switcher.lang-es:has(input[c-option="3"]:checked)::after {
  left: calc(52px + 100px + 100px + 55px);
  width: 95px;
}

.switcher.lang-es:has(input[c-option="4"]:checked)::after {
  left: calc(52px + 130px + 135px + 90px);
  width: 110px;
}

.switcher.lang-es:has(input[c-option="5"]:checked)::after {
  left: calc(52px + 130px + 135px + 105px + 95px);
  width: 130px;
}

@keyframes scaleToggle {
  0% {
    scale: 1 1;
  }

  50% {
    scale: 1.1 1;
  }

  100% {
    scale: 1 1;
  }
}

@keyframes scaleToggle2 {
  0% {
    scale: 1 1;
  }

  50% {
    scale: 1.2 1;
  }

  100% {
    scale: 1 1;
  }
}

@keyframes scaleToggle3 {
  0% {
    scale: 1 1;
  }

  50% {
    scale: 1.1 1;
  }

  100% {
    scale: 1 1;
  }
}


@media screen and (max-width: 900px) {
  .switcher {
    top: 15px;
    width: 96vw;
    max-width: 96vw;
    gap: 4px;
    padding: 5px 8px 6px;
    height: 55px;
  }

  .switcher__name {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
  }

  .switcher__icon--home {
    width: 22px;
    height: 22px;
  }
}

@media screen and (max-width: 720px) {
  .switcher {
    top: 15px;
    width: 97vw;
    max-width: 97vw;
    gap: 3px;
    padding: 4px 6px 6px;
    height: 50px;
  }

  .switcher__name {
    font-size: 0.55rem;
    letter-spacing: 0.3px;
  }

  .switcher__icon--home {
    width: 20px;
    height: 20px;
  }

  .switcher:has(input[c-option="0"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="1"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="2"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="3"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="4"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="5"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }

  /* Force Spanish variant to use measured indicator on mobile */
  .switcher.lang-es:has(input[c-option="0"]:checked)::after,
  .switcher.lang-es:has(input[c-option="1"]:checked)::after,
  .switcher.lang-es:has(input[c-option="2"]:checked)::after,
  .switcher.lang-es:has(input[c-option="3"]:checked)::after,
  .switcher.lang-es:has(input[c-option="4"]:checked)::after,
  .switcher.lang-es:has(input[c-option="5"]:checked)::after {
    left: var(--indicator-left, 4px);
    width: var(--indicator-width, 16%);
  }
}

@media screen and (max-width: 480px) {
  .switcher {
    height: 45px;
    gap: 2px;
    padding: 3px 5px 5px;
    top: 10px;
  }

  .switcher__name {
    font-size: 0.48rem;
    letter-spacing: 0.2px;
  }

  .switcher__icon--home {
    width: 16px;
    height: 16px;
  }

  .switcher:has(input[c-option="0"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="1"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="2"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="3"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="4"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  .switcher:has(input[c-option="5"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }

  /* Force Spanish variant to use measured indicator on small mobile */
  .switcher.lang-es:has(input[c-option="0"]:checked)::after,
  .switcher.lang-es:has(input[c-option="1"]:checked)::after,
  .switcher.lang-es:has(input[c-option="2"]:checked)::after,
  .switcher.lang-es:has(input[c-option="3"]:checked)::after,
  .switcher.lang-es:has(input[c-option="4"]:checked)::after,
  .switcher.lang-es:has(input[c-option="5"]:checked)::after {
    left: var(--indicator-left, 3px);
    width: var(--indicator-width, 16%);
  }
}
