/* ============================================================
   Min — Components
   Reusable UI blocks. Each maps to a Figma component of the same
   name. Style with tokens only (see tokens.css) — no literals.
   Depends on tokens.css + base.css.
   ============================================================ */

/* ---- Brand / logo -------------------------------------------------- */
.logo {
  position: relative;
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto var(--space-2);
}

/* Animated homepage lockup — the wordmark (dot masked out at the source,
   see assets/img/min-logo-flat.svg) plays Material Emergence; the dot is
   a plain circle (matches the flat mark's dot exactly) that plays Drop on top.
   Both start together, 0.8s after the page lands, per the Figma motion
   principles board (Motion > Behaviors). */
.logo__mark {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  /* Runs a little longer than the dot's Hero-length Drop (890ms vs. 800ms)
     so the dot lands at the ~90%-done point of the emergence, not at its
     very end — the wordmark keeps quietly resolving for another beat
     after the dot has already settled, then reaches a fully crisp finish. */
  animation: logo-emerge 890ms var(--ease-emergence) 0.8s both;
}

.logo__dot {
  position: absolute;
  left: 46.48%;
  top: 22.65%;
  width: 10.06%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--violet-deep);
  opacity: 0;
  animation: logo-dot-drop var(--duration-hero) var(--ease-drop) 0.8s both;
}

@keyframes logo-emerge {
  0%   { opacity: 0;    filter: blur(18px); transform: scale(1.06); }
  50%  { opacity: 0.55; filter: blur(7px);  transform: scale(1.02); }
  80%  { opacity: 0.9;  filter: blur(2px);  transform: scale(1.004); }
  100% { opacity: 1;    filter: blur(0);    transform: scale(1); }
}

@keyframes logo-dot-drop {
  0%   { opacity: 0; transform: translateY(-42px) scale(0.9); }
  55%  { opacity: 1; }
  72%  { transform: translateY(3px) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .logo__mark,
  .logo__dot {
    animation: none;
    opacity: 1;
    filter: none;
    transform: none;
  }
}

.tagline {
  text-align: center;
  color: var(--color-muted-strong);
  font-size: var(--text-base);
  margin-bottom: var(--space-11);
}

/* ---- Card ---------------------------------------------------------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  padding: var(--space-7);
}

/* Hero variant — renders the exact card vector exported from Figma
   (organic squircle path, drop shadow and frosted sheen baked in)
   instead of the flat CSS card, for the waitlist's primary card. */
.card--hero {
  position: relative;
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* An <img>, not a CSS background-image: WebKit rasterizes SVG
   background-images at a fixed resolution regardless of device pixel
   ratio, which reads as blurry/pixelated on Retina iPhones once
   stretched. An <img> renders the vector natively at full sharpness. */
.card--hero .card__bg {
  position: absolute;
  /* top/left + explicit width/height (not full inset) — a replaced
     element with all four inset sides AND width/height set is
     over-constrained, and the browser silently drops one offset,
     which is what was breaking the stretch-to-fill before. */
  top: -4.1%;
  left: -7.2%;
  width: 114.4%;
  height: 109.3%;
  max-width: none; /* base.css's global `img { max-width: 100% }` was clamping this */
  z-index: 0;
  pointer-events: none;
}

.card--hero .card__content {
  position: relative;
  z-index: 1;
  padding: var(--space-11) var(--space-9) var(--space-10);
}

.card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  margin: 0 0 var(--space-1);
}

.card__sub {
  color: var(--color-muted);
  font-size: 14px;
  margin: 0 0 var(--space-8);
}

/* ---- Form ---------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Extra breathing room below the segmented toggle now that the contact
   input has no label of its own — the slider is the only indicator of
   which field is showing, so it needs a beat of separation from it. */
.field--contact {
  margin-top: var(--space-3);
}

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

.input {
  width: 100%;
  background: var(--color-surface-sunken);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-pill);
  padding: var(--space-3) var(--space-4);
  color: var(--color-text);
  font-size: var(--text-base);
  font-family: inherit;
  outline: none;
  transition: box-shadow var(--transition-fast);
}

.input::placeholder { color: var(--color-muted); }
.input:focus { box-shadow: var(--shadow-pill), var(--shadow-accent-glow); }

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

.hint {
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin-top: calc(var(--space-2) * -1);
}

/* ---- Segmented toggle --------------------------------------------- */
.segmented {
  position: relative;
  display: flex;
  gap: var(--space-2);
  /* Visible sunken track for the pill to slide in — --color-surface-sunken
     is transparent (meant for shadow-only fields), which left this
     invisible. */
  background: color-mix(in srgb, var(--color-text) 6%, transparent);
  box-shadow: inset 0 1px 3px color-mix(in srgb, var(--color-text) 8%, transparent);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

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

.segmented button.active {
  color: var(--color-text);
}

/* Sliding pill (Figma "Motion Lab" spec, node 442:323) — the outer
   element owns the Email<->Phone slide, its ::after owns the
   squash/opacity/border "jelly" launch, so the two motions (different
   easings) don't fight over one `transform` property. */
.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; /* true capsule, independent of the track's squircle corners */
  background-color: var(--color-surface-pill);
  box-shadow: var(--shadow-pill);
  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; }
}

@media (prefers-reduced-motion: reduce) {
  .segmented__pill { transition: none; }
  .segmented__pill.is-launching::after { animation: none; }
}

/* ---- Buttons ------------------------------------------------------- */
.btn {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  /* Explicit fill, not just the glass sheen — without it, native button
     chrome (iOS/Safari renders this as gray even with appearance: none)
     shows through wherever the translucent gradient doesn't fully cover. */
  background-color: var(--color-surface);
  background-image: var(--gradient-glass);
  backdrop-filter: blur(3px);
  color: var(--color-on-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-accent-glow), var(--shadow-inset-highlight);
  padding: 13px 26px;
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-press);
}

.btn:hover { box-shadow: 0px 0px 28px 6px rgba(201, 168, 224, 0.3), var(--shadow-inset-highlight); }
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.7; cursor: default; }

.btn--block { display: block; width: 100%; padding: 13px 0; }
.btn--mt { margin-top: var(--space-1); }

/* Submit spring press (Figma "Motion Lab" spec, nodes 426:196 + 424:198).
   Two different transitions per state, not one: pressing in uses a fast
   linear-ish ease-in; releasing uses an overshooting curve that stands in
   for the spec's spring (stiffness 210 / damping 12). The label gets
   slightly smaller values and a touch of delay so it reads as trailing
   the button body by a hair, per the spec. */
.submit {
  background-color: var(--color-surface);
  transform: translateY(0) scale(1, 1);
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 350ms ease-out, box-shadow var(--transition-fast);
}

/* Press fades the fill toward translucent (spec: #F2EEE7 -> rgba(...,0.4))
   so the backdrop-filter blur and the glass sheen show through more —
   a moment of luminescence at the instant of contact, on top of the
   spring press. Released back to opaque on the same spring timing. */
.submit:active {
  background-color: color-mix(in srgb, var(--color-surface) 40%, transparent);
  transform: translateY(2px) scale(0.97, 0.94);
  transition: transform 100ms ease-in, background-color 100ms ease-in;
}

.btn__label {
  display: inline-block;
  transform: translateY(0) scale(1, 1);
  transition: transform 450ms cubic-bezier(0.34, 1.56, 0.64, 1) 20ms;
}

.submit:active .btn__label {
  transform: translateY(1.5px) scale(0.985, 0.97);
  transition: transform 100ms ease-in;
}

@media (prefers-reduced-motion: reduce) {
  .submit,
  .submit:active,
  .btn__label,
  .submit:active .btn__label {
    transition: none;
    transform: none;
  }
}

/* ---- Status / feedback -------------------------------------------- */
.status {
  text-align: center;
  font-size: 14px;
  margin-top: var(--space-4);
  min-height: 20px;
}
.status.success { color: var(--color-success); }
.status.error { color: var(--color-error); }

.consent {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-muted);
  margin: 0;
}
.consent a { color: var(--violet-ink); text-decoration: none; }
.consent a:hover { color: var(--ink-primary); text-decoration: underline; }

.footer-note {
  text-align: center;
  color: var(--color-muted);
  font-size: var(--text-xs);
  margin-top: var(--space-5);
}
.footer-note a { color: var(--color-muted); text-decoration: none; }
.footer-note a:hover { color: var(--ink-primary); text-decoration: underline; }

/* ---- Success view -------------------------------------------------- */
.success-view {
  display: none;
  text-align: center;
  padding: var(--space-2) 0;
}
.success-view .check { font-size: 40px; margin-bottom: var(--space-3); }
.success-view h2 { font-size: 18px; margin: 0 0 var(--space-1); }
.success-view p { color: var(--color-muted); font-size: 14px; margin: 0; }

/* ---- Prose (long-form pages, e.g. privacy policy) ----------------- */
.prose h1 { font-size: 22px; margin: 0 0 var(--space-6); }
.prose h2 {
  font-size: var(--text-md);
  margin: var(--space-7) 0 var(--space-2);
  color: var(--color-text);
}
.prose h2:first-of-type { margin-top: 0; }
.prose p,
.prose li { font-size: 14px; line-height: var(--leading-normal); color: #4A453D; }
.prose ul { margin: var(--space-2) 0; padding-left: var(--space-5); }
.prose li { margin-bottom: var(--space-1); }

.note {
  background: #FAF3E3;
  border: 1px solid #E5C98A;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: #8A6A22;
  margin: var(--space-2) 0 var(--space-4);
}

.back-link {
  display: inline-block;
  margin-top: var(--space-7);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-decoration: none;
}
.back-link:hover { color: var(--color-text); }

.page-header__title {
  font-size: 24px;
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-1);
}
.page-header__meta {
  color: var(--color-muted);
  font-size: var(--text-sm);
  margin-bottom: var(--space-8);
}

/* ---- QR code ------------------------------------------------------- */
.qr-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  display: inline-block;
  line-height: 0;
}
.qr-box img { display: block; width: 220px; height: 220px; }

.url {
  margin-top: var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-muted);
  word-break: break-all;
}
.url a { color: var(--violet-ink); text-decoration: none; }
.url a:hover { color: var(--ink-primary); text-decoration: underline; }

/* ---- Hero (homepage) ---------------------------------------------- */
.hero__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  margin: 0 0 var(--space-3);
}
.hero__description {
  color: var(--color-muted);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  margin: 0 0 var(--space-8);
}
