body {
  display: flex;
  justify-content: center;
  padding: clamp(3rem, 10vh, 6rem) 1.5rem 3rem;
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 32rem;
}

.logo {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: 2.5rem;
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.subtitle {
  font-size: clamp(0.95rem, 2vw, 1.05rem);
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 2.5rem;
}

.cta-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.9rem;
}

.badges {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: 15.5rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  border-radius: var(--r-control);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 150ms ease,
    background 150ms ease;
}

.badge:hover,
.badge:focus-visible {
  background: #ffffff;
  transform: translateY(-1px);
}

.badge:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* Badge pills always oppose their ground: paper-on-asphalt at the page
   level (above), ink-on-paper once a badge sits inside a (now-light)
   stage-card — the classic black app-store-badge treatment. */
.stage-card .badge {
  background: var(--card);
  color: var(--paper);
  border-color: transparent;
}

.stage-card .badge:hover,
.stage-card .badge:focus-visible {
  background: var(--ink);
}

.badge svg {
  flex: none;
  width: 24px;
  height: 24px;
}

.badge-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.badge-text .eyebrow {
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-text .name {
  font-size: 1rem;
  font-weight: 700;
}

.web-link {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  border-radius: 2px;
  transition:
    color 150ms ease,
    border-color 150ms ease;
}

.web-link:hover,
.web-link:focus-visible {
  color: var(--paper);
  border-bottom-color: currentColor;
}

.web-link:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

/* ── The stage: one swappable region for states A–G ──────────────────── */

.stage {
  width: 100%;
}

.stage-card {
  background: var(--paper);
  color: var(--ink);
  color-scheme: light;
  /* Paper scope: descendants reading these custom properties (dividers,
     wells, muted/faint text, focus rings) automatically flip to their
     paper-appropriate values — see tokens.css. --accent/--info/--error
     stay unreassigned (load-bearing as fills); text uses of them are
     swapped explicitly at each call site instead. */
  --muted: var(--ink-muted);
  --faint: var(--ink-faint);
  --line: var(--paper-line);
  --line-soft: var(--paper-line-soft);
  --well: var(--paper-well);
  --focus-ring: var(--ink);
  border-radius: var(--r-card);
  padding: clamp(1.25rem, 4vw, 2rem);
  text-align: left;
  animation: stage-in 200ms ease;
}

.stage-card--center {
  text-align: center;
}

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

.eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.8rem;
}

.eyebrow--zone {
  color: var(--accent-ink);
}

.eyebrow--info {
  color: var(--info-ink);
}

.stage-card h2 {
  font-size: clamp(1.25rem, 3.2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.4rem;
  text-wrap: balance;
}

/* Headings receive programmatic focus on state changes (goto() moves focus
   to the new panel's h2). Mouse-driven moves must not paint a ring; keyboard
   users tabbing back to the heading keep the standard one. */
.stage-card h2:focus:not(:focus-visible) {
  outline: none;
}

.lede {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 1.4rem;
}

.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 1rem 0 0.45rem;
}

.field-label:first-of-type {
  margin-top: 0;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.45;
  margin: 0.4rem 0 0;
}

.check-row {
  display: flex;
  gap: 0.6rem;
}

.check-row input {
  flex: 1;
  min-width: 0;
}

input[type="text"],
input[type="email"],
input[type="date"],
input[type="tel"],
input[type="url"] {
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  font: inherit;
  color: var(--ink);
  background: var(--paper-bright);
  border: 1px solid var(--ink-faint);
  border-radius: var(--r-control);
}

input::placeholder {
  color: var(--ink-faint);
}

input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-color: var(--accent);
}

input[aria-invalid="true"] {
  border-color: var(--error-ink);
}

.error[hidden] {
  display: none;
}

.error {
  display: flex;
  gap: 0.4rem;
  align-items: start;
  font-size: 0.8rem;
  color: var(--error-ink);
  margin: 0.6rem 0 0;
}

.hint {
  font-size: 0.8rem;
  color: var(--faint);
  line-height: 1.45;
  margin: 0.6rem 0 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.1rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none; /* .btn on an <a> (e.g. the 404 page) */
  border-radius: var(--r-control);
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--accent);
  color: var(--ink);
  border: 1px solid transparent;
}

.btn--primary:hover {
  background: var(--accent-soft);
}

.btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn--ghost:hover {
  border-color: var(--muted);
  background: rgba(11, 11, 12, 0.04);
}

.btn--block {
  width: 100%;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.1rem 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.or-divider::before,
.or-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line-soft);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 2px;
  cursor: pointer;
  transition: color 150ms ease;
}

.link-btn:hover,
.link-btn:focus-visible {
  color: var(--ink);
}

.link-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.form-heading {
  font-size: 1rem;
  margin: 1.5rem 0 0.2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-soft);
}

.address-echo {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 1.2rem;
}

.micro {
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
  margin: 0.8rem 0 0;
}

.celebration {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.celebration img {
  width: 96px;
  height: 96px;
}

.envelope {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.distance-line {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -0.6rem 0 1.2rem;
}

.consent-row {
  display: flex;
  gap: 0.6rem;
  align-items: start;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 1.2rem 0;
  cursor: pointer;
}

.consent-row input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 18px;
  height: 18px;
  flex: none;
  accent-color: var(--accent);
}

.consent-row a {
  color: var(--ink);
}

/* Text links inside a paper card (consent row, ledes) get the same
   designed focus ring as the controls around them, instead of the UA
   default. --focus-ring is already paper-scoped to ink by .stage-card. */
.stage-card a:not(.btn):not(.badge):focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.site-footer {
  margin-top: 3rem;
  font-size: 0.78rem;
  color: var(--faint);
  text-align: center;
}

.site-footer a {
  color: var(--faint);
  border-radius: 2px;
  text-underline-offset: 2px;
  transition: color 150ms ease;
}

.site-footer a:hover {
  color: var(--paper);
}

.site-footer a:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  color: var(--paper);
}

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

/* ── Rolling-Noah "checking" loader ──────────────────────────────────── */

.rolling-noah {
  position: relative;
  width: 180px;
  height: 28px;
  margin: 0 auto 1.4rem;
}

.rolling-noah .road {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line-soft);
}

.stage-card .rolling-noah .road {
  background: var(--paper-line);
}

.rolling-noah .noah-dot {
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  background: var(--paper);
  border-radius: 6px;
  animation: roll 1.2s ease-in-out infinite alternate;
}

.stage-card .rolling-noah .noah-dot {
  background: var(--card);
}

.rolling-noah .noah-dot::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 3px;
  background: var(--accent);
}

@keyframes roll {
  from {
    left: 0;
  }
  to {
    left: calc(100% - 20px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge,
  .btn,
  .stage-card,
  .link-btn,
  .web-link,
  .site-footer a {
    transition: none;
    animation: none;
  }
  .btn:hover,
  .btn:active {
    transform: none;
  }
  .rolling-noah .noah-dot {
    animation: none;
    left: calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .check-row {
    flex-direction: column;
  }
  .check-row .btn {
    width: 100%;
  }
}
