/* Refreshed look: warm palette, Newsreader for display text, Inter for UI and body.
   Loaded after the other theme styles; every rule is scoped to html.refresh so it can be switched off in one place. */
@font-face{font-family:Inter;font-style:normal;font-weight:400 600;font-display:swap;src:url('./fonts/inter-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Inter;font-style:normal;font-weight:400 600;font-display:swap;src:url('./fonts/inter-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Newsreader;font-style:normal;font-weight:400;font-display:swap;src:url('./fonts/newsreader-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Newsreader;font-style:normal;font-weight:400;font-display:swap;src:url('./fonts/newsreader-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:Newsreader;font-style:italic;font-weight:400;font-display:swap;src:url('./fonts/newsreader-italic-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:Newsreader;font-style:italic;font-weight:400;font-display:swap;src:url('./fonts/newsreader-italic-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400 600;font-display:swap;src:url('./fonts/jetbrains-mono-latin.woff2') format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:'JetBrains Mono';font-style:normal;font-weight:400 600;font-display:swap;src:url('./fonts/jetbrains-mono-latin-ext.woff2') format('woff2');unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}

html.refresh{--paper:#fdfdfc;--ink:#1d1b18;--muted:#6a645c;--line:#eaeae6;--blue:#1764e8;--serif:Newsreader,Georgia,serif;--sans:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
html.refresh[data-theme=dark]{--paper:#121110;--ink:#ece8e1;--muted:#a39d93;--line:#2e2c29;--blue:#79a6ff}
/* Persian pages keep Vazirmatn everywhere; only colour and spacing change there. */
html.refresh[dir=rtl]{--serif:Vazirmatn,Tahoma,sans-serif;--sans:Vazirmatn,Tahoma,sans-serif}
html.refresh[dir=rtl] :is(h1,h2,h3,.post-title){letter-spacing:0!important}
html.refresh body{background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:16.5px}
html.refresh .site-header::before{background:color-mix(in srgb,var(--paper) 92%,transparent)}

/* Intro: serif name, bright tagline, muted bio */
html.refresh .intro{gap:44px;margin:64px 0 42px;align-items:center}
html.refresh .portrait img{width:168px;height:188px;border-radius:10px;filter:grayscale(1) contrast(1.04);transition:filter .5s ease}
html.refresh .portrait img:hover{filter:none}
html.refresh .intro h1{font:400 58px/1.04 var(--serif);letter-spacing:-.02em;margin:0 0 18px;color:var(--ink)}
html.refresh .intro .role{font-size:20px;font-weight:400;line-height:1.5;letter-spacing:-.01em;color:var(--ink);margin:0 0 10px}
html.refresh .intro .bio{font-size:16.5px;line-height:1.7;color:var(--muted);max-width:560px}

/* Social links: pills with icon and name */
html.refresh .social-links{gap:10px;margin-top:26px;flex-wrap:wrap}
html.refresh .social-links a{text-decoration:none;width:auto;height:auto;gap:8px;padding:8px 15px;border:1px solid var(--line);border-radius:999px;color:var(--ink);font:500 13.5px var(--sans);transition:border-color .2s,background .2s}
html.refresh .social-links svg{width:14px;height:14px}
@media(hover:hover){html.refresh .social-links a:hover{color:var(--ink);border-color:var(--muted);background:color-mix(in srgb,var(--ink) 4%,transparent)}}

/* Sections: full-width hairline and a serif heading */
html.refresh .writing-section{position:relative;padding-top:32px;margin-bottom:40px}
html.refresh .writing-section::before{content:'';position:absolute;top:0;left:50%;width:100vw;transform:translateX(-50%);border-top:1px solid var(--line)}
html.refresh[dir=rtl] .writing-section::before{transform:translateX(50%);left:auto;right:50%}
html.refresh .section-heading{border-bottom:0;padding-bottom:10px;align-items:baseline}
html.refresh .section-heading h2{font:400 38px/1.15 var(--serif);letter-spacing:-.015em;text-transform:none}
html.refresh .section-heading h2>span{display:none}
html.refresh .section-heading>a{font:500 14px var(--sans);letter-spacing:0;text-transform:none;color:var(--ink);border-bottom:1px solid var(--line);padding-bottom:2px}
html.refresh .page-heading h1{font:400 56px/1.05 var(--serif);letter-spacing:-.02em}

/* Post rows: blue date, title, thumbnail instead of the category label */
html.refresh .post-row{grid-template-columns:96px minmax(0,1fr) 176px;gap:28px;padding:28px 0;border-color:var(--line);align-items:center}
html.refresh .post-row time{font:500 13px var(--sans);color:var(--blue);text-transform:none;letter-spacing:0;align-self:start;padding-top:3px}
html.refresh .post-title{font:500 19px/1.4 var(--sans);letter-spacing:-.01em}
html.refresh .post-row p{font-size:14.5px;line-height:1.6;color:var(--muted);margin-top:6px}
html.refresh .post-kind{display:none}
html.refresh .thumb-link{display:block}
html.refresh .thumb{display:block;width:176px;height:auto;aspect-ratio:16/10;object-fit:cover;object-position:top left;border-radius:6px;border:1px solid var(--line);outline:0;transition:transform .35s ease}
html.refresh .post-row:hover .thumb{transform:translateY(-2px)}
html.refresh .site-footer{border-color:var(--line)}

@media(max-width:600px){
  html.refresh .intro{margin:30px 0 30px;gap:20px}
  html.refresh .portrait img{width:92px;height:104px}
  html.refresh .intro h1{font-size:36px;margin-bottom:12px}
  html.refresh .intro .role{font-size:17.5px}
  html.refresh .intro .bio{font-size:15px}
  html.refresh .social-links a{padding:7px 12px;font-size:12.5px}
  html.refresh .writing-section{padding-top:24px}
  html.refresh .section-heading h2{font-size:30px}
  html.refresh .page-heading h1{font-size:42px}
  html.refresh .post-row{grid-template-columns:minmax(0,1fr);gap:10px;padding:22px 0}
  html.refresh .post-row .thumb-link{order:-1}
  html.refresh .post-row .thumb{width:100%}
}

/* Post page */
html.refresh .article-heading{border-color:var(--line);padding-bottom:34px}
html.refresh .back-link{font:500 14px var(--sans);letter-spacing:0;text-transform:none;color:var(--muted)}
html.refresh .article-heading h1{font:400 clamp(38px,4.4vw,54px)/1.1 var(--serif);letter-spacing:-.02em;margin:22px 0 18px;color:var(--ink)}
html.refresh .article-deck{font:400 19px/1.6 var(--sans);color:var(--muted);max-width:640px;margin-bottom:22px}
html.refresh .article-meta{font:500 13.5px var(--sans);letter-spacing:0;color:var(--muted);gap:12px}
html.refresh .article-meta time{color:var(--blue)}
/* Each item takes its direction from its own text, so an English date reads correctly on a Persian page. */
html.refresh .article-meta>*{unicode-bidi:plaintext}
html.refresh .article-meta>*+*{padding-inline-start:12px;border-inline-start:1px solid var(--line)}
/* the same post in other languages */
html.refresh .article-translations{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:16px;font:500 13.5px var(--sans);color:var(--muted)}
html.refresh .article-translations span{margin-inline-end:2px}
html.refresh .article-translations a{display:inline-flex;align-items:center;min-height:32px;padding:0 14px;border:1px solid var(--line);border-radius:999px;color:var(--ink);text-decoration:none;transition:border-color .2s,background .2s}
html.refresh .article-translations a{font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}
@media(hover:hover){html.refresh .article-translations a:hover{border-color:var(--muted);background:color-mix(in srgb,var(--ink) 4%,transparent)}}
html.refresh .article-layout{grid-template-columns:190px minmax(0,1fr);gap:56px;margin-top:44px}
html.refresh .article-toc{font:400 13.5px/1.5 var(--sans);color:var(--muted)}
html.refresh .article-toc summary{font:500 12.5px var(--sans);letter-spacing:0;text-transform:none;color:var(--ink);padding-bottom:14px}
html.refresh .article-toc ol{border-inline-start:1px solid var(--line)}
html.refresh .article-toc li{margin:0}
html.refresh .article-toc a{display:block;padding-block:6px;padding-inline:14px 0;margin-inline-start:-1px;border-inline-start:2px solid transparent}
html.refresh .article-toc a:hover{color:var(--ink)}
html.refresh .article-toc a[aria-current]{color:var(--ink);border-color:var(--blue)}
html.refresh .prose{font:400 17.5px/1.8 var(--sans);color:var(--ink);letter-spacing:0}
html.refresh .prose>p:first-child{font-size:inherit;color:inherit}
html.refresh .prose h2{font:400 31px/1.25 var(--serif);letter-spacing:-.015em;margin:56px 0 14px}
html.refresh .prose h3{font:600 20px/1.4 var(--sans)}
html.refresh .prose p,html.refresh .prose li{color:color-mix(in srgb,var(--ink) 88%,var(--paper))}
html.refresh .prose a{color:var(--blue);text-decoration-thickness:1px;text-underline-offset:3px}
html.refresh .prose blockquote{border:0;border-radius:10px;background:color-mix(in srgb,var(--ink) 4%,transparent);padding:22px 26px;margin:0 0 36px}
html.refresh .prose blockquote p{font:italic 400 20px/1.6 var(--serif);color:var(--ink);margin:0}
html.refresh[dir=rtl] .prose blockquote p{font-style:normal;font-size:18px}
html.refresh .prose :not(pre)>code{background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--ink);border-radius:4px;padding:.15em .4em;font-size:.84em}
/* Code samples are always dark, in the JetBrains New UI Dark scheme (Android Studio, CLion), on light and dark
   pages alike. Punctuation and operators keep the plain text colour, as in the IDE. */
html.refresh{--code-bg:#1e1f22;--code-line:#2b2d30;--code-text:#bcbec4;--code-muted:#868a91;--code-comment:#7a7e85;--code-comment-style:normal;--code-keyword:#cf8e6d;--code-function:#56a8f5;--code-type:#6fafbd;--code-string:#6aab73;--code-number:#2aacb8;--code-property:#c77dbb;--code-preproc:#b3ae60}
html.refresh .prose .code-block{border:1px solid var(--code-line);border-radius:10px;background:var(--code-bg);color:var(--code-text);overflow:hidden}
html.refresh .prose .code-head{border-bottom:1px solid var(--code-line);color:var(--code-muted)}
html.refresh .prose .code-head :is(.code-language,.copy-code){color:var(--code-muted)}
html.refresh .prose pre{background:var(--code-bg);color:var(--code-text);border-color:var(--code-line);border-radius:10px}
/* JetBrains Mono, as in the IDE; ligatures off, which is also the IDE default */
html.refresh .prose :is(pre,code,kbd){font-family:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-ligatures:none}
html.refresh .prose pre{font-size:13.5px;line-height:1.6}
@media(max-width:600px){html.refresh .prose pre{font-size:12.5px}}
/* IDE layout: a quiet header, then the code; long lines scroll sideways */
html.refresh .prose .code-head{min-height:36px}
html.refresh .prose .code-block pre{margin:0;padding:14px 22px 16px;line-height:1.6;background:none;border:0;border-radius:0}
/* Indent guides (site.js sets --kp-guides from the leading whitespace); the code box grows with its longest line
   so the guides scroll with the text. */
html.refresh .prose .code-block pre code{min-width:max-content;background-image:var(--kp-guides,none);background-size:calc(var(--kp-guide-cols,0)*1ch) calc(var(--kp-guide-rows,0)*1lh);background-repeat:no-repeat}
html.refresh .prose pre .token:is(.comment,.prolog,.doctype,.cdata){color:var(--code-comment);font-style:var(--code-comment-style)}
html.refresh .prose pre .token:is(.punctuation,.operator,.double-colon,.variable,.parameter,.namespace){color:var(--code-text)}
html.refresh .prose pre .token:is(.keyword,.boolean,.important,.atrule,.selector,.tag){color:var(--code-keyword)}
html.refresh .prose pre .token:is(.function,.function-definition){color:var(--code-function)}
html.refresh .prose pre .token:is(.class-name,.builtin){color:var(--code-type)}
html.refresh .prose pre .token:is(.string,.char,.regex,.attr-value,.url){color:var(--code-string)}
html.refresh .prose pre .token:is(.number,.symbol){color:var(--code-number)}
html.refresh .prose pre .token:is(.property,.attr-name,.constant){color:var(--code-property)}
html.refresh .prose pre .token.constant{font-style:italic}
html.refresh .prose pre .token:is(.macro,.directive,.annotation,.decorator){color:var(--code-preproc)}
html.refresh .prose pre ::selection{background:color-mix(in srgb,var(--code-keyword) 22%,transparent)}
html.refresh .prose .wp-block-table th{font:600 12.5px/1.6 var(--sans);letter-spacing:0;text-transform:none;color:var(--muted)}
html.refresh .prose .wp-block-table td{font-variant-numeric:tabular-nums}
html.refresh .prose .wp-block-table :is(th,td){border-color:var(--line)}
/* Benchmark tables: a full grid, and the second column (the featured result) tinted */
html.refresh .prose .wp-block-table.is-style-benchmark{overflow-x:auto}
html.refresh .prose .is-style-benchmark table{width:100%;min-width:560px;border-collapse:collapse;font:400 14px/1.45 var(--sans)}
html.refresh .prose .is-style-benchmark :is(th,td){border:1px solid var(--line);padding:12px 14px;vertical-align:top;text-align:start}
html.refresh .prose .is-style-benchmark thead :is(th,td){font:500 13.5px/1.4 var(--sans);color:var(--ink);background:transparent}
html.refresh .prose .is-style-benchmark tbody td:first-child{font-weight:500;color:var(--ink)}
html.refresh .prose .is-style-benchmark tbody td:not(:first-child){font-variant-numeric:tabular-nums;color:var(--ink)}
html.refresh .prose .is-style-benchmark :is(th,td):nth-child(2){background:color-mix(in srgb,var(--blue) 9%,transparent);box-shadow:inset 1px 0 0 color-mix(in srgb,var(--blue) 45%,transparent),inset -1px 0 0 color-mix(in srgb,var(--blue) 45%,transparent)}
html.refresh .prose .is-style-benchmark td strong{font-weight:600}
/* Footnotes: blue mono markers in the text, a quiet numbered list at the end */
html.refresh .prose sup.fn{line-height:0}
html.refresh .prose sup.fn a{font:500 .7em 'JetBrains Mono',ui-monospace,monospace;color:var(--blue);text-decoration:none;padding:0 1px}
html.refresh .prose .article-footnotes{margin-top:52px;padding-top:20px;border-top:1px solid var(--line)}
html.refresh .prose .article-footnotes-label{font:500 13.5px var(--sans);color:var(--ink);margin:0 0 10px}
html.refresh .prose .wp-block-footnotes{margin:0;padding-inline-start:24px;font-size:14.5px;line-height:1.65}
html.refresh .prose .wp-block-footnotes li{margin:0 0 8px;padding-inline-start:4px;color:var(--muted)}
html.refresh .prose .wp-block-footnotes li::marker{font:400 12px 'JetBrains Mono',ui-monospace,monospace;color:var(--muted)}
html.refresh .prose .wp-block-footnotes li:target{color:var(--ink)}
html.refresh .prose .wp-block-footnotes a[href^="#"]{text-decoration:none}
html.refresh .prose :is(h2,h3,sup.fn a,.wp-block-footnotes li){scroll-margin-top:96px}
html.refresh .kp-vector .kp-vector-frame{border:1px solid var(--line);border-radius:10px}
html.refresh .prose figcaption{font:400 14px/1.6 var(--sans);color:var(--muted);margin-top:12px}
html.refresh .conversation{border-color:var(--line)}
html.refresh .conversation h2{font:400 30px var(--serif);letter-spacing:-.015em}
html.refresh .comment-form input:not([type=checkbox]):not([type=submit]),html.refresh .comment-form textarea{background:transparent;border:1px solid var(--line);border-radius:8px;color:var(--ink)}
html.refresh .comment-form .button,html.refresh .comment-form input[type=submit]{border-radius:999px;padding:11px 22px;background:var(--ink);border-color:var(--ink);color:var(--paper);font:500 14px var(--sans)}
@media(max-width:850px){html.refresh .article-layout{grid-template-columns:minmax(0,1fr);gap:24px}}
@media(max-width:600px){
  html.refresh .article-heading h1{font-size:34px}
  html.refresh .article-deck{font-size:17px}
  html.refresh .prose{font-size:16.5px}
  html.refresh .prose h2{font-size:26px;margin-top:44px}
  html.refresh .prose blockquote p{font-size:18px}
}
