/* Coming-soon gate: one held note, waiting to swell. */

.gate {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow-x: hidden;
  background:
    radial-gradient(120% 70% at 50% 52%, #233036 0%, rgba(35, 48, 54, 0) 70%),
    var(--slate);
}

.gate-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  padding: calc(var(--s-2) + env(safe-area-inset-top, 0px)) var(--gutter) var(--s-2);
  font-size: var(--step--1);
  color: var(--fog-dim);
}

.access-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0 0.25rem;
  background: none;
  border: 0;
  color: var(--fog-dim);
  font: inherit;
  cursor: pointer;
  transition: color 0.25s var(--ease-out);
}

.access-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.access-toggle:hover,
.access-toggle[aria-expanded="true"] {
  color: var(--fog);
}

.access {
  position: absolute;
  top: calc(3.6rem + env(safe-area-inset-top, 0px));
  right: var(--gutter);
  z-index: 5;
  width: min(23rem, calc(100vw - 2 * var(--gutter)));
  padding: var(--s-3);
  background: var(--slate-deep);
  border: 1px solid var(--fog-faint);
  border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  animation: access-in 0.45s var(--ease-out);
}

.access .field-row input {
  font-size: var(--step-0);
  letter-spacing: 0.12em;
}

@keyframes access-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* Line, then "Coming soon", then the list signup, held together in the middle of the screen */
.gate-main {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto auto minmax(var(--s-4), 1.3fr);
  min-width: 0;
  padding-bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px));
}

.soon {
  grid-row: 3;
  margin-bottom: var(--s-4);
  font-family: var(--font-display);
  font-size: var(--step-2);
  font-variation-settings: "wdth" 150, "wght" 250;
  letter-spacing: 0.02em;
  line-height: 1;
  text-align: center;
  color: var(--fog);
}

/* The stage: the name sits on a single held line */
.stage {
  grid-row: 2;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 40vh;
}

.gate-main .signup {
  grid-row: 4;
  width: 100%;
  max-width: calc(27rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.drone {
  position: absolute;
  inset: 50% 0 auto 0;
  width: 100%;
  height: min(38vh, 22rem);
  transform: translateY(-50%);
  touch-action: pan-y;
}

.wordmark {
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(4rem, 17vw, 17rem);
  font-variation-settings: "wdth" 50, "wght" 110;
  font-weight: 110;
  line-height: 0.9;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: center;
  color: var(--fog);
  text-shadow: 0 0 40px var(--slate);
  pointer-events: none;
  transition: color 1.1s var(--ease-in-out), text-shadow 1.1s var(--ease-in-out);
}

/* Once split into letters, each one carries its own weight (set by gate.js as the pulse passes) */
.wordmark .wm-letter {
  display: inline-flex;
  justify-content: center; /* a heavier glyph grows evenly to both sides */
  margin-inline: 0.035em;
}

.wordmark:has(.wm-letter) {
  letter-spacing: 0;
}

.is-entering .wordmark {
  color: var(--ink);
  text-shadow: none;
}

/* ---------- Atmosphere: dust in the light, film grain, a vignette ---------- */

.dust {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.gate-bar,
.gate-main {
  position: relative;
  z-index: 1;
}

.gate::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(ellipse 85% 75% at 50% 45%, rgba(20, 26, 28, 0) 55%, rgba(12, 16, 17, 0.6) 100%);
}

.gate::after {
  content: "";
  position: fixed;
  inset: -100%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  17% { transform: translate(-6%, 4%); }
  33% { transform: translate(5%, -7%); }
  50% { transform: translate(-3%, 9%); }
  67% { transform: translate(8%, 2%); }
  83% { transform: translate(-7%, -5%); }
  100% { transform: translate(2%, 6%); }
}

/* Held back until the opening sequence runs */
.is-intro .wordmark,
.is-intro .gate-bar,
.is-intro .gate-main .signup,
.is-intro .soon {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .gate::after {
    animation: none;
  }
}

/* Unlock: the line swells and the room floods with light */
.flood {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--amber);
  clip-path: inset(50% 0 50% 0);
  pointer-events: none;
  visibility: hidden;
}

.is-flooding .flood {
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path 0.7s var(--ease-in-out);
}

.is-entering .gate-bar,
.is-entering .signup,
.is-entering .soon {
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}

@media (max-width: 760px) {
  .stage {
    min-height: 34vh;
  }

  .wordmark {
    letter-spacing: 0.04em;
  }

  .soon {
    font-size: var(--step-1);
  }
}

@media (max-width: 640px) {
  .wordmark,
  .hero-word {
    font-size: 25vw;
  }
}
