/* The email popup (gate/page.ts) and the privacy notice (privacy.html).
   Served without an email, so it carries its own copy of the research site's
   tokens rather than importing the app's stylesheets. */

:root {
  color-scheme: dark;
  --bg: #070a10;
  --card: rgba(13, 18, 28, 0.9);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --line-accent: rgba(167, 139, 250, 0.36);
  --ink: #eef1f7;
  --ink-2: #bcc3d3;
  --ink-3: #939bb0;
  --violet: #a78bfa;
  --violet-ink: #d6ccff;
  --blue: #5b9cff;
  --cyan: #38d6f5;
  --red-ink: #f9bfc4;
  --red-wash: rgba(240, 112, 122, 0.12);
  --font-sans: "Instrument Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Roboto", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--violet-ink);
  text-decoration: underline;
  text-decoration-color: rgba(214, 204, 255, 0.4);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- the site behind the popup: a blurred sketch, no content ---------- */

.gate-body {
  min-height: 100dvh;
  overflow-x: hidden;
}

.gate-sketch {
  position: fixed;
  inset: 0;
  padding: 18px clamp(18px, 4vw, 48px);
  filter: blur(9px);
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}

.gate-sketch::after {
  content: "";
  position: fixed;
  inset: -40px;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(124, 124, 245, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(7, 10, 16, 0.35), rgba(7, 10, 16, 0.75));
}

.gate-sketch i,
.gate-sketch b,
.gate-sketch span {
  display: block;
  border-radius: 999px;
  background: rgba(238, 241, 247, 0.14);
}

.gate-sketch__nav {
  display: flex;
  gap: 28px;
  align-items: center;
  max-width: 1240px;
  margin: 0 auto;
  height: 40px;
}

.gate-sketch__nav i {
  height: 10px;
  width: 64px;
}

.gate-sketch__nav i:first-child {
  width: 150px;
  height: 22px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.5), rgba(56, 214, 245, 0.35));
  margin-right: auto;
}

.gate-sketch__hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  max-width: 1240px;
  margin: 12vh auto 0;
}

.gate-sketch__copy {
  display: grid;
  gap: 18px;
  align-content: start;
}

.gate-sketch__copy b {
  height: 52px;
  width: 92%;
  background: rgba(238, 241, 247, 0.3);
}

.gate-sketch__copy i {
  height: 13px;
  width: 88%;
}

.gate-sketch__copy .is-short {
  width: 55%;
}

.gate-sketch__figure {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  height: 360px;
  padding: 32px;
  border-radius: 24px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(16, 21, 31, 0.8);
}

.gate-sketch__figure span {
  flex: 1;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.7), rgba(56, 214, 245, 0.4));
}

.gate-sketch__figure span:nth-child(1) { height: 40%; }
.gate-sketch__figure span:nth-child(2) { height: 72%; }
.gate-sketch__figure span:nth-child(3) { height: 55%; }
.gate-sketch__figure span:nth-child(4) { height: 90%; }
.gate-sketch__figure span:nth-child(5) { height: 64%; }
.gate-sketch__figure span:nth-child(6) { height: 80%; }
.gate-sketch__figure span:nth-child(7) { height: 46%; }

/* ---------- the popup ---------- */

.gate {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px 16px;
}

.gate__card {
  width: 100%;
  max-width: 460px;
  padding: 32px;
  border-radius: 18px;
  border: 1px solid var(--line-accent);
  background: var(--card);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 40px 90px -40px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.03);
  animation: gate-in 420ms var(--ease-out) both;
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
}

.gate__mark {
  display: block;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
}

.gate__eyebrow {
  margin: 0 0 6px;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--violet-ink);
}

.gate__title {
  margin: 0;
  font-size: clamp(1.625rem, 5vw, 2rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.gate__lede {
  margin: 12px 0 24px;
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.gate__form {
  margin: 0;
}

.gate__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
}

.gate__row {
  display: flex;
  gap: 10px;
}

/* 16px text: anything smaller makes iOS zoom the page on focus. */
.gate__input {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  font: 400 16px/1.2 var(--font-ui);
  transition: border-color 160ms ease, background 160ms ease;
}

.gate__input::placeholder {
  color: var(--ink-3);
}

.gate__input:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.gate__input:focus-visible {
  outline: 2px solid var(--violet);
  outline-offset: 2px;
  border-color: var(--violet);
  border-radius: 12px;
  background: rgba(167, 139, 250, 0.06);
}

.gate__input[aria-invalid="true"] {
  border-color: rgba(240, 112, 122, 0.7);
}

/* The darker end of the site's primary gradient, so white text stays above 4.5:1. */
.gate__button {
  flex: none;
  height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid rgba(167, 139, 250, 0.55);
  background: linear-gradient(180deg, #6f5ce8, #5b48d6);
  color: #fff;
  font: 500 0.9375rem/1 var(--font-ui);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 10px 24px -14px rgba(124, 124, 245, 0.9);
  transition: box-shadow 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.gate__button:hover {
  border-color: var(--violet);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 14px 30px -12px rgba(124, 124, 245, 1);
}

.gate__button:active {
  transform: translateY(1px);
}

.gate__error {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-wash);
  color: var(--red-ink);
  font-family: var(--font-ui);
  font-size: 0.875rem;
  line-height: 1.45;
}

.gate__consent {
  margin: 16px 0 0;
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-3);
}

.gate__back {
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--ink-3);
}

/* The honeypot: present for bots, invisible and unreachable for people. */
.gate__trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 460px) {
  .gate__card {
    padding: 26px 20px;
  }

  .gate__row {
    flex-direction: column;
  }

  /* In a column, flex: 1 would size the field by the free height (none)
     instead of its own 48px. */
  .gate__input {
    flex: none;
    width: 100%;
  }

  .gate__button {
    width: 100%;
  }
}

@media (max-width: 900px) {
  .gate-sketch__hero {
    grid-template-columns: 1fr;
  }

  .gate-sketch__figure {
    height: 220px;
  }
}

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

/* ---------- privacy notice ---------- */

.doc {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.doc__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
}

.doc h1 {
  margin: 32px 0 6px;
  font-size: clamp(1.75rem, 5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.doc h2 {
  margin: 36px 0 8px;
  font-size: 1.1875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc ul {
  padding-left: 1.2em;
}

.doc li + li {
  margin-top: 6px;
}

.doc code {
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font-size: 0.875em;
}

.doc__updated {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  color: var(--ink-3);
}
