/*
 * ════════════════════════════════════════════════════════════════
 *  FUTUREBRAINING · DESIGN SYSTEM v2 · COMPONENT CSS
 *  brand.css · v2.0.0-pilot · June 2026
 *
 *  Loaded AFTER /v2/tokens.css. Provides the component classes
 *  used across v2 surfaces (entry, survey, intermediate screens).
 *
 *  Contents:
 *    1.  Reset + base
 *    2.  Logo
 *    3.  Site nav (light, paper-tone)
 *    4.  Ambient surface (topography + grain)
 *    5.  Eyebrows + field labels
 *    6.  Manifesto headlines (Archivo Black)
 *    7.  Conversational text (Crimson Pro italic)
 *    8.  Buttons + CTAs
 *    9.  Form fields (checkbox, radio, scale)
 *   10.  Cards (paper, observation, field)
 *   11.  Triad (Sharp · Connected · Independent)
 *   12.  Progress
 *   13.  Survey question layout
 *   14.  Annotation card (researcher voice)
 *   15.  Utility classes
 *   16.  Responsive overrides
 *   17.  Reduced motion
 * ════════════════════════════════════════════════════════════════
 */

/* ── 1. RESET + BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

body {
  font-family: var(--v2-font-ui);
  background: var(--v2-paper);
  color: var(--v2-ink);
  line-height: var(--v2-leading-base);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

img { display: block; max-width: 100%; height: auto; }

/* ── 2. LOGO ─────────────────────────────────────────────── */
/*  Use /assets/fb-logo-color.png for light surfaces (default)
 *  Use /assets/fb-logo-white.png for dark surfaces (rare in v2)  */
.v2-logo { display: inline-flex; align-items: center; }
.v2-logo img { height: 32px; width: auto; }
.v2-logo--sm img { height: 26px; }
.v2-logo--lg img { height: 40px; }

/* ── 3. SITE NAV ─────────────────────────────────────────── */
.v2-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--v2-space-6) var(--v2-space-14);
  border-bottom: 1px solid var(--v2-paper-edge);
}

.v2-nav__meta {
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-field-lg);
  color: var(--v2-sage-deep);
  letter-spacing: var(--v2-tracking-wide);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.v2-nav__dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--v2-sage);
  box-shadow: 0 0 0 3px var(--v2-sage-tint-strong);
  animation: v2PulseDot 2.6s ease-in-out infinite;
}
@keyframes v2PulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(108,143,94,0.20); }
  50%      { box-shadow: 0 0 0 7px rgba(108,143,94,0); }
}

/* ── 4. AMBIENT SURFACE ──────────────────────────────────── */
/*  Drop a <svg class="v2-topo"> inside any section that
 *  wants sage contour lines. Stays behind content.            */
.v2-topo {
  position: absolute; inset: 0;
  pointer-events: none; opacity: 0.18;
  width: 100%; height: 100%;
}
.v2-topo--soft { opacity: 0.10; }

.v2-grain {
  position: absolute; inset: 0;
  pointer-events: none; opacity: 0.06; mix-blend-mode: multiply;
}

/* ── 5. EYEBROWS + FIELD LABELS ──────────────────────────── */
.v2-eyebrow {
  font-family: var(--v2-font-ui);
  font-size: var(--v2-size-eyebrow);
  font-weight: var(--v2-fw-bold);
  letter-spacing: var(--v2-tracking-widest);
  text-transform: uppercase;
  color: var(--v2-sage-deep);
}
.v2-eyebrow--purple { color: var(--v2-brand-purple); }
.v2-eyebrow--ink    { color: var(--v2-ink-soft); }

.v2-fig {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-field);
  color: var(--v2-sage-deep);
  letter-spacing: var(--v2-tracking-widest);
  text-transform: uppercase;
}
.v2-fig::before {
  content: '';
  display: inline-block; width: 24px; height: 1px;
  background: currentColor;
}

/* ── 6. MANIFESTO HEADLINES ──────────────────────────────── */
.v2-manifesto {
  font-family: var(--v2-font-display);
  font-size: clamp(72px, 9vw, var(--v2-size-display-xl));
  line-height: var(--v2-leading-tight);
  letter-spacing: -0.05em;
  color: var(--v2-ink);
  text-wrap: balance;
}
.v2-manifesto--lg { font-size: var(--v2-size-display-lg); }
.v2-manifesto--md { font-size: var(--v2-size-display); }
.v2-manifesto--sm { font-size: var(--v2-size-display-sm); }

/*  Two highlight variants for the manifesto voice  */
.v2-manifesto em {
  font-style: normal;
  color: var(--v2-brand-purple);
  position: relative;
}
.v2-manifesto em::after {
  content: '';
  position: absolute; left: -2px; right: -2px; bottom: 8px;
  height: 14px; background: var(--v2-sage); opacity: 0.30;
  z-index: -1;
}
.v2-manifesto em.v2-pink {
  color: var(--v2-brand-pink);
}
.v2-manifesto em.v2-pink::after {
  background: var(--v2-brand-pink); opacity: 0.22;
}

/* ── 7. CONVERSATIONAL TEXT (Crimson Pro italic) ─────────── */
.v2-prompt {
  font-family: var(--v2-font-headline);
  font-size: var(--v2-size-prompt);
  font-style: italic;
  font-weight: var(--v2-fw-medium);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--v2-ink);
  text-wrap: balance;
}
.v2-prompt em {
  font-style: italic;
  font-weight: var(--v2-fw-semibold);
  color: var(--v2-brand-purple);
  border-bottom: 2px solid var(--v2-sage);
}
.v2-prompt--lg { font-size: var(--v2-size-prompt-lg); }
.v2-prompt--sm { font-size: var(--v2-size-prompt-sm); }

.v2-lede {
  font-family: var(--v2-font-headline);
  font-size: var(--v2-size-lede);
  font-style: italic;
  font-weight: var(--v2-fw-regular);
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--v2-ink-soft);
}

.v2-observation {
  font-family: var(--v2-font-headline);
  font-size: var(--v2-size-observation);
  font-style: italic;
  line-height: var(--v2-leading-relaxed);
  color: var(--v2-ink);
  padding: 14px 16px;
  background: var(--v2-sage-tint);
  border-left: 2px solid var(--v2-sage);
  border-radius: 0 var(--v2-radius-sm) var(--v2-radius-sm) 0;
}

/* ── 8. BUTTONS + CTAs ───────────────────────────────────── */

/*  Primary CTA — brand purple, pill, the main action  */
.v2-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--v2-font-ui);
  font-size: var(--v2-size-body);
  font-weight: var(--v2-fw-bold);
  letter-spacing: -0.005em;
  color: var(--v2-ink-on-purple);
  background: var(--v2-brand-purple);
  padding: 16px 28px;
  border: 0;
  border-radius: var(--v2-radius-pill);
  cursor: pointer;
  transition: background var(--v2-t-base),
              transform var(--v2-t-base),
              box-shadow var(--v2-t-base),
              opacity var(--v2-t-base);
  box-shadow: var(--v2-shadow-cta);
}
.v2-btn:hover:not([disabled]) {
  background: var(--v2-brand-purple-hover);
  transform: translateY(-1px);
  box-shadow: var(--v2-shadow-cta-h);
}
.v2-btn:focus-visible {
  outline: 2px solid var(--v2-sage);
  outline-offset: 3px;
}
.v2-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.v2-btn__arrow { transition: transform var(--v2-t-base); }
.v2-btn:hover:not([disabled]) .v2-btn__arrow { transform: translateX(3px); }

/*  Ghost — secondary action (e.g. "Previous question")  */
.v2-btn-ghost {
  font-family: var(--v2-font-ui);
  font-size: var(--v2-size-body-sm);
  font-weight: var(--v2-fw-medium);
  color: var(--v2-ink-soft);
  background: transparent;
  border: 0;
  padding: 8px 0;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: color var(--v2-t-fast);
}
.v2-btn-ghost:hover { color: var(--v2-ink); }

/* ── 9. FORM FIELDS ──────────────────────────────────────── */

/*  Custom checkbox  */
.v2-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 14px;
  align-items: start;
  cursor: pointer;
}
.v2-check input {
  appearance: none; -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 5px;
  border: 1.5px solid var(--v2-ink-faint);
  background: transparent;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all var(--v2-t-fast);
  margin-top: 1px;
}
.v2-check input:hover { border-color: var(--v2-sage-deep); }
.v2-check input:focus-visible {
  outline: 2px solid var(--v2-sage);
  outline-offset: 2px;
}
.v2-check input:checked {
  background: var(--v2-sage);
  border-color: var(--v2-sage);
}
.v2-check input:checked::after {
  content: '';
  width: 12px; height: 7px;
  border-left: 2px solid var(--v2-paper);
  border-bottom: 2px solid var(--v2-paper);
  transform: rotate(-45deg) translate(1px, -1px);
}
.v2-check__label {
  font-family: var(--v2-font-ui);
  font-size: var(--v2-size-body-sm);
  color: var(--v2-ink);
  line-height: var(--v2-leading-relaxed);
}
.v2-check__label a {
  color: var(--v2-sage-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.v2-check__sub {
  display: block;
  color: var(--v2-ink-soft);
  font-size: var(--v2-size-caption);
  margin-top: 2px;
}
.v2-check__pill {
  display: inline-block;
  font-family: var(--v2-font-mono);
  font-size: 9.5px;
  letter-spacing: var(--v2-tracking-widest);
  text-transform: uppercase;
  color: var(--v2-sage-deep);
  margin-right: 8px;
  vertical-align: 1px;
}
.v2-check__pill--required {
  background: var(--v2-sage-tint);
  color: var(--v2-sage-deep);
  padding: 2px 6px;
  border-radius: var(--v2-radius-sm);
}

/*  Likert scale — five field cards  */
.v2-scale {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.v2-scale__opt {
  background: rgba(241, 239, 231, 0.6);
  border: 1px solid var(--v2-paper-edge);
  border-radius: var(--v2-radius);
  padding: 22px 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all var(--v2-t-base);
  text-align: left;
}
.v2-scale__opt:hover {
  border-color: var(--v2-sage);
  background: var(--v2-sage-tint);
  transform: translateY(-1px);
}
.v2-scale__opt[data-selected="true"] {
  background: var(--v2-sage-tint);
  border-color: var(--v2-sage);
  border-width: 1.5px;
  box-shadow: var(--v2-shadow-select);
}
.v2-scale__num {
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-eyebrow);
  color: var(--v2-sage-deep);
  letter-spacing: var(--v2-tracking-wide);
}
.v2-scale__label {
  font-family: var(--v2-font-headline);
  font-style: italic;
  font-size: 16px;
  font-weight: var(--v2-fw-medium);
  color: var(--v2-ink);
  line-height: 1.3;
}
.v2-scale__opt[data-selected="true"] .v2-scale__label { color: var(--v2-sage-deep); }

/* ── 10. CARDS ───────────────────────────────────────────── */

.v2-card {
  background: var(--v2-paper-white);
  border: 1px solid var(--v2-paper-edge);
  border-radius: var(--v2-radius-lg);
  padding: var(--v2-space-8) var(--v2-space-10);
}
.v2-card--soft {
  background: rgba(241, 239, 231, 0.5);
  border-color: var(--v2-paper-edge);
}

/* ── 11. TRIAD ───────────────────────────────────────────── */
.v2-triad {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--v2-paper-edge);
}
.v2-triad__row {
  display: grid;
  grid-template-columns: 56px 1fr 110px;
  gap: 18px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--v2-paper-edge);
}
.v2-triad__row:last-child { border-bottom: 0; }

.v2-triad__no {
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-field);
  color: var(--v2-sage-deep);
  letter-spacing: var(--v2-tracking-widest);
}
.v2-triad__name {
  font-family: var(--v2-font-display);
  font-size: 32px;
  letter-spacing: -0.04em;
  color: var(--v2-ink);
  line-height: 0.9;
}
.v2-triad__name span { color: var(--v2-sage); }
.v2-triad__caption {
  font-family: var(--v2-font-headline);
  font-style: italic;
  font-size: 13.5px;
  font-weight: var(--v2-fw-regular);
  color: var(--v2-ink-soft);
  margin-top: 4px;
}
.v2-triad__mark { display: flex; justify-content: flex-end; }
.v2-triad__mark svg { display: block; }

/*  Triad mark — three custom SVGs. Inline them where used;
    these are reference proportions only.  */
.v2-mark { width: 64px; height: 64px; }
.v2-mark--lg { width: 96px; height: 96px; }

/* ── 12. PROGRESS ────────────────────────────────────────── */
.v2-progress {
  display: flex; align-items: center; gap: 14px;
}
.v2-progress__track {
  flex: 1;
  height: 2px;
  background: var(--v2-paper-edge);
  position: relative;
  border-radius: 1px;
}
.v2-progress__fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--v2-sage);
  border-radius: 1px;
  transition: width var(--v2-t-progress);
}
.v2-progress__label {
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-eyebrow);
  color: var(--v2-sage-deep);
  letter-spacing: var(--v2-tracking-wide);
  text-transform: uppercase;
}

/* ── 13. SURVEY QUESTION LAYOUT ──────────────────────────── */
.v2-q {
  padding: var(--v2-space-14) var(--v2-space-14) var(--v2-space-20);
  max-width: var(--v2-max-section);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.v2-q__head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: var(--v2-space-6);
}
.v2-q__tag {
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-field);
  letter-spacing: var(--v2-tracking-widest);
  color: var(--v2-sage-deep);
  text-transform: uppercase;
  padding: 5px 10px;
  border: 1px solid var(--v2-sage);
  border-radius: var(--v2-radius-sm);
}
.v2-q__under {
  font-family: var(--v2-font-ui);
  font-size: 11.5px;
  color: var(--v2-ink-soft);
  letter-spacing: 0.04em;
}
.v2-q__helper {
  font-family: var(--v2-font-ui);
  font-size: var(--v2-size-body-sm);
  color: var(--v2-ink-soft);
  line-height: var(--v2-leading-loose);
  max-width: var(--v2-max-prose);
}
.v2-q__foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--v2-space-7);
  border-top: 1px solid var(--v2-paper-edge);
}

/* ── 14. ANNOTATION (researcher voice) ──────────────────── */
.v2-annotation {
  max-width: 240px;
  font-family: var(--v2-font-mono);
  font-size: var(--v2-size-field);
  color: var(--v2-sage-deep);
  line-height: var(--v2-leading-relaxed);
  padding: 12px 14px;
  border: 1px dashed var(--v2-sage);
  border-radius: var(--v2-radius-sm);
  background: rgba(241, 239, 231, 0.7);
}
.v2-annotation__label {
  font-size: 9.5px;
  letter-spacing: var(--v2-tracking-widest);
  color: var(--v2-sage);
  margin-bottom: 6px;
  font-weight: var(--v2-fw-medium);
}

/* ── 15. UTILITY CLASSES ─────────────────────────────────── */
.v2-paper       { background: var(--v2-paper); }
.v2-paper-soft  { background: var(--v2-paper-soft); }
.v2-white       { background: var(--v2-paper-white); }

.v2-text-ink     { color: var(--v2-ink); }
.v2-text-soft    { color: var(--v2-ink-soft); }
.v2-text-purple  { color: var(--v2-brand-purple); }
.v2-text-pink    { color: var(--v2-brand-pink); }
.v2-text-sage    { color: var(--v2-sage); }
.v2-text-sage-d  { color: var(--v2-sage-deep); }

/* ── 16. RESPONSIVE OVERRIDES ────────────────────────────── */
@media (max-width: 920px) {
  .v2-nav { padding: var(--v2-space-4) var(--v2-space-6); }
  .v2-q { padding: var(--v2-space-10) var(--v2-space-6) var(--v2-space-16); }
  .v2-scale { grid-template-columns: 1fr 1fr; }
  .v2-triad__row { grid-template-columns: 48px 1fr 80px; }
  .v2-triad__name { font-size: 26px; }
}

@media (max-width: 640px) {
  .v2-scale { grid-template-columns: 1fr; }
  .v2-q__foot { flex-direction: column-reverse; gap: 18px; align-items: stretch; }
  .v2-q__foot .v2-btn { width: 100%; justify-content: center; }
  .v2-manifesto { font-size: 56px; }
}

/* ── 17. REDUCED MOTION ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
