/* Beyond the Book Scorecard.
   Self-contained on purpose: it shares nothing with /css/style.css, so the
   scorecard and the marketing site can never restyle each other.
   Tokens come from the handoff (section 6); layout follows the screenshots in
   its design/ folder. */

:root {
  --desk: #e6e0d4;
  --paper: #f7f4ee;
  --ink: #1a2820;
  --muted: #3e5148;      /* do not go lighter than this on paper */
  --line: #ddd4c6;
  --card: #fffcf8;
  --mint: #0f5136;
  --mint-soft: #e5f2eb;
  --gold: #7a5b2e;       /* limit messages only */

  --font-head: 'Fraunces', Georgia, serif;
  --font-body: 'Outfit', 'Segoe UI', system-ui, sans-serif;

  --pad: 20px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }

:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

h1, .sc-q-title, .sc-title, .sc-ask, .sc-tier, .sc-rail-chapter {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -0.01em;
}

/* A focused heading is how a screen change is announced; it is not a control. */
.sc-title:focus, .sc-q-title:focus, .sc-open h1:focus { outline: 2px solid var(--mint); outline-offset: 4px; }

.sc-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.sc-card { flex: 1; display: flex; flex-direction: column; padding: var(--pad) var(--pad) 0; }
.sc-card > .sc-body, .sc-main { flex: 1; }
.sc-body { padding-bottom: 32px; }

/* ---------- Shared pieces ---------- */

.sc-wordmark {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--mint);
}

.sc-wordmark::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--mint); }

.sc-eyebrow, h1.sc-eyebrow {
  font-family: var(--font-body);
  line-height: 1.45;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--mint);
}

.sc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 32px;
  border: 0;
  border-radius: 999px;
  background: var(--mint);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.sc-btn.is-quiet { background: var(--card); color: var(--ink); border: 1px solid var(--line); }

.sc-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  border: 0;
  background: none;
  color: var(--mint);
  font-weight: 600;
}

.sc-link.is-muted { color: var(--muted); font-weight: 400; }

.sc-muted { color: var(--muted); }
.sc-small { font-size: 15px; }
.sc-limit { color: var(--gold); font-size: 15px; margin-top: 8px; }
.sc-need { color: var(--ink); font-size: 15px; font-weight: 500; margin-top: 8px; }

.sc-note { background: var(--mint-soft); border-radius: 16px; padding: 14px 16px; font-size: 15px; }

/* Top bar: Back left, context centre or right, Start over right. */
.sc-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; min-height: 48px; }
.sc-top > :last-child { justify-self: end; text-align: right; }
.sc-top-mid { font-weight: 500; text-align: center; }
.sc-top-side strong { display: block; font-weight: 600; }
.sc-top-side span { color: var(--muted); font-size: 15px; }

/* The action bar sticks to the bottom of a phone screen and sits in the column
   on desktop. */
.sc-bar-bottom {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 12px;
  margin: 0 calc(-1 * var(--pad));
  padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.sc-bar-bottom .sc-btn.is-quiet { flex: 0 0 34%; }

/* ---------- Opening screen ---------- */

.sc-open { padding-bottom: 32px; }
.sc-open h1 { font-size: 30px; margin-top: 20px; }
.sc-sub { color: var(--muted); font-size: 17px; margin-top: 14px; }
.sc-open .sc-btn { margin-top: 22px; }
.sc-micro { color: var(--muted); font-size: 15px; margin-top: 12px; text-align: center; }

.sc-open-more { margin-top: 24px; }
.sc-sourced { font-size: 15px; color: var(--muted); }
.sc-sourced summary { display: inline-flex; align-items: center; min-height: 48px; color: var(--mint); font-weight: 600; cursor: pointer; list-style: none; }
.sc-sourced summary::-webkit-details-marker { display: none; }
.sc-sourced details p { padding-bottom: 8px; }

.sc-open .sc-eyebrow { margin-top: 20px; }
.sc-list { margin-top: 14px; display: grid; gap: 12px; }
.sc-list li { position: relative; padding-left: 20px; }
.sc-list li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }

.sc-trust { margin-top: 24px; color: var(--muted); font-size: 15px; }
.sc-honest { margin-top: 12px; font-size: 15px; }

/* ---------- Lead form ---------- */

.sc-title { font-size: 28px; margin-top: 16px; }
.sc-helper { color: var(--muted); margin-top: 8px; }

.sc-form { display: flex; flex-direction: column; flex: 1; }
.sc-form-grid { display: grid; gap: 24px; padding-bottom: 28px; flex: 1; align-content: start; }
.sc-fields { display: grid; gap: 20px; margin-top: 24px; }
.sc-consents { display: grid; gap: 16px; }

.sc-field label, .sc-legend, .sc-part-label { display: block; font-weight: 600; margin-bottom: 8px; }

.sc-field input, .sc-textarea {
  width: 100%;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  font-size: 17px;          /* 16px or more, so iOS does not zoom the form */
}

.sc-field input:focus, .sc-textarea:focus { border-color: var(--mint); }
.sc-field .sc-hint { display: block; color: var(--muted); font-size: 15px; margin-top: 6px; }

.sc-check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; align-items: start; font-size: 15px; cursor: pointer; }
.sc-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--mint); }

/* ---------- Options ---------- */

.sc-opts { display: grid; gap: 10px; }
.sc-opts.is-grid { grid-template-columns: 1fr 1fr; }
.sc-opts.is-three { grid-template-columns: repeat(3, 1fr); }

.sc-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  text-align: left;
  font-size: 17px;
  line-height: 1.3;
}

/* The radio / check circle on the left of every option. */
.sc-opt::before {
  content: '';
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
}

.sc-opt[aria-checked="true"] { border-color: var(--mint); background: var(--mint-soft); }

.sc-opt[aria-checked="true"]::before {
  border-color: var(--mint);
  background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 26'%3E%3Cpath d='M8 13.5l3.4 3.4L18 9.8' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 26px no-repeat;
}

.sc-opts.is-grid .sc-opt, .sc-opts.is-three .sc-opt { min-height: 48px; font-size: 15px; padding: 10px 12px; gap: 10px; }
.sc-opts.is-grid .sc-opt::before, .sc-opts.is-three .sc-opt::before { width: 22px; height: 22px; background-size: 22px; }
.sc-opts.is-three .sc-opt { flex-direction: column; align-items: flex-start; gap: 6px; }

.sc-order { flex: none; font-weight: 600; color: var(--mint); margin-right: -4px; }

/* ---------- Question screen ---------- */

.sc-rail { display: none; }

.sc-progress { margin-top: 4px; }
.sc-segments { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.sc-segments span { height: 6px; border-radius: 3px; background: var(--line); }
.sc-segments span.is-done { background: var(--mint); }
.sc-segments span.is-now { background: #5a8a74; }       /* mint at rest: the chapter in progress */
.sc-bar { height: 6px; margin-top: 8px; background: var(--line); border-radius: 3px; overflow: hidden; }
.sc-bar i { display: block; height: 100%; background: var(--mint); border-radius: 3px; }
.sc-count { margin-top: 8px; text-align: center; font-size: 15px; color: var(--muted); }
.sc-resume { display: flex; flex-direction: column; align-items: center; margin-top: 4px; }
.sc-resume .sc-link { font-size: 15px; }
.sc-resume .sc-note { margin-bottom: 8px; }

.sc-q-title { font-size: 28px; margin-top: 20px; }
.sc-main { display: flex; flex-direction: column; }
.sc-question { flex: 1; display: flex; flex-direction: column; }
.sc-parts { flex: 1; padding-bottom: 28px; }

.sc-part { margin-top: 20px; }
.sc-part-label.has-help { margin-bottom: 2px; }
.sc-part-help { color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.sc-other { margin-top: 12px; }
.sc-part:first-of-type { margin-top: 16px; }

.sc-text-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; font-size: 15px; color: var(--muted); }
.sc-textarea { min-height: 148px; resize: vertical; line-height: 1.45; }
.sc-example { margin-top: 12px; }
.sc-example b { font-weight: 600; }
.sc-tip { margin-top: 12px; font-size: 15px; color: var(--muted); }

.sc-picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.sc-pick { min-height: 64px; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-size: 14px; }
.sc-pick b { display: block; color: var(--mint); font-weight: 600; }
.sc-caption { margin-top: 8px; font-size: 15px; color: var(--muted); }

.sc-row + .sc-row { margin-top: 20px; }
.sc-row-label { font-weight: 600; }
.sc-row-hint { font-size: 15px; color: var(--muted); }
.sc-row .sc-opts { margin-top: 10px; }

/* ---------- Pause after question 1 ---------- */

.sc-beat .sc-eyebrow { margin-top: 24px; }
.sc-beat .sc-title { margin-top: 8px; }
.sc-figure { margin-top: 20px; font-size: 18px; }
.sc-ask { margin-top: 28px; font-size: 24px; line-height: 1.25; }

/* ---------- Results ---------- */

.sc-results .sc-eyebrow { margin-top: 12px; }
.sc-score { margin-top: 20px; text-align: center; }
.sc-ring { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.sc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sc-ring circle { fill: none; stroke-width: 11; }
.sc-ring .is-track { stroke: var(--desk); }
.sc-ring .is-value { stroke: var(--mint); stroke-linecap: round; }
.sc-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.sc-ring-text b { font-family: var(--font-head); font-weight: 500; font-size: 36px; line-height: 1; }
.sc-ring-text span { font-size: 14px; color: var(--muted); margin-top: 4px; }
.sc-tier { font-size: 32px; margin-top: 12px; }
.sc-tier-line { margin-top: 8px; font-size: 17px; }

.sc-noticed { margin-top: 24px; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; }
.sc-noticed p:not(.sc-eyebrow) { margin-top: 12px; font-size: 17px; }
.sc-noticed p span { color: var(--muted); }

.sc-after { margin-top: 20px; display: grid; gap: 14px; font-size: 17px; }
.sc-status { margin-top: 20px; }
.sc-status .sc-link { margin-right: 20px; font-size: 15px; }
.sc-spark-note { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* ---------- Fit call ---------- */

.sc-book-list { margin-top: 16px; display: grid; gap: 8px; }
.sc-book-list li { position: relative; padding-left: 20px; }
.sc-book-list li::before { content: ''; position: absolute; left: 0; top: 0.5em; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.sc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.sc-chips .sc-opt { width: auto; min-height: 48px; font-size: 15px; padding: 8px 14px; }
.sc-chips .sc-opt::before { width: 20px; height: 20px; background-size: 20px; }

/* ---------- Desktop: 1024px and up ---------- */

@media (min-width: 1024px) {
  body { background: var(--desk); }

  .sc-page { align-items: center; padding: 24px; }

  .sc-card {
    flex: none;
    width: 100%;
    max-width: 1024px;
    padding: 56px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 28px;
  }

  .sc-body { padding-bottom: 0; }

  /* Buttons are sized to their label, and the action bar sits in the column. */
  .sc-btn { width: auto; }
  .sc-bar-bottom { position: static; margin: 28px 0 0; padding: 0; border: 0; background: none; }
  .sc-bar-bottom .sc-btn.is-quiet { flex: none; }

  /* Opening: two columns */
  .sc-open { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding-bottom: 56px; }
  .sc-open h1 { font-size: 48px; margin-top: 24px; }
  .sc-sub { margin-top: 16px; }
  .sc-open .sc-btn { margin-top: 28px; }
  .sc-micro { text-align: left; font-size: 14px; }
  .sc-open-more { margin-top: 24px; }
  .sc-sourced, .sc-list, .sc-trust, .sc-honest { font-size: 14px; }

  /* Lead: details left, roles and consent right, Start centred under both */
  .sc-lead { padding: 20px 56px 56px; }
  .sc-lead .sc-top { margin: 0 -40px; }
  .sc-form-grid { grid-template-columns: 1fr 1fr; gap: 24px 48px; align-items: start; }
  .sc-lead-left .sc-title { font-size: 36px; margin-top: 12px; }
  .sc-lead-right { display: grid; gap: 24px; padding-top: 16px; }
  .sc-lead .sc-bar-bottom { justify-content: center; margin-top: 12px; }
  .sc-lead .sc-bar-bottom .sc-btn { width: 100%; max-width: 688px; }

  /* Questions: chapter rail left, one question right */
  .sc-quiz { display: grid; grid-template-columns: 260px minmax(0, 1fr); padding: 0; max-width: 1150px; min-height: calc(100vh - 48px); min-height: calc(100dvh - 48px); }
  .sc-rail { display: flex; flex-direction: column; padding: 40px 32px 32px; border-right: 1px solid var(--line); }
  .sc-rail-chapter { font-size: 30px; margin-top: 36px; }
  .sc-rail-count { color: var(--muted); font-size: 15px; margin-top: 8px; }
  .sc-rail-list { display: grid; gap: 10px; margin-top: 28px; color: var(--muted); font-size: 15px; counter-reset: ch; }
  .sc-rail-list li { counter-increment: ch; }
  .sc-rail-list li::before { content: counter(ch) '. '; }
  .sc-rail-list .is-now { color: var(--ink); font-weight: 600; }
  .sc-rail-foot { margin-top: auto; padding-top: 32px; color: var(--muted); font-size: 15px; }
  .sc-main { padding: 20px 16px 40px; min-width: 0; }
  .sc-question { width: 100%; max-width: 692px; margin: 0 auto; flex: none; }
  .sc-parts { padding-bottom: 0; }
  .sc-q-title { font-size: 36px; margin-top: 24px; }

  /* Pause and fit call: one centred column */
  .sc-beat, .sc-book { max-width: 768px; }

  /* Results: score left, detail right, nothing under a sticky bar */
  .sc-results-grid { display: grid; grid-template-columns: 5fr 6fr; gap: 56px; align-items: start; margin-top: 12px; }
  .sc-results .sc-bar-bottom { justify-content: center; }
  .sc-noticed { margin-top: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .sc-opt { transition: border-color .15s ease, background-color .15s ease; }
  .sc-bar i { transition: width .25s ease; }
}
