/* Stylesheet for the generated static pages under certs/ (see
   scripts/build-pages.mjs). Deliberately small: these pages are plain documents
   for readers and crawlers, the interactive app has its own stylesheet. */

:root {
  --bg: #0b0d12; --panel: #13171f; --border: #232a37; --border-strong: #2e3645;
  --text: #e6e8ec; --text-dim: #b3b9c5; --muted: #7d8595;
  --accent: #8aa9d4; --accent-strong: #a8c1e6; --accent-soft: rgba(138, 169, 212, .12);
  --mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f7f8fa; --panel: #ffffff; --border: #e3e6ec; --border-strong: #cdd2dc;
    --text: #161a22; --text-dim: #3e4654; --muted: #6a7280;
    --accent: #3f6ea4; --accent-strong: #2c558a; --accent-soft: rgba(63, 110, 164, .1);
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
small { color: var(--muted); font-size: .85em; font-weight: 400; }

.top, main, footer { max-width: 920px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.brand { font: 700 16px var(--mono); color: var(--text); letter-spacing: -.02em; }
.brand:hover { color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.top nav { display: flex; gap: 18px; font-size: 13px; }
main { padding-top: 22px; padding-bottom: 40px; }
footer { padding-top: 18px; padding-bottom: 40px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }
footer p { margin: 0 0 6px; }

.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
h1 { font-size: 28px; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 12px; text-wrap: balance; }
h1 .acro { display: inline-block; font: 600 .55em var(--mono); color: var(--accent); padding: 2px 8px; border: 1px solid var(--accent); border-radius: 6px; vertical-align: middle; white-space: nowrap; }
h2 { font-size: 17px; margin: 32px 0 12px; }
.lead { font-size: 17px; color: var(--text-dim); margin: 0 0 12px; }
p { margin: 0 0 14px; max-width: 70ch; }

.cta { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 6px; max-width: none; }
.btn { display: inline-block; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--panel); color: var(--text-dim); font-size: 13.5px; }
.btn:hover { color: var(--text); border-color: var(--accent); text-decoration: none; }
.btn.primary { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }

.facts { margin: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.facts > div { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--panel); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.facts small { display: block; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; max-width: none; }
.tags a { font-size: 12px; padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); }
.tags a:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }

.related { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.related a { font: 600 13.5px var(--mono); }
.related span { color: var(--muted); font-size: 12.5px; }

.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: 18px 0 4px; }
.toc a { font-size: 12.5px; padding: 3px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); }
.toc a:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
th, td { padding: 7px 10px 7px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
td:first-child a { font: 600 13.5px var(--mono); }
td:first-child span { display: block; color: var(--muted); font-size: 12.5px; }
td:last-child, th:last-child { text-align: right; padding-right: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
section { scroll-margin-top: 16px; }

@media (max-width: 600px) {
  h1 { font-size: 23px; }
  .facts > div { grid-template-columns: 1fr; gap: 0; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}

.toc small { margin-left: 2px; }

/* ---------- prose ---------- */
main p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; text-wrap: pretty; }
.cta, .tags { text-align: left; }

/* ---------- about page ---------- */
.hero { text-align: center; padding: 28px 0 8px; }
.hero .mark { display: block; margin: 0 auto 18px; }
.mark-bg { fill: var(--panel); stroke: var(--border-strong); }
.mark-grid circle { fill: var(--border-strong); }
.mark-path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mark-node { fill: var(--accent); }
.kicker { margin: 0 0 6px; max-width: none; text-align: center; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.hero h1 { font-size: 38px; max-width: 16ch; margin: 0 auto 14px; }
.hero .lead { max-width: 56ch; margin: 0 auto; text-align: center; hyphens: manual; }
.hero .cta { justify-content: center; margin-top: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 30px; }
.stat { padding: 16px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.stat strong { display: block; font: 700 28px var(--mono); letter-spacing: -.03em; color: var(--text); }
.stat span { font-size: 12px; color: var(--muted); }

.block { margin-top: 44px; }
.block > h2 { margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.prose p { max-width: none; color: var(--text-dim); }
.prose.two { columns: 2; column-gap: 34px; }
.prose.two p { break-inside: avoid; margin: 0 0 12px; }

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.steps li { counter-increment: step; padding: 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
.steps li::before { content: "0" counter(step); display: block; margin-bottom: 10px; font: 600 12px var(--mono); color: var(--accent); }
.steps strong { display: block; margin-bottom: 4px; font-size: 15px; }
.steps span { font-size: 13px; line-height: 1.5; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.tile { display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text-dim); }
.tile:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.tile strong { display: block; font: 700 22px var(--mono); color: var(--accent); letter-spacing: -.02em; }
.tile span { font-size: 13px; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 34px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 100px 26px; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.bars a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars b, .columns b { font: 500 12px var(--mono); color: var(--muted); text-align: right; }
.bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.bar i[data-w="1"] { width: 5%; }
.bar i[data-w="2"] { width: 10%; }
.bar i[data-w="3"] { width: 15%; }
.bar i[data-w="4"] { width: 20%; }
.bar i[data-w="5"] { width: 25%; }
.bar i[data-w="6"] { width: 30%; }
.bar i[data-w="7"] { width: 35%; }
.bar i[data-w="8"] { width: 40%; }
.bar i[data-w="9"] { width: 45%; }
.bar i[data-w="10"] { width: 50%; }
.bar i[data-w="11"] { width: 55%; }
.bar i[data-w="12"] { width: 60%; }
.bar i[data-w="13"] { width: 65%; }
.bar i[data-w="14"] { width: 70%; }
.bar i[data-w="15"] { width: 75%; }
.bar i[data-w="16"] { width: 80%; }
.bar i[data-w="17"] { width: 85%; }
.bar i[data-w="18"] { width: 90%; }
.bar i[data-w="19"] { width: 95%; }
.bar i[data-w="20"] { width: 100%; }

.columns { list-style: none; margin: 0; padding: 0; columns: 4; column-gap: 28px; font-size: 13px; }
.columns li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border); break-inside: avoid; }
.columns a { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.faq details { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 13px 16px; font-weight: 600; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 18px var(--mono); color: var(--muted); line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details[open] summary { color: var(--accent); }
.faq p { margin: 0; padding: 0 16px 15px; max-width: none; color: var(--text-dim); }

@media (max-width: 760px) {
  .hero h1 { font-size: 28px; }
  .stats, .tiles, .steps { grid-template-columns: repeat(2, 1fr); }
  .prose.two { columns: 1; }
  .bars { grid-template-columns: 1fr; }
  .columns { columns: 2; }
}

/* ---------- home page ---------- */
.btn.big { padding: 11px 20px; font-size: 15px; border-radius: 10px; }
.contact { font-size: 15px; text-align: left; }

/* ---------- sponsors ---------- */
.support { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 18px 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); }
.support > div { flex: 1; min-width: 240px; }
.support strong { display: block; font-size: 15px; margin-bottom: 2px; }
.support span { font-size: 13.5px; line-height: 1.55; color: var(--text-dim); }
.supporters { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 28px; margin-bottom: 16px; }
.supporter .slot { border: 0; background: none; padding: 0; height: 44px; }
.supporter.tier-gold .slot { height: 64px; }
.supporter.tier-bronze .slot { height: 32px; }
.supporter img { max-height: 100%; max-width: 200px; object-fit: contain; }

.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-items: stretch; }
.tier { display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--border); border-top: 3px solid var(--tier); border-radius: 12px; background: var(--panel); }
.tier-gold { --tier: #d4af37; }
.tier-silver { --tier: #aab4c3; }
.tier-bronze { --tier: #c08457; }
.tier-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.tier-head h3 { margin: 0; font-size: 20px; letter-spacing: -.01em; color: var(--tier); }
.tier-head span { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tier-terms { flex: 1; list-style: none; margin: 0 0 16px; padding: 0; font-size: 13.5px; color: var(--text-dim); }
.tier-terms li { position: relative; padding: 5px 0 5px 18px; line-height: 1.45; }
.tier-terms li::before { content: ""; position: absolute; left: 2px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--tier); }
.slots { display: flex; gap: 6px; }
.slot { flex: 1; display: flex; align-items: center; justify-content: center; height: 46px; padding: 6px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
.slot img { max-width: 86%; max-height: 80%; object-fit: contain; }
.slot.empty { border-style: dashed; border-color: var(--border-strong); }
.slot.empty span { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.fine { margin-top: 14px; max-width: none; font-size: 12.5px; color: var(--muted); text-align: left; }
.steps.plain li::before { content: none; }
@media (max-width: 760px) { .tiers { grid-template-columns: 1fr; } }

.steps.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .steps.three { grid-template-columns: 1fr; } }

/* ---------- comparisons and preparation ---------- */
table.versus th[scope="row"] { width: 150px; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 500; color: var(--muted); }
table.versus thead th { font-size: 15px; text-transform: none; letter-spacing: 0; }
table.versus thead th a { font: 700 16px var(--mono); }
table.versus td { width: 40%; text-align: left; white-space: normal; padding-right: 14px; }
table.versus td:last-child, table.versus th:last-child { text-align: left; white-space: normal; }
table.versus small { display: block; }
.diff { margin: 0; padding-left: 20px; color: var(--text-dim); }
.diff li { margin-bottom: 6px; max-width: 75ch; }
ul.prep { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
ul.prep li { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--panel); }
ul.prep li:last-child { border-bottom: 0; }
ul.prep span { font-size: 12.5px; color: var(--muted); }
.prep-sponsored { margin-bottom: 10px; }
.prep-sponsored small { display: block; margin-bottom: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }

/* ---------- languages and right-to-left pages ---------- */
.langs { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -8px 0 18px; font-size: 12.5px; }
.langs a, .langs span { padding: 2px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-dim); }
.langs span { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.langs a:hover { border-color: var(--accent); text-decoration: none; }
[dir="rtl"] th, [dir="rtl"] table.versus td, [dir="rtl"] table.versus td:last-child, [dir="rtl"] table.versus th:last-child { text-align: right; }
[dir="rtl"] th, [dir="rtl"] td { padding: 7px 0 7px 10px; }
[dir="rtl"] .diff { padding-left: 0; padding-right: 20px; }
[dir="rtl"] .fine, [dir="rtl"] .cta { text-align: right; }
[dir="rtl"] body { font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Sans Hebrew", -apple-system, sans-serif; }
[dir="rtl"] .faq summary { text-align: right; }

.orline { margin: -6px 0 10px; max-width: none; font-size: 18px; font-weight: 600; color: var(--accent); text-align: start; }

/* ---------- study plan ---------- */
h3.phase { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--accent); }
ol.prep { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; counter-reset: none; }
ol.prep li { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 9px 14px; border-bottom: 1px solid var(--border); background: var(--panel); }
ol.prep li:last-child { border-bottom: 0; }
ol.prep li::before { content: attr(value); flex: none; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font: 600 11px var(--mono); color: var(--accent); border: 1px solid var(--accent); background: var(--accent-soft); }
ol.prep li a { flex: 1; min-width: 200px; }
ol.prep span { font-size: 12.5px; color: var(--muted); }

/* ---------- folding plan phases ---------- */
details.phase { margin: 8px 0 0; border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
details.phase summary { display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; list-style: none; font-weight: 600; font-size: 14.5px; }
details.phase summary::-webkit-details-marker { display: none; }
details.phase summary::before { content: "+"; width: 12px; font: 400 17px var(--mono); line-height: 1; color: var(--accent); }
details.phase[open] summary::before { content: "\2212"; }
details.phase summary small { margin-inline-start: auto; font: 500 12px var(--mono); }
details.phase ol.prep { border: 0; border-top: 1px solid var(--border); border-radius: 0 0 10px 10px; }
details.phase ol.prep li { background: none; }
h2.phase { display: flex; align-items: baseline; gap: 10px; scroll-margin-top: 16px; }
h2.phase small { font: 500 12px var(--mono); }

.steps.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 900px) { .steps.five { grid-template-columns: repeat(2, 1fr); } }

/* ---------- code ---------- */
pre { margin: 0 0 14px; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); direction: ltr; text-align: left; }
code { font: 12.5px/1.6 var(--mono); }
td code { white-space: nowrap; }

ol.terms { margin: 0 0 14px; padding-inline-start: 22px; color: var(--text-dim); }
ol.terms li { margin-bottom: 7px; max-width: 78ch; }
