/* Public practice pages. Same Nova tokens as the workspace app (src/styles.css):
   Night by default, <html data-theme="light"> for Day. */
@font-face {
  font-family: "UBAI Chivo";
  src: url("fonts/Chivo-Black-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --brand: #8ab4f8; --brand-dark: #aecbfa; --brand-solid: #1a73e8; --brand-soft: #17263d; --brand-line: #2a4a78;
  --ink: #e8eaed; --muted: #9aa0a6; --line: #2e3033;
  --bg: #0f1011; --card: #18191b; --soft: #232528;
  --ok: #4ade9a; --ok-bg: #0f2a20; --bad: #ff7a8c; --bad-bg: #30141c; --warn: #ffc24a;
  --grad: var(--ink); --tone: #e8eaed; --tone-hover: #cfd2d6; --on-tone: #0f1011; --tone-ink: #111214; --banner: #18191b;
  --grad-text: linear-gradient(var(--ink), var(--ink));
  --glow: none; --elevate: none;
  --aurora-a: transparent; --aurora-b: transparent; --aurora-c: transparent;
  --display: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --brand: #1967d2; --brand-dark: #174ea6; --brand-solid: #1a73e8; --brand-soft: #e8f0fe; --brand-line: #c6dafc;
  --ink: #202124; --muted: #5f6368; --line: #e3e5e8;
  --bg: #f7f8f9; --card: #ffffff; --soft: #f1f3f4; --tone: #1f4bb8; --tone-hover: #193e9a; --on-tone: #fff; --tone-ink: #163784; --banner: #2453c9;
  --ok: #0b7a4c; --ok-bg: #e6f8ef; --bad: #d02f4f; --bad-bg: #fdecef; --warn: #a8650a;
  --elevate: 0 1px 2px rgba(60, 64, 67, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; color: var(--ink); font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(70vw 54vh at 6% -10%, var(--aurora-a), transparent 62%),
    radial-gradient(56vw 46vh at 104% 2%, var(--aurora-b), transparent 62%),
    radial-gradient(60vw 50vh at 70% 112%, var(--aurora-c), transparent 62%);
}
::selection { background: var(--brand-line); }
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
:where(a, button, summary):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 10; background: var(--brand-solid); color: #fff; padding: 8px 12px; border-radius: 10px; }
.skip-link:focus { top: 8px; color: #fff; }
main { max-width: 860px; margin: 0 auto; padding: 0 16px 56px; }

.site-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 860px; margin: 0 auto; padding: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: 19px; font-weight: 600; letter-spacing: -.02em; text-decoration: none; color: var(--ink); }
.brand img { display: block; width: auto; height: 24px; }
.brand .brand-image-light, :root[data-theme="light"] .brand .brand-image-dark { display: none; }
:root[data-theme="light"] .brand .brand-image-light { display: block; }
.site-header nav { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.site-header nav a { text-decoration: none; color: var(--muted); }
.site-header nav a:hover { color: var(--ink); }
.lang { display: inline-grid; place-items: center; min-height: 36px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 0 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.lang:hover { border-color: var(--brand); color: var(--brand); }
.theme-switch { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.theme-switch button { min-height: 28px; padding: 0 11px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.theme-switch button:hover { color: var(--ink); }
:root[data-theme="dark"] .theme-switch [data-theme-set="dark"],
:root[data-theme="light"] .theme-switch [data-theme-set="light"] { background: var(--tone); color: var(--on-tone); }
.site-header nav a.button-small { min-height: 36px; display: inline-grid; place-items: center; border-radius: 999px; padding: 0 16px; background: var(--tone); color: var(--on-tone); font-weight: 600; }
.site-header nav a.button-small:hover { color: var(--on-tone); background: var(--tone-hover); }

.back-home { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; margin: 4px 0 10px; font-size: 14px; font-weight: 600; text-decoration: none; }
.back-home:hover { text-decoration: underline; }
.syllabus-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.syllabus-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.syllabus-tabs a:hover { border-color: var(--brand); }
.syllabus-tabs a[aria-current="location"] { background: var(--tone); color: var(--on-tone); border-color: var(--tone); }
.syllabus-tabs a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.crumbs { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.crumbs a { text-decoration: none; }
.hero { padding: 28px 0 14px; }
.eyebrow { display: inline-flex; padding: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 14px; }
h1 { font-family: var(--display); font-size: clamp(30px, 6vw, 50px); font-weight: 600; line-height: 1.1; margin: 0 0 14px; letter-spacing: -.03em; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
h2 { letter-spacing: -.015em; }
.lead { font-size: 17px; line-height: 1.7; color: var(--ink); margin: 0 0 10px; }
.meta { color: var(--muted); font-size: 14px; margin: 0; }

.button, .button-secondary { display: inline-block; border-radius: 8px; padding: 12px 20px; font-weight: 700; text-decoration: none; transition: transform .16s ease, filter .2s ease, border-color .16s ease, background-color .16s ease; }
.button { background: var(--tone); color: var(--on-tone); }
.button:hover { color: var(--on-tone); background: var(--tone-hover); }
.button-secondary { border: 1px solid var(--line); color: var(--ink); background: var(--card); }
.button-secondary:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); transform: translateY(-1px); }
.cta-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }

.scorebar { position: sticky; top: 8px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--banner); border: 1px solid var(--line); color: #fff; border-radius: 8px; padding: 10px 16px; font-size: 14px; font-weight: 600; margin-bottom: 10px; box-shadow: var(--glow); }
.scorebar strong { font-family: var(--display); font-size: 18px; font-variant-numeric: tabular-nums; }

.question { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 22px; margin: 16px 0; box-shadow: var(--elevate); scroll-margin-top: 64px; }
.question > header { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.qnum { display: inline-flex; padding: 4px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; font-size: 12px; }
.difficulty { border-radius: 999px; padding: 3px 10px; background: var(--soft); font-weight: 600; font-size: 12px; }
.prompt { font-size: 16.5px; line-height: 1.75; }
.prompt p { margin: 0 0 10px; }
.prompt figure { margin: 8px 0 12px; }
.prompt img { display: block; max-width: 100%; height: auto; background: #fff; border-radius: 12px; }
figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.table-frame { overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 12px; }
table { border-collapse: collapse; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 7px 11px; text-align: center; }
.table-frame table { width: 100%; }
.table-frame tr:first-child > * { border-top: 0; }
.table-frame tr:last-child > * { border-bottom: 0; }
.table-frame tr > :first-child { border-left: 0; }
.table-frame tr > :last-child { border-right: 0; }
th { background: var(--soft); }

.choices { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.choice { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 54px; text-align: left; font: inherit; color: inherit; background: var(--card); border: 1.5px solid var(--line); border-radius: 10px; padding: 11px 14px; cursor: default; transition: border-color .16s ease, background-color .16s ease, transform .16s ease, box-shadow .16s ease; }
.is-interactive .choice { cursor: pointer; }
.is-interactive:not(.is-answered) .choice:hover { border-color: var(--brand); background: var(--brand-soft); }
.is-interactive:not(.is-answered) .choice:active { transform: scale(.99); }
.choice .key { display: grid; place-items: center; flex-shrink: 0; width: 32px; height: 32px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 800; transition: background-color .16s ease, color .16s ease; }
.is-interactive:not(.is-answered) .choice:hover .key { background: var(--brand-solid); color: #fff; }
.choice:disabled { cursor: default; color: inherit; }
.choice.is-key { border-color: var(--ok); background: var(--ok-bg); box-shadow: 0 0 0 4px var(--ok-bg); }
.choice.is-key .key { background: #0f8552; color: #fff; }
.choice.picked-wrong { border-color: var(--bad); background: var(--bad-bg); box-shadow: 0 0 0 4px var(--bad-bg); }
.choice.picked-wrong .key { background: #d83a56; color: #fff; }
.feedback { font-weight: 700; margin: 12px 0 0; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

.explanation { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; font-size: 15px; }
.explanation summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.answer { margin: 8px 0; }
.rationales { padding-left: 18px; }
.rationales li { margin: 4px 0; color: var(--muted); }
.rationales li.is-correct { color: var(--ink); }

.cta { position: relative; isolation: isolate; overflow: hidden; background: var(--banner); border: 1px solid var(--line); color: #fff; border-radius: 12px; padding: 28px; margin: 32px 0;  }
.cta h2 { margin: 0 0 8px; font-family: var(--display); font-size: 26px; font-weight: 600; letter-spacing: -.02em; }
.cta p { margin: 0; color: rgba(255, 255, 255, .85); }
.cta .button { background: #fff; color: var(--tone-ink); box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.cta .button:hover { color: var(--tone-ink); filter: none; }
.cta .button-secondary { border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .1); color: #fff; }
.cta .button-secondary:hover { border-color: #fff; background: rgba(255, 255, 255, .2); color: #fff; }
.pager { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.pager a { text-decoration: none; }

.topic-list, .units { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 14px; }
.topic-list li, .unit { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; box-shadow: var(--elevate); transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.topic-list li:hover { border-color: var(--muted); }
.topic-list a { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; text-decoration: none; }
.topic-list .code { padding: 3px 9px; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 13px; font-weight: 800; }
.topic-list .t { font-weight: 750; font-size: 18px; color: var(--ink); }
.topic-list .n { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--muted); }
.topic-list p { margin: 8px 0 0; font-size: 15px; color: var(--muted); }
.unit h2 { font-size: 20px; margin: 0 0 4px; }
.unit h2 a { text-decoration: none; color: var(--ink); }
.unit h2 a:hover { color: var(--brand); }
.weight { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.weight strong { color: var(--ok); }
.unit ul { margin: 0; padding-left: 18px; color: var(--muted); }
.unit ul a { text-decoration: none; }

.site-footer { max-width: 860px; margin: 0 auto; padding: 20px 16px 40px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.tm { font-size: 12px; }
.missing { color: var(--warn); }
.brand, .site-header nav a, .lang { white-space: nowrap; }
/* Practice pages (body.focus): calm palette while answering. */
body.focus::before { display: none; }
body.focus { background: var(--bg); }
:root[data-theme="dark"] body.focus { --ink: #d7dadd; }
body.focus h1 { background: none; color: var(--ink); }
body.focus .choice.is-key, body.focus .choice.picked-wrong { box-shadow: none; }
body.focus .is-interactive:not(.is-answered) .choice:hover { transform: none; }
:root[data-theme="dark"] .prompt img { filter: brightness(.86); }
@media (max-width: 560px) { .site-header nav { gap: 6px; } .theme-switch button { padding: 0 8px; } .question { padding: 16px; border-radius: 10px; } .cta { padding: 22px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
@media print {
  :root, :root[data-theme="light"] { --ink: #111; --muted: #444; --line: #ccc; --bg: #fff; --card: #fff; --soft: #f4f4f6; --brand: #3b22b8; --brand-dark: #2a177f; --elevate: none; --glow: none; }
  body::before, .site-header nav, .scorebar { display: none; }
  h1 { background: none; color: #111; }
}

/* Facts pages (pricing, FAQ, about) */
.prose { max-width: 760px; margin: 0 auto 32px; line-height: 1.65; }
.prose h2 { margin: 28px 0 10px; font-size: 20px; }
.faq dt { margin-top: 18px; font-weight: 700; }
.faq dd { margin: 6px 0 0; }
.course-facts { padding-left: 18px; }
.course-facts li { margin: 6px 0; }
.price-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.price-table th, .price-table td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--line, rgba(127,127,127,.3)); }
.price-table td:nth-child(2) { white-space: nowrap; font-weight: 700; }
@media (max-width: 560px) { .price-table th:nth-child(3), .price-table td:nth-child(3) { font-size: 14px; } }
