/* ============================================================
   NSW Rigid Licence Test Prep — Shared Stylesheet
   Design language: Australian road signage — warning yellow,
   route green, regulatory red, asphalt dark, condensed display type.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Karla:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  /* --- Colour tokens --- */
  --asphalt: #1E2226;
  --asphalt-2: #2A2F35;
  --paper: #FAF9F6;
  --paper-2: #F1EFE9;
  --ink: #20242A;
  --ink-soft: #565C64;
  --line: #DEDAD0;

  --yellow: #FFC629;
  --yellow-ink: #4A3600;
  --green: #0B6E4F;
  --green-soft: #E4F3EC;
  --red: #D7263D;
  --red-soft: #FCE8EA;
  --blue: #1D5B9E;
  --blue-soft: #E7EFF8;

  /* --- Type --- */
  --font-display: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Karla', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* --- Layout --- */
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-card: 0 1px 2px rgba(30,34,38,0.06), 0 4px 16px rgba(30,34,38,0.06);
  --shadow-pop: 0 8px 28px rgba(30,34,38,0.16);
  --maxw: 1080px;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
  color: var(--asphalt);
}
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); font-weight: 700; line-height: 1.05; text-transform: uppercase; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); text-transform: uppercase; }
h3 { font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.02em; }
p { margin: 0 0 1em; color: var(--ink); }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Lane-marker divider (signature element) ---------- */
.lane-divider {
  height: 6px;
  margin: 40px 0;
  background-image: repeating-linear-gradient(
    to right, var(--yellow) 0 28px, transparent 28px 46px
  );
  background-position: 0 center;
  background-repeat: repeat-x;
  background-size: 46px 6px;
  border-radius: 3px;
  opacity: 0.9;
}
.lane-divider.tight { margin: 24px 0; height: 4px; background-size: 34px 4px; background-image: repeating-linear-gradient(to right, var(--yellow) 0 20px, transparent 20px 34px); }

/* ---------- Top nav ---------- */
.site-nav {
  background: var(--asphalt);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 4px solid var(--yellow);
}
.site-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #fff;
  text-decoration: none;
}
.brand-badge {
  width: 34px; height: 34px;
  background: var(--yellow);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transform: rotate(45deg);
  flex: none;
}
.brand-badge span {
  transform: rotate(-45deg);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--asphalt);
  font-size: 15px;
}
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 0.65rem; color: #B9BEC4; text-transform: none; letter-spacing: 0.01em; }

.nav-links { display: flex; gap: 4px; align-items: center; }
.nav-links a {
  color: #D8DBDE;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav-links a:hover { background: var(--asphalt-2); color: #fff; }
.nav-links a.active { background: var(--yellow); color: var(--yellow-ink); }
.nav-toggle { display: none; }

@media (max-width: 720px) {
  .nav-links { position: fixed; inset: 68px 0 auto 0; background: var(--asphalt); flex-direction: column; align-items: stretch; padding: 8px; gap: 2px; border-bottom: 4px solid var(--yellow); transform: translateY(-110%); transition: transform 0.2s ease; }
  .nav-links.open { transform: translateY(0); }
  .nav-links a { padding: 14px 16px; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; background: transparent; border: 2px solid #4A5058; border-radius: var(--radius-sm); color: #fff; font-size: 1.2rem; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.92rem;
  padding: 14px 26px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--yellow); color: var(--yellow-ink); box-shadow: var(--shadow-card); }
.btn-primary:hover { box-shadow: var(--shadow-pop); }
.btn-dark { background: var(--asphalt); color: #fff; }
.btn-dark:hover { background: var(--asphalt-2); }
.btn-outline { background: transparent; border-color: var(--asphalt); color: var(--asphalt); }
.btn-outline:hover { background: var(--asphalt); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #095d42; }
.btn-sm { padding: 9px 16px; font-size: 0.78rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 24px;
}
.card-hover { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-pop); }

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 860px) { .mode-grid { grid-template-columns: 1fr; } }

.mode-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-pop); }
.mode-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 6px;
  background: var(--accent, var(--yellow));
}
.mode-card .mode-icon { font-size: 2rem; margin-bottom: 14px; display: block; }
.mode-card h3 { margin-bottom: 8px; }
.mode-card p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.94rem; }

/* ---------- Badges / tags ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 100px;
  text-transform: none;
}
.badge-RUH { background: var(--blue-soft); color: var(--blue); }
.badge-HVH { background: #FDEEDA; color: #92530A; }
.badge-LRG { background: #F1E6FB; color: #6A2FA8; }
.badge-HVDH { background: var(--red-soft); color: var(--red); }
.badge-cat { background: var(--paper-2); color: var(--ink-soft); }
.badge-source-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Filter chips ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.86rem;
  background: #fff;
  border: 1.5px solid var(--line);
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 100px;
  transition: all 0.12s ease;
}
.chip:hover { border-color: var(--asphalt); color: var(--ink); }
.chip.active { background: var(--asphalt); border-color: var(--asphalt); color: #fff; }

/* ---------- Question card ---------- */
.qid {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.question-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}
.question-card .qhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 10px;
}
.question-text { font-size: 1.08rem; font-weight: 600; color: var(--asphalt); margin-bottom: 14px; }
.question-image { margin: 10px 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--paper-2); text-align: center; }
.question-image img { margin: 0 auto; max-height: 220px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  transition: border-color 0.12s ease, background 0.12s ease;
}
.option-letter {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 0.76rem;
  color: var(--ink-soft);
  background: #fff;
}
button.option { width: 100%; text-align: left; cursor: pointer; font-size: 0.98rem; color: var(--ink); }
button.option:hover:not([disabled]) { border-color: var(--asphalt); }
button.option[disabled] { cursor: default; }

.option.correct { background: var(--green-soft); border-color: var(--green); }
.option.correct .option-letter { background: var(--green); border-color: var(--green); color: #fff; }
.option.incorrect { background: var(--red-soft); border-color: var(--red); }
.option.incorrect .option-letter { background: var(--red); border-color: var(--red); color: #fff; }
.option.reveal-correct { background: var(--green-soft); border-color: var(--green); }

.explanation {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
}
.explanation strong { color: var(--blue); text-transform: uppercase; font-family: var(--font-display); font-size: 0.78rem; letter-spacing: 0.03em; }

/* ---------- Progress bar ---------- */
.progress-wrap { background: var(--paper-2); border-radius: 100px; height: 10px; overflow: hidden; border: 1px solid var(--line); }
.progress-bar { height: 100%; background: var(--yellow); border-radius: 100px; transition: width 0.25s ease; }
.progress-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 8px; }

/* ---------- Tables (handbook data) ---------- */
table.data-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 0.92rem; }
table.data-table th, table.data-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
table.data-table th { font-family: var(--font-display); text-transform: uppercase; font-size: 0.76rem; letter-spacing: 0.03em; color: var(--ink-soft); background: var(--paper-2); }
table.data-table td:last-child { font-family: var(--font-mono); font-weight: 600; color: var(--asphalt); }

/* ---------- Score summary ---------- */
.score-hero {
  text-align: center;
  padding: 40px 24px;
  border-radius: var(--radius);
  color: #fff;
  margin-bottom: 24px;
}
.score-hero.pass { background: linear-gradient(135deg, var(--green), #094F39); }
.score-hero.fail { background: linear-gradient(135deg, var(--red), #9C1729); }
.score-hero .big { font-family: var(--font-display); font-size: clamp(3rem,8vw,5rem); font-weight: 700; line-height: 1; }
.score-hero .label { font-family: var(--font-display); text-transform: uppercase; letter-spacing: 0.05em; font-size: 1rem; opacity: 0.9; margin-top: 6px; }

.stat-row { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 20px; }
.stat-pill { background: rgba(255,255,255,0.15); border-radius: var(--radius-sm); padding: 10px 18px; font-family: var(--font-mono); font-size: 0.85rem; }
.stat-pill b { display: block; font-size: 1.3rem; font-family: var(--font-display); }

/* ---------- Utility ---------- */
.eyebrow { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--ink-soft); margin-bottom: 10px; display: block; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.section { padding: 56px 0; }
.section-tight { padding: 32px 0; }

footer.site-footer {
  background: var(--asphalt);
  color: #9BA1A8;
  padding: 32px 0;
  margin-top: 60px;
  font-size: 0.86rem;
}
footer.site-footer a { color: #D8DBDE; text-decoration: underline; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-state .mode-icon { font-size: 2.4rem; display: block; margin-bottom: 12px; }

/* Sticky test toolbar */
.test-toolbar {
  position: sticky; top: 68px; z-index: 30;
  background: rgba(250,249,246,0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
}
