/* Shared by every page and version (index.html, blog.html, v5.html): the review
   switcher and the modals. Each page's own stylesheet sets the tokens these fall back
   on (--accent, --accent-shadow, --ink, --font) and can retint the modals. */

/* ---------- Version switcher (review tool, not part of the site design) ---------- */

.version-switch {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: calc(100% - 32px);
  border-radius: 22px;
  background: rgba(17, 17, 20, 0.88);
  color: #fff;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}
.version-switch span { padding: 0 6px 0 10px; opacity: 0.7; }
.version-switch .group { display: flex; align-items: center; gap: 4px; }
.version-switch .group + .group { margin-left: 4px; border-left: 1px solid rgba(255, 255, 255, 0.25); }
.version-switch button {
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.version-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); }

/* ---------- Modals: exposure score quiz (score.js), talk to the founder (founder.js) ----------
   Dark brand ground, lavender for eyebrows, progress and selection, the site's purple
   button. .modal is the shared shell and form fields; the rest is per modal. */
.modal {
  --s-bg: #17122b;
  --s-surface: #221b3d;
  --s-surface-hover: #2b2350;
  --s-line: #3a3160;
  --s-text: #f3f0fa;
  --s-muted: #9a92b8;
  --s-lavender: #c3a3f5;
  --s-critical: #f0708f;
  --s-high: #f4a261;
  --s-moderate: #c3a3f5;
  --s-low: #7fd6b4;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--s-line);
  border-radius: 24px;
  background: linear-gradient(180deg, #1e1838, var(--s-bg));
  box-shadow: 0 40px 80px -24px rgba(0, 0, 0, 0.6);
  color: var(--s-text);
  font-family: inherit;
  overflow-y: auto;
}
.modal::backdrop { background: rgba(8, 6, 16, 0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.modal[open] { animation: score-in 0.25s ease; }
@keyframes score-in { from { opacity: 0; translate: 0 12px; } }
html.modal-open { overflow: hidden; }

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--s-line);
  border-radius: 10px;
  background: transparent;
  color: var(--s-text);
  cursor: pointer;
}
.modal-close:hover { background: var(--s-surface); }
.modal-close svg { width: 20px; height: 20px; }
.score-eyebrow {
  margin: 8px 48px 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: center;
  color: var(--s-lavender);
}

.score-progress { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; }
.score-track { flex: 1; height: 6px; border-radius: 3px; background: var(--s-surface); overflow: hidden; }
.score-track i { display: block; height: 100%; border-radius: 3px; background: var(--s-lavender); transition: width 0.35s ease; }
.score-count { font-size: 14px; font-weight: 600; color: var(--s-muted); font-variant-numeric: tabular-nums; }

.score-question { margin: 0; padding: 0; border: 0; min-width: 0; }
.score-question.is-entering { animation: question-in 0.3s ease; }
@keyframes question-in { from { opacity: 0; translate: 12px 0; } }
.score-question legend { display: grid; gap: 6px; margin-bottom: 20px; padding: 0; }
.score-q { font-size: clamp(20px, 2.4vw, 24px); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; }
.score-hint { font-size: 15px; color: var(--s-muted); }
.score-options { display: grid; gap: 10px; }
.score-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: var(--s-surface);
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.score-option:hover { background: var(--s-surface-hover); }
.score-option input {
  appearance: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  border: 2px solid #4b4170;
  border-radius: 50%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.score-option input:checked { border-color: var(--s-lavender); box-shadow: inset 0 0 0 4px var(--s-surface-hover), inset 0 0 0 11px var(--s-lavender); }
.score-option:has(input:checked) { border-color: var(--s-lavender); background: var(--s-surface-hover); }
.score-option input:focus-visible { outline: 2px solid var(--s-lavender); outline-offset: 3px; }

.score-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; font-size: 14px; color: var(--s-muted); }
.score-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--s-text);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
}
.score-back svg { width: 18px; height: 18px; }
.score-back:disabled { color: var(--s-muted); opacity: 0.6; cursor: default; }

/* Result: the gauge and its colour follow data-level on .score-result */
.score-result { --level: var(--s-critical); text-align: center; }
.score-result[data-level="high"] { --level: var(--s-high); }
.score-result[data-level="moderate"] { --level: var(--s-moderate); }
.score-result[data-level="low"] { --level: var(--s-low); }
.score-gauge { width: 200px; margin: 0 auto; }
.score-gauge svg { display: block; width: 100%; fill: none; stroke-width: 14; stroke-linecap: round; }
.gauge-track { stroke: var(--s-surface-hover); }
.gauge-fill { stroke: var(--level); stroke-dasharray: 0 100; transition: stroke-dasharray 1.1s cubic-bezier(0.2, 0.7, 0.2, 1); }
/* The number sits under the arc, between its two ends */
.score-number { display: grid; justify-items: center; gap: 6px; margin: -34px 0 0; }
.score-number b { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--level); font-variant-numeric: tabular-nums; }
.score-number span { white-space: nowrap; font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--s-muted); }
.score-level { margin: 20px 0 6px; font-size: 22px; font-weight: 700; color: var(--level); }
.score-summary { margin: 0; padding-bottom: 28px; border-bottom: 1px solid var(--s-line); font-size: 16px; color: #c9c3dc; }

.score-form, .score-sent { text-align: left; }
.score-form h3, .score-sent h3 { margin: 28px 0 6px; font-size: 20px; font-weight: 700; }
.score-form > p, .score-sent p { margin: 0 0 20px; font-size: 15px; line-height: 1.5; color: var(--s-muted); }
.score-sent b { color: var(--s-text); }
.field { display: grid; gap: 8px; margin-bottom: 18px; font-size: 14px; color: #c9c3dc; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: var(--s-surface);
  color: var(--s-text);
  font: inherit;
  font-size: 16px;
}
.field select {
  appearance: none;
  padding-right: 40px;
  background: var(--s-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f3f0fa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 14px center / 18px no-repeat;
  cursor: pointer;
}
.field select:invalid { color: var(--s-muted); }
.field option { background: #221b3d; color: var(--s-text); }
.field textarea { height: auto; min-height: 96px; padding: 12px 16px; line-height: 1.5; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: #6f6890; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-color: var(--s-lavender); box-shadow: 0 0 0 3px rgba(195, 163, 245, 0.25); }
.field.is-invalid input,
.field.is-invalid select { border-color: var(--s-critical); }
.form-error { min-height: 1.4em; margin: -6px 0 10px; font-size: 14px; color: var(--s-critical); }
.modal-submit {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, #8f52c9, var(--accent, #6c299d));
  box-shadow: 0 2px 0 var(--accent-shadow, #4a1870), 0 16px 40px -12px rgba(143, 82, 201, 0.7);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.modal-submit:hover { filter: brightness(1.08); }
.modal-submit:active { transform: translateY(1px); }

/* Talk to the founder (founder.js) */
.founder-title { margin: 4px 56px 28px 0; font-size: clamp(26px, 3vw, 32px); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; }
.founder-card { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 20px; }
.founder-avatar {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 72px;
  height: 72px;
  overflow: hidden;
  border: 2px solid var(--s-line);
  border-radius: 50%;
  background: linear-gradient(135deg, #8f52c9, #4a1870);
  font-size: 24px;
  font-weight: 700;
}
.founder-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.founder-who { display: grid; flex: 1; min-width: 160px; }
.founder-who b { font-size: 20px; }
.founder-who span { font-size: 15px; color: var(--s-muted); white-space: nowrap; }
.founder-actions { display: flex; gap: 10px; }
.founder-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: var(--s-surface);
  font-size: 15px;
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.founder-action:hover { background: var(--s-surface-hover); border-color: var(--s-lavender); }
.founder-action svg { width: 20px; height: 20px; }
.founder-quote {
  margin: 28px 0;
  padding: 2px 0 2px 24px;
  border-left: 3px solid var(--s-lavender);
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
  color: #c9c3dc;
}
.founder-reach {
  min-width: 0;
  margin: 0 0 18px;
  padding: 18px 20px 2px;
  border: 1px dashed #4b4170;
  border-radius: 14px;
}
.founder-reach.is-invalid { border-color: var(--s-critical); }
.founder-reach legend { float: left; width: 100%; padding: 0; font-size: 17px; font-weight: 700; }
.founder-reach p { clear: both; margin: 4px 0 16px; padding-top: 4px; font-size: 14px; line-height: 1.5; color: var(--s-muted); }
.founder-sent h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; }
.founder-sent p { margin: 0; font-size: 15px; color: var(--s-muted); }

/* The quiz's first question as an on-page card (score.js, [data-score-inline]) */
.score-inline { position: relative; width: 100%; max-height: none; margin: 0; overflow: visible; text-align: left; }
.score-inline .score-eyebrow { margin: 0 0 18px; }
.score-inline .score-track i { width: 3%; }
.score-inline .score-q { font-size: clamp(18px, 1.6vw, 21px); }
.score-inline .score-options { gap: 8px; }
.score-inline .score-option { padding: 11px 16px; font-size: 15px; }
.score-inline-note { margin: 18px 0 0; font-size: 13px; color: var(--s-muted); }

@media (max-width: 480px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .modal[open], .score-question.is-entering { animation: none; }
  .gauge-fill, .score-track i { transition: none; }
}

/* ---------- Version note (review tool): a toast when a version is picked ---------- */
.version-note {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 210;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 14px 14px 18px;
  border-radius: 14px;
  background: rgba(17, 17, 20, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  color: #fff;
  font-family: var(--font, system-ui, sans-serif);
  font-size: 14px;
  line-height: 1.45;
  animation: note-in 0.3s ease;
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.version-note.is-leaving { opacity: 0; transform: translateY(8px); }
.version-note p { margin: 0; }
.version-note b { font-weight: 600; }
.version-note button { flex: none; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px; background: rgba(255, 255, 255, 0.12); color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.version-note button:hover { background: rgba(255, 255, 255, 0.22); }
@keyframes note-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .version-note { animation: none; transition: none; } }
.version-note a { color: #c3a3f5; text-decoration: underline; text-underline-offset: 3px; }

/* Phones: a smaller switcher, so it covers less of the page */
@media (max-width: 640px) {
  .version-switch { right: 8px; bottom: 8px; padding: 3px; font-size: 12px; }
  .version-switch span { padding: 0 4px 0 8px; }
  .version-switch button { padding: 5px 10px; }
  .version-note { right: 8px; bottom: 52px; }
}

/* Logo (script.js): the base artwork <img> sits under the wave SVG, which sets the size */
.logo-art { position: relative; display: block; width: max-content; }
.logo-art svg { position: relative; display: block; }
.logo-art .logo-base { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
