@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,700&display=swap');

/* gregwitz-funnel design tokens — UI-SPEC source of truth.
   Exactly four font sizes (14/16/20/32px), exactly two font weights (400/700).
   Hand-written CSS, no build step, no Tailwind. */

:root {
  --surface: #F8F9F9;
  --charcoal: #202020;
  --accent: #6C4D9E;
  --accent-deep: #460AA5;
  --accent-on-fill: #FFFFFF;
  --accent-muted: #BDAFD3;
  --error: #B3261E;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Helvetica Neue', Helvetica, Arial, sans-serif;

  --size-micro: 14px;
  --size-body: 16px;
  --size-heading: 20px;
  --size-display: 32px;

  --lh-micro: 1.4;
  --lh-body: 1.5;
  --lh-heading: 1.2;
  --lh-display: 1.15;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --column-max: 520px;
  --tap-min: 48px;
  --icon-hit-min: 44px;
}

* {
  box-sizing: border-box;
}

/* ── Layout ── */

.funnel-root {
  min-height: 100vh;
  background: var(--surface);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  color: var(--charcoal);
}

.column {
  max-width: var(--column-max);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
  animation: screen-in 0.4s ease;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cover-screen layout. The `display` MUST stay scoped to `.active`: `.screen-cover`
   has the same specificity as `.screen { display: none }` and is declared later, so
   an unscoped `display: flex` here wins the cascade and the cover never hides — it
   sits painted over the questions and the whole funnel looks dead on the first tap. */
.screen-cover {
  background: var(--charcoal);
  color: #FFFFFF;
  min-height: 100vh;
  flex-direction: column;
  justify-content: center;
}

.screen-cover.active {
  display: flex;
}

/* ── Type roles ── */

.kicker {
  font-size: var(--size-micro);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.screen-cover .kicker {
  color: var(--accent-muted);
}

.display {
  font-family: var(--font-display);
  font-size: var(--size-display);
  font-weight: 700;
  line-height: var(--lh-display);
}

.heading {
  font-family: var(--font-display);
  font-size: var(--size-heading);
  font-weight: 700;
  line-height: var(--lh-heading);
}

.body-copy {
  font-size: var(--size-body);
  font-weight: 400;
  line-height: var(--lh-body);
}

.micro {
  font-size: var(--size-micro);
  font-weight: 400;
  line-height: var(--lh-micro);
}

/* ── CTA ── */

.cta {
  min-height: var(--tap-min);
  background: var(--accent);
  color: var(--accent-on-fill);
  font-size: var(--size-body);
  font-weight: 700;
  border: none;
  border-radius: 8px;
  width: 100%;
  cursor: pointer;
}

.cta:hover,
.cta:active {
  background: var(--accent-deep);
}

/* ── Progress ── */

.progress-track {
  height: 4px;
  background: rgba(108, 77, 158, 0.15);
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s ease;
}

/* ── Back affordance ── */

.back-btn {
  min-width: var(--icon-hit-min);
  min-height: var(--icon-hit-min);
  background: transparent;
  border: none;
  cursor: pointer;
}

/* ── Question options ── */

.option {
  min-height: var(--tap-min);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border: 2px solid rgba(32, 32, 32, 0.12);
  border-radius: 8px;
  padding: var(--space-md);
  cursor: pointer;
}

.option.selected {
  border-color: var(--accent);
}

.letter-chip {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--size-micro);
  font-weight: 700;
  background: rgba(32, 32, 32, 0.06);
}

.option.selected .letter-chip {
  background: var(--accent);
  color: var(--accent-on-fill);
}

/* ── Email capture ── */

.email-input {
  width: 100%;
  min-height: var(--tap-min);
  font-size: var(--size-body);
  padding: var(--space-md);
  border: 2px solid rgba(32, 32, 32, 0.2);
  border-radius: 8px;
}

.email-input.is-invalid {
  border-color: var(--error);
}

.field-error {
  font-size: var(--size-micro);
  color: var(--error);
  display: none;
}

.field-error.visible {
  display: block;
}

/* ── Result bars — carried forward verbatim from assessment.html:236-245 ── */

.result-bar {
  height: 10px;
  background: rgba(108, 77, 158, 0.1);
  border-radius: 100px;
  overflow: hidden;
}

.result-bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Accessibility ── */

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

/* Social proof. Deliberately set in the existing micro (14px) role so the type
   scale stays at exactly four sizes — proof supports the CTA, it never competes
   with it. Quotes are verbatim excerpts from real named clients. */
.proof {
  margin: var(--space-lg) 0 0;
  padding-left: var(--space-md);
  border-left: 2px solid var(--accent);
}

.proof blockquote {
  margin: 0 0 var(--space-xs);
  font-style: italic;
}

.proof figcaption {
  opacity: 0.72;
}

.proof-note {
  margin-top: var(--space-md);
  opacity: 0.72;
}

/* On the charcoal cover, the standard purple border reads as almost black.
   Use the cover-scoped lighter tint. Colour only — never `display` here
   (see the .screen-cover cascade note above). */
.screen-cover .proof {
  border-left-color: var(--accent-muted);
}
