/* ==========================================================================
   style2.css — VOIDFILTERS invite-only locker
   --------------------------------------------------------------------------
   Sits over index.html as a semi-transparent, blurred layer. The page stays
   the background: its shapes and colours show through, but nothing behind it
   can be read or clicked until a code is accepted.

   Loaded AFTER style.css on purpose — the site tokens (--text, --accent, …)
   already exist by then, so the locker inherits the palette and follows the
   html.dark theme the site's toggle sets.

   Everything is namespaced .vf-* / #vf-gate so it cannot collide with
   style.css or app.js.
   ========================================================================== */

/* ------------------------------------------------------------------ shell -- */

.vf-gate {
  --vf-ink: var(--text, #191a17);
  --vf-soft: var(--muted, #62665f);
  --vf-line: var(--border, #deddd6);
  --vf-accent: var(--accent, #688715);
  --vf-red: var(--red, #b53f3a);
  --vf-delay: 900ms;

  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(14px, 3.5vw, 40px);
  overflow-y: auto;
  font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--vf-ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.vf-gate[hidden] { display: none; }

/* The scrim is the semi-transparent part: a light wash plus a soft blur, so the
   page stays readable-ish behind the card — visible, but clearly not the focus. */
.vf-gate__scrim {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, 0.04), transparent 60%),
    rgba(14, 18, 15, 0.32);
  -webkit-backdrop-filter: blur(7px) saturate(0.95);
  backdrop-filter: blur(7px) saturate(0.95);
  animation: vf-fade 0.4s ease both;
}

html.dark .vf-gate__scrim {
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(148, 239, 195, 0.06), transparent 62%),
    rgba(4, 7, 5, 0.46);
}

/* one quiet accent bloom behind the card, tied to the current theme accent */
.vf-gate__scrim::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(760px, 130vw);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(148, 239, 195, 0.16), transparent 62%);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--vf-accent) 26%, transparent),
    transparent 62%
  );
  filter: blur(28px);
  opacity: 0.4;
  pointer-events: none;
}

/* Browsers that cannot blur get a heavier wash instead of a see-through one. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .vf-gate__scrim { background: rgba(12, 16, 13, 0.62); }
  html.dark .vf-gate__scrim { background: rgba(3, 5, 4, 0.72); }
  .vf-gate__card { background: #ffffff; }
  html.dark .vf-gate__card { background: #141a17; }
}

/* ------------------------------------------------------------------- card -- */

.vf-gate__card {
  position: relative;
  z-index: 1;
  width: min(452px, 100%);
  max-height: calc(100vh - 2 * clamp(14px, 3.5vw, 40px));
  max-height: calc(100dvh - 2 * clamp(14px, 3.5vw, 40px));
  margin: auto;
  padding: 24px 26px 20px;
  overflow: hidden auto;
  border: 1px solid var(--vf-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  backdrop-filter: blur(14px) saturate(1.05);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 40px 90px -34px rgba(20, 26, 20, 0.55),
    0 10px 30px -18px rgba(20, 26, 20, 0.35);
  animation: vf-rise 0.52s cubic-bezier(0.16, 1, 0.3, 1) both;
  scrollbar-width: thin;
  scrollbar-color: var(--vf-line) transparent;
}

html.dark .vf-gate__card {
  background: rgba(19, 24, 21, 0.82);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 40px 90px -34px rgba(0, 0, 0, 0.85),
    0 10px 30px -20px rgba(0, 0, 0, 0.6);
}

.vf-gate__card:focus { outline: none; }

/* hairline accent at the top edge */
.vf-gate__card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(90deg, var(--vf-accent), transparent 62%);
  opacity: 0.9;
  pointer-events: none;
}

.vf-gate__card::-webkit-scrollbar { width: 8px; }
.vf-gate__card::-webkit-scrollbar-thumb { background: var(--vf-line); border-radius: 99px; }
.vf-gate__card::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------- head -- */

.vf-gate__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 30px;
}

.vf-gate__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 500 9.5px/1 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--vf-soft);
  white-space: nowrap;
}

.vf-gate__brand img {
  width: 16px;
  height: 16px;
  display: block;
  opacity: 0.9;
}

.vf-gate__brand b {
  color: var(--vf-accent);
  font-weight: 500;
}

.vf-gate__status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--vf-line);
  border-radius: 999px;
  font: 500 8.5px/1 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--vf-accent);
  white-space: nowrap;
}

.vf-gate__status i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: vf-pulse 2.6s ease-in-out infinite;
}

/* ------------------------------------------------------------------- copy -- */

.vf-gate__eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  font: 500 9px/1 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 1.7px;
  text-transform: uppercase;
  color: var(--vf-accent);
}

.vf-gate__eyebrow::before {
  content: '';
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.vf-gate__title {
  margin: 0 0 10px;
  font-size: clamp(27px, 3.3vw, 33px);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -1.4px;
  color: var(--vf-ink);
}

.vf-gate__title em {
  font-style: normal;
  color: var(--vf-accent);
}

.vf-gate__copy {
  margin: 0 0 24px;
  max-width: 36ch;
  font-size: 13px;
  line-height: 1.62;
  color: var(--vf-soft);
}

/* ------------------------------------------------------------------- form -- */

.vf-gate__form { margin: 0; }

.vf-gate__label {
  display: block;
  margin-bottom: 8px;
  font: 500 9px/1 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--vf-soft);
}

.vf-gate__field {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 5px 5px 14px;
  border: 1px solid var(--vf-line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.66);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.vf-gate__field:focus-within {
  border-color: var(--vf-accent);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(104, 135, 21, 0.16);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--vf-accent) 18%, transparent);
}

html.dark .vf-gate__field { background: rgba(255, 255, 255, 0.03); }
html.dark .vf-gate__field:focus-within { background: rgba(255, 255, 255, 0.055); }

.vf-gate__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--vf-ink);
  font: 500 13.5px/1 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.6px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.vf-gate__input:focus,
.vf-gate__input:focus-visible { outline: none; }

.vf-gate__input::placeholder {
  color: var(--vf-soft);
  opacity: 0.55;
  letter-spacing: 0.4px;
}

.vf-gate__input:-webkit-autofill,
.vf-gate__input:-webkit-autofill:hover,
.vf-gate__input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--vf-ink);
  -webkit-box-shadow: 0 0 0 60px rgba(255, 255, 255, 0.01) inset;
  transition: background-color 9999s ease-out 0s;
}

.vf-gate__submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #1b1c19;
  color: #ffffff;
  font: 600 12px/1 Inter, -apple-system, 'Segoe UI', sans-serif;
  letter-spacing: 0.1px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, opacity 0.18s,
    transform 0.12s;
}

.vf-gate__submit span {
  font-size: 13px;
  opacity: 0.75;
  transition: transform 0.18s;
}

.vf-gate__submit:hover { background: #34352f; }
.vf-gate__submit:hover span { transform: translate(1px, -1px); }
.vf-gate__submit:active { transform: translateY(1px); }
.vf-gate__submit:disabled { opacity: 0.7; cursor: default; }
.vf-gate__submit:focus-visible {
  outline: 2px solid var(--vf-accent);
  outline-offset: 2px;
}

html.dark .vf-gate__submit { background: var(--vf-accent); color: #0d2117; }
html.dark .vf-gate__submit:hover { background: #b5f5d6; }
html.dark .vf-gate__submit:disabled { opacity: 0.65; }

/* ----------------------------------------------------------------- message -- */

.vf-gate__msg {
  min-height: 16px;
  margin: 10px 0 0;
  font: 500 10px/1.45 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 0.3px;
  color: var(--vf-soft);
}

.vf-gate__msg.is-err { color: var(--vf-red); }
.vf-gate__msg.is-ok { color: var(--vf-accent); }

/* -------------------------------------------------------------------- foot -- */

.vf-gate__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--vf-line);
  font: 400 9.5px/1.5 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  letter-spacing: 0.2px;
  color: var(--vf-soft);
}

.vf-gate__foot code {
  color: var(--vf-ink);
  font-family: inherit;
}

.vf-gate__foot span:last-child { text-align: right; }

/* ---------------------------------------------------------------- progress -- */

.vf-gate__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s;
}

.vf-gate__progress i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--vf-accent);
}

.vf-gate.is-ok .vf-gate__progress { opacity: 1; }
.vf-gate.is-ok .vf-gate__progress i { animation: vf-progress var(--vf-delay) linear forwards; }

/* ----------------------------------------------------------------- states -- */

.vf-gate.is-ok .vf-gate__field {
  border-color: var(--vf-accent);
  background: transparent;
}

.vf-gate.is-ok .vf-gate__submit {
  background: var(--vf-accent);
  border-color: var(--vf-accent);
  color: #ffffff;
}

html.dark .vf-gate.is-ok .vf-gate__submit { color: #0d2117; }

.vf-gate.is-err .vf-gate__field {
  border-color: var(--vf-red);
  box-shadow: 0 0 0 3px rgba(181, 63, 58, 0.14);
}

.vf-gate.is-err .vf-gate__card {
  animation: vf-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.vf-gate.is-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

/* --------------------------------------------------------------- animation -- */

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

@keyframes vf-rise {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes vf-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@keyframes vf-progress {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes vf-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

/* ---------------------------------------------------------------- responsive -- */

@media (max-width: 520px) {
  .vf-gate { padding: 12px; }

  .vf-gate__card {
    padding: 20px 18px 16px;
    border-radius: 14px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .vf-gate__top { margin-bottom: 24px; }
  .vf-gate__title { font-size: 26px; letter-spacing: -1px; }
  .vf-gate__copy { margin-bottom: 20px; font-size: 12.5px; }
  .vf-gate__eyebrow { margin-bottom: 12px; }

  .vf-gate__field {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .vf-gate__input { height: 38px; padding: 0 4px; }
  .vf-gate__submit { width: 100%; height: 42px; }

  .vf-gate__foot {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .vf-gate__foot span:last-child { text-align: left; }
}

@media (max-height: 560px) and (min-width: 521px) {
  .vf-gate { padding: 12px; }
  .vf-gate__card {
    padding: 18px 22px 14px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .vf-gate__top { margin-bottom: 16px; }
  .vf-gate__eyebrow { margin-bottom: 10px; }
  .vf-gate__title { font-size: 25px; letter-spacing: -1px; }
  .vf-gate__copy { margin-bottom: 14px; font-size: 12px; line-height: 1.5; }
  .vf-gate__foot { margin-top: 12px; padding-top: 10px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .vf-gate,
  .vf-gate *,
  .vf-gate *::before,
  .vf-gate *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
