/*
 * VENTUROXX W1-A — RESEARCH SHELL STYLESHEET
 * ==========================================
 * Design tokens reproduced locally from the Venturoxx visual system
 * (typography, colour, spacing logic, restraint). NOTHING is imported from the
 * commercial site: no BaseLayout, no header/footer, no marketing components —
 * W1-A §10, O8 §23.
 *
 * System fonts only: no webfont request leaves the research origin (CSP blocks
 * it anyway, and a font CDN would be a third party the respondent was never
 * told about).
 */

:root {
  --ink:        #14161a;
  --ink-soft:   #454b54;
  --ink-muted:  #6b727c;
  --line:       #d9dce1;
  --line-soft:  #e9ebef;
  --paper:      #ffffff;
  --paper-warm: #f7f6f4;
  --gold:       #a8843c;
  --gold-soft:  #f0e7d5;
  --focus:      #1c4f9c;
  --error:      #9a2c2c;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;

  --s1: .25rem; --s2: .5rem;  --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;   --s7: 3rem;   --s8: 4rem;

  --measure: 34rem;          /* controlled readable width — O8 §22 */
  --measure-wide: 44rem;
  --radius: 3px;
  --tap: 44px;               /* minimum touch target */
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eceef1; --ink-soft: #b9bfc7; --ink-muted: #8b929c;
    --line: #33383f; --line-soft: #262a30;
    --paper: #15171a; --paper-warm: #1b1e22;
    --gold: #c8a459; --gold-soft: #2a2419;
    --focus: #7fb0ff; --error: #ef8888;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;               /* no horizontal scroll, ever */
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ shell */

.shell-head {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s4) var(--s5);
  border-bottom: 1px solid var(--line-soft);
}
.mark {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: var(--gold); line-height: 1;
}
.shell-title {
  font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-muted);
}
.shell-main { padding: var(--s6) var(--s5) var(--s8); }
.shell-foot {
  padding: var(--s6) var(--s5); border-top: 1px solid var(--line-soft);
  color: var(--ink-muted); font-size: .875rem;
}
.shell-foot p { margin: 0 0 var(--s2); }

/* The single information-handling link. Findable, not advertised: it inherits
   the muted footer colour instead of the primary link blue, and keeps an
   underline so it still reads and behaves as a link. */
.shell-foot a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.shell-foot a:hover, .shell-foot a:focus-visible { color: var(--ink); }

.wrap { max-width: var(--measure-wide); margin: 0 auto; }
.wrap--narrow { max-width: var(--measure); }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper); padding: var(--s3) var(--s4); z-index: 10;
}
.skip:focus { left: var(--s4); top: var(--s4); }

.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;
}

/* ------------------------------------------------------------- typography */

h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2rem);
  line-height: 1.25; margin: 0 0 var(--s4); color: var(--ink);
}
h2 {
  font-size: 1rem; font-weight: 600; letter-spacing: .01em;
  margin: var(--s6) 0 var(--s3);
}
p { margin: 0 0 var(--s4); color: var(--ink-soft); }
a { color: var(--focus); text-underline-offset: .15em; }

.standfirst { font-size: 1.125rem; color: var(--ink); }
.sponsor { font-size: .9375rem; color: var(--ink-muted); }
.hint { font-size: .9375rem; color: var(--ink-muted); margin-bottom: var(--s4); }
.muted { color: var(--ink-muted); }
.promise {
  font-size: .9375rem; color: var(--ink); padding: var(--s3) 0;
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.block { margin-top: var(--s6); }
.error {
  color: var(--error); background: color-mix(in srgb, var(--error) 8%, transparent);
  border-left: 3px solid var(--error); padding: var(--s3) var(--s4); margin-bottom: var(--s4);
}
.prose h2 { margin-top: var(--s6); }
.prose ul { padding-left: var(--s5); color: var(--ink-soft); }
.prose li { margin-bottom: var(--s2); }

/* --------------------------------------------------------------- progress */

.progress { margin-bottom: var(--s6); }
.progress-text {
  font-size: .8125rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-muted); margin: 0 0 var(--s2);
}
.progress-track { height: 2px; background: var(--line-soft); }
.progress-fill { height: 2px; background: var(--gold); transition: width .25s ease; }
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

/* -------------------------------------------------------------- questions */

.q-text {
  font-family: var(--serif); font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
  line-height: 1.3; margin-bottom: var(--s4);
}
.q-sub { font-family: var(--sans); font-size: 1.0625rem; font-weight: 600; margin-top: var(--s6); }
.meta-label { font-size: 1rem; font-weight: 600; margin: 0 0 var(--s2); }
.meta-field { margin-bottom: var(--s7); }

.opts { border: 0; margin: 0 0 var(--s5); padding: 0; }

.opt { position: relative; border-bottom: 1px solid var(--line-soft); }
.opt:first-child { border-top: 1px solid var(--line-soft); }

.opt input[type=radio], .opt input[type=checkbox] {
  position: absolute; opacity: 0; width: 1px; height: 1px;
}
.opt label {
  display: flex; align-items: flex-start; gap: var(--s3);
  min-height: var(--tap);
  padding: var(--s3) var(--s2) var(--s3) 0;
  cursor: pointer; color: var(--ink);
}
.opt label::before {
  content: ""; flex: 0 0 auto;
  width: 1.25rem; height: 1.25rem; margin-top: .2rem;
  border: 1.5px solid var(--line); background: var(--paper);
}
.opt input[type=radio] + label::before { border-radius: 50%; }
.opt input[type=checkbox] + label::before { border-radius: 2px; }

.opt input:checked + label::before {
  border-color: var(--gold);
  background: var(--gold);
  box-shadow: inset 0 0 0 3px var(--paper);
}
.opt input:focus-visible + label {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.opt input:disabled + label { color: var(--ink-muted); cursor: not-allowed; }
.opt--exclusive { border-top: 1px solid var(--line-soft); }

.other-wrap { padding: 0 0 var(--s3) 2rem; }
.other-wrap.is-hidden { display: none; }
.other-label { display: block; font-size: .875rem; color: var(--ink-muted); margin-bottom: var(--s1); }
.other-input, .code-input, .textarea {
  width: 100%; font: inherit; color: var(--ink);
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s3);
  min-height: var(--tap);
}
.textarea { min-height: 9rem; resize: vertical; line-height: 1.6; }
.other-input:focus, .code-input:focus, .textarea:focus {
  outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus);
}

.part-label { display: block; font-weight: 500; color: var(--ink); margin-bottom: var(--s2); }
.part-letter {
  display: inline-block; font-family: var(--serif); font-size: 1.125rem;
  color: var(--gold); margin-right: var(--s2);
}
.field { margin-bottom: var(--s5); }
.followup { border-top: 1px solid var(--line-soft); padding-top: var(--s2); }

.limit-msg { font-size: .875rem; color: var(--error); margin: var(--s3) 0 0; min-height: 1.4em; }
.save-state { font-size: .8125rem; color: var(--ink-muted); min-height: 1.4em; margin: 0 0 var(--s3); }
.save-state[data-state="failed"] { color: var(--error); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: var(--tap); padding: var(--s3) var(--s5);
  font: inherit; font-size: 1rem; font-weight: 500;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer;
}
.btn--primary:hover { background: #000; }
.btn--quiet { background: transparent; color: var(--ink); border-color: var(--line); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.linkbtn {
  background: none; border: 0; padding: var(--s2) 0; font: inherit;
  font-size: .9375rem; color: var(--ink-muted);
  text-decoration: underline; cursor: pointer; min-height: var(--tap);
}
.linkbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); margin-top: var(--s6);
}
.actions--end { justify-content: flex-end; }
.skip-line { margin: var(--s4) 0 0; }

.code-form label { display: block; font-weight: 600; margin-bottom: var(--s1); }
.code-input {
  font-size: 1.5rem; letter-spacing: .35em; text-align: center;
  max-width: 9rem; margin-bottom: var(--s5);
}

.consent-check { display: flex; gap: var(--s3); align-items: flex-start; margin: var(--s5) 0; }
.consent-check input { width: 1.25rem; height: 1.25rem; margin-top: .25rem; flex: 0 0 auto; }
.consent-check label { color: var(--ink); }

/* ----------------------------------------------------------------- review */

.summary { border-top: 1px solid var(--line); margin: var(--s5) 0; }
.sum-row {
  display: grid; grid-template-columns: 1fr auto;
  gap: var(--s2) var(--s4); padding: var(--s4) 0;
  border-bottom: 1px solid var(--line-soft);
}
.sum-q { grid-column: 1; }
.sum-n {
  font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted);
}
.sum-text { margin: var(--s1) 0 0; font-size: .9375rem; color: var(--ink); }
.sum-a { grid-column: 1; color: var(--ink-soft); }
.sum-edit { grid-column: 2; grid-row: 1; align-self: start; }
.sum-list { margin: 0; padding-left: var(--s5); }
.sum-part { margin-bottom: var(--s3); }
.sum-row--locked { opacity: .78; }
.locked-tag {
  font-size: .75rem; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-muted); border: 1px solid var(--line); border-radius: 2px;
  padding: 2px var(--s2);
}
.locked-block { margin-top: var(--s6); }
.locked-block summary { cursor: pointer; color: var(--ink-muted); padding: var(--s3) 0; min-height: var(--tap); }

.confirm {
  margin-top: var(--s6); padding: var(--s5);
  background: var(--paper-warm); border: 1px solid var(--line);
}
.confirm h2 { margin-top: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 500; }
.confirm-actions { display: flex; gap: var(--s4); justify-content: flex-end; margin-top: var(--s5); }

.signature { font-family: var(--serif); font-size: 1.125rem; color: var(--ink); margin-top: var(--s6); }

/* ------------------------------------------------------------- responsive */

@media (max-width: 32rem) {
  .shell-main { padding: var(--s5) var(--s4) var(--s8); }
  .shell-head, .shell-foot { padding-left: var(--s4); padding-right: var(--s4); }
  .actions { flex-direction: column-reverse; align-items: stretch; }
  .actions .btn { width: 100%; }
  .confirm-actions { flex-direction: column-reverse; }
  .confirm-actions .btn { width: 100%; }
  .sum-row { grid-template-columns: 1fr; }
  .sum-edit { grid-column: 1; grid-row: auto; }
  .other-wrap { padding-left: 0; }
}

@media (min-width: 60rem) {
  .shell-main { padding-top: var(--s7); }
}

@media print { .actions, .skip-line, .progress { display: none; } }
