/* ===================================================================
   WILD PIXEL — QUIZ MODULE (LOCKED v3)
   Per-page diagnostic on services / industries / role pages.
   Locked from design-exploration/services-paid-quiz-options/services-paid-quiz-option-a-v3.html
   May 1, 2026.

   Dependencies (host page must already define):
     - CSS variables: --charcoal, --salmon, --salmon-deep, --salmon-glow,
       --stone, --slate, --slate-soft, --paper, --paper-warm, --midnight,
       --midnight-deep, --container, --gutter
     - Fonts: 'Zilla Slab' (or Roca One), 'Space Grotesk', 'JetBrains Mono'
     - Locked textures (swatch-cool + grain-med) from assets/textures/textures.css
       (loaded separately or co-loaded with this file)
   =================================================================== */

/* The section */
.diag {
  background: var(--stone);
  position: relative;
  overflow: hidden;
  padding: 130px 0 150px;
}

.diag-inner {
  position: relative; z-index: 3;
  max-width: var(--container);
  margin: 0 auto; padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  column-gap: 80px;
  align-items: start;
}
@media (max-width: 980px) {
  .diag-inner { grid-template-columns: 1fr; row-gap: 56px; }
  .diag-card { margin-top: 0 !important; }
}

/* Editorial intro (left column) */
.diag-head .eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--salmon-deep); margin: 0 0 24px;
  display: inline-flex; align-items: center; gap: 12px;
}
.diag-head .eyebrow::before {
  content: ""; width: 28px; height: 1px; background: var(--salmon-deep);
}
.diag-head h2 {
  font-family: 'Zilla Slab', 'Roca One', Georgia, serif; font-weight: 300;
  font-size: clamp(38px, 4.6vw, 60px);
  line-height: 1.04; letter-spacing: -0.022em;
  color: var(--charcoal); margin: 0 0 26px;
  display: flex; flex-wrap: wrap; align-items: center;
  column-gap: 16px; row-gap: 4px;
}
.diag-head h2 em { font-style: italic; }
.diag-head h2 .wp-stop { transform: translateY(2px); }
.diag-head .sub {
  font-size: 18px; color: var(--midnight-moss, var(--charcoal)); margin: 0 0 28px;
  max-width: 460px; line-height: 1.5;
}
.diag-head .meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: var(--midnight-moss, var(--charcoal)); padding: 0;
  margin-bottom: 24px;
}
.diag-head .meta strong { color: var(--charcoal); font-weight: 600; }
.diag-head .credibility {
  font-size: 14px; color: var(--midnight-moss, var(--charcoal)); font-style: italic;
  line-height: 1.55; max-width: 420px;
}

/* The quiz card (right column) — runs swatch-cool + grain-med
   Scoped overrides on the textures system's expected variables so the
   swatch renders identically across pages regardless of how their :root
   defines --midnight-deep. */
.diag-card {
  --midnight: #3A3932;
  --midnight-deep: #2A2924;
  border-radius: 8px;
  padding: 40px 40px 32px;
  color: var(--paper);
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 48px -28px rgba(20,20,15,0.32);
  min-height: 540px;
  display: flex; flex-direction: column;
  margin-top: 14px;
}
.diag-card > * { position: relative; z-index: 2; }

.diag-card .head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--slate-soft); margin-bottom: 22px;
  padding-bottom: 18px; border-bottom: 1px solid rgba(238,238,227,0.18);
}
.diag-card .head .label { display: inline-flex; align-items: center; gap: 10px; }
.diag-card .head .pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--salmon-glow); box-shadow: 0 0 10px var(--salmon-glow);
  animation: diag-pulse 1.6s ease-in-out infinite;
}
@keyframes diag-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.95); }
  50% { opacity: 1; transform: scale(1.1); }
}
.diag-card .head .progress strong { color: var(--paper); font-weight: 600; }

/* Stages */
.diag-card .stage { display: none; flex-direction: column; gap: 22px; flex: 1; }
.diag-card .stage.active { display: flex; }
.diag-card .qtitle {
  font-family: 'Zilla Slab', 'Roca One', Georgia, serif; font-weight: 300;
  font-size: 26px; line-height: 1.18; color: var(--paper);
  margin: 0;
}
.diag-card .qtitle em { font-style: italic; }

/* Stagger fade-up on stage advance */
.diag-fade-up { animation: diag-fadeUp 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes diag-fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Options — type-led editorial list, hairline-separated, hairline-draw hover */
.diag-card .options {
  list-style: none; padding: 0; margin: 0;
  border-top: 1px solid rgba(238,238,227,0.18);
}
.diag-card .options li {
  border-bottom: 1px solid rgba(238,238,227,0.18);
  position: relative;
  opacity: 0; transform: translateY(6px);
  animation: diag-optIn 360ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: calc(var(--i, 0) * 55ms + 80ms);
}
@keyframes diag-optIn { to { opacity: 1; transform: translateY(0); } }
.diag-card .opt {
  display: flex; align-items: center; gap: 22px;
  padding: 20px 4px; width: 100%; text-align: left;
  position: relative;
  transition: padding-left 280ms cubic-bezier(0.2, 0.8, 0.2, 1),
              color 220ms ease;
  color: var(--paper);
  background: none; border: 0; cursor: pointer; font-family: inherit;
}
.diag-card .opt:hover { padding-left: 14px; color: #ffffff; }
.diag-card .opt::after {
  content: ""; position: absolute;
  left: 4px; bottom: 8px;
  width: 0; height: 1.5px;
  background: var(--salmon-glow);
  transition: width 380ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.diag-card .opt:hover::after { width: calc(100% - 30px); }
.diag-card .opt .key {
  flex-shrink: 0; width: 26px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px; color: var(--paper-warm);
  font-weight: 600; letter-spacing: 0.04em;
  opacity: 0.65;
  transition: opacity 220ms ease, color 220ms ease;
}
.diag-card .opt:hover .key { opacity: 1; color: var(--salmon-glow); }
.diag-card .opt .text {
  flex: 1; font-size: 17px; line-height: 1.4; color: inherit; font-weight: 400;
}
.diag-card .opt .arrow {
  flex-shrink: 0; opacity: 0;
  transform: translateX(-6px);
  transition: opacity 280ms ease, transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  font-family: 'JetBrains Mono', monospace; font-size: 14px;
  color: var(--salmon-glow);
}
.diag-card .opt:hover .arrow { opacity: 1; transform: translateX(0); }

/* Verdict in the card — re-flows the same composition */
.diag-card .verdict { display: none; flex-direction: column; gap: 18px; flex: 1; }
.diag-card .verdict.active { display: flex; }
.diag-card .verdict .v-eyebrow {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--salmon-glow);
  display: inline-flex; align-items: center; gap: 10px; margin: 0;
}
.diag-card .verdict .v-eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--salmon-glow);
}
.diag-card .verdict .v-text {
  font-family: 'Zilla Slab', 'Roca One', Georgia, serif; font-weight: 300;
  font-size: 21px; line-height: 1.34; color: var(--paper); margin: 0;
}
.diag-card .verdict .v-ctas {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  margin-top: 4px;
}
.diag-card .v-prim {
  display: inline-flex; align-items: center;
  background: var(--salmon); color: var(--paper-warm);
  padding: 13px 24px; border-radius: 999px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 500; font-size: 14.5px;
  letter-spacing: 0.005em;
  transition: background 240ms ease;
  text-decoration: none;
  position: relative; overflow: hidden;
  height: 22px;
}
.diag-card .v-prim:hover { background: var(--salmon-glow); }
.diag-card .v-prim .stack { display: inline-flex; flex-direction: column; height: 22px; line-height: 22px; overflow: hidden; }
.diag-card .v-prim .stack > span { display: block; transition: transform 380ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.diag-card .v-prim:hover .stack > span { transform: translateY(-22px); }
.diag-card .v-secondary {
  font-size: 13.5px; color: var(--slate-soft); opacity: 0.88;
  transition: opacity 220ms ease, color 220ms ease;
  text-decoration: none;
}
.diag-card .v-secondary:hover { opacity: 1; color: var(--paper); }
.diag-card .v-restart {
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--slate); cursor: pointer; padding: 6px 0;
  align-self: flex-start;
  transition: color 220ms ease;
  background: none; border: 0;
}
.diag-card .v-restart:hover { color: var(--paper); }

/* Foot strip in the card */
.diag-card .foot {
  margin-top: auto; padding-top: 18px;
  border-top: 1px solid rgba(238,238,227,0.14);
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
  letter-spacing: 0.10em; color: var(--slate-soft);
}

/* wp-stop device — sits with the H2 (locked Calibration 2) */
.diag-head .wp-stop { display: inline-block; vertical-align: middle; position: relative; flex-shrink: 0; }
.diag-head .wp-stop canvas { display: block; width: 100%; height: 100%; }
.diag-head .wp-stop-md { width: 72px; height: 72px; }
