/* ============================================================
   Min — waitlist
   ------------------------------------------------------------
   The waitlist lives in the same world as the landing page: cave
   light, drifting fog, and one piece of optical resin floating in
   it. This file only adds what the form itself needs — the
   environment, the wordmark, the buttons and the reveal recipe all
   come from landing.css.

   Because .resin flips --ink to graphite, everything inside the
   card can keep reading from --ink / --ink-soft / --ink-faint and
   land the right way round without a second palette.

   Depends on tokens.css + landing.css.
   ============================================================ */

/* ---- page ---------------------------------------------------
   One object, centred, with nothing to scroll to. No dock here:
   the page *is* the call to action, so there is nothing for a
   floating CTA to point at. */

body.wl {
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding:
    calc(var(--space-10) + env(safe-area-inset-top, 0px))
    var(--space-5)
    calc(var(--space-10) + env(safe-area-inset-bottom, 0px));
}

.wl__shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--container-narrow);
  display: grid;
  justify-items: center;
}

/* ---- the mark and the line under it -------------------------
   The hero lockup at pebble scale. Min doesn't come along — he is
   discovered on the landing page, and this page has one job — so
   the i-dot stays punctuation here, in the accent. */

.wl .wordmark--hero {
  width: min(208px, 44vw);
  margin-bottom: var(--space-6);
}
/* The glass letterforms surface on their own animation (landing.css);
   the dot drops in just behind them. */
.wl .wordmark__dot {
  opacity: 0;
  animation: surface 600ms var(--ease-emergence) 640ms forwards;
}

.tagline {
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem);
  letter-spacing: -0.02em;
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: var(--space-9);
}

/* ---- reveal -------------------------------------------------
   Same recipe as .rise on the landing page, driven by delay rather
   than by the scroll observer, since everything here is above the
   fold at once. The card is opacity + scale only: it carries a
   backdrop-filter, and animating a blur filter on top of that
   makes the material flicker as it resolves. */

@keyframes wl-rise {
  from { opacity: 0; transform: translateY(8px) scale(1.06); filter: blur(5px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes wl-surface {
  from { opacity: 0; transform: translateY(10px) scale(1.03); }
  to   { opacity: 1; transform: none; }
}

.tagline     { animation: wl-rise var(--duration-emergence) ease 500ms both; }
.wl-card     { animation: wl-surface var(--duration-hero) var(--ease-emergence) 620ms both; }
.footer-note { animation: wl-rise var(--duration-emergence) ease 900ms both; }

/* ---- the card ----------------------------------------------- */

.wl-card {
  width: 100%;
  padding: clamp(var(--space-8), 7vw, var(--space-10));
}

.wl h1.card__title {
  font-size: clamp(1.5rem, 4.6vw, 1.875rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-2);
}

.card__sub {
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink-soft);
  margin-bottom: var(--space-8);
}

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

.form {
  display: grid;
  gap: var(--space-5);
}

button, input {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  color: inherit;
}

.field label,
.label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

/* An inset well in the resin, not a bordered box: the light comes
   from above, so the top edge is the shadow and the bottom edge
   catches the highlight — the inverse of the objects that sit on
   top of the material. */
.input {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid rgba(35, 33, 30, 0.08);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.42);
  box-shadow:
    inset 0 2px 4px rgba(15, 13, 20, 0.1),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7);
  color: var(--ink);
  font-size: var(--text-md);
  outline: none;
  transition:
    box-shadow var(--duration-quick) ease,
    background var(--duration-quick) ease,
    border-color var(--duration-quick) ease;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus {
  background: rgba(255, 255, 255, 0.6);
  border-color: color-mix(in srgb, var(--color-accent) 40%, transparent);
  box-shadow:
    inset 0 2px 4px rgba(15, 13, 20, 0.08),
    inset 0 -1px 0 rgba(255, 255, 255, 0.7),
    0 0 0 3px color-mix(in srgb, var(--color-accent) 18%, transparent);
}
/* Chrome paints autofilled fields a flat yellow, which would punch a
   hole straight through the material. */
.input:-webkit-autofill {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: inset 0 0 0 100px rgba(255, 255, 255, 0.55);
  caret-color: var(--ink);
}

/* the contact input has no label of its own — the segmented pill above
   is the only indicator of which field is showing, so it needs a beat
   of separation from it */
.field--contact { margin-top: var(--space-1); }

.field-error {
  min-height: 16px;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-error);
}

/* ---- segmented toggle --------------------------------------
   A sunken track in the resin with one lit pebble sliding along it.
   The outer element owns the Email<->Phone slide, its ::after owns
   the squash/opacity "jelly" launch, so the two motions don't fight
   over one transform property. */

.segmented {
  position: relative;
  display: flex;
  gap: var(--space-2);
  padding: var(--space-1);
  border-radius: var(--radius-xl);
  background: rgba(35, 33, 30, 0.06);
  box-shadow: inset 0 2px 4px rgba(15, 13, 20, 0.1);
}

.segmented button {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 9px 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: color 250ms ease-out;
}
.segmented button.active { color: var(--ink); }

.segmented__pill {
  position: absolute;
  top: var(--space-1);
  left: var(--space-1);
  z-index: 0;
  width: calc((100% - var(--space-1) * 2 - var(--space-2)) / 2);
  height: calc(100% - var(--space-1) * 2);
  transition: transform 400ms cubic-bezier(0.25, 0.1, 0, 1);
}
.segmented.is-phone .segmented__pill {
  transform: translateX(calc(100% + var(--space-2)));
}

.segmented__pill::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background:
    linear-gradient(168deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.62));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(15, 13, 20, 0.12),
    0 6px 14px -6px rgba(15, 13, 20, 0.3);
  border: 0 solid rgba(255, 255, 255, 0.6);
}
.segmented__pill.is-launching::after {
  animation: segmented-pill-launch 400ms cubic-bezier(0.25, 0.1, 0, 1);
}
@keyframes segmented-pill-launch {
  0%   { transform: scale(1, 1);       opacity: 1;    border-width: 0; }
  62%  { transform: scale(0.97, 0.92); opacity: 0.18; border-width: 1px; }
  100% { transform: scale(1, 1);       opacity: 1;    border-width: 0; }
}

/* ---- submit ------------------------------------------------
   landing.css's .btn, stretched across the card. Full width, so the
   cursor-tracked fill has somewhere to travel. */

.btn--block {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 16px 24px;
  font-size: var(--text-md);
}
.btn--mt { margin-top: var(--space-2); }
.btn:disabled { opacity: 0.65; cursor: default; transform: none; }

/* ---- feedback ---------------------------------------------- */

.consent {
  text-align: center;
  font-size: var(--text-xs);
  line-height: 1.5;
  color: var(--ink-faint);
}
.consent a {
  color: var(--ink-soft);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 40%, transparent);
  text-underline-offset: 2px;
}
.consent a:hover { color: var(--color-accent-hover); }

.status {
  min-height: 20px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-soft);
}
.status.success { color: var(--color-success); }
.status.error { color: var(--color-error); }

.footer-note {
  margin-top: var(--space-6);
  text-align: center;
  font-size: var(--text-xs);
  color: var(--ink-faint);
  max-width: 34ch;
}

/* ---- success ----------------------------------------------- */

.success-view {
  display: none;
  text-align: center;
  padding: var(--space-2) 0;
}
.success-view .check {
  font-size: 44px;
  line-height: 1;
  margin-bottom: var(--space-4);
}
.wl .success-view h2 {
  font-size: clamp(1.375rem, 4vw, 1.625rem);
  font-weight: var(--font-weight-semibold);
  letter-spacing: -0.03em;
  margin-bottom: var(--space-2);
}
.success-view p {
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--ink-soft);
}

/* ---- small screens ---------------------------------------- */

@media (max-width: 480px) {
  .tagline { margin-bottom: var(--space-7); }
  .wl-card { border-radius: var(--radius-2xl); }
}

@media (prefers-reduced-motion: reduce) {
  .tagline, .wl-card, .footer-note, .wl .wordmark__dot {
    animation: none;
    opacity: 1;
    transform: none;
    filter: none;
  }
}
