.gateway {
  /* These points follow the divider polyline in index.html. */
  --gateway-left: polygon(0 0, 64% 0, 46% 47%, 55% 39%, 43% 100%, 0 100%);
  --gateway-right: polygon(64% 0, 100% 0, 100% 100%, 43% 100%, 55% 39%, 46% 47%);

  position: relative;
  isolation: isolate;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(1rem, 2.6svh, 1.75rem);
  min-height: 100vh;
  min-height: 100svh;
  padding: clamp(1.25rem, 3svh, 3rem) clamp(1rem, 5vw, 4rem);
  overflow: hidden;
  text-align: center;
}

.gateway-backdrop {
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
}

.gateway-backdrop::before,
.gateway-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  transition: filter .45s ease;
}

.gateway-backdrop::before {
  clip-path: var(--gateway-left);
  background: radial-gradient(ellipse at 15% 60%, #22252a, #101011 60%);
}

.gateway-backdrop::after {
  clip-path: var(--gateway-right);
  background: radial-gradient(ellipse at 85% 60%, #2b241a, #131210 60%);
}

.gateway-bolt {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.gateway-spark {
  fill: none;
  stroke: #fff0d0;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 14 100;
  opacity: 0;
  filter: drop-shadow(0 0 4px #d7ae74);
}

.gateway:has(.gateway-option-pl:is(:hover, :focus-visible), .gateway-story-pl:hover) .gateway-backdrop::before,
.gateway:has(.gateway-option-en:is(:hover, :focus-visible), .gateway-story-en:hover) .gateway-backdrop::after {
  filter: brightness(1.32);
}

.gateway:has(.gateway-option-pl:is(:hover, :focus-visible), .gateway-story-pl:hover) .gateway-spark-pl {
  animation: gateway-sweep .85s ease-out both;
}

.gateway:has(.gateway-option-en:is(:hover, :focus-visible), .gateway-story-en:hover) .gateway-spark-en {
  animation: gateway-sweep .85s ease-out reverse both;
}

@keyframes gateway-sweep {
  0% { stroke-dashoffset: 14; opacity: 0; }
  18%, 78% { opacity: 1; }
  100% { stroke-dashoffset: -100; opacity: 0; }
}

.gateway-brand {
  position: relative;
  pointer-events: none;
}

.gateway-brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -34% -28%;
  background: radial-gradient(ellipse, #0a0a0a 18%, rgb(10 10 10 / 84%) 46%, transparent 72%);
}

.gateway-logo {
  width: clamp(12rem, 32svh, 20rem);
  max-width: 76vw;
  height: auto;
  margin-inline: auto;
  mask-image: url("logo-revelsi.png");
  mask-mode: luminance;
  mask-size: 100% 100%;
}

.gateway-brand h1 {
  margin-top: .15rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.06em;
  text-wrap: balance;
}

.gateway-languages,
.gateway-stories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2.5rem, 12vw, 10rem);
  width: min(100%, 66rem);
}

.gateway-option {
  justify-self: center;
  color: var(--text);
  text-decoration: none;
}

.gateway-option::before {
  content: "";
  position: absolute;
  inset: 0;
}

.gateway-option-pl::before { clip-path: var(--gateway-left); }
.gateway-option-en::before { clip-path: var(--gateway-right); }

.gateway-choice {
  display: grid;
  justify-items: center;
  gap: .24rem;
  min-width: 7.25rem;
  padding: .65rem .9rem;
  border: 1px solid #665e50;
  background: rgb(10 10 10 / 46%);
  transition: background-color .25s ease, border-color .25s ease;
}

.gateway-choice strong {
  font-size: 1.85rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -.04em;
}

.gateway-choice span {
  color: var(--silver);
  font-size: .875rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.gateway-flag {
  width: auto;
  height: 1.2rem;
  margin-top: .12rem;
  box-shadow: 0 0 0 1px rgb(246 246 245 / 18%);
}

.gateway-option:is(:hover, :focus-visible) .gateway-choice {
  border-color: #deccac;
  background: #25211b;
}

.gateway-stories {
  position: relative;
  pointer-events: none;
}

.gateway-story {
  padding: 1rem 0 0;
  border-top: 1px solid #514a40;
  pointer-events: auto;
}

.gateway-story h2 {
  margin: .3rem 0 .65rem;
  font-size: clamp(1.55rem, 2.85vw, 2.3rem);
  line-height: 1.08;
  letter-spacing: -.045em;
}

.gateway-story p {
  max-width: 47ch;
  margin: .62rem auto 0;
  color: var(--silver);
  line-height: 1.45;
  text-wrap: pretty;
}

.gateway-story .gateway-story-kicker {
  margin-top: 0;
  color: #d6c6a9;
  font-size: .875rem;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.gateway-story .gateway-story-lead {
  color: var(--text);
  font-weight: 650;
}

.gateway-story-note {
  margin: .9rem auto 0;
}

.gateway-story-note h3 {
  color: #eadac0;
  font-size: 1.05rem;
  font-weight: 700;
}

.gateway-story-note p { margin-top: .23rem; }

@media (max-width: 46rem) {
  .gateway { align-content: start; }
  .gateway-brand::before { content: none; }
  .gateway-logo {
    mix-blend-mode: screen;
    mask-repeat: no-repeat;
  }
  .gateway-backdrop { mask-image: linear-gradient(#000 14rem, transparent 36rem); }
  .gateway-languages { column-gap: 1rem; }
  .gateway-option::before { content: none; }
  .gateway-stories {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 30rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gateway-backdrop::before, .gateway-backdrop::after, .gateway-choice { transition: none; }
  .gateway-spark { display: none; }
}
