/* Visual language follows the v10 consent gate and survey pages: Fraunces
   headings, IBM Plex Sans body, maroon actions, teal selections. */

:root {
  --ink: #172126;
  --ink-muted: #536167;
  --marker-grey: #8a9894;
  --paper: #ffffff;
  --canvas: #f6f7f4;
  --rule: #dfe5e2;
  --rule-strong: #aeb9b5;
  --accent: #8b1e3f;
  --accent-dark: #67132d;
  --teal: #086f68;
  --teal-mid: #3d8c78;
  --teal-soft: #e5f4f1;
  --ghost: #cfd8d5;
  --focus: #b7791f;
  --error: #a12622;
}

* { box-sizing: border-box; }

html {
  background: var(--canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  font-family: 'IBM Plex Sans', -apple-system, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  overflow-x: clip;
}

button, input { font: inherit; }

a { color: var(--accent); text-underline-offset: 0.18em; }

.loading { padding: 64px 24px; text-align: center; color: var(--ink-muted); }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 16px 12px;
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 28px);
}

.logos img { display: block; width: auto; }
.logo-mit { height: 26px; }
.logo-harvard { height: 32px; }
.logo-northwestern { height: 21px; }

.progress {
  width: min(760px, 100%);
  margin: 12px auto 0;
}

.progress__label {
  margin-bottom: 6px;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.progress__track {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--rule);
}

.progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal) 0%, var(--teal-mid) 100%);
  transition: width 300ms ease;
}

.demo-banner {
  width: min(760px, 100%);
  margin: 10px auto 0;
  padding: 6px 12px;
  border-left: 4px solid #9a7b16;
  border-radius: 3px;
  background: #fff4bd;
  color: #4d3c08;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ---------------------------------------------------------------- page */

.page {
  padding: clamp(20px, 4vw, 40px) 16px 64px;
}

.card {
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(22px, 4.5vw, 44px);
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 1px 2px rgba(23, 33, 38, 0.04), 0 12px 32px rgba(23, 33, 38, 0.06);
  animation: rise 260ms ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.title {
  margin: 0 0 18px;
  font-family: 'Fraunces', Georgia, serif;
  font-size: clamp(1.75rem, 4.2vw, 2.35rem);
  font-variation-settings: "opsz" 48;
  font-weight: 400;
  line-height: 1.15;
}

.title mark.content-type-variation { font-weight: 500; }

.prose { margin: 0 0 14px; }
.prose--muted { color: var(--ink-muted); font-size: 0.95rem; }

.type-description {
  margin: -8px 0 18px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.reminder {
  margin: 0 0 16px;
  padding: 14px 16px;
  border-left: 4px solid var(--teal);
  border-radius: 4px;
  background: #f4f9f7;
}

.question { margin-top: 4px; }

mark { background: none; color: inherit; }

.key-term {
  padding: 0 0.18em;
  border-radius: 3px;
  background: rgba(45, 74, 43, 0.08);
  color: #2d4a2b;
  font-weight: 650;
}

.content-type-variation {
  padding: 0.04em 0.26em;
  border-radius: 4px;
  background: #dff2e7;
  box-shadow: inset 0 -2px 0 #7cad91;
  color: #214d36;
  font-weight: 700;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.steps {
  margin: 4px 0 18px;
  padding-left: 1.2em;
}

.steps li { margin-bottom: 6px; }
.steps li::marker { color: var(--teal); }

.check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 16px 0 8px;
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--teal);
}

.irb { margin: 6px 0 0; color: var(--ink-muted); font-size: 0.82rem; }

/* ---------------------------------------------------------------- actions */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.button {
  min-height: 46px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}

.button:focus-visible,
.belief-chart__svg:focus-visible,
.check input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, white);
  outline-offset: 3px;
}

.button:disabled { cursor: not-allowed; opacity: 0.55; }

.button--primary { border-color: var(--accent); background: var(--accent); color: white; }
.button--primary:hover:not(:disabled) { border-color: var(--accent-dark); background: var(--accent-dark); }
.button--secondary { border-color: var(--rule-strong); background: white; color: var(--ink); }
.button--secondary:hover { background: #f4f6f5; }

.confirm-note,
.submit-error {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.confirm-note { border: 1px solid #e3cf86; background: #fff8dc; }
.submit-error { border: 1px solid #e6b8b6; background: #fbeceb; color: var(--error); }

/* ---------------------------------------------------------------- chart */

.chart-host,
.practice {
  margin: 8px -6px 0;
}

.practice {
  margin-top: 4px;
  padding: 12px 10px 4px;
  border: 1px dashed var(--rule-strong);
  border-radius: 10px;
}

.practice__label {
  margin: 0 4px 6px;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.belief-chart { width: 100%; }

.belief-chart__svg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.belief-chart__track { fill: #f3f5f4; transition: fill 120ms ease; }
.belief-chart__track--special { fill: #f1f0ec; }
.belief-chart__track.is-active { fill: var(--teal-soft); }

.belief-chart__ghost { fill: var(--ghost); }

.belief-chart__bar { fill: var(--teal); }
.belief-chart__bar.is-active { fill: #0a8a81; }
.belief-chart__bar--special { stroke: var(--teal); stroke-width: 1; }
.belief-chart__hatch-bg { fill: var(--teal); }
.belief-chart__hatch-line { stroke: #4fa69c; stroke-width: 2.5; }

.belief-chart__pct {
  fill: var(--ink);
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linejoin: round;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.belief-chart__pct.is-active { fill: var(--teal); font-size: 12px; }

.belief-chart__axis { stroke: #8a9894; stroke-width: 1.4; }
.belief-chart__tick { stroke: #8a9894; stroke-width: 1.2; }
.belief-chart__break { stroke: var(--ink-muted); stroke-width: 1.6; fill: none; }

.belief-chart__tick-label {
  fill: var(--ink);
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
}

.belief-chart__tick-label--special { font-weight: 700; }
.belief-chart__tick-label--accent { fill: var(--accent); font-size: 12px; font-weight: 700; }

.belief-chart__axis-title {
  fill: var(--ink-muted);
  font-size: 12px;
  font-style: italic;
  pointer-events: none;
}

.belief-chart__marker {
  stroke: var(--marker-grey);
  stroke-width: 1.8;
  stroke-dasharray: 5 4;
  pointer-events: none;
}

.belief-chart__fine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 2.2em;
  margin: 6px 6px 0;
}

.belief-chart__readout {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.belief-chart__stepper { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.belief-chart__stepper-label { margin-right: 4px; color: var(--ink-muted); font-size: 0.92rem; white-space: nowrap; }
.belief-chart__stepper-label strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.belief-chart__stepper[hidden] { display: none; }

.belief-chart__step {
  min-width: 52px;
  padding: 5px 10px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: var(--paper);
  color: var(--teal);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.belief-chart__step:hover:not(:disabled) { background: var(--teal-soft); }
.belief-chart__step:disabled { border-color: var(--rule-strong); color: var(--ink-muted); cursor: default; opacity: 0.6; }

.belief-chart__readout strong { color: var(--ink); }
.belief-chart__readout-muted { color: var(--ink-muted); }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.legend__item { display: flex; align-items: center; gap: 7px; }

.legend__swatch { flex: none; display: inline-block; width: 14px; height: 12px; border-radius: 2px; }
.legend__swatch--bar { background: var(--teal); }
.legend__swatch--ghost { background: var(--ghost); }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .site-header { position: static; padding: 10px 16px; }
  .progress { margin-top: 8px; }
  .logo-mit { height: 21px; }
  .logo-harvard { height: 26px; }
  .logo-northwestern { height: 17px; }
  .card { padding: 20px 16px 24px; border-radius: 12px; }
  .actions .button { flex: 1 1 auto; }
}

/* ---------------------------------------------------------------- tutorial */

.example {
  margin: 18px 0 14px;
  padding: 14px 12px 10px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: #fbfcfb;
}

.example__caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.example__tag {
  padding: 1px 7px;
  border-radius: 99px;
  background: #eef1ef;
  color: var(--ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.belief-chart--static .belief-chart__svg { cursor: default; }
.belief-chart--static .belief-chart__readout { margin-top: 2px; }

.example-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 6px 0 4px;
}

.example-pair .example { margin: 10px 0 8px; }
.example-pair__text { margin: 0 2px; font-size: 0.95rem; }

.guide {
  margin: 4px 0 18px;
  padding: 14px 16px 6px;
  border-radius: 8px;
  background: #f4f9f7;
}

.guide__title {
  margin: 0 0 6px;
  font-weight: 700;
}

.guide__frequency {
  margin: 0 0 10px;
  padding-top: 10px;
  border-top: 1px solid #dcebe6;
}

.axis-break-glyph {
  padding: 0 0.2em;
  color: var(--ink-muted);
  font-weight: 700;
  letter-spacing: -0.08em;
}

.quiz {
  margin: 22px 0 0;
  padding: 16px;
  border: 1px solid var(--rule);
  border-radius: 10px;
}

.quiz__question { margin: 0 0 12px; font-weight: 600; }

.quiz__choices { display: flex; flex-wrap: wrap; gap: 8px; }

.button--choice {
  min-width: 84px;
  border-color: var(--rule-strong);
  background: white;
  color: var(--ink);
}

.button--choice:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-soft); }
.button--choice.is-right, .button--choice.is-right:disabled { border-color: var(--teal); background: var(--teal); color: white; opacity: 1; }
.button--choice.is-wrong { border-color: #d9a3a1; background: #fbeceb; color: var(--error); }

.quiz__feedback {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 0.95rem;
}

.quiz__feedback--right { background: var(--teal-soft); color: #0b4f4a; }
.quiz__feedback--wrong { background: #fbeceb; color: #7a2727; }

.tips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 4px 0 6px;
  padding: 0;
  list-style: none;
  font-size: 0.93rem;
}

.tips li {
  padding: 7px 10px;
  border-radius: 6px;
  background: #f4f6f5;
}

@media (max-width: 560px) {
  .example-pair { grid-template-columns: 1fr; gap: 0; }
  .tips { grid-template-columns: 1fr; }
}

.example-pair + .prose { margin-top: 16px; }

/* ---------------------------------------------------------------- chart header */

.belief-chart__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 14px;
  margin: 0 6px 8px;
}

.belief-chart__average {
  font-size: 1rem;
  line-height: 1.35;
}

.belief-chart__average-label { color: var(--ink-muted); }
.belief-chart__average strong { color: var(--teal); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.belief-chart__initial {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.belief-chart__initial strong { color: var(--ink-muted); font-size: 1rem; font-variant-numeric: tabular-nums; }
.belief-chart__initial-parts { font-size: 0.88rem; }

.belief-chart__initial-swatch {
  flex: none;
  width: 2px;
  height: 16px;
  background: repeating-linear-gradient(to bottom, var(--marker-grey) 0 4px, transparent 4px 7px);
}

.belief-chart__average-note {
  display: block;
  color: var(--ink-muted);
  font-size: 0.8rem;
}

.belief-chart__average-note.is-placeholder { visibility: hidden; }
.belief-chart__stepper-label strong { display: inline-block; min-width: 2.6ch; text-align: right; }

.belief-chart__plot { position: relative; }

.belief-chart__shape {
  position: absolute;
  z-index: 1;
  padding: 5px 11px;
  border: 1px solid var(--teal);
  border-radius: 99px;
  background: white;
  color: var(--teal);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 33, 38, 0.08);
}

.belief-chart__shape:hover { background: var(--teal-soft); }
.belief-chart__shape:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, white); outline-offset: 2px; }

.belief-chart__shape.is-above { position: static; display: block; margin: 0 0 6px auto; }

@media (max-width: 560px) {
  .belief-chart__shape { padding: 4px 9px; font-size: 0.8rem; }
}

.belief-chart__extend {
  margin-left: auto;
  padding: 6px 12px;
  border: 1px solid var(--teal);
  border-radius: 99px;
  background: white;
  color: var(--teal);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.belief-chart__extend:hover:not(:disabled) { background: var(--teal-soft); }
.belief-chart__extend:disabled { border-color: var(--rule-strong); color: var(--ink-muted); cursor: not-allowed; opacity: 0.6; }
.belief-chart__extend:focus-visible { outline: 3px solid color-mix(in srgb, var(--focus) 70%, white); outline-offset: 2px; }

@media (max-width: 560px) {
  .belief-chart__tick-label { font-size: 13px; }
}
