/* ============================================================
   Kin — 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/logo-wordmark.png) plays Material Emergence; the dot is
   a plain circle (matches --color-accent 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(--color-accent);
  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;
}

.card--hero::before {
  content: "";
  position: absolute;
  inset: -4.1% -7.2% -5.2% -7.2%;
  background-image: url("/assets/img/card.svg");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 0;
}

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

.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), 0 0 0 1.5px var(--color-accent); }

.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 {
  display: flex;
  gap: var(--space-2);
  background: var(--color-surface-sunken);
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-1);
}

.segmented button {
  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: background-color var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
}

.segmented button.active {
  background-color: var(--color-surface-pill);
  box-shadow: var(--shadow-pill);
  color: var(--color-text);
}

/* ---- 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(193, 92, 219, 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); }

/* ---- 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(--color-accent); text-decoration: none; }
.consent a:hover { color: var(--color-accent-hover); 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(--color-accent-hover); 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: #454154; }
.prose ul { margin: var(--space-2) 0; padding-left: var(--space-5); }
.prose li { margin-bottom: var(--space-1); }

.note {
  background: #fbf1de;
  border: 1px solid #ecd8a6;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: #8a6a1a;
  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: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  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(--color-accent); text-decoration: none; }
.url a:hover { color: var(--color-accent-hover); 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);
}
