/* Blog articles: the information-page shell from legal.css, plus long-form reading styles.
   Loaded after legal.css on article pages and the 404 page only, so an article change can
   never alter a policy page. legal.css styles every header, nav, footer, section, button
   and input, so the article's own blocks use classes and undo those rules explicitly.
   body.post is the article layout: the city behind the title, a sticky bar, the text
   with a side column of contents, then rating, sharing, author and comments. */
:root { --code: #0b1712; --rule: rgba(169, 223, 143, .5); --star: #e8b45a; --soft: rgba(169, 223, 143, .08); }
html[data-theme=day] { --code: #f5f7ef; --rule: rgba(23, 107, 77, .45); --star: #b7791f; --soft: rgba(23, 107, 77, .07); }
html { scroll-padding-top: 84px; }
body > header, body > footer { max-width: 860px; }
main.article { max-width: 860px; }

/* -- the head of the article -- */
main nav.crumbs { max-width: none; margin: 0 0 22px; padding: 0; display: block; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; color: var(--dim); }
.crumbs li + li::before { content: "/"; margin-inline-end: 10px; color: var(--line); }
.crumbs a { min-height: 44px; display: inline-flex; align-items: center; }
.kicker { margin: 0 0 16px; font: 400 10px/1.8 'Press Start 2P', monospace; color: var(--accent); overflow-wrap: normal; }
html[lang=ar] .kicker { font: 700 13px/1.8 'IBM Plex Sans Arabic', sans-serif; }
.prose h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.22; letter-spacing: -.015em; text-wrap: balance; }
html[lang=ar] h1 { font-family: 'IBM Plex Sans Arabic', sans-serif; line-height: 1.65; letter-spacing: 0; }
.prose .lead { margin-top: 26px; font-size: 1.14em; line-height: 1.75; color: var(--ink); max-width: 66ch; }
section[lang=ar] { font-family: 'IBM Plex Sans Arabic', sans-serif; font-size: 18px; }

/* -- prose -- */
.prose p { margin-top: 14px; }
.prose p, .prose li { max-width: 70ch; }
.prose blockquote p { margin-top: 0; }
.prose h2 { margin-top: 60px; font-size: clamp(22px, 3vw, 28px); line-height: 1.35; }
.prose h3 { margin-top: 34px; margin-bottom: 4px; font-size: 19px; line-height: 1.45; }
html[lang=ar] .prose h2, html[lang=ar] .prose h3 { line-height: 1.7; }
.prose ul, .prose ol { margin: 14px 0 0; padding-inline-start: 24px; color: var(--dim); }
.prose li { margin-top: 10px; }
.prose li::marker { color: var(--accent); }
.prose strong, .prose em { color: var(--ink); }
.prose q { color: var(--ink); }
code { font-family: 'Space Mono', ui-monospace, monospace; font-size: .86em; direction: ltr; unicode-bidi: isolate; }
:not(pre) > code { padding: .08em .36em; border: 1px solid var(--line); border-radius: 5px; background: var(--code); color: var(--ink); overflow-wrap: anywhere; }
pre { margin: 18px 0 0; padding: 16px 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--code); line-height: 1.75; direction: ltr; text-align: left; }
pre code { font-size: 13.5px; white-space: pre; color: var(--ink); }
pre:focus-visible, .table-wrap:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
blockquote { margin: 18px 0 0; padding: 2px 0; padding-inline-start: 18px; border-inline-start: 3px solid var(--rule); }
blockquote p { color: var(--ink); }
figure { margin: 30px 0 0; }
figure img { display: block; width: 100%; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
figure.narrow img { max-width: 460px; }
figcaption { margin-top: 10px; font-size: 14px; line-height: 1.7; color: var(--dim); }
html[lang=ar] figcaption { font-size: 15px; }
.table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.65; }
html[lang=ar] table { font-size: 16px; }
caption { padding: 12px 16px; text-align: start; font-weight: 700; color: var(--ink); }
th, td { padding: 10px 16px; text-align: start; vertical-align: top; border-top: 1px solid var(--line); }
th { color: var(--ink); }
td { color: var(--dim); }
td code { white-space: nowrap; }
td:last-child code, td code.wrap { white-space: normal; }

/* -- summary and the closing invitation -- */
.summary { margin-top: 30px; padding: 20px 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.summary h2 { margin-top: 0; font-size: 18px; }
.cta { margin-top: 64px; padding: 24px 26px; border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); }
.cta h2 { margin-top: 0; font-size: 22px; }
.cta-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 6px; padding: 0 20px; border-radius: 8px; background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none; }
.cta-link:hover { filter: brightness(1.08); }

/* -- footer of the page -- */
.page-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }
.page-foot nav { padding: 0; margin: 0; max-width: none; }

@media (max-width: 600px) {
  .summary, .cta { padding: 16px 18px; }
  pre { padding: 14px; }
  pre code { font-size: 12.5px; }
  th, td { padding: 9px 12px; }
}

/* =============================================================== the post layout */
/* Reading colours: text is neutral (not green), green stays for links and accents only.
   Night is a soft charcoal; day is warm paper. Both keep body text above 7:1. */
body.post { --bg: #0d1110; --panel: #141a18; --ink: #edf0ee; --dim: #b8c1bc; --accent: #9fdc84; --line: #3a4741; --code: #0a0d0c;
  --rule: rgba(159, 220, 132, .45); --soft: rgba(159, 220, 132, .08); }
html[data-theme=day] body.post { --bg: #f7f5ef; --panel: #ffffff; --ink: #1c2220; --dim: #4b5450; --accent: #1d7350; --line: #d6d9d2; --code: #f1efe8;
  --rule: rgba(29, 115, 80, .4); --soft: rgba(29, 115, 80, .07); --star: #b06f12; }
.post { --wrap: 1140px; --gut: clamp(16px, 4vw, 40px); }
.post .prose p, .post .prose li, .post .prose td { color: color-mix(in srgb, var(--ink) 86%, var(--bg)); }
.post [hidden] { display: none !important; }
.post .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.post #city { position: fixed; inset: 0; width: 100%; height: 100vh; z-index: 0; display: block; image-rendering: pixelated; pointer-events: none; }
.post > :not(#city):not(.read-progress):not(.skip):not(.to-top):not(.wkc) { position: relative; z-index: 1; }
.read-progress { position: fixed; inset: 0 0 auto; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--accent); box-shadow: 0 0 12px var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
html[dir=rtl] .read-progress span { transform-origin: 100% 50%; }
.post .skip { z-index: 70; }

/* the bar: brand, sections of the site, language, theme and the one call to action */
.post > header.site-bar { position: sticky; top: 0; z-index: 50; max-width: none; margin: 0; padding: 10px var(--gut); display: flex; align-items: center; flex-wrap: nowrap; gap: 8px 22px;
  background: color-mix(in srgb, var(--bg) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.site-bar .brand { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font: 400 12px/1 'Press Start 2P', monospace; color: var(--ink); text-decoration: none; white-space: nowrap; }
.caret { width: 8px; height: 14px; background: var(--accent); animation: caret 1.1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.post nav.site-nav { max-width: none; margin: 0; padding: 0; gap: 0 4px; flex-wrap: nowrap; }
.site-nav a { padding: 0 12px; border-radius: 8px; font-size: 14px; color: var(--dim); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--ink); background: var(--soft); }
.bar-tools { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.bar-lang { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; font-size: 14px; }
.post header #policyTheme { margin: 0; padding: 0 14px; font-size: 13px; }
.bar-cta { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap; }
.bar-cta:hover { filter: brightness(1.08); }

/* the title over the city, fading into the page */
.post main.article { max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
/* the hero is at least as tall as the scene's skyline sits, so the city shows under the title */
.hero { min-height: min(82vh, 760px); display: flex; flex-direction: column; justify-content: center; padding: clamp(36px, 7vh, 90px) var(--gut) clamp(70px, 14vh, 150px);
  background: linear-gradient(180deg, transparent 0%, transparent 72%, color-mix(in srgb, var(--bg) 70%, transparent) 90%, var(--bg) 100%); }
.hero-inner { width: 100%; }
.hero-inner { max-width: var(--wrap); margin: 0 auto; }
.hero .crumbs ol { font-size: 13px; }
.hero h1 { max-width: 19ch; font-size: clamp(34px, 5.6vw, 66px); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; text-shadow: 0 2px 28px color-mix(in srgb, var(--bg) 85%, transparent); }
html[lang=ar] .hero h1 { max-width: 24ch; line-height: 1.45; }
.dek { max-width: 60ch; margin-top: 22px; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.7; color: var(--ink); text-shadow: 0 1px 14px var(--bg); }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; margin-top: 28px; font-size: 14px; color: var(--dim); }
.avatar { display: inline-grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule); background: var(--code); color: var(--accent); font: 400 10px/1 'Press Start 2P', monospace; }
.avatar.big { width: 64px; height: 64px; font-size: 14px; }
.who { display: grid; line-height: 1.35; }
.who b { color: var(--ink); }
.who small { font-size: 12.5px; }
.facts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.facts > * + *::before { content: "·"; margin-inline: .65em; color: var(--line); text-decoration: none; display: inline-block; }
.facts a { color: var(--star); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.chips li { padding: 3px 12px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--bg) 60%, transparent); font-size: 13px; color: var(--ink); }

/* the text and its side column */
.read-wrap { background: var(--bg); padding: 8px var(--gut) 72px; }
.read-grid { max-width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.col { min-width: 0; }
.post .prose { font-size: 17.5px; line-height: 1.85; }
html[lang=ar] .post .prose { font-size: 19px; }
.post .prose > .lead:first-child, .post .prose > p:first-child { margin-top: 0; }
.side-inner { display: grid; gap: 18px; }
.toc { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.toc summary { min-height: 48px; display: flex; align-items: center; padding: 0 18px; cursor: pointer; font-weight: 700; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; margin-inline-start: auto; color: var(--accent); font-size: 20px; }
.toc[open] summary::after { content: "–"; }
.post .toc nav { display: block; max-width: none; margin: 0; padding: 0 10px 12px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.post .toc a { display: flex; gap: 10px; min-height: 0; padding: 7px 10px; border-radius: 8px; border-inline-start: 2px solid transparent; font-size: 14px; line-height: 1.5; color: var(--dim); text-decoration: none; }
.toc a::before { content: counter(toc, decimal-leading-zero); font: 400 12px/1.9 'Space Mono', monospace; color: var(--line); }
.toc a:hover { color: var(--ink); background: var(--soft); }
.toc a.is-here { color: var(--ink); background: var(--soft); border-inline-start-color: var(--accent); }
.toc a.is-here::before { color: var(--accent); }
.hire { padding: 20px; border: 1px solid var(--rule); border-radius: 12px; background: linear-gradient(160deg, var(--soft), transparent 70%), var(--panel); }
.hire p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.65; }
.post .hire .hire-kicker { margin: 0; font: 400 9px/1.8 'Press Start 2P', monospace; color: var(--accent); }
html[lang=ar] .post .hire .hire-kicker { font: 700 13px/1.8 'IBM Plex Sans Arabic', sans-serif; }
.post .hire .hire-title { margin-top: 8px; font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.hire-cta { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 14px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--bg); font-weight: 700; text-decoration: none; }
.hire-cta:hover { filter: brightness(1.08); }

/* code blocks get a copy button */
.code-block { position: relative; }
.post button.copy-code { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 1; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--ink); font-size: 12.5px; opacity: .85; }
.post button.copy-code:hover, .post button.copy-code:focus-visible { opacity: 1; border-color: var(--accent); }
.code-block pre { padding-top: 46px; }

/* after the text */
.post .col > section, .share, .author-box { margin-top: 48px; }
.post .col > section h2, .author-box .ab-name { margin: 0; font-size: 22px; line-height: 1.4; }
.rate { padding: 26px; border: 1px solid var(--rule); border-radius: 14px; background: linear-gradient(135deg, var(--soft), transparent 60%), var(--panel); text-align: center; }
.rate p { margin: 6px auto 0; }
.stars { display: flex; justify-content: center; gap: 6px; margin-top: 14px; direction: ltr; }
html[dir=rtl] .stars { flex-direction: row-reverse; }
.post .stars button { display: grid; place-items: center; width: 52px; height: 52px; min-height: 0; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--line); cursor: pointer; transition: transform .15s, color .15s; }
.stars svg { width: 38px; height: 38px; fill: currentColor; }
.post .stars button.on { color: var(--star); }
.post .stars button:hover { transform: scale(1.12); }
.rate .rate-score { min-height: 1.85em; font-size: 14.5px; color: var(--dim); }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.share-label { margin-inline-end: 6px; font-weight: 700; color: var(--ink); }
.share a, .post .share button { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); font-size: 14px; text-decoration: none; }
.share a:hover, .post .share button:hover { border-color: var(--accent); color: var(--accent); }
.author-box { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.author-box p { margin: 6px 0 0; }
.post .author-box .ab-label { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.ab-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.ab-links a { min-height: 44px; display: inline-flex; align-items: center; }
.next-up ul { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.next-up li { padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); }
.soon { display: inline-block; margin-inline-end: 8px; padding: 1px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--rule); color: var(--accent); font-size: 12.5px; }
.comments .comment-list { margin: 18px 0 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.comment { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.comment-head { display: flex; align-items: center; gap: 10px; }
.comment-head .avatar { width: 32px; height: 32px; font-size: 9px; }
.comment-head time { margin-inline-start: auto; font-size: 13px; color: var(--dim); }
.post .comment-body { margin: 10px 0 0; white-space: pre-line; color: var(--ink); }
.comment-form { display: grid; gap: 6px; margin-top: 22px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.comment-form label { font-weight: 700; font-size: 14px; margin-top: 8px; }
.post .comment-form input, .comment-form textarea { width: 100%; height: auto; min-height: 46px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.comment-form textarea { resize: vertical; line-height: 1.6; }
.comment-form [aria-invalid=true] { border-color: #ff7a63; }
.comment-form .hp { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }
.post .comment-form .form-note { margin: 4px 0 0; font-size: 13.5px; }
.comment-form button[type=submit] { justify-self: start; margin-top: 10px; border-radius: 999px; font-weight: 700; }
.comment-form button[disabled] { opacity: .6; cursor: progress; }
.form-status:empty { display: none; }
.post .to-top { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 40; width: 48px; height: 48px; padding: 0; border: 1px solid var(--rule); border-radius: 50%; background: var(--panel); color: var(--accent); font-size: 20px; box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.post .to-top[hidden] { display: none; }
.post > footer.page-foot { max-width: none; margin: 0; padding: 28px max(var(--gut), calc((100% - var(--wrap)) / 2)) 40px; background: var(--bg); border-top: 1px solid color-mix(in srgb, var(--line) 45%, transparent); }

@media (min-width: 1080px) {
  .read-grid { grid-template-columns: minmax(0, 740px) 300px; justify-content: space-between; gap: 56px; }
  .side { grid-column: 2; grid-row: 1; }
  .col { grid-column: 1; grid-row: 1; }
  .side-inner { position: sticky; top: 86px; }
  /* the list scrolls inside its box so the invitation below it always stays in view */
  .post .toc nav { max-height: max(160px, calc(100vh - 430px)); overflow-y: auto; scrollbar-width: thin; }
  .toc summary { pointer-events: none; }
  .toc summary::after { display: none; }
}
@media (max-width: 860px) {
  .post nav.site-nav { display: none; }
}
@media (max-width: 600px) {
  .post .site-bar .brand { font-size: 10px; }
  .post header #policyTheme { padding: 0 10px; font-size: 12px; }
  .bar-cta { padding: 0 12px; }
  .rate, .author-box, .comment-form { padding: 18px; }
  .author-box { flex-direction: column; }
  .post .stars button { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .caret { animation: none; }
  .post .stars button { transition: none; }
}
@media print {
  body > header, body > footer, .crumbs, .toc, .cta, .side, .rate, .share, .author-box, .next-up, .comments, .to-top, .read-progress, #city, .copy-code { display: none !important; }
  main.article { border: 0; padding: 0; }
  .hero, .read-wrap { background: none; padding: 0; }
  pre { white-space: pre-wrap; }
}
