/* ============================================================
   GENAI SURVEY | survey.css (uses the shared tokens from styles.css)
   One question per screen, built thumb-first for mobile.
   ============================================================ */
.sv-body {
  --sv-panel: #0d0d0f; --sv-panel-2: #151518;
  --sv-line: rgba(255,255,255,0.09); --sv-line-2: rgba(255,255,255,0.18);
  --sv-label: #f5f5f7; --sv-label-2: #ff4d6a; --sv-label-3: #e8304f;
  --sv-accent: #e0143c; --sv-accent-soft: rgba(224,20,60,0.12);
  --sv-actions-h: 84px;
  --sv-font-apple: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', 'Inter', system-ui, sans-serif;
  background: #000;
  color: var(--sv-label);
}

/* ── Nav: home link, counter, progress line ── */
.sv-nav { justify-content: space-between; }
.sv-back-home, .sv-count {
  display: inline-flex; align-items: center; gap: 8px;
  font: 700 11px var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  color: var(--sv-label-2); transition: color .2s;
}
.sv-back-home:hover { color: var(--text); }
.sv-count { font-variant-numeric: tabular-nums; }
.sv-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: transparent; }
.sv-progress i {
  display: block; height: 100%; width: 0; background: var(--sv-accent);
  box-shadow: 0 0 12px rgba(224,20,60,.6); transition: width .45s var(--ease-out);
}

/* ── Layout ── */
.sv-page {
  min-height: 100vh; min-height: 100dvh;
  padding: calc(var(--nav-h) + clamp(28px, 7vh, 72px)) clamp(16px, 5vw, 40px) calc(var(--sv-actions-h) + 40px + env(safe-area-inset-bottom, 0px));
  font-family: var(--font-body);
}
.sv-form { max-width: 640px; margin: 0 auto; }
.sv-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.sv-step { animation: sv-in .45s var(--ease-out) both; }
.sv-step.is-back { animation-name: sv-in-back; }
@keyframes sv-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes sv-in-back { from { opacity: 0; transform: translateY(-14px); } }

/* ── Question text ── */
.sv-eyebrow {
  margin: 0 0 14px; font: 700 10px var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--sv-accent);
}
.sv-q {
  margin: 0; outline: none;
  font-family: var(--font-serif); font-size: clamp(25px, 5.4vw, 36px); font-weight: 600;
  line-height: 1.18; letter-spacing: -0.02em; text-transform: none; color: var(--sv-label);
}
.sv-help { margin: 12px 0 0; font-size: 15px; line-height: 1.55; color: var(--sv-label-2); }
.sv-optional {
  display: inline-block; margin-left: 6px; padding: 2px 8px; vertical-align: middle; border-radius: 999px;
  border: 1px solid var(--sv-line-2); font: 700 9px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sv-label-3);
}

/* ── Choice options (native radio / checkbox inside a label) ── */
.sv-options { display: grid; gap: 10px; margin-top: 28px; }
.sv-options--two { grid-template-columns: 1fr 1fr; }
.sv-opt { position: relative; display: block; }
.sv-opt input { position: absolute; z-index: 1; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sv-opt__box {
  display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 12px 16px;
  border-radius: 14px; border: 1px solid var(--sv-line-2); background: var(--sv-panel);
  font-size: 16px; line-height: 1.35; color: var(--sv-label); cursor: pointer;
  transition: border-color .15s, background .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.sv-opt__key {
  flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 7px;
  border: 1px solid var(--sv-line-2); font: 700 11px var(--font-mono); color: var(--sv-label-3);
  transition: background .15s, border-color .15s, color .15s;
}
.sv-opt__text { flex: 1; }
.sv-opt__tick { flex-shrink: 0; width: 18px; height: 18px; color: var(--sv-accent); opacity: 0; transform: scale(.6); transition: opacity .15s, transform .2s var(--ease-out); }
@media (hover: hover) { .sv-opt:hover .sv-opt__box { border-color: rgba(255,255,255,.35); } }
.sv-opt:active .sv-opt__box { transform: scale(.985); }
.sv-opt input:focus-visible + .sv-opt__box { outline: 2px solid var(--sv-accent); outline-offset: 3px; }
.sv-opt input:checked + .sv-opt__box { border-color: var(--sv-accent); background: var(--sv-accent-soft); }
.sv-opt input:checked + .sv-opt__box .sv-opt__key { background: var(--sv-accent); border-color: var(--sv-accent); color: #fff; }
.sv-opt input:checked + .sv-opt__box .sv-opt__tick { opacity: 1; transform: none; }
.sv-opt input:disabled + .sv-opt__box { opacity: .4; cursor: not-allowed; }

/* "Other, please say" text box */
.sv-other { margin-top: 2px; }
.sv-other[hidden] { display: none; }

/* ── Text inputs ── */
.sv-input, .sv-textarea {
  display: block; width: 100%; margin-top: 28px; padding: 14px 16px;
  border-radius: 14px; border: 1px solid var(--sv-line-2); background: var(--sv-panel);
  color: var(--sv-label); font: 400 16px/1.5 var(--font-body); /* 16px stops iOS zoom-on-focus */
  transition: border-color .15s;
}
.sv-other .sv-input { margin-top: 0; }
.sv-textarea { min-height: 150px; resize: vertical; }
.sv-input::placeholder, .sv-textarea::placeholder { color: var(--sv-label-3); }
.sv-input:focus, .sv-textarea:focus { outline: 0; border-color: var(--sv-accent); box-shadow: 0 0 0 3px var(--sv-accent-soft); }
.sv-input.is-invalid { border-color: #ff6b84; }

/* ── Likert scale ── */
.sv-likert { display: grid; gap: 12px; margin-top: 28px; }
.sv-stmt { margin: 0; padding: 16px; border: 1px solid var(--sv-line); border-radius: 16px; background: var(--sv-panel); }
.sv-stmt.is-missing { border-color: rgba(255,107,132,.55); }
.sv-stmt legend { float: left; width: 100%; margin-bottom: 14px; font-size: 16px; font-weight: 500; line-height: 1.4; }
.sv-scale { clear: both; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sv-scale label { position: relative; }
.sv-scale input { position: absolute; z-index: 1; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sv-scale span {
  display: grid; place-items: center; height: 46px; border-radius: 10px;
  border: 1px solid var(--sv-line-2); background: var(--sv-panel-2);
  font: 700 14px var(--font-mono); color: var(--sv-label-2); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
@media (hover: hover) { .sv-scale label:hover span { border-color: rgba(255,255,255,.35); } }
.sv-scale input:focus-visible + span { outline: 2px solid var(--sv-accent); outline-offset: 2px; }
.sv-scale input:checked + span { background: var(--sv-accent); border-color: var(--sv-accent); color: #fff; }
.sv-scale-ends { display: flex; justify-content: space-between; margin-top: 8px; font-size: 11.5px; color: var(--sv-label-3); }

/* ── Intro / end screens ── */
.sv-hero .sv-eyebrow {
  margin-bottom: 10px; font: 600 15px/1.3 var(--sv-font-apple); letter-spacing: -0.01em; text-transform: none;
}
.sv-hero .sv-title {
  margin: 0; font-family: var(--sv-font-apple); font-size: clamp(30px, 9vw, 76px); font-weight: 700;
  line-height: 1.03; letter-spacing: -0.035em; text-transform: none;
}
.sv-hero .sv-title span { color: var(--sv-accent); }
.sv-hero .sv-title .sv-title__line { display: block; color: inherit; white-space: nowrap; }
.sv-hero .sv-title .sv-title__ai {
  display: block; margin-bottom: 6px; color: var(--sv-label);
  font-size: 0.62em; font-weight: 700; letter-spacing: -0.01em;
}
.sv-hero .sv-title .sv-title__line span { color: var(--sv-accent); }
.sv-lede { margin: 22px 0 0; font-size: clamp(16px, 2.4vw, 18px); line-height: 1.6; color: var(--sv-label-2); }
.sv-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 0; padding: 0; }
.sv-facts li {
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--sv-line-2);
  font: 600 14px var(--sv-font-apple); letter-spacing: 0; text-transform: none; color: var(--sv-label-2);
}
.sv-consent {
  margin-top: 28px; padding: 18px; border-radius: 16px; border: 1px solid var(--sv-line); background: var(--sv-panel);
  font-size: 14px; line-height: 1.6; color: var(--sv-label-2);
}
.sv-consent summary { cursor: pointer; font-weight: 600; color: var(--sv-label); }
.sv-consent ul { margin: 10px 0 0; padding-left: 18px; list-style: disc; }
.sv-consent li + li { margin-top: 4px; }
.sv-rq {
  margin: 14px 0 0; padding: 4px 0 4px 16px; border-left: 3px solid var(--sv-accent);
  font: 500 clamp(17px, 2.6vw, 20px)/1.45 var(--font-serif); color: var(--sv-label);
}
/* Research question gently fades in and out */
.sv-rq { animation: sv-breathe 4.5s ease-in-out infinite; }
@keyframes sv-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .sv-rq { animation: none; } }

/* Consent: a big, obvious tap target that must be ticked to start */
.sv-agree {
  position: relative; display: flex; align-items: center; gap: 16px; margin-top: 22px; padding: 18px;
  border-radius: 16px; border: 2px dashed var(--sv-accent); background: var(--sv-accent-soft);
  cursor: pointer; -webkit-tap-highlight-color: transparent; transition: border-color .2s, background .2s;
}
.sv-agree input { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sv-agree__box {
  flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  border: 2px solid var(--sv-accent); background: #000; color: #fff;
  animation: sv-nudge 1.8s ease-in-out infinite;
}
.sv-agree__box svg { width: 24px; height: 24px; opacity: 0; transform: scale(.5); transition: opacity .15s, transform .2s var(--ease-out); }
.sv-agree__text { font-size: 15px; line-height: 1.45; color: var(--sv-label-2); }
.sv-agree__text b { display: block; margin-bottom: 2px; font-size: 16px; color: var(--sv-label); }
.sv-agree input:focus-visible ~ .sv-agree__box { outline: 2px solid #fff; outline-offset: 3px; }
.sv-agree.is-on { border-style: solid; }
.sv-agree.is-on .sv-agree__box { background: var(--sv-accent); animation: none; }
.sv-agree.is-on .sv-agree__box svg { opacity: 1; transform: none; }
@keyframes sv-nudge { 50% { box-shadow: 0 0 0 6px rgba(224,20,60,.25); } }
@media (prefers-reduced-motion: reduce) { .sv-agree__box { animation: none; } }
.sv-hero .sv-btn { margin-top: 18px; width: 100%; }

.sv-end { text-align: center; padding-top: 6vh; }
.sv-end__mark {
  display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto 26px; border-radius: 50%;
  background: var(--sv-accent-soft); border: 1px solid var(--sv-accent); color: var(--sv-accent);
}
.sv-end .sv-lede { max-width: 480px; margin-left: auto; margin-right: auto; }
.sv-end__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.sv-end__actions { flex-wrap: nowrap; }
.sv-end__actions .sv-btn { flex: 1 1 0; min-width: 0; max-width: 260px; padding: 0 12px; font-size: 11px; letter-spacing: .08em; white-space: nowrap; }

/* Pop-up confirmation (e.g. "Copied to clipboard") */
.sv-toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); z-index: 310;
  padding: 12px 20px; border-radius: 999px; background: var(--sv-label); color: #000;
  font: 600 14px var(--font-body); box-shadow: 0 10px 30px rgba(0,0,0,.5);
  opacity: 0; transform: translate(-50%, 12px); pointer-events: none;
  transition: opacity .2s, transform .25s var(--ease-out);
}
.sv-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.sv-error { margin: 14px 0 0; min-height: 1.4em; font-size: 14px; color: #ff6b84; }

/* ── Buttons & sticky action bar ── */
.sv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 54px; padding: 0 26px;
  border-radius: 999px; border: 1px solid var(--sv-accent); background: var(--sv-accent); color: #fff;
  font: 700 12px var(--font-mono); letter-spacing: .14em; text-transform: uppercase;
  cursor: pointer; transition: transform .15s, opacity .15s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { .sv-btn:hover { transform: translateY(-1px); } }
.sv-btn:active { transform: scale(.98); }
.sv-btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.sv-btn:focus-visible { outline: 2px solid var(--sv-accent); outline-offset: 3px; }
.sv-btn--ghost { background: transparent; border-color: var(--sv-line-2); color: var(--sv-label); }

.sv-actions {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: flex; gap: 10px; justify-content: center;
  padding: 14px clamp(16px, 5vw, 40px) calc(14px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #000 62%, rgba(0,0,0,0));
}
.sv-actions[hidden] { display: none; }
.sv-actions .sv-btn { flex: 0 1 auto; }
.sv-actions #svNext { flex: 1; max-width: 520px; }
.sv-skip { width: 100%; margin-top: 6px; }
.sv-hint { margin: 14px 0 0; font-size: 12.5px; color: var(--sv-label-3); }
.sv-hint kbd { padding: 1px 6px; border-radius: 5px; border: 1px solid var(--sv-line-2); font: 700 11px var(--font-mono); }

@media (max-width: 520px) {
  .sv-options--two { grid-template-columns: 1fr; }
  .sv-opt__key { display: none; }       /* letter shortcuts are a keyboard nicety */
  .sv-hint { display: none; }
  .sv-scale span { height: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  .sv-step { animation: none; }
  .sv-progress i, .sv-opt__tick { transition: none; }
}

/* The site's global styles centre text; forms scan faster left-aligned */
.sv-form, .sv-opt__box, .sv-stmt legend { text-align: left; }
.sv-end { text-align: center; }

/* Intro heading sits centred above the left-aligned content */
.sv-hero .sv-eyebrow, .sv-hero .sv-title { text-align: left; }
.sv-consent a { color: var(--sv-label); text-decoration: underline; text-underline-offset: 3px; }

/* Red mist rising from the bottom of the page */
.sv-mist {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 0;
  width: 100%; height: 55vh; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 100%);
  mask-image: linear-gradient(to top, #000 30%, transparent 100%);
}
.sv-page { position: relative; z-index: 1; }

/* "AI in..." — the three dots pulse in sequence like typing */
.sv-dots i { display: inline-block; font-style: normal; animation: sv-dot 1.4s ease-in-out infinite; }
.sv-dots i:nth-child(2) { animation-delay: 0.2s; }
.sv-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes sv-dot { 0%, 60%, 100% { opacity: 0.2; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-0.12em); } }
@media (prefers-reduced-motion: reduce) { .sv-dots i { animation: none; opacity: 1; } }
