:root {
  color-scheme: dark;
  --navy: #071421;
  --navy-2: #0d2034;
  --surface: #10263d;
  --surface-2: #14314d;
  --gold: #d6ad55;
  --gold-2: #f0d58a;
  --mint: #74c7a5;
  --text: #f7f2e8;
  --muted: #b9c2ce;
  --faint: #8190a1;
  --border: rgba(214, 173, 85, 0.26);
}

* {
  box-sizing: border-box;
}

/* Keyboard users get a visible ring everywhere; :focus-visible keeps it off
   mouse clicks, so this costs the pointer experience nothing. */
:focus-visible {
  outline: 2px solid var(--gold-2);
  outline-offset: 2px;
  border-radius: 3px;
}

/* First tab stop on every page. Off-screen until focused, then pinned to the
   top-left so it can't be missed. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

/* main takes focus programmatically after a skip-link jump; it should never
   draw a ring of its own for that. */
main:focus {
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  background: var(--navy);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(13, 32, 52, 0.95), var(--navy) 42%),
    radial-gradient(circle at top right, rgba(116, 199, 165, 0.14), transparent 34%);
}

a {
  color: var(--gold-2);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.site-header,
.site-footer,
.hero,
.section,
.policy {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

.nav {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--gold-2);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 44px;
  align-items: center;
  min-height: calc(100vh - 104px);
  padding: 42px 0 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: clamp(3rem, 8vw, 6.5rem);
  line-height: 0.95;
}

h2 {
  font-family: "New York", "Iowan Old Style", Georgia, serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.05;
}

h3 {
  font-size: 1.05rem;
}

.lede {
  max-width: 690px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  border-color: transparent;
  color: #111827;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
}

.proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 34px;
}

.stat,
.feature,
.notice,
.support-box {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 38, 61, 0.82);
}

.stat {
  padding: 16px;
}

.stat strong {
  display: block;
  color: var(--gold-2);
  font-size: 1.35rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-visual {
  display: grid;
  place-items: center;
  padding: 36px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(20, 49, 77, 0.9), rgba(7, 20, 33, 0.9)),
    repeating-linear-gradient(135deg, rgba(214, 173, 85, 0.08) 0, rgba(214, 173, 85, 0.08) 1px, transparent 1px, transparent 16px);
}

.hero-visual img {
  width: min(100%, 340px);
  border-radius: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.section {
  padding: 70px 0;
}

.section-header {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-header p,
.policy p,
.policy li,
.support-box p {
  color: var(--muted);
}

.features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.feature,
.support-box {
  padding: 20px;
}

.feature h3,
.support-box h2,
.support-box h3 {
  color: var(--text);
}

.feature p {
  margin-bottom: 0;
  color: var(--muted);
}

.notice {
  padding: 18px 20px;
  color: var(--muted);
}

.policy {
  max-width: 840px;
  padding: 48px 0 80px;
}

.policy h1 {
  font-size: clamp(2.6rem, 7vw, 4.8rem);
}

.policy h2 {
  margin-top: 34px;
  font-size: 1.45rem;
}

.policy ul {
  padding-left: 22px;
}

.support-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 28px 0 36px;
  color: var(--faint);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- content pages (generated by scripts/generate_website.py) ---- */

.page-hero {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 8px;
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.05;
}

.breadcrumbs {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 14px 0 0;
  color: var(--faint);
  font-size: 0.85rem;
}

.breadcrumbs a {
  color: var(--faint);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--gold-2);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}

.data-table th {
  color: var(--gold-2);
  background: rgba(16, 38, 61, 0.85);
  font-weight: 700;
}

.data-table td {
  color: var(--muted);
}

.data-table td strong {
  color: var(--text);
}

.table-scroll {
  overflow-x: auto;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.link-card {
  display: block;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 38, 61, 0.82);
  color: var(--text);
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--gold);
}

.link-card h3 {
  margin-bottom: 6px;
}

.link-card p,
.link-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.sample-question {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 38, 61, 0.82);
  padding: 18px 20px;
  margin-top: 14px;
}

.sample-question p {
  margin-top: 0;
  color: var(--text);
}

.sample-question ol {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--muted);
}

.sample-question details {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 12px;
}

.sample-question summary {
  color: var(--gold-2);
  font-weight: 700;
  cursor: pointer;
}

.sample-question .answer {
  margin-top: 10px;
  color: var(--muted);
}

.sample-question .answer strong {
  color: var(--mint);
}

.sample-question .source {
  margin-top: 8px;
  color: var(--faint);
  font-size: 0.85rem;
}

.term-list {
  margin: 0;
}

.term-list dt {
  margin-top: 22px;
  font-weight: 800;
  color: var(--gold-2);
  font-size: 1.05rem;
}

.term-list dd {
  margin: 6px 0 0;
  color: var(--muted);
}

.formula-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(16, 38, 61, 0.82);
  padding: 20px;
  margin-top: 14px;
}

.formula-card .formula {
  display: block;
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(7, 20, 33, 0.85);
  color: var(--gold-2);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.95rem;
  overflow-x: auto;
}

.formula-card .worked {
  margin-top: 12px;
  color: var(--muted);
}

.formula-card .worked li {
  margin-top: 4px;
}

.formula-card .worked .result {
  color: var(--mint);
  font-weight: 700;
}

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px 28px;
  background:
    linear-gradient(135deg, rgba(20, 49, 77, 0.95), rgba(7, 20, 33, 0.95)),
    repeating-linear-gradient(135deg, rgba(214, 173, 85, 0.07) 0, rgba(214, 173, 85, 0.07) 1px, transparent 1px, transparent 14px);
}

.cta-banner p {
  color: var(--muted);
  max-width: 640px;
}

.weight-bar {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.weight-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
}

.anchor-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 6px;
}

.anchor-index a {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.85rem;
  text-decoration: none;
}

.anchor-index a:hover {
  color: var(--gold-2);
  border-color: var(--gold);
}

/* ---- in-browser practice quiz (assets/quiz.js) ---- */

.quiz-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(16, 38, 61, 0.82);
  padding: 26px 28px;
}

.quiz-header h2 {
  margin-bottom: 6px;
}

.quiz-sub {
  color: var(--muted);
}

.quiz-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.quiz-mode {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 20, 33, 0.6);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quiz-mode:hover {
  border-color: var(--gold);
}

.quiz-mode span {
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-meta {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  color: var(--faint);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

.quiz-timer {
  color: var(--gold-2);
  font-weight: 800;
}

.quiz-question {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 600;
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.quiz-option {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(7, 20, 33, 0.6);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.quiz-option:hover:enabled {
  border-color: var(--gold);
}

/* Correctness carries a glyph as well as a colour. Colour alone fails WCAG
   1.4.1 and disappears entirely in forced-colours mode. */
.quiz-option.correct,
.quiz-option.wrong {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quiz-option.correct::before,
.quiz-option.wrong::before {
  flex: 0 0 auto;
  font-weight: 900;
  font-size: 1.05em;
  line-height: 1;
}

.quiz-option.correct {
  border-color: var(--mint);
  background: rgba(116, 199, 165, 0.14);
}

.quiz-option.correct::before {
  content: "\2713"; /* check */
  color: var(--mint);
}

.quiz-option.wrong {
  border-color: #d97066;
  background: rgba(217, 112, 102, 0.14);
}

.quiz-option.wrong::before {
  content: "\2717"; /* ballot x */
  color: #d97066;
}

.quiz-feedback {
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 14px;
}

.quiz-right {
  color: var(--mint);
  font-weight: 800;
}

.quiz-wrong {
  color: #d97066;
  font-weight: 800;
}

.quiz-explanation {
  color: var(--muted);
}

.quiz-source {
  color: var(--faint);
  font-size: 0.85rem;
}

.quiz-next,
.quiz-restart {
  margin-top: 14px;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.quiz-readiness {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 18px;
}

.quiz-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.quiz-ring-inner {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: var(--navy-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.quiz-ring-inner strong {
  color: var(--gold-2);
  font-size: 1.2rem;
}

.quiz-ring-inner span {
  color: var(--faint);
  font-size: 0.75rem;
}

.quiz-topic-bars {
  flex: 1;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quiz-topic-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) 2fr auto;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.quiz-topic-pct {
  color: var(--gold-2);
  font-weight: 700;
}

@media (max-width: 820px) {
  .card-grid,
  .card-grid.two {
    grid-template-columns: 1fr;
  }

  .page-hero,
  .breadcrumbs {
    width: min(100% - 28px, 1120px);
  }

  .site-header,
  .site-footer,
  .hero,
  .section,
  .policy {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 24px;
  }

  .hero-visual {
    padding: 24px;
  }

  .proof,
  .features,
  .support-grid {
    grid-template-columns: 1fr;
  }
}
