/* The Gate — shared styles for /gate (A) and /gate-b (B) */
:root {
  --vault: #0f161c;        /* page ground: cold blue-black, like a sealed room */
  --paper: #ddd7c8;        /* body text: aged file paper */
  --paper-dim: #8e918b;    /* secondary text */
  --rule: #26313a;         /* input outline */
  --gold: #c8a24a;         /* gold dust — used only for the one action */
  --hero-ratio: 1080 / 718;  /* matches the hero video exactly */
  --measure: 32rem;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--vault);
  color: var(--paper);
  font-family: "Spectral", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  font-weight: 300;
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

/* ---- Hero: fixed frame so nothing below it can ever jump ---- */
.hero {
  position: relative;
  width: 100%;
  max-width: 44rem;
  margin: 0 auto;
  aspect-ratio: var(--hero-ratio);
  background: #0a0f13;
  overflow: hidden;
}
.hero video,
.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* soft fall-off into the page so the frame has no hard bottom edge */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 28%;
  background: linear-gradient(to bottom, rgba(15,22,28,0), var(--vault));
  pointer-events: none;
}

/* ---- Record ---- */
.record {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}
.record p { margin: 0 0 1.15em; }

.opening p {
  font-size: 1.6rem;
  line-height: 1.3;
  font-weight: 400;
  margin-bottom: 0.45em;
}
.opening { margin-bottom: 2.4rem; }

/* ---- Capture ---- */
.capture {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1rem 1.5rem 5rem;
}
.capture form { margin: 1.5rem 0 1.75rem; }

.capture label {
  display: block;
  font-size: 0.95rem;
  color: var(--paper-dim);
  margin-bottom: 0.5rem;
}
.capture input[type="email"] {
  width: 100%;
  font: inherit;
  font-size: 1.0625rem; /* ≥16px stops iOS zooming on focus */
  color: var(--paper);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.75rem;
}
.capture input[type="email"]::placeholder { color: #5d646a; }

.capture button {
  width: 100%;
  font: inherit;
  font-weight: 500;
  font-size: 1.0625rem;
  font-variant: all-small-caps;
  letter-spacing: 0.08em;
  color: var(--vault);
  background: var(--gold);
  border: 0;
  border-radius: 2px;
  padding: 0.9rem 1rem;
  cursor: pointer;
}
.capture button[disabled] { opacity: 0.6; cursor: wait; }

.capture input:focus-visible,
.capture button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.status { min-height: 1.6em; font-size: 1rem; margin: 0.75rem 0 0; }
.status.is-error { color: #d9a08a; }

.received p { font-size: 1.35rem; line-height: 1.4; margin: 0 0 0.5em; }

.leave { color: var(--paper-dim); font-size: 0.95rem; }

/* ---- The one orchestrated moment: the opening lines arrive one at a time ---- */
.js .opening p { opacity: 0; transform: translateY(4px); }
.js.ready .opening p {
  opacity: 1;
  transform: none;
  transition: opacity 1.1s ease, transform 1.1s ease;
}
.js.ready .opening p:nth-child(2) { transition-delay: 0.7s; }
.js.ready .opening p:nth-child(3) { transition-delay: 1.4s; }

@media (prefers-reduced-motion: reduce) {
  .js .opening p { opacity: 1; transform: none; transition: none; }
}

@media (min-width: 48rem) {
  body { font-size: 1.1875rem; }
  .record { padding-top: 3.5rem; }
  .opening p { font-size: 1.85rem; }
}
