/* cueva.cc. Colours are the app's own (lib/theme/tokens.dart): the ink
   ground, the violet bloom, his pink, and brass on exactly one thing, the
   join button, because joining is something opening. The faces are the
   book's: Inter for the wordmark (the brand board's heavy grotesque),
   Bodoni Moda for anything said with weight. Both are served from here
   (SIL OFL, licences in /fonts), so the lockup looks the same on every
   phone and nothing is fetched from anywhere else. */

@font-face {
  font-family: "CUEVA Mark";
  src: url("/fonts/inter-900.woff2") format("woff2");
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/bodoni-moda-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

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

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

  --spring: cubic-bezier(.2, .9, .25, 1.12);
  --ease: cubic-bezier(.22, .8, .25, 1);

  --gutter: 16px;
  --him-w: 200px;
  --tuck: 0.06; /* how much of his frame's empty top sits up under the icons */
  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: var(--ink);
  color: var(--on);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* The light the whole page sits in. app.js puts its centre behind the
   wordmark, wherever the layout has put that. */
.light {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42vmax 34vmax at var(--lx, 50%) var(--ly, 18%), rgba(74, 61, 146, 0.85) 0%, rgba(58, 48, 112, 0.55) 34%, rgba(19, 13, 42, 0.4) 62%, transparent 82%),
    radial-gradient(30vmax 30vmax at 88% 92%, rgba(228, 150, 186, 0.07), transparent 70%),
    var(--ink);
  animation: fade 1.2s ease both;
}

.field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  animation: fade 1.6s ease 200ms both;
}

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 page: one column on a phone, the hero and the waitlist on the left
   with the guidebook beside them on a wide screen. ----------------------- */

.page {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) var(--gutter) 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* The lockup ------------------------------------------------------------- */

.hero { text-align: center; }

.mark {
  margin: 0;
  display: flex;
  justify-content: center;
  font-family: var(--mark);
  font-weight: 900;
  font-size: clamp(60px, 20vw, 92px);
  line-height: 0.86;
  letter-spacing: -0.035em;
  padding-bottom: 0.04em;
  filter: drop-shadow(0 0 26px rgba(150, 128, 255, 0.38)) drop-shadow(0 10px 30px rgba(5, 2, 20, 0.55));
}

/* Each letter carries its own fill so it can arrive on its own: white at
   the top falling to violet, and a band of light that crosses once. */
.mark span {
  display: inline-block;
  color: transparent;
  background-image:
    linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.95) 50%, transparent 62%),
    linear-gradient(180deg, #FFFFFF 0%, #F3F0FF 40%, #BFB2FA 100%);
  background-size: 320% 100%, 100% 100%;
  background-position: 160% 0, 0 0;
  background-repeat: no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  animation:
    letter 900ms var(--spring) both,
    glint 1300ms ease-in-out both;
}

.mark span:nth-child(1) { animation-delay: 60ms, 1150ms; }
.mark span:nth-child(2) { animation-delay: 115ms, 1220ms; }
.mark span:nth-child(3) { animation-delay: 170ms, 1290ms; }
.mark span:nth-child(4) { animation-delay: 225ms, 1360ms; }
.mark span:nth-child(5) { animation-delay: 280ms, 1430ms; }

/* Each letter is its own box, so the font's own kerning is lost between
   them. Inter kerns only one pair in CUEVA: V and A, by -0.088 em. */
.mark span:nth-child(5) { margin-left: -0.088em; }

@keyframes letter {
  from { opacity: 0; transform: translateY(0.32em) scale(0.94); }
  to { opacity: 1; transform: none; }
}

@keyframes glint {
  from { background-position: 160% 0, 0 0; }
  to { background-position: -60% 0, 0 0; }
}

.tagline {
  margin: 12px auto 0;
  max-width: 22em;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 4.8vw, 21px);
  line-height: 1.3;
  color: #DCD6F7;
  text-wrap: balance;
  animation: up 760ms var(--ease) 360ms both;
}

/* The three places he is. */
.socials {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.social {
  position: relative;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--on);
  border-radius: 50%;
  background: rgba(251, 250, 255, 0.05);
  border: 1px solid rgba(251, 250, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  -webkit-tap-highlight-color: transparent;
  transition: transform 280ms var(--spring), background 200ms ease, border-color 200ms ease, box-shadow 280ms ease;
  animation: pop 700ms var(--spring) both;
}

.social:nth-child(1) { animation-delay: 470ms; }
.social:nth-child(2) { animation-delay: 530ms; }
.social:nth-child(3) { animation-delay: 590ms; }

.social svg { width: 20px; height: 20px; fill: currentColor; transition: transform 280ms var(--spring); }
.social svg.line { fill: none; stroke: currentColor; stroke-width: 2; }
.social svg.line .dot { fill: currentColor; stroke: none; }

.social:active { transform: scale(0.94); }
.social:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; }

/* A name under the icon on a screen with a pointer. */
.tip {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: var(--on);
  background: var(--surface3);
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -4px);
  transition: opacity 160ms ease, transform 200ms var(--ease);
}

@media (hover: hover) {
  .social:hover {
    transform: translateY(-3px);
    color: #FFFFFF;
    background: rgba(160, 146, 236, 0.18);
    border-color: rgba(206, 196, 255, 0.45);
    box-shadow: 0 12px 26px -10px rgba(130, 108, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .social:hover svg { transform: scale(1.08); }
  .social:hover .tip { opacity: 1; transform: translate(-50%, 0); }
}

/* The waitlist card, and him on its edge ---------------------------------- */

.stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  /* His frame: the card's top edge is where his fists are. The top of the
     frame is room for his hops and his arms in the cheer, empty while he
     holds on, so it tucks up under the icons. */
  padding-top: calc(var(--him-w) * 0.68);
  margin-top: calc(var(--him-w) * var(--tuck) * -1);
  animation: up 800ms var(--ease) 380ms both;
}

/* Him. The frames come from the app's own painter (mascot.js only chooses
   which to show). The poster is his resting frame, there before anything
   loads and for anybody without JavaScript; the canvas takes over once his
   movements have loaded. */
.peek {
  position: absolute;
  top: 0;
  left: 50%;
  width: var(--him-w);
  height: calc(var(--him-w) * 0.68);
  margin-left: calc(var(--him-w) / -2);
  z-index: 0; /* behind the card, so he rises from behind its edge */
  animation: rise 720ms cubic-bezier(.34, 1.5, .64, 1) 760ms both;
}

.peek .body {
  position: absolute;
  inset: 0;
  transform-origin: 50% 100%;
  animation: breathe 3.6s ease-in-out infinite;
}

.peek .poster,
.peek .him {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.peek .him { visibility: hidden; cursor: pointer; }
.peek.live .him { visibility: visible; }
.peek.live .poster { visibility: hidden; }

@keyframes breathe {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.004, 1.01); }
}

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

/* Asleep: Zs drifting up off his head. */
.zzz {
  position: absolute;
  left: 64%;
  top: 22%;
  width: 50px;
  height: 60px;
  pointer-events: none;
}

.zzz span {
  position: absolute;
  left: 0;
  bottom: 0;
  font-family: var(--serif);
  font-style: italic;
  color: #CFC8F5;
  opacity: 0;
}

.zzz span:nth-child(1) { font-size: 14px; }
.zzz span:nth-child(2) { font-size: 18px; }
.zzz span:nth-child(3) { font-size: 23px; }

.stage.asleep .zzz span { animation: drift 3s ease-out infinite; }
.stage.asleep .zzz span:nth-child(2) { animation-delay: 1s; }
.stage.asleep .zzz span:nth-child(3) { animation-delay: 2s; }

@keyframes drift {
  0% { opacity: 0; transform: translate(0, 0) rotate(-8deg); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(26px, -54px) rotate(6deg); }
}

/* Solid, never see-through: he sits behind it as he rises. */
.card {
  position: relative;
  z-index: 1;
  container-type: inline-size;
  background: linear-gradient(180deg, #1B1438 0%, var(--surface1) 46%, #100A25 100%);
  border: 1px solid rgba(251, 250, 255, 0.09);
  border-radius: 26px;
  padding: 24px 20px 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 1px rgba(10, 6, 32, 0.6),
    0 34px 80px -24px rgba(0, 0, 0, 0.75),
    0 0 90px -30px rgba(120, 100, 230, 0.45);
}

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

h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  color: var(--on);
  text-wrap: balance;
  outline: none;
}

.join h2 { font-size: clamp(27px, 7.6vw, 38px); }

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

.feats {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: none;
}

.feats li {
  position: relative;
  padding: 4px 0 4px 24px;
  color: var(--on);
  font-size: 16px;
  line-height: 1.45;
}

/* A small violet diamond: these are what is inside, not things to press. */
.feats li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 12px;
  width: 7px;
  height: 7px;
  background: #8C7FD6;
  transform: rotate(45deg);
  border-radius: 1.5px;
}

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

form { margin-top: 18px; }

.row { display: flex; flex-direction: column; gap: 10px; }

input[type="email"] {
  display: block;
  width: 100%;
  min-width: 0;
  height: 56px;
  padding: 0 18px;
  font: inherit;
  font-size: 17px; /* 16 and up, or iOS zooms in on focus */
  color: var(--on);
  background: rgba(6, 3, 20, 0.75);
  border: 1px solid var(--surface3);
  border-radius: 16px;
  outline: none;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: border-color 160ms ease, box-shadow 220ms ease;
}

input[type="email"]::placeholder { color: var(--faint); opacity: 0.7; }
input[type="email"]:hover { border-color: #3A3266; }
input[type="email"]:focus {
  border-color: rgba(206, 196, 255, 0.7);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(160, 146, 236, 0.18);
}
.stage[data-state="wrong"] input[type="email"] {
  border-color: var(--bad);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 4px rgba(232, 133, 133, 0.14);
}

/* The app's key: a brass face on a lip, which the face goes down onto. */
button {
  position: relative;
  flex: none;
  display: block;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #1A1006;
  background: linear-gradient(180deg, var(--brass-hi) 0%, var(--brass) 55%);
  border: 0;
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--brass-lip), 0 14px 28px -12px rgba(224, 172, 76, 0.55);
  cursor: pointer;
  overflow: hidden;
  transition: transform 110ms ease, box-shadow 110ms ease, filter 160ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* A sheen that crosses the face when a pointer arrives. */
button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.45) 50%, transparent 70%);
  transform: translateX(-120%);
  pointer-events: none;
}

@media (hover: hover) {
  button:hover:not(:disabled) {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 5px 0 var(--brass-lip), 0 18px 32px -12px rgba(224, 172, 76, 0.7);
  }
  button:hover:not(:disabled)::before { transform: translateX(120%); transition: transform 700ms var(--ease); }
}

button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--brass-lip), 0 6px 14px -8px rgba(224, 172, 76, 0.5);
  transition-duration: 60ms;
}

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

/* Sending: the words make way for three dots. */
.stage[data-state="sending"] button .label { opacity: 0.55; }
.stage[data-state="sending"] button::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #1A1006;
  box-shadow: -12px 0 0 #1A1006, -24px 0 0 #1A1006;
  animation: dots 900ms ease-in-out infinite;
}

@keyframes dots {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.9; }
}

.note {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--faint);
  text-align: center;
  text-wrap: balance;
  transition: color 160ms ease;
}

.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;
}

@container (min-width: 470px) {
  .row { flex-direction: row; gap: 8px; }
  .row button { width: auto; }
  .note { text-align: left; }
}

/* What happens to your email */
.privacy {
  margin-top: 6px;
  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: 0 0 10px;
  padding: 16px 18px 16px 34px;
  background: rgba(6, 3, 20, 0.5);
  border: 1px solid rgba(251, 250, 255, 0.06);
  border-radius: 16px;
}

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

@container (min-width: 470px) {
  .privacy summary { text-align: left; }
}

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

.done { display: none; padding-bottom: 12px; }

.stage[data-state="done"] .ask { display: none; }
.stage[data-state="done"] .done {
  display: block;
  animation: arrive 480ms var(--ease) both;
}

.done .wait { margin: 24px 0 10px; }

.follow.socials { justify-content: flex-start; margin-top: 0; }

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

.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); }
}

/* The guidebook ---------------------------------------------------------- */

.book {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 16px 16px 14px;
  border-radius: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(228, 150, 186, 0.14), transparent 60%),
    linear-gradient(180deg, rgba(34, 26, 70, 0.82), rgba(19, 13, 42, 0.86));
  border: 1px solid rgba(251, 250, 255, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 26px 60px -24px rgba(0, 0, 0, 0.7);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  animation: up 800ms var(--ease) 520ms both;
}

.book .cover {
  position: relative;
  display: block;
  perspective: 900px;
  -webkit-tap-highlight-color: transparent;
}

/* His pink, glowing behind the book. */
.book .cover::before {
  content: "";
  position: absolute;
  inset: 8% -6% 4%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(228, 150, 186, 0.5), rgba(160, 120, 230, 0.18) 60%, transparent);
  filter: blur(14px);
  pointer-events: none;
}

.tilt {
  position: relative;
  display: block;
  border-radius: 3px 6px 6px 3px;
  transform: rotateY(calc(-14deg + var(--ty, 0deg))) rotateX(calc(3deg + var(--tx, 0deg)));
  transform-style: preserve-3d;
  transition: transform 600ms var(--ease);
  /* The page edges, then the shadow on the table. */
  box-shadow:
    1px 0 0 rgba(255, 255, 255, 0.18),
    4px 3px 0 -1px #E9E3F6,
    7px 6px 0 -2px #CFC6E6,
    16px 22px 36px -10px rgba(0, 0, 0, 0.7);
}

.tilt img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px 6px 6px 3px;
}

/* The spine's fold, and a light that crosses the cover. */
.tilt::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7%;
  z-index: 1;
  border-radius: 3px 0 0 3px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.35), rgba(255, 255, 255, 0.12) 55%, transparent);
  pointer-events: none;
}

.sheen {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.28) 50%, transparent 65%);
  background-size: 300% 100%;
  background-position: 120% 0;
  pointer-events: none;
  animation: sheen 1400ms ease-in-out 1700ms both;
}

@keyframes sheen {
  from { background-position: 120% 0; }
  to { background-position: -40% 0; }
}

@media (hover: hover) {
  .book:hover .tilt { transform: rotateY(calc(-5deg + var(--ty, 0deg))) rotateX(calc(1deg + var(--tx, 0deg))) translateY(-4px); }
}

.book-words { min-width: 0; }
.book .eyebrow { margin-bottom: 6px; font-size: 11px; letter-spacing: 0.12em; }

.book h2 { font-size: 21px; line-height: 1.12; }

.book-line {
  display: none;
  margin: 10px 0 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--soft);
  text-wrap: pretty;
}

/* Under the cover and the title on a phone: the price, and the way in. */
.buy {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(251, 250, 255, 0.08);
}

.price {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.amount {
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--on);
}

.cost { display: inline-flex; align-items: baseline; gap: 10px; }

/* The crossed-out price (Khai, 4 Nov). */
.was {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1;
  color: var(--faint);
  text-decoration: line-through;
  text-decoration-color: rgba(228, 150, 186, 0.85);
  text-decoration-thickness: 1.5px;
}

.format { font-size: 13px; color: var(--faint); }

.explore {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.2;
  text-align: center;
  color: var(--on);
  text-decoration: none;
  background: linear-gradient(180deg, #3D3376, #2A2256);
  border: 1px solid rgba(206, 196, 255, 0.28);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 10px 24px -14px rgba(120, 100, 240, 0.9);
  -webkit-tap-highlight-color: transparent;
  transition: transform 200ms var(--spring), border-color 160ms ease, box-shadow 200ms ease, background 200ms ease;
}

.explore svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 260ms var(--spring);
}

@media (hover: hover) {
  .explore:hover {
    color: #FFFFFF;
    background: linear-gradient(180deg, #4A3F8C, #322966);
    border-color: rgba(220, 212, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 16px 30px -14px rgba(140, 118, 255, 0.95);
  }
  .explore:hover svg { transform: translateX(3px); }
}

.explore:active { transform: translateY(1px) scale(0.99); }
.explore:focus-visible { outline: 2px solid var(--on); outline-offset: 3px; }

.inside {
  display: none;
  margin-top: 10px;
  font-size: 14px;
  color: var(--faint);
  text-align: center;
  text-decoration: none;
}

.inside:hover { color: var(--on); text-decoration: underline; }

/* The shelf: the guidebook's pointer on a phone. Hidden until app.js says
   the book card is still below the fold, and gone again once it is seen,
   or while somebody types. */
.shelf {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 8px 10px 8px 12px;
  color: var(--on);
  text-decoration: none;
  border-radius: 18px;
  background: rgba(30, 23, 62, 0.82);
  border: 1px solid rgba(251, 250, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 40px -12px rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-tap-highlight-color: transparent;
  visibility: hidden;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 260ms ease, transform 420ms var(--spring), visibility 0s linear 420ms;
}

.shelf.show {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity 260ms ease, transform 420ms var(--spring), visibility 0s;
}

.shelf img {
  flex: none;
  width: 34px;
  height: 48px;
  border-radius: 2px 4px 4px 2px;
  box-shadow: 3px 3px 0 -1px #E9E3F6, 0 6px 14px rgba(0, 0, 0, 0.6);
  transform: rotate(-4deg);
}

.shelf-words { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.shelf-title { font-weight: 600; font-size: 14px; line-height: 1.2; text-wrap: balance; }
.shelf-line { margin-top: 2px; font-size: 13px; color: var(--soft); }
.shelf-line s { color: var(--faint); text-decoration-color: rgba(228, 150, 186, 0.85); }

.shelf-go {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  padding: 0 12px 0 14px;
  font-weight: 600;
  font-size: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #3D3376, #2A2256);
  border: 1px solid rgba(206, 196, 255, 0.28);
}

.shelf-go svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shelf:active { transform: scale(0.98); }

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

.foot {
  padding: 18px var(--gutter) max(22px, env(safe-area-inset-bottom));
  font-size: 13px;
}

.foot nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 6px;
}

.foot a {
  display: inline-block;
  padding: 13px 8px;
  color: var(--faint);
  text-decoration: none;
}

.foot a:hover { color: var(--on); }

/* Motion shared by the arrivals. */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(0.6); } to { opacity: 1; transform: none; } }

/* The smallest phones: a little tighter, so the book still shows. */
@media (max-width: 359px) {
  :root { --him-w: 176px; }
  .page { padding-top: max(18px, env(safe-area-inset-top)); }
  .card { padding: 20px 16px 10px; }
  .book { grid-template-columns: 78px minmax(0, 1fr); gap: 12px; }
  .book h2 { font-size: 19px; }
  .eyebrow { font-size: 11px; letter-spacing: 0.1em; }
  .join h2 { font-size: 24px; }
  .shelf-go { width: 40px; padding: 0; justify-content: center; font-size: 0; }
  .shelf-go svg { width: 18px; height: 18px; }
}

/* A phone with little height, which is most phones inside Instagram's own
   browser: the lockup tightens and the card says less, so the button sits
   clear of the guidebook's bar. */
@media (max-width: 599px) and (max-height: 760px) {
  :root { --him-w: 138px; }
  .page { padding-top: max(10px, env(safe-area-inset-top)); }
  .mark { font-size: clamp(52px, 16vw, 62px); }
  .tagline { margin-top: 6px; font-size: 16px; line-height: 1.25; max-width: 17em; }
  .socials { margin-top: 8px; gap: 10px; }
  .card { padding-top: 18px; }
  .join .lede { font-size: 16px; margin-top: 8px; }
  form { margin-top: 14px; }
  .note { margin-top: 10px; }
}

@media (max-width: 599px) and (max-height: 600px) {
  :root { --him-w: 128px; }
  .mark { font-size: 50px; }
  .tagline { font-size: 15px; }
  form { margin-top: 14px; }
}

/* Tablets and big phones on their side: room to breathe and to say more. */
@media (min-width: 600px) {
  .shelf { display: none; }
  .stage { max-width: none; }
  .page { max-width: 620px; padding-top: max(44px, env(safe-area-inset-top)); }
  .mark { font-size: 112px; }
  .tagline { font-size: 23px; }
  :root { --him-w: 220px; }
  .card { padding: 34px 34px 18px; }
  .join h2 { font-size: 42px; }
  .feats { display: block; }
  .book { grid-template-columns: 150px minmax(0, 1fr); gap: 26px; padding: 22px 26px 22px 22px; margin-top: 18px; }
  .book h2 { font-size: 26px; }
  .book-line { display: block; }
  .explore { flex: none; }
  .inside { display: inline-block; margin: 0 0 0 auto; padding: 12px 4px; }
}

/* Wide: the hero and the waitlist on the left, the guidebook standing
   beside them from the wordmark down to the card's foot. */
@media (min-width: 980px) {
  .page {
    flex: none;
    margin-block: auto;
    padding: clamp(22px, 3.6vh, 56px) 32px 8px;
    display: grid;
    max-width: 1080px;
    grid-template-columns: minmax(0, 1fr) 380px;
    grid-template-areas: "hero hero" "stage book";
    column-gap: 28px;
  }

  .hero { grid-area: hero; }
  /* The card fills its row, so it ends where the guidebook card ends in
     every state (after joining, its words are fewer). */
  .stage { grid-area: stage; align-self: stretch; max-width: none; display: flex; flex-direction: column; }
  .stage .card { flex: 1; }

  .mark { font-size: clamp(88px, min(11vw, 15.5vh), 156px); }
  .tagline { font-size: clamp(20px, 2.7vh, 26px); margin-top: clamp(10px, 1.6vh, 16px); }
  .socials { margin-top: clamp(16px, 2.6vh, 26px); gap: 14px; }
  .social { width: 50px; height: 50px; }
  .social svg { width: 21px; height: 21px; }

  :root { --him-w: clamp(210px, 30vh, 250px); --tuck: 0.16; }

  .card { padding: 28px 38px 12px; }
  .feats li { padding: 3px 0 3px 24px; }
  .feats li::before { top: 11px; }

  /* Beside the waitlist card, from its top edge to its foot, and smaller:
     the cover and the title side by side, the price and the way in under. */
  .book {
    grid-area: book;
    align-self: stretch;
    margin-top: calc(var(--him-w) * (0.68 - var(--tuck)));
    grid-template-columns: 124px minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 0 20px;
    padding: 26px 24px 22px;
    border-radius: 26px;
  }

  .book .cover { margin-top: 4px; }
  .book-words { align-self: center; }
  .book h2 { font-size: 25px; }
  .book-line { display: none; }


  .buy { grid-row: 2; align-self: end; margin-top: 18px; padding-top: 16px; }
  .amount { font-size: 32px; }
  .explore { flex: 1 1 100%; min-height: 52px; font-size: 16px; }
  .inside { display: block; flex: 1 1 100%; margin: -6px 0 -10px; padding: 10px 0; }
  .shelf { display: none; }
  .foot { padding-top: 6px; }
}

@media (min-width: 980px) and (hover: hover) and (pointer: fine) {
  .foot a { padding-top: 8px; padding-bottom: 8px; }
}

/* A wide screen that is short (a laptop): say less, so it all fits. */
@media (min-width: 980px) and (max-height: 820px) {
  .feats { display: none; }
  .book { grid-template-columns: 100px minmax(0, 1fr); padding-top: 22px; }
  .book .buy { margin-top: 14px; padding-top: 12px; }
  .book .price { flex-direction: row; align-items: baseline; gap: 10px; }
  .book .inside { display: none; }
}

/* Very large screens: the same composition, a size up. */
@media (min-width: 1800px) and (min-height: 1150px) {
  .page, .foot { zoom: 1.2; }
}

@media (min-width: 2300px) and (min-height: 1300px) {
  .page, .foot { zoom: 1.45; }
}

@media (prefers-reduced-motion: reduce) {
  .light, .field, .mark span, .tagline, .social, .stage, .peek, .peek .body,
  .book, .sheen, .stage[data-state="done"] .done, .stage.shake .card,
  .stage.asleep .zzz span, .stage[data-state="sending"] button::after {
    animation: none;
  }
  .mark span { background-position: 160% 0, 0 0; }
  .tilt, .social, .social svg, .explore, .explore svg, button, .shelf, .shelf.show { transition: none; }
  button::before { display: none; }
}
