/* Design B, "the answer sheet": graphite on white, the pale-blue grid of an optical answer form, ballpoint blue for
   the reader's own marks. Rubik (display) and IBM Plex Sans Hebrew (text), self-hosted, OFL. */
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url(/assets/fonts/rubik-hebrew-500-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 500; font-display: swap; src: url(/assets/fonts/rubik-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url(/assets/fonts/rubik-hebrew-800-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Rubik"; font-weight: 800; font-display: swap; src: url(/assets/fonts/rubik-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-hebrew-hebrew-400-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Plex"; font-weight: 400; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-hebrew-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-hebrew-hebrew-600-normal.woff2) format("woff2"); unicode-range: U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Plex"; font-weight: 600; font-display: swap; src: url(/assets/fonts/ibm-plex-sans-hebrew-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+2212; }

:root {
  --ink: #22272f; --ink-2: #3a414d; --muted: #5f6b7d;
  --paper: #ffffff; --sheet: #eaf0f9; --sheet-2: #dde6f4; --rule: #c9d4e6;
  --pen: #1f45c4; --pen-soft: #e6ecfb; --on-pen: #ffffff;
  --ok: #17703f; --ok-soft: #e4f3ea; --bad: #b42318; --bad-soft: #fbe9e7;
  --focus: #1f45c4;
  --radius-s: 6px; --radius-m: 10px;
  --measure: 66ch;
  --f-head: "Rubik", "Arial Hebrew", system-ui, sans-serif;
  --f-body: "Plex", "Arial Hebrew", "Segoe UI", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #e8edf6; --ink-2: #c7d0e0; --muted: #a3afc4;
    --paper: #0f1420; --sheet: #182134; --sheet-2: #1d2b47; --rule: #33456a;
    --pen: #8fa8ff; --pen-soft: #1f2f57; --on-pen: #0f1420;
    --ok: #6fd39b; --ok-soft: #123524; --bad: #ff8a7a; --bad-soft: #3a1714; --focus: #8fa8ff;
  }
}
html[data-a11y-contrast="1"] { --ink: #000; --ink-2: #000; --muted: #222; --paper: #fff; --sheet: #fff; --sheet-2: #f0f0f0; --rule: #000; --pen: #0030b8; --ok: #005a24; --bad: #a00000; }
html[data-a11y-size="1"] { font-size: 112.5%; }
html[data-a11y-size="2"] { font-size: 125%; }
html[data-a11y-links="1"] a { text-decoration: underline 2px !important; background: #fff59d; color: #000 !important; }
html[data-a11y-readable="1"] { --f-head: var(--f-body); letter-spacing: .02em; word-spacing: .08em; }
html[data-a11y-readable="1"] body { line-height: 1.9; }
html[data-a11y-motion="1"] *, html[data-a11y-motion="1"] *::before, html[data-a11y-motion="1"] *::after { animation: none !important; transition: none !important; }
html[data-a11y-cursor="1"], html[data-a11y-cursor="1"] * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Cpath d='M4 2l26 16-12 2 7 14-5 2-7-14-9 8z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 2, auto !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--f-body); font-size: 1.125rem; line-height: 1.65; }
img, svg { max-width: 100%; }
a { color: var(--pen); text-underline-offset: .18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--f-head); line-height: 1.2; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); font-weight: 800; letter-spacing: -.015em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 1em; max-width: var(--measure); }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-s); z-index: 100; }
.skip:focus { top: 8px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* header */
.site-head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { font-family: var(--f-head); font-weight: 800; font-size: 1.25rem; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; flex: none; }
.site-nav { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; padding: 6px 2px; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--pen); text-decoration: underline; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid var(--pen); background: var(--pen); color: var(--on-pen); font: 600 1.05rem var(--f-body); text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.1); }
.btn.secondary { background: transparent; color: var(--pen); }
.btn.secondary:hover { background: var(--sheet); }
.btn.pen { background: var(--pen); border-color: var(--pen); color: var(--on-pen); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* hero */
.hero { padding: 56px 0 40px; border-bottom: 1px solid var(--rule); }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: start; }
.hero .lead { font-size: 1.25rem; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; margin: 24px 0 28px; padding: 0; list-style: none; justify-content: start; }
.facts b { display: block; font-family: var(--f-head); font-size: 1.8rem; line-height: 1.1; }
.facts span { color: var(--muted); font-size: .95rem; }

/* the answer sheet (memorable element) */
.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius-m); padding: 18px 18px 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid var(--rule); padding-bottom: 8px; margin-bottom: 10px; }
.sheet-head h2, .sheet-head h3 { font-size: 1.05rem; margin: 0; font-family: var(--f-body); }
.sheet-grid { display: grid; grid-template-columns: 2.2em repeat(5, 1fr); gap: 4px 6px; align-items: center; }
.sheet-grid .col-h { text-align: center; font-weight: 700; color: var(--muted); font-size: .85rem; }
.sheet-grid .row-n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; text-align: center; }
.bubble { width: 30px; height: 30px; margin-inline: auto; border-radius: 50%; border: 2px solid var(--rule); background: var(--paper); display: grid; place-items: center; font-size: .78rem; color: var(--muted); padding: 0; font-family: var(--f-body); }
button.bubble { cursor: pointer; }
.bubble.marked { background: var(--pen); border-color: var(--pen); color: #fff; }
.bubble.right { background: var(--ok); border-color: var(--ok); color: #fff; }
.bubble.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.bubble.key { border-color: var(--ok); border-width: 3px; color: var(--ok); font-weight: 700; }
.row-current .row-n { color: var(--pen); font-weight: 700; }

/* sections */
.section { padding: 56px 0; border-bottom: 1px solid var(--rule); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.plain-list { padding-inline-start: 1.2em; margin: 0 0 1em; }
.plain-list li { margin-bottom: .45em; max-width: var(--measure); }
.method { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.method li { counter-increment: step; position: relative; padding-inline-start: 3.2em; margin-bottom: 1.4em; max-width: var(--measure); }
.method li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; width: 2.1em; height: 2.1em; border-radius: 50%; border: 2px solid var(--pen); color: var(--pen); display: grid; place-items: center; font-weight: 700; }
.result-table { border-collapse: collapse; width: 100%; max-width: 640px; margin: 8px 0 16px; font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { border-bottom: 1px solid var(--rule); padding: 10px 8px; text-align: start; }
.result-table th { color: var(--muted); font-weight: 600; font-size: .95rem; }
.price-box { border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 24px; max-width: 520px; }
.price { font-family: var(--f-head); font-size: 2.6rem; font-weight: 700; }
details { border-bottom: 1px solid var(--rule); padding: 14px 0; max-width: 780px; }
summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; }
details p { margin-top: .6em; }
.site-foot { padding: 32px 0 84px; color: var(--muted); font-size: .95rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 12px; }
.site-foot a { color: var(--ink-2); }
.notice { border-inline-start: 4px solid var(--pen); background: var(--pen-soft); padding: 12px 16px; border-radius: var(--radius-s); margin: 0 0 16px; max-width: 780px; }
.notice.bad { border-color: var(--bad); background: var(--bad-soft); }
.notice.ok { border-color: var(--ok); background: var(--ok-soft); }

/* question card */
.qcard { max-width: 820px; }
.qmeta { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--muted); font-size: .95rem; margin-bottom: 10px; }
.qctx { background: var(--sheet); border-inline-start: 4px solid var(--rule); padding: 12px 16px; border-radius: var(--radius-s); margin-bottom: 14px; white-space: pre-line; }
.qstem { font-size: 1.2rem; font-weight: 600; margin-bottom: 16px; white-space: pre-line; max-width: none; }
.opts { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; width: 100%; text-align: start; background: var(--paper); border: 2px solid var(--rule); border-radius: var(--radius-m); padding: 12px 14px; font: inherit; color: var(--ink); cursor: pointer; }
.opt:hover { border-color: var(--ink-2); }
.opt .ltr { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--rule); display: grid; place-items: center; font-weight: 700; }
.opt[aria-checked="true"] { border-color: var(--pen); background: var(--pen-soft); }
.opt[aria-checked="true"] .ltr { background: var(--pen); border-color: var(--pen); color: #fff; }
.opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-right .ltr { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.is-wrong .ltr { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt[disabled] { cursor: default; }
.feedback { border-radius: var(--radius-m); padding: 16px 18px; margin-bottom: 16px; border: 2px solid var(--rule); }
.feedback.ok { border-color: var(--ok); background: var(--ok-soft); }
.feedback.bad { border-color: var(--bad); background: var(--bad-soft); }
.feedback h3 { margin-bottom: .3em; }
.source { font-size: .95rem; border-top: 1px solid var(--rule); padding-top: 10px; margin-top: 10px; }
.source q { quotes: "״" "״"; }
.dn { margin: .4em 0 0; padding-inline-start: 1.2em; }

/* app shell */
.app-main { padding: 28px 0 96px; min-height: 60vh; }
#main:focus { outline: none; }
.topic-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.topic-item a { display: block; border: 2px solid var(--rule); border-radius: var(--radius-m); padding: 14px 16px; color: var(--ink); text-decoration: none; }
.topic-item a:hover { border-color: var(--ink-2); }
.meter { height: 8px; background: var(--sheet-2); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.meter > i { display: block; height: 100%; background: var(--pen); }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.2rem; }
.exam-layout { display: grid; grid-template-columns: 1fr 290px; gap: 28px; align-items: start; }
.exam-layout .sheet { position: sticky; top: 12px; }
.breakdown { list-style: none; padding: 0; margin: 0 0 1em; max-width: 640px; }
.breakdown li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.code-input { font: 700 1.3rem var(--f-body); letter-spacing: .12em; direction: ltr; text-align: center; padding: 12px; width: min(100%, 420px); border: 2px solid var(--ink-2); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); }
label.field { display: block; font-weight: 700; margin-bottom: 6px; }
.empty { border: 2px dashed var(--rule); border-radius: var(--radius-m); padding: 24px; max-width: 640px; }
.banner { position: sticky; top: 0; z-index: 50; background: var(--bad-soft); border-bottom: 2px solid var(--bad); padding: 10px 0; }
.loading { display: flex; gap: 10px; align-items: center; color: var(--muted); }
.loading::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--rule); border-top-color: var(--pen); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.legal h2 { margin-top: 1.6em; }
.legal table { border-collapse: collapse; margin: 8px 0 16px; width: 100%; max-width: 900px; }
.legal td, .legal th { overflow-wrap: anywhere; }
.legal th, .legal td { border: 1px solid var(--rule); padding: 8px; text-align: start; vertical-align: top; }

/* accessibility menu */
.a11y-toggle { position: fixed; inset-inline-start: 12px; bottom: 12px; z-index: 60; width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--paper); background: var(--ink); color: var(--paper); cursor: pointer; display: grid; place-items: center; }
.a11y-panel { position: fixed; inset-inline-start: 12px; bottom: 68px; z-index: 61; width: min(330px, calc(100vw - 28px)); background: var(--paper); border: 2px solid var(--ink); border-radius: var(--radius-m); padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.a11y-panel[hidden] { display: none; }
.a11y-panel h2 { font-size: 1.15rem; font-family: var(--f-body); }
.a11y-panel .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.a11y-panel button { min-height: 44px; border: 2px solid var(--rule); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); font: 600 .95rem var(--f-body); cursor: pointer; padding: 6px; }
.a11y-panel button[aria-pressed="true"] { border-color: var(--pen); background: var(--pen-soft); }

@media (max-width: 900px) {
  .hero .wrap, .cols-2, .cols-3, .exam-layout { grid-template-columns: 1fr; }
  .exam-layout .sheet { position: static; }
  .hero { padding-top: 36px; }
}
@media (max-width: 420px) {
  .facts { grid-template-columns: 1fr 1fr; }
  .bubble { width: 26px; height: 26px; }
  .opt { grid-template-columns: 34px 1fr; padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .a11y-toggle, .site-nav, .banner { display: none; } }
.opt-tag { font-weight: 700; font-size: .9em; }
.qstem:focus { outline: 2px dashed var(--pen); outline-offset: 4px; }
.mark-dot { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--pen); box-shadow: 0 0 0 3px var(--paper), 0 0 0 4.5px var(--pen); flex: none; }
.cancel-form input, .cancel-form textarea { font: inherit; padding: 10px; width: min(100%, 420px); border: 2px solid var(--ink-2); border-radius: var(--radius-s); background: var(--paper); color: var(--ink); }
.cancel-form [aria-invalid="true"] { border-color: #b00020; }
.cancel-line { font-weight: 700; }
.brand-logo { width: 28px; height: 28px; border-radius: 7px; flex: none; }
