/* ==========================================================================
   The founding-offer pop-up.
   --------------------------------------------------------------------------
   PERFORMANCE
     Everything animated here is opacity or transform. Both are composited by
     the GPU, so the pop-up cannot cost you a dropped frame.

     Deliberately NOT used: filter/blur (repaints the whole viewport), animated
     box-shadow (same), and animated width or height (forces layout). The card
     gets its size once and never changes it, apart from the two answer rows
     staggering in, which is a transform.

     The exit is an animation rather than a transition so that removing the
     node cannot flash. A 400ms fallback timer removes it even if
     animationend never fires, which happens if the tab is backgrounded.
   ========================================================================== */

.gate {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(14, 14, 17, 0.5);
  animation: gate-fade 0.22s ease-out both;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.gate.gate-leaving {
  animation: gate-fade-out 0.18s ease-in both;
}

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

.gate-card {
  position: relative;
  width: 100%;
  max-width: 468px;
  margin: auto;
  background: var(--paper-3, #fffefb);
  border: 1px solid var(--line, rgba(14, 14, 17, 0.12));
  border-radius: 20px;
  padding: 30px 28px 24px;
  box-shadow: 0 30px 70px -24px rgba(14, 14, 17, 0.4);
  text-align: center;
  animation: gate-rise 0.44s cubic-bezier(0.16, 0.84, 0.28, 1) both;
  animation-delay: 0.04s;
  will-change: transform, opacity;
}

@keyframes gate-rise {
  from { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.97); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* the two answer rows land just after the card settles */
.gate-row {
  animation: gate-row-in 0.4s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}
.gate-row:nth-of-type(1) { animation-delay: 0.16s; }
.gate-row:nth-of-type(2) { animation-delay: 0.22s; }

@keyframes gate-row-in {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ---- the mark ---------------------------------------------------------- */

.gate-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: 1.02rem;
  color: var(--ink, #0e0e11);
  margin-bottom: 16px;
}

.gate-mark i {
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--ink, #0e0e11);
  flex: none;
}

.gate-mark i::before,
.gate-mark i::after {
  content: "";
  position: absolute;
  left: 5px;
  height: 4px;
  border-radius: 2px;
  background: var(--paper, #f7f3ec);
}
.gate-mark i::before { top: 7px;  right: 5px; }
.gate-mark i::after  { top: 15px; right: 11px; background: var(--accent, #b23a1f); }

/* ---- content ----------------------------------------------------------- */

.gate-badge {
  display: inline-block;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent, #b23a1f);
  background: rgba(178, 58, 31, 0.09);
  border-radius: 999px;
  padding: 5px 12px;
  margin-bottom: 13px;
}

.gate-card h2 {
  font-size: clamp(1.4rem, 4vw, 1.78rem);
  line-height: 1.14;
  letter-spacing: -0.028em;
  margin: 0 0 9px;
}

.gate-sub {
  color: var(--muted, #55555e);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 20px;
}

.gate-form {
  display: grid;
  gap: 10px;
  text-align: left;
}

.gate-form input[type="email"] {
  width: 100%;
  padding: 15px 16px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink, #0e0e11);
  background: var(--paper, #f7f3ec);
  border: 1px solid var(--line, rgba(14, 14, 17, 0.16));
  border-radius: 12px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.gate-form input[type="email"]:focus {
  outline: none;
  border-color: var(--ink, #0e0e11);
  background: var(--paper-3, #fffefb);
}

.gate-form input.gate-invalid {
  border-color: var(--accent, #b23a1f);
  background: rgba(178, 58, 31, 0.04);
}

.gate-form .btn {
  width: 100%;
  justify-content: center;
}

.gate-form .btn[disabled] {
  opacity: 0.6;
  cursor: default;
}

.gate-note {
  font-size: 0.79rem;
  line-height: 1.5;
  color: var(--muted, #55555e);
  margin: 3px 0 0;
}

.gate-msg {
  font-size: 0.85rem;
  color: var(--accent, #b23a1f);
  margin: 0;
  min-height: 1.15em;
}

.gate-done {
  font-size: 1.12rem;
  font-weight: 650;
  color: var(--green, #276147);
  margin: 4px 0 12px;
  animation: gate-row-in 0.4s ease both;
}

.gate-skip {
  display: inline-block;
  margin-top: 16px;
  padding: 5px;
  font-size: 0.86rem;
  font-family: inherit;
  color: var(--muted, #55555e);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate-skip:hover { color: var(--ink, #0e0e11); }

/* ---- the "this page is in English" bar --------------------------------- */

.lang-nudge {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 350;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 32px);
  padding: 11px 12px 11px 16px;
  background: var(--ink, #0e0e11);
  color: var(--paper, #f7f3ec);
  border-radius: 12px;
  font-size: 0.88rem;
  box-shadow: 0 14px 34px -14px rgba(14, 14, 17, 0.5);
  transform: translate3d(-50%, 0, 0);
  animation: nudge-in 0.4s cubic-bezier(0.16, 0.84, 0.28, 1) both;
  animation-delay: 0.5s;
}

@keyframes nudge-in {
  from { opacity: 0; transform: translate3d(-50%, 10px, 0); }
  to   { opacity: 1; transform: translate3d(-50%, 0, 0); }
}

.lang-nudge a {
  color: var(--paper, #f7f3ec);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.lang-nudge button {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  color: var(--paper, #f7f3ec);
  background: rgba(247, 243, 236, 0.14);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.lang-nudge button:hover { background: rgba(247, 243, 236, 0.26); }

@media (max-width: 560px) {
  .lang-nudge {
    left: 16px;
    right: 16px;
    bottom: 14px;
    max-width: none;
    transform: none;
    flex-wrap: wrap;
    animation-name: nudge-in-mobile;
  }
  @keyframes nudge-in-mobile {
    from { opacity: 0; transform: translate3d(0, 10px, 0); }
    to   { opacity: 1; transform: translate3d(0, 0, 0); }
  }
}

/* ---- accessibility and print ------------------------------------------ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* stop the page behind scrolling sideways while the pop-up is open */
body.gate-open { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .gate,
  .gate-card,
  .gate-row,
  .gate-done,
  .gate.gate-leaving,
  .lang-nudge {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
  }
  .gate-form input[type="email"] { transition: none; }
}

@media print {
  .gate,
  .lang-nudge { display: none !important; }
}
