/* =========================================================
   Mongolian Customs Examination
   Editorial / civic / institutional aesthetic
   ========================================================= */

:root {
  /* Surfaces */
  --bg:           #F4EFE4;          /* warm parchment */
  --bg-tint:      #FBF7EE;
  --surface:      #FFFFFF;
  --surface-warm: #FAF6EC;

  /* Ink */
  --ink:          #161A22;
  --ink-soft:     #4A5060;
  --ink-mute:     #8B8F9C;
  --ink-faint:    #B6B6BD;

  /* Brand */
  --blue:         #1F4E9C;
  --blue-deep:    #0E2B5C;
  --blue-soft:    #E8EEF8;

  /* Accent */
  --gold:         #B58A3D;
  --gold-deep:    #8C6628;
  --gold-soft:    #F1E6CD;

  /* States */
  --correct:      #2E6B47;
  --correct-soft: #DDEBE2;
  --wrong:        #B23A3A;
  --wrong-soft:   #F2DCDC;

  /* Rules */
  --rule:         rgba(20, 22, 30, 0.14);
  --rule-soft:    rgba(20, 22, 30, 0.07);

  /* Type */
  --serif:  "Cormorant Garamond", "EB Garamond", Georgia, "Noto Serif", serif;
  --sans:   "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:   "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Layout */
  --max:     880px;
  --pad:     clamp(20px, 4vw, 56px);
  --header-h: 84px;

  /* Motion */
  --ease:   cubic-bezier(.22, .61, .36, 1);
}

/* === Reset === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(31, 78, 156, 0.05), transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(181, 138, 61, 0.04), transparent 70%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.035 0'/></filter><rect width='240' height='240' filter='url(%23n)'/></svg>");
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga";
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, button { font-family: inherit; }
em { font-style: italic; }

/* === Sticky Header === */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(244, 239, 228, 0.85);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px var(--pad);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  text-align: left;
  transition: opacity .2s var(--ease);
}
.brand:hover { opacity: .7; }
.brand-logo { width: 38px; height: 38px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-mn {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--blue-deep);
  letter-spacing: 0.005em;
}
.brand-en {
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 2px;
}

.section-pills {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.section-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 14px 8px;
  border-radius: 0;
  transition: color .2s var(--ease);
  color: var(--ink-mute);
}
.section-pill:hover { color: var(--ink); }
.section-pill[data-active="true"] { color: var(--blue-deep); }
.section-pill[data-complete="true"] { color: var(--gold-deep); }
.section-pill .pill-num {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1;
}
.section-pill .pill-bar {
  width: 100%;
  height: 2px;
  background: var(--rule-soft);
  position: relative;
  overflow: hidden;
}
.section-pill .pill-bar::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--blue);
  transform: scaleX(var(--p, 0));
  transform-origin: left center;
  transition: transform .5s var(--ease);
}
.section-pill[data-complete="true"] .pill-bar::after { background: var(--gold); }
.section-pill[data-active="true"] .pill-bar { background: var(--rule); }

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.btn-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-mute);
  border: 1px solid var(--rule);
  background: transparent;
  border-radius: 0;
  transition: all .18s var(--ease);
  white-space: nowrap;
}
.btn-reset:hover {
  color: var(--wrong);
  border-color: var(--wrong);
}
.btn-reset svg {
  transition: transform .4s var(--ease);
}
.btn-reset:hover svg { transform: rotate(-180deg); }

.progress-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.1;
}
.progress-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 4px;
}
.progress-num {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.progress-num em { color: var(--ink-faint); margin: 0 2px; }

.progress-bar {
  height: 2px;
  background: transparent;
  position: relative;
}
.progress-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-deep));
  transition: width .45s var(--ease);
}

/* === Main wrapper === */
main { display: block; }
.view {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
  animation: viewIn .6s var(--ease) both;
}
.view[hidden] { display: none; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Landing === */
.landing-frame {
  padding: clamp(40px, 9vh, 96px) 0 clamp(40px, 9vh, 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.landing-mark {
  margin-bottom: 36px;
  animation: rise .9s var(--ease) .05s both;
}
.landing-logo {
  width: clamp(96px, 14vw, 132px);
  height: auto;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  animation: rise .9s var(--ease) .15s both;
}
.eyebrow-rule {
  display: block;
  width: 48px;
  height: 1px;
  background: var(--rule);
}
.eyebrow-text {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 500;
}

.landing-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.5rem, 10vw, 6.5rem);
  line-height: 0.92;
  color: var(--blue-deep);
  letter-spacing: -0.012em;
  margin-bottom: 18px;
  animation: rise 1s var(--ease) .25s both;
}
.landing-title span { display: inline-block; }
.landing-title em {
  display: block;
  font-style: italic;
  font-weight: 500;
  color: var(--blue);
  margin-top: -0.06em;
}

.landing-sub {
  font-size: 13px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
  margin-bottom: 44px;
  animation: rise .9s var(--ease) .35s both;
}

.ornament {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 44px;
  animation: rise .9s var(--ease) .4s both;
}
.orn-line { width: 36px; height: 1px; background: var(--gold); opacity: .5; }
.orn-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--gold);
}

.landing-meta {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 28px;
  margin-bottom: 56px;
  animation: rise .9s var(--ease) .5s both;
}
.meta-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 90px;
}
.meta-item dt {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.meta-item dd {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1;
}
.meta-divider {
  width: 1px;
  background: var(--rule);
  margin: 4px 0;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 36px;
  background: var(--blue-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: 0;
  position: relative;
  transition: all .25s var(--ease);
  animation: rise .9s var(--ease) .6s both;
}
.btn-primary:hover {
  background: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 18px 32px -16px rgba(31, 78, 156, .55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { transition: transform .25s var(--ease); }
.btn-primary:hover svg { transform: translateX(4px); }

.landing-foot {
  margin-top: 28px;
  font-size: 12px;
  color: var(--ink-mute);
  font-style: italic;
  font-family: var(--serif);
  animation: rise .9s var(--ease) .7s both;
}

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

/* === Quiz section === */
.quiz-section {
  padding: 56px 0 96px;
}

.section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 56px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.section-head::after {
  content: "";
  position: absolute;
  left: 0; bottom: -1px;
  width: 96px; height: 2px;
  background: var(--blue);
}
.section-roman {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(64px, 12vw, 112px);
  line-height: 1;
  color: var(--gold);
  letter-spacing: 0;
  margin-bottom: 12px;
}
.section-eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
  font-weight: 500;
}
.section-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 4.5vw, 42px);
  line-height: 1.15;
  color: var(--blue-deep);
  letter-spacing: -0.005em;
  max-width: 820px;
}
.section-meta {
  display: flex; gap: 24px;
  margin-top: 20px;
  font-size: 12px;
  color: var(--ink-mute);
  letter-spacing: 0.06em;
  font-family: var(--mono);
}

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 56px;
}

.question-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: clamp(16px, 3vw, 32px);
  align-items: start;
  scroll-margin-top: calc(var(--header-h) + 24px);
}
@media (max-width: 600px) {
  .question-card { grid-template-columns: 1fr; gap: 8px; }
}

.q-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 44px;
  color: var(--ink-faint);
  line-height: 1;
  text-align: right;
  user-select: none;
  font-feature-settings: "lnum";
  transition: color .25s var(--ease);
  padding-top: 4px;
}
@media (max-width: 600px) {
  .q-num { text-align: left; font-size: 32px; }
}
.question-card[data-answered="true"] .q-num { color: var(--blue); }

.q-body { display: flex; flex-direction: column; }

.q-text {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 22px;
  font-weight: 400;
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.q-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--rule);
  cursor: pointer;
  transition: all .18s var(--ease);
  user-select: none;
}
.q-option:hover {
  background: var(--surface-warm);
  border-color: var(--ink-faint);
}
.q-option input { position: absolute; opacity: 0; pointer-events: none; }
.q-option .opt-letter {
  flex-shrink: 0;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-mute);
  background: transparent;
  transition: all .2s var(--ease);
  margin-top: 2px;
}
.q-option .opt-text {
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.q-option[data-selected="true"] {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}
.q-option[data-selected="true"] .opt-letter {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.q-option[data-selected="true"] .opt-text {
  color: var(--ink);
}

/* Review states (results page) */
.q-option[data-state="correct"] {
  background: var(--correct-soft);
  border-color: var(--correct);
  box-shadow: inset 3px 0 0 var(--correct);
}
.q-option[data-state="correct"] .opt-letter {
  background: var(--correct); border-color: var(--correct); color: #fff;
}
.q-option[data-state="wrong"] {
  background: var(--wrong-soft);
  border-color: var(--wrong);
  box-shadow: inset 3px 0 0 var(--wrong);
}
.q-option[data-state="wrong"] .opt-letter {
  background: var(--wrong); border-color: var(--wrong); color: #fff;
}

/* === Section nav (footer of quiz section) === */
.section-nav {
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.btn-secondary {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 20px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  background: transparent;
  transition: all .2s var(--ease);
}
.btn-secondary:hover:not(:disabled) {
  color: var(--ink);
  border-color: var(--ink);
  background: var(--surface);
}
.btn-secondary:disabled {
  opacity: .35; cursor: not-allowed;
}
.btn-secondary svg { transition: transform .25s var(--ease); }
.btn-secondary:hover:not(:disabled) svg.right { transform: translateX(3px); }
.btn-secondary:hover:not(:disabled) svg.left  { transform: translateX(-3px); }

.section-nav-meta {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-mute);
  font-size: 14px;
}

.btn-finish {
  background: var(--blue-deep);
  color: #fff;
  border-color: var(--blue-deep);
}
.btn-finish:hover:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* === Results === */
.results-frame {
  padding: 56px 0 96px;
}
.results-eyebrow {
  font-size: 11px; letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--ink-mute); font-weight: 500;
  margin-bottom: 24px; text-align: center;
}
.score-hero {
  text-align: center;
  padding: 32px 0 56px;
  border-bottom: 1px solid var(--rule);
  position: relative;
}
.score-num {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(96px, 18vw, 180px);
  line-height: 0.9;
  color: var(--blue-deep);
  letter-spacing: -0.02em;
  font-feature-settings: "lnum";
}
.score-num .slash {
  font-style: italic;
  font-weight: 300;
  color: var(--gold);
  margin: 0 0.04em;
}
.score-num .total {
  color: var(--ink-mute);
  font-weight: 300;
  font-size: 0.55em;
  vertical-align: 0.32em;
}
.score-pct {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.18em;
  color: var(--ink-soft);
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.score-verdict {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--gold-deep);
  margin-top: 18px;
}

.section-breakdown {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 56px 0;
  background: var(--rule);
  border: 1px solid var(--rule);
}
@media (max-width: 700px) {
  .section-breakdown { grid-template-columns: 1fr; }
}
.breakdown-cell {
  background: var(--surface);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.breakdown-roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 28px;
  color: var(--gold);
  line-height: 1;
}
.breakdown-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
  min-height: 2.6em;
}
.breakdown-score {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--blue-deep);
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.breakdown-score em {
  color: var(--ink-faint); font-style: normal; font-weight: 400;
}
.breakdown-bar {
  height: 4px; background: var(--rule-soft);
  position: relative; overflow: hidden;
  margin-top: 6px;
}
.breakdown-bar::after {
  content: ""; position: absolute; inset: 0;
  background: var(--blue);
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  transition: transform 1s var(--ease);
}

.results-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin: 40px 0;
  flex-wrap: wrap;
}

.review-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin: 40px 0 0;
  cursor: pointer;
  user-select: none;
}
.review-toggle:hover .review-toggle-label { color: var(--ink); }
.review-toggle-label {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color .2s var(--ease);
}
.review-toggle-icon {
  transition: transform .3s var(--ease);
}
.review-toggle[data-open="true"] .review-toggle-icon { transform: rotate(45deg); }

.review-list {
  display: none;
  flex-direction: column;
  gap: 56px;
  margin-top: 48px;
}
.review-list[data-open="true"] { display: flex; }

.review-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: clamp(16px, 3vw, 32px);
}
@media (max-width: 600px) {
  .review-item { grid-template-columns: 1fr; gap: 8px; }
}
.review-section-tag {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
  margin-bottom: 8px;
}

/* === Question Navigator (fixed footer, 1-row scrollable) === */
.qnav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(244, 239, 228, 0.88);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--rule);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px));
}
.qnav-progress {
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 2px;
  background: var(--rule-soft);
  z-index: 4;
  overflow: hidden;
}
.qnav-progress-fill {
  position: absolute; inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, var(--blue), var(--blue-deep));
  transition: width .45s var(--ease);
}
/* Soft fade on left/right edges to indicate horizontal scroll */
.qnav::before,
.qnav::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 56px;
  pointer-events: none;
  z-index: 2;
}
.qnav::before {
  left: 44px;
  background: linear-gradient(90deg, rgba(244, 239, 228, 0.95), transparent);
}
.qnav::after {
  right: 44px;
  background: linear-gradient(270deg, rgba(244, 239, 228, 0.95), transparent);
}

/* Edge arrow buttons */
.qnav-arrow {
  position: absolute;
  top: 0; bottom: 0;
  width: 44px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(244, 239, 228, 0.92);
  color: var(--ink-soft);
  border: 0;
  cursor: pointer;
  transition: color .18s var(--ease), background .18s var(--ease), opacity .18s var(--ease);
}
.qnav-arrow:hover:not(:disabled) {
  color: var(--blue-deep);
  background: var(--surface);
}
.qnav-arrow:disabled {
  opacity: 0;
  pointer-events: none;
}
.qnav-arrow-left  { left: 0;  border-right: 1px solid var(--rule-soft); }
.qnav-arrow-right { right: 0; border-left:  1px solid var(--rule-soft); }

.qnav-track {
  display: flex;
  align-items: center;
  gap: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  padding: 4px 56px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  cursor: grab;
  user-select: none;
}
.qnav-track.is-dragging { cursor: grabbing; scroll-behavior: auto; }
.qnav-track.is-dragging .qnav-cell { pointer-events: none; }
.qnav-track::-webkit-scrollbar { display: none; } /* Webkit */

.qnav-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.qnav-group + .qnav-group {
  position: relative;
  padding-left: 18px;
}
.qnav-group + .qnav-group::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 1px; height: 22px;
  background: var(--rule);
  transform: translateY(-50%);
}
.qnav-group-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  flex-shrink: 0;
  padding: 0 2px;
}
.qnav-group-roman {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  font-weight: 500;
  color: var(--gold);
  line-height: 1;
}
.qnav-group-count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-mute);
  letter-spacing: 0.08em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.qnav-cells {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.qnav-cell {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-mute);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  user-select: none;
  flex-shrink: 0;
  scroll-margin: 0 80px;
}
.qnav-cell:hover {
  border-color: var(--blue);
  color: var(--blue-deep);
}
.qnav-cell[data-answered="true"] {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.qnav-cell[data-answered="true"]:hover {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
}
.qnav-cell[data-active="true"] {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.qnav-cell[data-state="correct"] {
  background: var(--correct);
  border-color: var(--correct);
  color: #fff;
}
.qnav-cell[data-state="wrong"] {
  background: var(--wrong);
  border-color: var(--wrong);
  color: #fff;
}

/* Push site footer above fixed nav */
body { padding-bottom: 60px; }
.site-foot { display: none; }

@media (max-width: 600px) {
  .qnav-cell { width: 28px; height: 28px; font-size: 10px; }
  .qnav-group-roman { font-size: 18px; }
  body { padding-bottom: 56px; }
}

/* === Footer === */
.site-foot {
  margin-top: 64px;
  padding: 32px var(--pad);
  border-top: 1px solid var(--rule);
}
.foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.foot-sep { color: var(--gold); font-size: 10px; }

/* === Responsive === */
@media (max-width: 720px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px var(--pad);
  }
  .brand-text { display: none; }
  .section-pills { grid-column: 1 / -1; order: 2; justify-content: flex-start; }
  .header-right { order: 1; gap: 10px; }
  .btn-reset span { display: none; }
  .btn-reset { padding: 7px 9px; }
}
@media (max-width: 460px) {
  .progress-label { display: none; }
}

/* selection */
::selection { background: var(--blue-soft); color: var(--blue-deep); }
