/* The CUEVA waitlist. Colours are the app's own (lib/theme/tokens.dart):
   the ink ground, the violet bloom, and brass on exactly one thing, the
   button, because joining is something opening. */

:root {
  --ink: #0A0620;
  --surface1: #130D2A;
  --surface2: #1A1636;
  --surface3: #262048;
  --glow: #3A3070;
  --on: #FBFAFF;
  --soft: #B6B2CE;
  --faint: #908BAF;
  --brass: #E0AC4C;
  --brass-lip: #B9862F;
  --bad: #E88585;

  --serif: Didot, "Bodoni 72", "Bodoni Moda", Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", Roboto, system-ui, sans-serif;
  --mark: -apple-system, "SF Pro Display", "Helvetica Neue", Arial, system-ui, sans-serif;

  --gutter: 16px;
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background-color: var(--ink);
  background-image: radial-gradient(130% 85% at 50% 22%, var(--glow) 0%, var(--surface1) 46%, var(--ink) 100%);
  background-attachment: fixed;
  color: var(--on);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

a { color: var(--soft); text-underline-offset: 3px; }
a:hover { color: var(--on); }

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

/* The wordmark ---------------------------------------------------------- */

.top {
  padding: max(28px, env(safe-area-inset-top)) var(--gutter) 0;
  text-align: center;
}

.wordmark {
  font-family: var(--mark);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 0.5px;
  color: var(--on);
}

/* The card, and him on top of it ---------------------------------------- */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px var(--gutter) 32px;
}

.stage {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding-top: 96px; /* his height: the card's top edge is where his fists are */
}

.peek {
  position: absolute;
  top: 0;
  left: 50%;
  width: 160px;
  height: 96px;
  margin-left: -80px;
  z-index: 0; /* behind the card, so he rises from behind its edge */
  transform-origin: 50% 100%;
  animation: rise 720ms cubic-bezier(.34, 1.5, .64, 1) 260ms both;
}

.peek.cheer { opacity: 0; }

.card {
  position: relative;
  z-index: 1;
  background: var(--surface1);
  border: 1px solid rgba(251, 250, 255, 0.07);
  border-radius: 24px;
  padding: 30px 24px 26px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

@keyframes rise {
  from { transform: translateY(78%); }
  to { transform: translateY(0); }
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

h1, h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.08;
  color: var(--on);
  text-wrap: balance;
}

h1 { font-size: 40px; }
h2 { font-size: 36px; outline: none; }

.lede {
  margin: 14px 0 0;
  color: var(--soft);
  line-height: 1.55;
  text-wrap: pretty;
}

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

form { margin-top: 26px; }

input[type="email"] {
  display: block;
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font: inherit;
  font-size: 17px; /* 16 and up, or iOS zooms in on focus */
  color: var(--on);
  background: var(--ink);
  border: 1px solid var(--surface3);
  border-radius: 14px;
  outline: none;
  transition: border-color 160ms ease;
}

input[type="email"]::placeholder { color: var(--faint); opacity: 0.75; }
input[type="email"]:focus { border-color: var(--soft); }
.stage[data-state="wrong"] input[type="email"] { border-color: var(--bad); }

button {
  display: block;
  width: 100%;
  height: 54px;
  margin-top: 12px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  background: var(--brass);
  border: 0;
  border-radius: 14px;
  /* The app's key: a lip under the face, which the face goes down onto. */
  box-shadow: 0 4px 0 var(--brass-lip);
  cursor: pointer;
  transition: transform 90ms ease, box-shadow 90ms ease, opacity 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--brass-lip);
}

button:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; }
button:disabled { cursor: default; opacity: 0.7; }

.note {
  margin: 14px 0 0;
  font-size: 14px;
  color: var(--faint);
  text-align: center;
}

.stage[data-state="wrong"] .note,
.stage[data-state="failed"] .note { color: var(--bad); }

/* A bot fills every field it finds. People never see this one. */
.trap {
  position: absolute;
  left: -10000px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* On the list ----------------------------------------------------------- */

.done { display: none; }

.stage[data-state="done"] .ask { display: none; }
.stage[data-state="done"] .done {
  display: block;
  animation: arrive 420ms ease both;
}
.stage[data-state="done"] .done .lede { margin-bottom: 4px; }

.stage[data-state="done"] .peek { animation: none; }
.stage[data-state="done"] .peek:not(.cheer) { opacity: 0; }
.stage[data-state="done"] .peek.cheer {
  opacity: 1;
  animation: hop 520ms cubic-bezier(.3, 1.6, .6, 1) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

@keyframes hop {
  0% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(6px) scale(1.04, .94); }
  60% { transform: translateY(-14px) scale(.98, 1.03); }
  100% { transform: translateY(0) scale(1, 1); }
}

.stage.shake .card { animation: shake 360ms ease; }

@keyframes shake {
  0%, 100% { transform: none; }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

/* What happens to your email -------------------------------------------- */

.privacy {
  width: 100%;
  max-width: 440px;
  margin-top: 22px;
  font-size: 14px;
  color: var(--soft);
}

.privacy summary {
  list-style: none;
  cursor: pointer;
  text-align: center;
  color: var(--faint);
  padding: 12px 0; /* a 44pt target */
  -webkit-tap-highlight-color: transparent;
}

.privacy summary::-webkit-details-marker { display: none; }
.privacy summary::after { content: " +"; }
.privacy[open] summary::after { content: " \2212"; }
.privacy summary:hover { color: var(--soft); }
.privacy summary:focus-visible { outline: 2px solid var(--soft); outline-offset: 2px; border-radius: 6px; }

.privacy ul {
  margin: 4px 0 0;
  padding: 18px 22px 18px 38px;
  background: rgba(19, 13, 42, 0.7);
  border: 1px solid rgba(251, 250, 255, 0.06);
  border-radius: 18px;
}

.privacy li { margin: 0 0 10px; line-height: 1.55; }
.privacy li:last-child { margin-bottom: 0; }

.foot {
  padding: 8px var(--gutter) max(24px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
}

.foot a { color: var(--faint); text-decoration: none; display: inline-block; padding: 12px 4px; }
.foot a:hover { color: var(--soft); }

/* Wider screens --------------------------------------------------------- */

@media (min-width: 560px) {
  .card { padding: 38px 40px 32px; }
  h1 { font-size: 48px; }
  h2 { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  .peek,
  .stage[data-state="done"] .peek.cheer,
  .stage[data-state="done"] .done,
  .stage.shake .card { animation: none; }
}
