/* TAPE93 — splash + email capture */

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

:root {
  --ink: #1a1a1a;
  --paper: #ffffff;
  --muted: #8c8c8c;
  --error: #c0392b;
  --rule: #1a1a1a;
  --form-width: 480px;
}

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  min-height: 100%;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(64px, 9vh, 96px);
  padding: 6vh 24px;
}

/* ---------- logo ---------- */

.logo {
  margin: 0;
  line-height: 0;
}

.logo img {
  display: block;
  width: min(225px, 46vw);
  height: auto;
}

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

.signup {
  width: 100%;
  max-width: var(--form-width);
}

/* Row and message occupy the SAME grid cell, so swapping one for the other
   cannot change the height of anything — the logo above never moves. */
.signup__stack {
  display: grid;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 10px;
}

.signup__stack > * {
  grid-area: 1 / 1;
}

.signup__row {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.signup__input {
  flex: 1 1 auto;
  min-width: 0;
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 0; /* iOS */
}

.signup__input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.signup__input:focus,
.signup__input:focus-visible { outline: none; }

/* focus affordance with zero layout cost — a border-width change would nudge
   the message that shares this box */
.signup__stack:focus-within {
  box-shadow: 0 1px 0 var(--rule);
}

.signup__submit {
  flex: 0 0 auto;
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--ink);
  font: inherit;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.signup__submit:hover { opacity: 0.55; }
.signup__submit:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.signup.is-busy .signup__submit {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* ---------- the swap ---------- */

.signup__message {
  align-self: center;
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.signup__message.is-error { color: var(--error); }
.signup__message.is-success { color: var(--ink); }

/* row visible, message hidden — the default */
.signup__row,
.signup__message {
  transition: opacity 260ms ease;
}

.signup__message {
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

/* swapped: message visible, row gone */
.signup.is-swapped .signup__row {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms ease, visibility 0s linear 260ms;
}

.signup.is-swapped .signup__message {
  opacity: 1;
  visibility: visible;
  transition: opacity 260ms ease, visibility 0s linear 0s;
}

/* quick dip when one message replaces another (sending -> result) */
.signup.is-swapped.is-dipping .signup__message {
  opacity: 0;
  transition: opacity 140ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .signup__row,
  .signup__message,
  .signup.is-swapped .signup__row,
  .signup.is-swapped .signup__message,
  .signup.is-swapped.is-dipping .signup__message {
    transition: none;
  }
}

/* ---------- utilities ---------- */

.signup__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .wrap { padding: 6vh 16px; }
  .signup { max-width: none; }
  .signup__input { font-size: 16px; } /* stop iOS zoom-on-focus */
  .signup__submit { font-size: 16px; }
  .signup__message { font-size: 14px; } /* stays shorter than the row, which sets the height */
}

@media (prefers-reduced-motion: no-preference) {
  .signup__submit { transition: opacity 120ms ease; }
}
