
.gate { display: none; }

html.gate-open body { overflow: hidden; }

html.gate-open .gate {
  display: block;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100svh;
  z-index: 8;
  background: #050506;
  transform-origin: 50% 46%;
}

.gate__stage { position: absolute; inset: 0; overflow: hidden; }
.gate__canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.gate.is-leaving {
  pointer-events: none;
  opacity: 0;
  transform: scale(1.14);
  filter: blur(20px);
  transition:
    opacity 580ms cubic-bezier(0.5, 0, 0.12, 1),
    transform 860ms cubic-bezier(0.5, 0, 0.12, 1),
    filter 640ms cubic-bezier(0.5, 0, 0.12, 1);
}

.gate__cta {
  --gate-h: clamp(44px, 3.6vw, 54px);
  --gate-spread: calc((100vw - 300px) / 12);
  --gate-in-dur: 1400ms;
  --gate-in-delay: 260ms;
  --gate-in-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --gate-ch-dur: 460ms;
  --gate-ch-step: 34ms;

  visibility: hidden;
  pointer-events: none;

  position: absolute;
  left: 50%;
  width: max-content;
  transform: translateX(-50%);
  bottom: clamp(26px, 6svh, 60px);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: clamp(14px, 1.3vw, 20px);
  height: var(--gate-h);
  padding: 0 clamp(18px, 1.6vw, 26px);
  appearance: none;
  margin: 0;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  color: #fff;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(16px, 1.35vw, 21px);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.4s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
              scale 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate__cta::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 999px;
  background: transparent;
}

.gate__liquid {
  position: absolute;
  left: 50%;
  bottom: -40%;
  z-index: 1;
  height: 60%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 46% 54% 59% 41% / 59% 41% 54% 46%;
  transform: translateX(-50%) scale(0);
  transform-origin: 50% 100%;
  pointer-events: none;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1),
              border-radius 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}

.gate__cta::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 1px solid #fff;
  border-radius: 999px;
  pointer-events: none;
  transition: border-color 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.06s;
}

.gate__label {
  position: relative;
  z-index: 2;
  display: block;
  letter-spacing: calc(0.02em + var(--ls-bump, 0em));
  margin-right: -0.02em;
}

.gate__ch {
  display: inline-block;
}

.gate.is-ready .gate__cta { visibility: visible; }
.gate.is-armed .gate__cta { pointer-events: auto; }

.gate.is-ready .gate__ch {
  animation: gate-ch var(--gate-ch-dur) cubic-bezier(0.22, 1, 0.36, 1)
             calc(var(--gate-in-delay) + var(--i) * var(--gate-ch-step)) backwards;
}
.gate.is-ready .gate__label {
  animation: gate-letters var(--gate-in-dur) var(--gate-in-ease) var(--gate-in-delay) backwards;
}
.gate.is-ready .gate__cta::before {
  animation: gate-outline var(--gate-in-dur) var(--gate-in-ease) var(--gate-in-delay) backwards;
}

@keyframes gate-ch {
  from { opacity: 0; transform: translateY(0.6em); }
  to   { opacity: 1; transform: none; }
}

@keyframes gate-letters {
  0%, 32%   { letter-spacing: var(--gate-spread); margin-right: calc(-1 * var(--gate-spread));
              filter: blur(0px);
              animation-timing-function: cubic-bezier(0.5, 0, 0.2, 1); }
  52%       { filter: blur(0.13em); }
  84%, 100% { letter-spacing: calc(0.02em + var(--ls-bump, 0em)); margin-right: -0.02em;
              filter: blur(0px); }
}

@keyframes gate-outline {
  0%, 56%   { clip-path: inset(0 50% 0 50% round 999px); border-color: rgba(255, 255, 255, 0); }
  66%       { border-color: rgba(255, 255, 255, 1); }
  86%, 100% { clip-path: inset(0 0 0 0 round 999px); border-color: rgba(255, 255, 255, 1); }
}

@keyframes gate-latido {
  0%, 100% { scale: 1; }
  50%      { scale: 1.035; }
}

.gate.is-armed .gate__cta {
  animation: gate-latido 2.4s ease-in-out infinite;
}

@media (hover: hover) and (pointer: fine) {
  .gate.is-armed .gate__cta:hover {
    color: #0b0b0c;
    animation: none;
    scale: 1;
  }
  .gate__cta:hover::before { border-color: transparent; }
  .gate__cta:hover .gate__liquid {
    transform: translateX(-50%) scale(11, 3.2);
    border-radius: 50%;
  }
}
.gate.is-armed .gate__cta:active {
  color: #0b0b0c;
  animation: none;
  scale: 1;
}
.gate__cta:active::before { border-color: transparent; }
.gate__cta:active .gate__liquid {
  transform: translateX(-50%) scale(11, 3.2);
  border-radius: 50%;
}
@media (max-width: 760px) {
  .gate__cta { --gate-spread: calc((100vw - 215px) / 12); }
}

.gate__cta:focus-visible { outline: 2px solid #fff; outline-offset: 5px; }

.gate.is-zooming .gate__liquid { transition: none; }

.gate.is-zooming .gate__cta,
.gate.is-zooming .gate__cta::before,
.gate.is-zooming .gate__cta::after,
.gate.is-zooming .gate__label,
.gate.is-zooming .gate__ch {
  animation: none;
  filter: none;
}
.gate.is-zooming .gate__cta { scale: 1; }
.gate.is-zooming .gate__cta {
  pointer-events: none;
  transform: translateX(-50%) scale(0.86);
  opacity: 0;
  transition: transform 190ms cubic-bezier(0.4, 0, 1, 1),
              opacity 220ms linear;
}

.hero--opening {
  z-index: 9;
  --gate-cx: 50%;
  --gate-cy: 88%;
  --gate-bw: 240px;
  --gate-bh: 56px;
  --gate-mw: var(--gate-bw);
  --gate-mh: var(--gate-bh);

  -webkit-mask-image: radial-gradient(closest-side, #000 40%, rgba(0, 0, 0, 0) 100%);
          mask-image: radial-gradient(closest-side, #000 40%, rgba(0, 0, 0, 0) 100%);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-size: var(--gate-mw) var(--gate-mh);
          mask-size: var(--gate-mw) var(--gate-mh);
  -webkit-mask-position: calc(var(--gate-cx) - var(--gate-mw) / 2) calc(var(--gate-cy) - var(--gate-mh) / 2);
          mask-position: calc(var(--gate-cx) - var(--gate-mw) / 2) calc(var(--gate-cy) - var(--gate-mh) / 2);
  will-change: mask-size, mask-position;
}
.hero--opening .hero__bg {
  transform: scale(1.72);
  filter: blur(18px);
  will-change: transform, filter;
}
.hero--opening.is-open {
  --gate-mw: 520vmax;
  --gate-mh: 520vmax;
  transition: -webkit-mask-size 620ms cubic-bezier(0.5, 0, 0.12, 1),
              mask-size 620ms cubic-bezier(0.5, 0, 0.12, 1),
              -webkit-mask-position 620ms cubic-bezier(0.5, 0, 0.12, 1),
              mask-position 620ms cubic-bezier(0.5, 0, 0.12, 1);
}
.hero--opening.is-open .hero__bg {
  transform: scale(1);
  filter: blur(0px);
  transition: transform 920ms cubic-bezier(0.5, 0, 0.12, 1),
              filter 640ms cubic-bezier(0.5, 0, 0.12, 1);
}

@media (prefers-reduced-motion: reduce) {
  .gate__cta,
  .gate__cta::before,
  .gate__cta::after,
  .gate__label,
  .gate__ch { animation: none !important; transition: none; filter: none; }
  .gate__cta { scale: 1; }
  .gate__cta { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%); }
  .gate__liquid { display: none; }
  .gate__cta:hover { color: #0b0b0c; }
  .gate__cta:hover::after { background: #fff; }
  .gate__label, .gate__ch { opacity: 1; }
  .gate.is-leaving { transition: none; }
  .hero--opening { -webkit-mask-image: none; mask-image: none; transition: none; }
  .hero--opening .hero__bg { transform: none; filter: none; transition: none; }
}
