@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/fredoka-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/fredoka-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: Fredoka;
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/fredoka-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Nunito Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/nunito-sans-latin-700-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  font-family: "Nunito Sans", system-ui, sans-serif;
  color: #e6fff7;
  background: #06100e;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background: #06100e;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: #7ee8c9;
}

a:hover {
  color: #b8f5e2;
}

#page {
  position: relative;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  flex-direction: column;
  overflow-x: clip;
  background: radial-gradient(ellipse at 50% 40%, #0c221d 0%, #06100e 60%);
}

.hx-header {
  position: relative;
  z-index: 6;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 28px clamp(16px, 4vw, 56px) 0;
}

.hx-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.hx-title-home {
  display: inline-block;
  align-self: flex-start;
}

.hx-header h1 {
  margin: 0;
}

.hx-title {
  display: inline-block;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #7ee8c9;
  cursor: pointer;
  font-family: Fredoka, sans-serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  white-space: nowrap;
  transition: text-shadow 0.6s;
}

.hx-title:focus-visible {
  border-radius: 6px;
  outline: 2px solid #e6fff7;
  outline-offset: 4px;
}

.hx-title.hx-settled {
  text-shadow: 0 0 24px rgb(126 232 201 / 70%);
}

.hx-tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.35em;
  margin: 0;
  color: #a9cfc4;
  font-size: 17px;
  transition: opacity 0.5s;
}

.hx-tagline-hidden {
  opacity: 0;
}

/* One language at a time: <html lang> (set by js/lang.js, switched by the toggle) hides the other one. */
html[lang="es"] body [lang="en"],
html[lang="en"] body [lang="es"] {
  display: none !important;
}

.hx-lang {
  min-width: 48px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid #2bb39a;
  border-radius: 999px;
  background: transparent;
  color: #e6fff7;
  cursor: pointer;
  font: 700 15px "Nunito Sans", system-ui, sans-serif;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.hx-lang:hover {
  background: rgb(43 179 154 / 18%);
}

.hx-lang:focus-visible {
  outline: 2px solid #e6fff7;
  outline-offset: 3px;
}

.hx-main {
  display: flex;
  flex-grow: 1;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 56px) 48px;
}

.hx-stage {
  width: min(100%, 1000px);
  margin: 0 auto;
}

.hx-wells {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 40px 56px;
}

.hx-well {
  position: relative;
  display: flex;
  width: 260px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #e6fff7;
  text-decoration: none;
}

.hx-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: hx-phase 9s ease-in-out infinite;
  transition: transform 0.4s;
}

.hx-well:nth-child(1) .hx-phase {
  animation-duration: 9s;
  animation-delay: 0s;
}

.hx-well:nth-child(2) .hx-phase {
  animation-duration: 11.5s;
  animation-delay: -4s;
}

.hx-well:nth-child(3) .hx-phase {
  animation-duration: 7.5s;
  animation-delay: -2.5s;
}

.hx-well:nth-child(4) .hx-phase {
  animation-duration: 13s;
  animation-delay: -7s;
}

.hx-well:nth-child(5) .hx-phase {
  animation-duration: 10s;
  animation-delay: -5.5s;
}

.hx-well:nth-child(6) .hx-phase {
  animation-duration: 12s;
  animation-delay: -9s;
}

.hx-well:hover,
.hx-well:focus-visible {
  z-index: 2;
  animation-play-state: paused;
}

.hx-well:hover .hx-phase,
.hx-well:focus-visible .hx-phase {
  opacity: 1 !important;
  filter: none !important;
  transform: scale(1.1) !important;
  animation-play-state: paused;
}

.hx-well:focus-visible {
  border-radius: 8px;
  outline: 2px solid #e6fff7;
  outline-offset: 5px;
}

.hx-orb {
  position: relative;
  width: 130px;
  height: 130px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: radial-gradient(circle, #000 0%, #000 48%, #0a2c25 64%, var(--tint) 80%, rgb(0 0 0 / 0%) 90%);
  transition: box-shadow 0.3s;
}

.hx-well:nth-child(1) .hx-orb {
  width: 130px;
  height: 130px;
}

.hx-well:nth-child(2) .hx-orb {
  width: 135px;
  height: 135px;
}

.hx-well:nth-child(3) .hx-orb {
  width: 130px;
  height: 130px;
}

.hx-well:nth-child(4) .hx-orb,
.hx-well:nth-child(5) .hx-orb {
  width: 125px;
  height: 125px;
}

.hx-well:nth-child(1) .hx-orb {
  --tint: #e2a33a;
}

.hx-well:nth-child(2) .hx-orb {
  --tint: #f4a7c0;
}

.hx-well:nth-child(3) .hx-orb {
  --tint: #f6c445;
}

.hx-well:nth-child(4) .hx-orb {
  --tint: #ff8a5b;
}

.hx-well:nth-child(5) .hx-orb {
  --tint: #e2b544;
}

.hx-well:nth-child(6) .hx-orb {
  --tint: #4fd1c5;
}

.hx-well:hover .hx-orb {
  box-shadow: 0 0 40px 4px var(--tint);
}

.hx-well:focus-visible .hx-orb {
  box-shadow: 0 0 0 3px #e6fff7;
}

.hx-orb-img {
  position: absolute;
  top: 6%;
  left: 6%;
  width: 88%;
  height: 88%;
  border-radius: 50%;
  object-fit: cover;
}

.hx-orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle closest-side,
    rgb(0 0 0 / 0%) 0%,
    rgb(0 0 0 / 0%) 62%,
    rgb(0 0 0 / 80%) 80%,
    #0a2c25 90%,
    var(--tint) 100%
  );
}

.hx-text {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.hx-name {
  color: #e6fff7;
  font-family: Fredoka, sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.hx-line-es,
.hx-line-en {
  font-size: 15px;
  line-height: 1.35;
}

.hx-line-es {
  color: #a9cfc4;
}

.hx-line-en {
  color: #789c92;
}

.hx-yard {
  position: relative;
  height: 150px;
  margin: 0 clamp(16px, 4vw, 56px);
  border-bottom: 2px dashed rgb(126 232 201 / 18%);
  cursor: crosshair;
  touch-action: pan-y;
}

.hx-rooster {
  position: absolute;
  bottom: 4px;
  left: 4%;
  width: 96px;
  margin-left: -48px;
  pointer-events: none;
  animation: hx-roam 38s ease-in-out infinite;
}

.hx-rooster-face {
  animation: hx-face 38s step-end infinite;
}

.hx-rooster-face.hx-facing-left {
  transform: scaleX(-1);
}

.hx-rooster svg {
  transform-origin: 50% 100%;
  animation: hx-strut 0.7s ease-in-out infinite;
}

.hx-head {
  transform-box: fill-box;
  transform-origin: 20% 90%;
  animation: hx-peck 3.4s ease-in-out infinite;
}

.hx-leg {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: hx-step 0.7s ease-in-out infinite;
}

.hx-leg-b {
  animation-delay: -0.35s;
}

.hx-rooster.hx-chasing {
  animation: none;
}

.hx-rooster.hx-chasing .hx-rooster-face,
.hx-rooster.hx-chasing .hx-head {
  animation: none;
}

.hx-rooster.hx-chasing svg {
  animation-duration: 0.32s;
}

.hx-rooster.hx-chasing .hx-leg {
  animation-duration: 0.32s;
}

.hx-rooster.hx-chasing .hx-leg-b {
  animation-delay: -0.16s;
}

.hx-rooster.hx-still .hx-leg,
.hx-rooster.hx-dead .hx-leg,
.hx-rooster.hx-still svg {
  animation: none;
}

/* Flip around the middle (not the feet); after the turn, -14px moves it down to rest on its back on the line. */
.hx-rooster.hx-dead svg {
  transform-origin: 50% 50%;
  transform: rotate(180deg) translateY(-14px);
  animation: none;
}

.hx-poop {
  position: absolute;
  bottom: 4px;
  left: 4%;
  display: none;
  width: 26px;
  height: 22px;
  margin-left: -13px;
  pointer-events: none;
  transform-origin: 50% 100%;
}

.hx-poop.hx-visible {
  display: block;
  animation: hx-plop 0.4s ease-out both;
}

.hx-footer {
  position: relative;
  z-index: 1;
  padding: 12px clamp(16px, 4vw, 56px) 14px;
  color: #8fb5aa;
  font-size: 14px;
  text-align: right;
  pointer-events: none;
}

.hx-overlay[hidden] {
  display: none;
}

.hx-overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 24px 16px;
  background: #000;
  text-align: center;
  animation: hx-fade 0.9s ease-out both;
}

.hx-overlay-title {
  display: flex;
  flex-direction: column;
  margin: 0;
  color: #7ee8c9;
  font-family: Fredoka, sans-serif;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 600;
}

.hx-overlay-subtitle {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  color: #a9cfc4;
  font-size: 16px;
}

.hx-climb-out {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  padding: 8px 22px;
  border: 1px solid #2bb39a;
  border-radius: 999px;
  background: transparent;
  color: #e6fff7;
  cursor: pointer;
  font: 600 15px "Nunito Sans", sans-serif;
}

.hx-climb-out:hover,
.hx-climb-out:focus-visible {
  background: #0a2c25;
}

.hx-climb-out:focus-visible {
  outline: 2px solid #e6fff7;
  outline-offset: 3px;
}

@keyframes hx-phase {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) skewX(0deg);
  }
  22% {
    opacity: 0.85;
    filter: blur(1px);
    transform: scale(1.04) skewX(-4deg);
  }
  38% {
    opacity: 0.12;
    filter: blur(7px);
    transform: scale(0.8) skewX(10deg);
  }
  46% {
    opacity: 0.05;
    filter: blur(10px) hue-rotate(60deg);
    transform: scale(0.7) skewX(-8deg);
  }
  58% {
    opacity: 0.6;
    filter: blur(3px);
    transform: scale(1.1) skewX(3deg);
  }
  66% {
    opacity: 0.3;
    filter: blur(5px);
    transform: scale(0.95) skewX(-2deg);
  }
  80%,
  100% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) skewX(0deg);
  }
}

@keyframes hx-roam {
  0% {
    left: 4%;
  }
  18%,
  26% {
    left: 28%;
  }
  40%,
  48% {
    left: 16%;
  }
  66%,
  74% {
    left: 62%;
  }
  90% {
    left: 44%;
  }
  100% {
    left: 4%;
  }
}

@keyframes hx-face {
  0%,
  25.9% {
    transform: scaleX(1);
  }
  26%,
  47.9% {
    transform: scaleX(-1);
  }
  48%,
  73.9% {
    transform: scaleX(1);
  }
  74%,
  100% {
    transform: scaleX(-1);
  }
}

@keyframes hx-strut {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-2deg);
  }
  75% {
    transform: translateY(-3px) rotate(2deg);
  }
}

@keyframes hx-peck {
  0%,
  60%,
  100% {
    transform: rotate(0deg);
  }
  70% {
    transform: rotate(28deg);
  }
  80% {
    transform: rotate(4deg);
  }
  90% {
    transform: rotate(26deg);
  }
}

@keyframes hx-step {
  0%,
  100% {
    transform: rotate(-20deg);
  }
  50% {
    transform: rotate(20deg);
  }
}

@keyframes hx-plop {
  0% {
    transform: scale(0) translateY(-20px);
  }
  60% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes hx-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .hx-header {
    padding-top: 18px;
  }

  .hx-title {
    font-size: clamp(36px, 11vw, 48px);
  }

  .hx-main {
    padding: 20px 16px 30px;
  }

  .hx-wells {
    width: 100%;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
  }

  .hx-well {
    width: 100%;
    max-width: 390px;
    min-height: 76px;
    flex-direction: row;
  }

  .hx-phase {
    width: 100%;
    flex-direction: row;
    gap: 14px;
  }

  .hx-wells .hx-well:nth-child(n) .hx-orb {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
  }

  .hx-text {
    width: auto;
    max-width: none;
    flex: 1;
    align-items: flex-start;
    text-align: left;
  }

  .hx-name {
    font-size: 20px;
  }

  .hx-line-es,
  .hx-line-en {
    font-size: 14px;
  }

  .hx-yard {
    height: 118px;
    margin: 0 16px;
  }

  .hx-rooster svg {
    width: 80px;
    height: 80px;
  }

  .hx-footer {
    padding-top: 10px;
    text-align: center;
  }

  .hx-climb-out {
    flex-direction: column;
    gap: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}
