/* PSCQuiz.com — hand-written CSS. No build step, no framework.

   The look borrows from the one sheet of paper every PSC aspirant knows: the
   OMR answer sheet. Ballpoint-blue ink on cool white paper, drop-out rose for
   the printed bubbles, black timing marks down the edge. Everything else stays
   quiet so the questions do the talking. */

/* Self-hosted so the browser never has to reach fonts.googleapis.com (a
   render-blocking stylesheet) and then fonts.gstatic.com for the file itself.
   One variable file covers weights 400-700.

   unicode-range limits it to the Malayalam block, so Latin text never waits on
   this download - it renders immediately in the system face. */
@font-face {
  font-family: 'Noto Sans Malayalam';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/noto-sans-malayalam-v29.woff2') format('woff2');
  unicode-range: U+0307, U+0323, U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA,
                 U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832;
}

/* Display face: Anek (Ek Type, an Indian foundry), Latin subset only, cut at
   87.5% width and weights 600-800. Used for headings, dates and numbers - the
   dates are the quiz titles, so this is what gives the site its voice. 39 KB,
   swap, not preloaded: headings paint in the system face first and never block. */
@font-face {
  font-family: 'Anek';
  font-style: normal;
  font-weight: 600 800;
  font-stretch: 87.5%;
  font-display: swap;
  src: url('/fonts/anek-latin-condensed-v18.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  color-scheme: light;

  --font-ml: 'Noto Sans Malayalam', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-ui: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Anek', 'Noto Sans Malayalam', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Ink and paper */
  --paper: #f6f7fa;
  --surface: #ffffff;
  --sunk: #eef0f5;
  --ink: #121831;
  --ink-soft: #464e6b;
  --ink-faint: #5f6784;
  --rule: #e1e4ec;
  --rule-strong: #c6cbd9;

  /* Ballpoint blue: links, primary actions, shaded bubbles */
  --pen: #2142a8;
  --pen-deep: #172f7a;
  --pen-wash: #e9eefc;

  /* OMR drop-out rose: printed bubbles and small structural marks only */
  --omr: #c23a60;
  --omr-wash: #fbebf0;

  --correct: #12755a;
  --correct-bg: #e4f3ec;
  --wrong: #b5392a;
  --wrong-bg: #fbebe8;

  --footer-bg: #121831;
  --footer-ink: #c5cbe0;
  --footer-faint: #98a0bd;

  --link: var(--pen);
  --radius: 12px;
  --shadow: 0 1px 2px rgba(18, 24, 49, .05);
  --shadow-lift: 0 10px 28px -14px rgba(18, 24, 49, .28);
}

html.dark {
  color-scheme: dark;

  --paper: #0e1220;
  --surface: #151a2c;
  --sunk: #1c2236;
  --ink: #eceff8;
  --ink-soft: #b0b6cc;
  --ink-faint: #9097b0;
  --rule: #262d44;
  --rule-strong: #384160;

  --pen: #94abff;
  --pen-deep: #b9c7ff;
  --pen-wash: #1d2649;

  --omr: #f2829f;
  --omr-wash: #3a1826;

  --correct: #4cc093;
  --correct-bg: #102c22;
  --wrong: #f07a66;
  --wrong-bg: #34171a;

  --footer-bg: #0a0d18;
  --footer-ink: #b0b6cc;
  --footer-faint: #8a91aa;

  --shadow: none;
  --shadow-lift: 0 10px 28px -14px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }

/* `hidden` is only display:none in the UA stylesheet, so any author rule
   (.row { display:flex }) beats it and JS row-hiding silently stops working. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: 88px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ml);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1 0 auto; }

img, svg { max-width: 100%; height: auto; vertical-align: middle; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; }
p { margin: 0; }

::selection { background: var(--pen); color: #fff; }
:focus-visible { outline: 2px solid var(--pen); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 480px) { .wrap { padding: 0 24px; } }
@media (min-width: 900px) { .wrap { padding: 0 32px; } }
.wrap.tight { max-width: 760px; }
.wrap.mid { max-width: 860px; }

.muted { color: var(--ink-soft); }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ui { font-family: var(--font-ui); }

/* ─── Header ─────────────────────────────────────────────────────────── */

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
@media (min-width: 1000px) { .site-header { position: sticky; top: 0; z-index: 40; } }

.header-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }

/* The mark is a shaded answer bubble: rose printed ring, blue pencil fill. */
.brand { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; }
.brand-mark {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--omr);
  background: radial-gradient(circle, var(--pen) 0 7px, transparent 7.5px);
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 800;
  font-size: 1.4rem; line-height: 1; letter-spacing: -.01em; color: var(--ink);
}
.brand-tld { color: var(--ink-faint); font-weight: 600; }
.brand-tag {
  margin-top: .2rem; font-family: var(--font-ui); font-size: .74rem; line-height: 1.2;
  color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.nav-desktop { display: none; align-items: center; gap: .15rem; }
@media (min-width: 1000px) { .nav-desktop { display: flex; } }
.nav-desktop a {
  position: relative; padding: .5rem .7rem;
  font-family: var(--font-ui); font-size: .9rem; font-weight: 550; color: var(--ink-soft);
  border-radius: 8px; transition: color .12s, background .12s;
}
.nav-desktop a:hover { color: var(--ink); background: var(--sunk); }
.nav-desktop a[aria-current="page"] { color: var(--pen); font-weight: 650; }
.nav-desktop a[aria-current="page"]::after {
  content: ''; position: absolute; left: .7rem; right: .7rem; bottom: -12px;
  height: 2px; background: var(--pen);
}
/* About / Contact / Privacy sit in the header while AdSense reviews the site.
   Smaller and greyer than the real sections so the hierarchy stays obvious. */
.nav-desktop .nav-quiet { font-size: .84rem; color: var(--ink-faint); padding-inline: .55rem; }
.nav-split { width: 1px; height: 18px; margin: 0 .4rem; background: var(--rule-strong); }

.header-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-width: 40px; height: 40px; padding: 0 .6rem;
  border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: var(--ink-soft); font-family: var(--font-ui); font-size: 1rem; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover { background: var(--sunk); color: var(--ink); }

.menu-btn { border-color: var(--rule-strong); color: var(--ink); font-size: .88rem; font-weight: 600; }
@media (min-width: 1000px) { .menu-btn { display: none; } }
.menu-icon, .menu-icon::before, .menu-icon::after {
  display: block; width: 16px; height: 2px; border-radius: 2px; background: currentColor;
}
.menu-icon { position: relative; }
.menu-icon::before, .menu-icon::after { content: ''; position: absolute; left: 0; }
.menu-icon::before { top: -5px; }
.menu-icon::after { top: 5px; }
.menu-btn[aria-expanded="true"] .menu-icon { background: transparent; }
.menu-btn[aria-expanded="true"] .menu-icon::before { top: 0; transform: rotate(45deg); }
.menu-btn[aria-expanded="true"] .menu-icon::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 359px) { .menu-label { display: none; } }

/* Phones: the four main sections stay on screen as tabs, so nobody has to
   open a menu to find the archive or search. */
.nav-tabs { border-top: 1px solid var(--rule); }
@media (min-width: 1000px) { .nav-tabs { display: none; } }
.nav-tabs .wrap {
  display: flex; gap: 1.25rem; overflow-x: auto; scrollbar-width: none;
}
.nav-tabs .wrap::-webkit-scrollbar { display: none; }
.nav-tabs a {
  flex-shrink: 0; padding: .7rem 0 .6rem; border-bottom: 2px solid transparent;
  font-family: var(--font-ui); font-size: .9rem; font-weight: 550; color: var(--ink-soft);
}
/* Five tabs have to fit a 360-390px phone without scrolling. */
@media (max-width: 479px) {
  .nav-tabs .wrap { gap: .7rem; justify-content: space-between; }
  .nav-tabs a { font-size: .84rem; }
}
@media (max-width: 379px) {
  .nav-tabs .wrap { gap: .5rem; }
  .nav-tabs a { font-size: .78rem; }
}
.nav-tabs a[aria-current="page"] { color: var(--pen); border-bottom-color: var(--pen); font-weight: 650; }

.nav-mobile { display: none; border-top: 1px solid var(--rule); background: var(--surface); }
.nav-mobile.open { display: block; }
@media (min-width: 1000px) { .nav-mobile.open { display: none; } }
.nav-mobile .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.5rem; padding-block: 1.1rem 1.4rem; }
@media (min-width: 560px) { .nav-mobile .wrap { grid-template-columns: repeat(3, 1fr); } }
.menu-group { display: flex; flex-direction: column; }
.menu-group:first-child { grid-column: 1 / -1; }
@media (min-width: 560px) { .menu-group:first-child { grid-column: auto; } }
.menu-title {
  font-family: var(--font-ui); font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: .3rem;
}
.menu-group a {
  padding: .5rem 0; font-family: var(--font-ui); font-size: .98rem; color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.menu-group a[aria-current="page"] { color: var(--pen); font-weight: 650; }

/* ─── Page grid: content + sidebar ───────────────────────────────────── */

.page { padding-block: 1.5rem 3rem; }
@media (min-width: 640px) { .page { padding-block: 2.25rem 4rem; } }

.with-side { display: grid; gap: 3rem; }
@media (min-width: 1000px) { .with-side { grid-template-columns: minmax(0, 1fr) 300px; gap: 3.5rem; } }
.main-col { min-width: 0; }

.section { padding-block: 2.5rem 0; }

.breadcrumbs {
  font-family: var(--font-ui); font-size: .82rem; color: var(--ink-faint); margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--link); text-decoration: underline; }
.breadcrumbs .sep { margin: 0 .45rem; opacity: .6; }

.page-title {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.7rem); line-height: 1.05; letter-spacing: -.01em;
  margin-bottom: .75rem;
}
.page-lede { color: var(--ink-soft); font-size: 1.02rem; max-width: 62ch; margin-bottom: 1.75rem; }
.page-actions { margin-top: 1.5rem; }

.eyebrow {
  font-family: var(--font-ui); font-size: .78rem; font-weight: 700; letter-spacing: .07em;
  text-transform: uppercase; color: var(--omr); margin-bottom: .6rem;
}

/* ─── Home masthead ──────────────────────────────────────────────────── */

.masthead { padding-block: .25rem 1.75rem; }
.masthead h1 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 800;
  font-size: clamp(2.1rem, 8vw, 3.2rem); line-height: 1.02; letter-spacing: -.015em;
  max-width: 16ch;
}
.masthead-lede { margin-top: .85rem; color: var(--ink-soft); font-size: 1.05rem; max-width: 56ch; }

.facts {
  display: flex; flex-wrap: wrap; gap: .5rem 1.4rem;
  list-style: none; margin: 1.1rem 0 0; padding: 0;
  font-family: var(--font-ui); font-size: .9rem; color: var(--ink-soft);
}
.facts li { display: inline-flex; align-items: center; gap: .5rem; }
/* A shaded bubble as the bullet - the one decorative device, used everywhere. */
.facts li::before {
  content: ''; width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  border: 1.5px solid var(--omr); background: radial-gradient(circle, var(--pen) 0 2.5px, transparent 3px);
}
.facts b { color: var(--ink); font-weight: 700; }
#streak.live b { color: var(--correct); }

/* ─── Today's quiz: the OMR card ─────────────────────────────────────── */

.today-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.25rem 1.1rem 1.35rem 1.85rem; box-shadow: var(--shadow-lift);
}
/* Timing marks: the black dashes printed down the edge of a real answer sheet
   so the scanner can find each row. */
.today-card::before {
  content: ''; position: absolute; left: 10px; top: 22px; bottom: 22px; width: 7px;
  background: repeating-linear-gradient(to bottom, var(--ink) 0 4px, transparent 4px 13px);
  opacity: .85; border-radius: 1px;
}
@media (min-width: 640px) {
  .today-card { padding: 1.75rem 2rem 1.85rem 2.75rem; }
  .today-card::before { left: 16px; top: 28px; bottom: 28px; width: 8px; }
}

.today-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem;
  font-family: var(--font-ui); font-size: .84rem; color: var(--ink-faint); margin-bottom: .75rem;
}
.today-head .done { margin-left: auto; color: var(--correct); font-weight: 700; }

.today-card h2 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700;
  font-size: clamp(1.45rem, 4vw, 1.85rem); line-height: 1.15;
}
.today-card h2 a:hover { color: var(--pen); }
.today-card h2 [lang="ml"] { font-size: .72em; font-weight: 600; color: var(--ink-soft); }

.omr-label {
  margin-top: 1.1rem; padding-top: 1rem; border-top: 1px dashed var(--rule-strong);
  font-family: var(--font-ui); font-size: .82rem; font-weight: 600; color: var(--omr);
}
.omr-question { margin-top: .35rem; font-size: 1.1rem; font-weight: 600; line-height: 1.7; color: var(--ink); }

.omr-options { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .55rem; }
@media (min-width: 600px) { .omr-options { grid-template-columns: 1fr 1fr; } }
.omr-option {
  display: flex; align-items: center; gap: .75rem; height: 100%;
  min-height: 52px; padding: .6rem .85rem;
  border: 1px solid var(--rule-strong); border-radius: 10px; background: var(--surface);
  font-size: .98rem; line-height: 1.5; color: var(--ink);
  transition: border-color .12s, background .12s;
}
.omr-option:hover { border-color: var(--pen); background: var(--pen-wash); }

/* The printed bubble. Shading it blue is the only animation on the page. */
.omr-bubble, .option-bubble {
  flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--omr); color: var(--omr); background: transparent;
  font-family: var(--font-ui); font-size: .78rem; font-weight: 700;
  transition: background .15s, border-color .15s, color .15s;
}
.omr-option:hover .omr-bubble { background: var(--pen); border-color: var(--pen); color: #fff; }

.today-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .85rem 1.4rem; margin-top: 1.35rem;
}
.today-foot .btn { flex: 1 1 100%; }
@media (min-width: 520px) { .today-foot .btn { flex: 0 0 auto; } }
.today-alt { font-family: var(--font-ui); font-size: .92rem; font-weight: 600; color: var(--link); }
.today-alt:hover { text-decoration: underline; }

/* ─── Buttons ────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 48px; padding: .7rem 1.35rem; border: 1px solid transparent; border-radius: 10px;
  font-family: var(--font-ui); font-size: .95rem; font-weight: 650; line-height: 1.2;
  cursor: pointer; text-align: center;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--pen); color: #fff; }
.btn-primary:hover { background: var(--pen-deep); }
html.dark .btn-primary { color: #0e1220; }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-ink:hover { background: var(--pen-deep); color: #fff; }
.btn-quiet { background: var(--surface); border-color: var(--rule-strong); color: var(--ink); }
.btn-quiet:hover { border-color: var(--pen); color: var(--pen); }
.btn-block { width: 100%; }
/* Quieten rather than fade: a 45%-opacity dark button reads as a grey slab. */
.btn:disabled {
  background: var(--sunk); color: var(--ink-faint);
  border-color: var(--rule); cursor: not-allowed;
}

/* ─── Quiz lists ─────────────────────────────────────────────────────── */

.list-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  margin-bottom: .9rem;
}
.list-head h2 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700;
  font-size: 1.45rem; line-height: 1.1;
}
.list-head a { font-family: var(--font-ui); font-size: .9rem; font-weight: 600; color: var(--link); white-space: nowrap; }
.list-head a:hover { text-decoration: underline; }

.quiz-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden;
}
.quiz-list li + li { border-top: 1px solid var(--rule); }

.row {
  display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: .1rem 1rem; align-items: center;
  padding: .85rem 1rem; transition: background .12s;
}
@media (min-width: 640px) { .row { grid-template-columns: 3.6rem minmax(0, 1fr); padding: 1rem 1.25rem; } }
.row:hover { background: var(--pen-wash); }
.row .day {
  grid-row: span 2; text-align: center; line-height: 1;
  font-family: var(--font-ui); font-size: .68rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--omr);
}
.row .day b {
  display: block; margin-top: .15rem;
  font-family: var(--font-display); font-stretch: 87.5%; font-size: 1.6rem; font-weight: 800;
  letter-spacing: -.01em; color: var(--ink);
}
.row .top { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.row h3 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700;
  font-size: 1.12rem; line-height: 1.25;
}
.row:hover h3 { color: var(--pen); }
@media (min-width: 640px) { .row .peek { -webkit-line-clamp: 1; } }
/* Every quiz has five questions; on a phone that column is noise. */
@media (max-width: 639px) { .row .count { display: none; } }
.row .count { margin-left: auto; font-family: var(--font-ui); font-size: .78rem; color: var(--ink-faint); white-space: nowrap; }
.row .peek {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-soft); font-size: .9rem; line-height: 1.55;
}
.row .done {
  flex-shrink: 0; padding: .05rem .45rem; border-radius: 999px;
  background: var(--correct-bg); color: var(--correct);
  font-family: var(--font-ui); font-size: .72rem; font-weight: 700;
}

.show-more { margin-top: 1rem; }

.month-group + .month-group { margin-top: 2.25rem; }
.month-group > h2 {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .8rem;
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; font-size: 1.35rem;
}
.month-group > h2 span { font-family: var(--font-ui); font-size: .82rem; font-weight: 500; color: var(--ink-faint); }

/* ─── Sidebar widgets ────────────────────────────────────────────────── */

.side-col { display: flex; flex-direction: column; gap: 1.25rem; }
.widget {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  font-family: var(--font-ui); font-size: .92rem; color: var(--ink-soft); line-height: 1.6;
}
.widget h2 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; font-size: 1.15rem;
  color: var(--ink); margin-bottom: .6rem;
}
.widget p + p { margin-top: .6rem; }
.widget-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: .85rem !important; }
.widget-links a { color: var(--link); font-weight: 600; }
.widget-links a:hover { text-decoration: underline; }
.widget-guide .btn { margin-top: .9rem; }

.month-list { list-style: none; margin: 0; padding: 0; }
.month-list a {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .45rem 0; border-bottom: 1px solid var(--rule); color: var(--ink);
}
.month-list li:last-child a { border-bottom: 0; }
.month-list a:hover { color: var(--pen); }
.month-list span { color: var(--ink-faint); font-variant-numeric: tabular-nums; }

.widget-toc { display: flex; flex-direction: column; }
.widget-toc a { padding: .45rem 0; border-bottom: 1px solid var(--rule); color: var(--link); font-weight: 600; }
.widget-toc a:last-child { border-bottom: 0; }
.widget-toc a:hover { text-decoration: underline; }
@media (max-width: 999px) { .widget-toc { display: none; } }

/* ─── Quiz page ──────────────────────────────────────────────────────── */

.quiz-kicker {
  display: block; margin-bottom: .35rem;
  font-family: var(--font-ui); font-size: .8rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--omr);
}

.meta-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 0;
  font-family: var(--font-ui); font-size: .88rem; color: var(--ink-faint);
  padding-bottom: 1.1rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--rule);
}
@media (min-width: 560px) { .meta-row > * + *::before { content: '·'; margin: 0 .6rem; color: var(--rule-strong); } }
@media (max-width: 559px) { .meta-row { gap: .25rem 1rem; } }
.meta-row a { color: var(--link); }
.meta-row a:hover { text-decoration: underline; }

.badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: 999px;
  background: var(--pen); color: #fff;
  font-family: var(--font-ui); font-size: .76rem; font-weight: 700;
}
html.dark .badge { color: #0e1220; }

.intro-box { margin-bottom: 1.25rem; font-size: 1rem; line-height: 1.75; color: var(--ink-soft); }

.quiz-shell {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lift);
}

.quiz-status {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
  padding: .75rem 1.1rem; background: var(--sunk); border-bottom: 1px solid var(--rule);
  font-size: .88rem; color: var(--ink-soft);
}
.quiz-status strong { color: var(--ink); }

/* Progress as a row of answer-sheet bubbles, shaded as you answer. */
.sheet { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.sheet-dot {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--omr); color: var(--omr);
  font-family: var(--font-ui); font-size: .66rem; font-weight: 700;
  transition: background .2s, border-color .2s, color .2s;
}
.sheet-dot.is-current { border: 2px solid var(--pen); color: var(--pen); }
.sheet-dot.is-right { background: var(--correct); border-color: var(--correct); color: #fff; }
.sheet-dot.is-wrong { background: var(--wrong); border-color: var(--wrong); color: #fff; }
/* Phones: question and score share the first line, the bubbles get their own. */
@media (max-width: 559px) { .sheet { order: 3; width: 100%; justify-content: flex-start; } }

.quiz-body { padding: 1.25rem 1rem 1.35rem; }
@media (min-width: 640px) { .quiz-body { padding: 1.75rem 1.9rem; } }

.quiz-question { font-size: 1.1rem; font-weight: 600; line-height: 1.7; margin-bottom: 1.25rem; }

.options { display: flex; flex-direction: column; gap: .6rem; }
.quiz-option {
  display: flex; align-items: center; gap: .8rem; width: 100%;
  min-height: 54px; padding: .7rem .9rem; text-align: left;
  border: 1px solid var(--rule-strong); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-ml); font-size: 1rem; line-height: 1.55;
  cursor: pointer; transition: border-color .12s, background .12s;
}
.quiz-option:hover:not(:disabled) { border-color: var(--pen); background: var(--pen-wash); }
.quiz-option:hover:not(:disabled) .option-bubble { background: var(--pen); border-color: var(--pen); color: #fff; }
.quiz-option:disabled { cursor: default; }
.quiz-option.selected .option-bubble { background: var(--pen); border-color: var(--pen); color: #fff; }
.quiz-option.correct { border-color: var(--correct); background: var(--correct-bg); }
.quiz-option.correct .option-bubble { background: var(--correct); border-color: var(--correct); color: #fff; }
.quiz-option.wrong { border-color: var(--wrong); background: var(--wrong-bg); }
.quiz-option.wrong .option-bubble { background: var(--wrong); border-color: var(--wrong); color: #fff; }

.verdict { margin-top: 1rem; font-size: .98rem; font-weight: 700; }
.verdict.ok { color: var(--correct); }
.verdict.no { color: var(--wrong); }

.explanation {
  margin-top: .6rem; padding: .85rem 1rem; border-radius: 10px;
  background: var(--sunk); color: var(--ink-soft); font-size: .95rem; line-height: 1.75;
}
.explanation strong { color: var(--ink); }

.quiz-hint {
  padding: 0 1.1rem 1rem; text-align: center;
  font-family: var(--font-ml); font-size: .76rem; color: var(--ink-faint);
}
/* Keyboard shortcuts mean nothing on a phone. */
@media (hover: none) { .quiz-hint { display: none; } }

.score-wrap { padding: 2.25rem 1.5rem 1rem; text-align: center; }
.score-ring {
  width: 132px; height: 132px; margin: 0 auto 1.1rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; position: relative;
  background: conic-gradient(var(--pen) calc(var(--pct) * 1%), var(--sunk) 0);
}
.score-ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--surface); }
.score-ring .score-num {
  position: relative; font-family: var(--font-display); font-stretch: 87.5%;
  font-size: 2rem; font-weight: 800;
}
.score-wrap h2 { font-family: var(--font-display); font-stretch: 87.5%; font-size: 1.5rem; margin-bottom: .3rem; }
.score-wrap p { color: var(--ink-soft); font-family: var(--font-ui); }
.quiz-actions { display: flex; flex-direction: column; gap: .6rem; padding: 1.25rem 1.5rem 1.5rem; }
@media (min-width: 520px) { .quiz-actions { flex-direction: row; } .quiz-actions > * { flex: 1; } }

.share-row { padding: 0 1.5rem; text-align: center; }
.share-label { font-size: .88rem; color: var(--ink-faint); margin-bottom: .6rem; }
.share-buttons { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.share-buttons .btn { flex: 1; min-width: 130px; }
.btn-wa { background: #25d366; color: #05310f; }
.btn-wa:hover { background: #1fb955; }

/* ─── Question list + answer key ─────────────────────────────────────── */

.question-list, .answer-key, .study-notes { margin-top: 2.75rem; }
.question-list > h2, .study-notes > h2 {
  font-size: 1.3rem; font-weight: 700; margin-bottom: .5rem;
}
.question-list > p { font-family: var(--font-ui); font-size: .9rem; color: var(--ink-faint); margin-bottom: 1rem; }

.qa-item { padding: 1.2rem 0; border-top: 1px solid var(--rule); }
.qa-item h3 { font-size: 1.04rem; font-weight: 600; line-height: 1.7; margin-bottom: .8rem; }
.qnum { font-family: var(--font-display); font-stretch: 87.5%; font-weight: 800; color: var(--omr); margin-right: .45rem; }
.qa-options { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
@media (min-width: 620px) { .qa-options { grid-template-columns: 1fr 1fr; gap: .45rem .75rem; } }
.qa-options li {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .65rem; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface);
  font-size: .95rem; line-height: 1.55;
}
.qa-options li .letter {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--omr); color: var(--omr);
  font-family: var(--font-ui); font-weight: 700; font-size: .66rem;
}

.answer-key > details { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); }
.answer-key > details > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.1rem; cursor: pointer; list-style: none; font-size: 1rem;
}
.answer-key > details > summary::-webkit-details-marker { display: none; }
.answer-key > details > summary::after {
  content: '+'; flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pen-wash); color: var(--pen); font-family: var(--font-ui); font-size: 1.2rem; font-weight: 600;
}
.answer-key > details[open] > summary::after { content: '−'; }
.answer-key > details[open] > summary { border-bottom: 1px solid var(--rule); }
.answer-key > details > summary .muted { font-family: var(--font-ui); font-size: .84rem; font-weight: 400; }
.answer-key-body { padding: .4rem 1.1rem 1rem; }

.key-item { padding: .95rem 0; border-bottom: 1px solid var(--rule); }
.key-item:last-child { border-bottom: 0; }
.qa-answer { font-size: .98rem; font-weight: 650; color: var(--correct); margin-bottom: .35rem; }
.qa-explanation { font-size: .94rem; line-height: 1.75; color: var(--ink-soft); }
.qa-explanation strong { color: var(--ink); }

.source-note { margin-top: 1.5rem; font-family: var(--font-ui); font-size: .875rem; font-style: italic; color: var(--ink-faint); }

.qa-note {
  margin-top: .6rem; padding: .75rem .9rem; border-radius: 10px;
  background: var(--pen-wash); color: var(--ink-soft); font-size: .94rem; line-height: 1.75;
}
.qa-note strong { color: var(--pen); }

.quiz-pager { display: grid; gap: .75rem; margin-top: 2.5rem; }
@media (min-width: 560px) { .quiz-pager { grid-template-columns: 1fr 1fr; } }
.pager-link {
  display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; font-size: 1.15rem;
  transition: border-color .12s, background .12s;
}
.pager-link span { font-family: var(--font-ui); font-size: .8rem; font-weight: 600; color: var(--ink-faint); }
.pager-link:hover { border-color: var(--pen); background: var(--pen-wash); color: var(--pen); }
.pager-next { text-align: right; }
.month-link { margin-top: 1rem; font-family: var(--font-ui); font-size: .92rem; color: var(--ink-soft); }
.month-link a { color: var(--link); font-weight: 600; }
.month-link a:hover { text-decoration: underline; }

.month-group > h2 a { font-family: var(--font-ui); font-size: .86rem; font-weight: 600; color: var(--link); }
.month-group > h2 a:hover { text-decoration: underline; }

/* Monthly one-liner pages */
.fact-day + .fact-day { margin-top: 2rem; }
.fact-day h2 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700; font-size: 1.3rem;
  padding-bottom: .5rem; margin-bottom: .6rem; border-bottom: 1px solid var(--rule);
}
.fact-day h2 a:hover { color: var(--pen); }
.fact-list { margin: 0; padding-left: 1.4rem; display: grid; gap: .55rem; }
.fact-list li { font-size: 1rem; line-height: 1.75; color: var(--ink); }
.fact-list li::marker { color: var(--omr); font-family: var(--font-ui); font-weight: 700; font-size: .85rem; }

/* ─── FAQ ────────────────────────────────────────────────────────────── */

.faq-list { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0 1.1rem; }
.faq-item + .faq-item { border-top: 1px solid var(--rule); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 0; font-family: var(--font-ui); font-weight: 600; font-size: 1rem;
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; flex-shrink: 0; color: var(--pen); font-size: 1.3rem; font-weight: 500; line-height: 1; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary:hover { color: var(--pen); }
.faq-item p { padding-bottom: 1.1rem; color: var(--ink-soft); font-family: var(--font-ui); font-size: .96rem; line-height: 1.7; }

/* ─── Search ─────────────────────────────────────────────────────────── */

.search-field { position: relative; margin-bottom: 1.1rem; }
.search-field input {
  width: 100%; min-height: 52px; padding: .85rem 1rem;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 10px;
  font-family: var(--font-ml); font-size: 1rem;
}
.search-field input:focus { outline: none; border-color: var(--pen); box-shadow: 0 0 0 3px var(--pen-wash); }

.result-count { font-family: var(--font-ui); font-size: .85rem; color: var(--ink-faint); margin-bottom: .6rem; }
#search-results { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.result-row {
  display: block; padding: .9rem 1.1rem; transition: background .12s;
}
.result-row + .result-row { border-top: 1px solid var(--rule); }
.result-row:hover { background: var(--pen-wash); }
.result-row h2 { font-family: var(--font-display); font-stretch: 87.5%; font-size: 1.12rem; font-weight: 700; }
.result-row:hover h2 { color: var(--pen); }
.result-row p {
  color: var(--ink-soft); font-size: .9rem;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}

.empty {
  margin-top: 1rem; padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-soft);
  border: 1px dashed var(--rule-strong); border-radius: var(--radius); font-family: var(--font-ui);
}

/* ─── Prose (About, policies, study guide) ───────────────────────────── */

.prose { font-size: 1.04rem; line-height: 1.8; color: var(--ink-soft); max-width: 70ch; }
.prose > * + * { margin-top: 1.15rem; }
.prose h1 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 800;
  font-size: clamp(1.9rem, 6vw, 2.7rem); line-height: 1.05; color: var(--ink); margin-bottom: .3rem;
}
.prose h2 {
  font-family: var(--font-display); font-stretch: 87.5%; font-weight: 700;
  font-size: 1.5rem; line-height: 1.15; color: var(--ink); margin-top: 2.4rem;
}
.prose h3 { font-size: 1.12rem; color: var(--ink); margin-top: 1.8rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2rem; }
.prose li { margin-bottom: .5rem; }
.prose li::marker { color: var(--omr); }
.prose a { color: var(--link); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.prose strong, .prose b { color: var(--ink); font-weight: 650; }
.prose .lede { font-size: 1.15rem; color: var(--ink); line-height: 1.7; }
.prose blockquote {
  margin: 1.25rem 0; padding: .9rem 1.1rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 10px;
}
.prose blockquote p { margin: 0; }

/* `.prose a` (0,1,1) outranks `.btn-*` (0,1,0), so a button placed inside prose
   was repainted with the link colour and underlined. */
.prose a.btn { text-decoration: none; }
.prose a.btn-primary { color: #fff; }
html.dark .prose a.btn-primary { color: #0e1220; }
.prose a.btn-ink { color: var(--surface); }
.prose a.btn-quiet { color: var(--ink); }

.cta-grid { display: grid; gap: .9rem; margin-top: 2.25rem; }
@media (min-width: 600px) { .cta-grid { grid-template-columns: 1fr 1fr; } }
.prose a.cta-card, .cta-card {
  display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); text-decoration: none; font-weight: 400;
  transition: border-color .15s, background .15s;
}
.cta-card:hover { border-color: var(--pen); background: var(--pen-wash); }
.cta-card h3 { font-size: 1.02rem; color: var(--ink); margin: 0 0 .3rem; }
.cta-card p { font-size: .9rem; color: var(--ink-soft); line-height: 1.6; }

/* ─── Footer ─────────────────────────────────────────────────────────── */

.site-footer { margin-top: 2rem; background: var(--footer-bg); color: var(--footer-ink); font-family: var(--font-ui); }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; padding: 2.75rem 0 2rem; }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr; } }
.footer-brand { grid-column: 1 / -1; }
@media (min-width: 860px) { .footer-brand { grid-column: auto; } }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-tld { color: var(--footer-faint); }
.footer-brand p { margin-top: .85rem; font-size: .92rem; line-height: 1.7; max-width: 40ch; }
.footer-mail { color: var(--footer-faint); }
.footer-mail a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.site-footer h2 {
  font-size: .76rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--footer-faint); margin-bottom: .8rem;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.site-footer li a { font-size: .94rem; color: var(--footer-ink); }
.site-footer li a:hover { color: #fff; text-decoration: underline; }

.footer-disclaimer {
  padding: 1.1rem 0; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .86rem; line-height: 1.6; color: var(--footer-faint); max-width: 80ch;
}
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between;
  padding: 1.1rem 0 4rem; border-top: 1px solid rgba(255, 255, 255, .1);
  font-size: .82rem; color: var(--footer-faint);
}
@media (min-width: 560px) { .footer-bottom { padding-bottom: 1.6rem; } }
.site-footer :focus-visible { outline-color: #fff; }

/* ─── Utility chrome ─────────────────────────────────────────────────── */

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  padding: .6rem 1rem; background: var(--ink); color: var(--surface);
  font-family: var(--font-ui); font-size: .88rem; font-weight: 600; border-radius: 8px;
}
.skip-link:focus { left: 8px; top: 8px; }
main:focus { outline: none; }

#share-btn {
  position: fixed; right: 14px; bottom: 14px; z-index: 50;
  display: inline-flex; align-items: center; gap: .4rem;
  min-width: 44px; min-height: 44px; padding: .55rem .7rem; justify-content: center;
  border: 1px solid var(--rule-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink);
  font-family: var(--font-ui); font-size: .85rem; font-weight: 650;
  box-shadow: var(--shadow-lift); cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
#share-btn:hover { background: var(--pen); border-color: var(--pen); color: #fff; }
/* Icon only on phones so it covers as little of the page as possible. */
#share-btn span { display: none; }
@media (min-width: 560px) { #share-btn { padding: .55rem 1rem; } #share-btn span { display: inline; } }

/* ─── Motion ─────────────────────────────────────────────────────────── */

@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.rise-in { animation: fadeUp .3s ease-out; }

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

@media print {
  .site-header, .site-footer, .side-col, #share-btn, .quiz-shell { display: none !important; }
  body { background: #fff; color: #000; }
  .answer-key details { border: 0; }
}
