/* bafrani.com public design system — extracted from "bafrani.com Prototype.html".
   Token values are the prototype's literal colours/sizes; see docs/design/prototype-analysis.md. */

@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/geist-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: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/geist-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: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/geist-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/geist-cyrillic-ext.woff2') format('woff2'); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: 'Geist'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/geist-vietnamese.woff2') format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/geist-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: 'Geist Mono'; font-style: normal; font-weight: 400 500; font-display: swap; src: url('../fonts/geist-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; }
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('../fonts/vazirmatn-variable.woff2') format('woff2'); }

:root {
  color-scheme: dark;
  --bg: #0C0F13;
  --bg-alt: #0F1317;
  --surface: #12161B;
  --surface-2: #13171C;
  --surface-3: #161B21;
  --border: #1C2128;
  --border-code: #1F252C;
  --border-input: #262C34;
  --border-strong: #2A313A;
  --border-quote: #2E353E;
  --border-focus: #4A525D;
  --text: #E6E8EB;
  --text-strong: #fff;
  --text-body: #C3C9D1;
  --text-soft: #B4BBC4;
  --text-muted: #9BA3AE;
  --text-subtle: #6E7681;
  --text-code: #D4D9DF;
  --accent: #E5002D;
  --accent-hover: #CC0028;
  --selection: rgba(229, 0, 45, .35);
  --link-underline: rgba(230, 232, 235, .3);
  --link-underline-hover: rgba(255, 255, 255, .7);
  --radius-xs: 4px;
  --radius-sm: 5px;
  --radius: 6px;
  --radius-lg: 8px;
  --container: min(1160px, 92vw);
  --container-article: min(1060px, 92vw);
  --container-narrow: min(860px, 92vw);
  --font-sans: Geist, Vazirmatn, system-ui, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, monospace;
  --tracking-display: -.03em;
  --tracking-h1: -.025em;
  --tracking-h2: -.02em;
  --tracking-h3: -.015em;
  --tracking-tight: -.01em;
}

/* Persian: Vazirmatn first, never negative tracking (it breaks joined letterforms). */
:root[dir="rtl"] {
  --font-sans: Vazirmatn, Geist, Tahoma, sans-serif;
  --tracking-display: 0;
  --tracking-h1: 0;
  --tracking-h2: 0;
  --tracking-h3: 0;
  --tracking-tight: 0;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); -webkit-font-smoothing: antialiased; font-size: 16px; }
:root[dir="rtl"] body { line-height: 1.6; }
a { color: var(--text); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px; }
a:hover { color: var(--text-strong); text-decoration-color: var(--link-underline-hover); }
::selection { background: var(--selection); }
img { display: block; max-width: 100%; height: auto; }
input::placeholder, textarea::placeholder { color: var(--text-subtle); }
:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.skip-link { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 12px; border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 8px; color: var(--bg); }
.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; }

.page { min-height: 100vh; display: flex; flex-direction: column; }
.page > main { flex: 1; }
.container { width: var(--container); margin: 0 auto; }
.container-article { width: var(--container-article); margin: 0 auto; }
.container-narrow { width: var(--container-narrow); margin: 0 auto; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.site-header__bar { width: var(--container); margin: 0 auto; height: 58px; display: flex; align-items: center; gap: 32px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
/* Logo.svg is drawn for the dark background: no tile behind it, proportions kept for CMS-uploaded logos too. */
.brand__mark { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.brand__mark img { display: block; object-fit: contain; }
.nav-links { display: flex; gap: 24px; }
.nav-links a { font-size: 14.5px; text-decoration: none; color: var(--text-muted); }
.nav-links a[aria-current="page"] { color: var(--text); font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.header-spacer { flex: 1; }
.lang-switch { font-size: 13.5px; color: var(--text-muted); text-decoration: none; padding: 6px 4px; white-space: nowrap; }
.lang-switch:hover { color: var(--text); }
.menu-toggle { display: none; width: 40px; height: 40px; border-radius: var(--radius); background: none; border: 1px solid var(--border-strong); color: var(--text); align-items: center; justify-content: center; font-size: 17px; cursor: pointer; list-style: none; }
.menu-toggle::-webkit-details-marker { display: none; }
.mobile-menu { position: static; }
.mobile-menu > nav { display: none; }
.mobile-menu[open] > nav { position: absolute; inset-inline: 0; top: 58px; background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 4px 4vw 10px; display: flex; flex-direction: column; }
.mobile-menu nav a { padding: 14px 0; font-size: 16px; text-decoration: none; border-bottom: 1px solid var(--border); }
.mobile-menu nav a:last-child { border-bottom: 0; }

/* ---------- Buttons ---------- */
.btn-yt { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: var(--radius); background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; white-space: nowrap; }
.btn-yt:hover { background: var(--accent-hover); color: #fff; }
.btn-yt--lg { height: 44px; padding: 0 18px; font-size: 15.5px; gap: 9px; }
.btn-yt--md { height: 40px; padding: 0 16px; font-size: 15px; gap: 9px; }
.btn-secondary { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: var(--radius); border: 1px solid var(--border-strong); color: var(--text); font-weight: 600; font-size: 15px; text-decoration: none; background: none; cursor: pointer; font-family: inherit; }
.btn-secondary:hover { border-color: var(--border-focus); color: var(--text-strong); }
.link-btn { background: none; border: none; padding: 0; color: var(--text-muted); font-size: 15px; cursor: pointer; font-family: inherit; }
.link-btn--underline { color: var(--text); text-decoration: underline; text-decoration-color: var(--link-underline); text-underline-offset: 3px; }

/* ---------- Typography ---------- */
.h-hero { font-size: clamp(30px, 4.4vw, 50px); line-height: 1.08; letter-spacing: var(--tracking-display); font-weight: 700; margin: 0 0 16px; max-width: 780px; text-wrap: balance; }
.h-page { font-size: clamp(28px, 3.6vw, 40px); letter-spacing: var(--tracking-h1); font-weight: 700; margin: 0 0 8px; }
.h-detail { font-size: clamp(28px, 3.6vw, 42px); line-height: 1.12; letter-spacing: var(--tracking-h1); font-weight: 700; margin: 0 0 14px; text-wrap: balance; }
.h-section { font-size: clamp(22px, 2.2vw, 26px); letter-spacing: var(--tracking-h2); font-weight: 700; margin: 0 0 20px; }
.h-sub { font-size: 22px; font-weight: 700; letter-spacing: var(--tracking-h3); margin: 0 0 6px; }
.h-label { font-size: 15px; font-weight: 600; margin: 0 0 4px; color: var(--text-muted); }
.lead { font-size: clamp(16px, 1.5vw, 18px); line-height: 1.6; color: var(--text-muted); max-width: 600px; margin: 0 0 24px; text-wrap: pretty; }
.lead-lg { font-size: 18.5px; line-height: 1.6; color: var(--text-muted); margin: 0 0 28px; }
.intro { font-size: 16.5px; color: var(--text-muted); margin: 0 0 20px; max-width: 600px; line-height: 1.55; }
.meta { font-size: 13px; color: var(--text-subtle); }
.meta-muted { font-size: 13.5px; color: var(--text-muted); }
.crumbs { font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.crumbs a { color: var(--text-muted); }
.crumbs span[aria-hidden] { color: var(--text-subtle); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.section-head .h-section { margin: 0; }
.section-head a { font-size: 14.5px; }

/* ---------- Home ---------- */
.hero { width: var(--container); margin: 0 auto; padding: clamp(32px, 5vw, 56px) 0 clamp(24px, 3vw, 36px); }
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.hero__actions > a:not(.btn-yt) { font-weight: 500; font-size: 15.5px; }
.band { border-top: 1px solid var(--border); }
.band--alt { background: var(--bg-alt); }
.section { width: var(--container); margin: 0 auto; padding: 52px 0; }
.section--tight-top { padding-top: 0; }
.section--featured { padding: 0 0 56px; }
.band .section { padding: 48px 0 52px; }
.feat-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: start; }
.feature-card { display: flex; flex-direction: column; gap: 16px; text-decoration: none; }
.feature-card:hover { color: var(--text-strong); }
.feature-card h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; letter-spacing: var(--tracking-h2); font-weight: 700; margin: 0 0 10px; text-wrap: balance; }
.feature-card p { font-size: 16px; line-height: 1.6; color: var(--text-muted); margin: 0; max-width: 620px; }
.about-snippet { max-width: 680px; }
.about-snippet p { font-size: 17px; line-height: 1.7; color: var(--text-soft); margin: 0 0 14px; text-wrap: pretty; }
.cta-band { width: var(--container); margin: 0 auto; padding: 40px 0 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.cta-band p { font-size: clamp(19px, 2vw, 22px); font-weight: 600; letter-spacing: var(--tracking-h3); margin: 0; max-width: 560px; }
.cta-band .cta-band__body { font-size: 16px; font-weight: 400; color: var(--text-muted); letter-spacing: 0; margin-top: 8px; }
.social-row { display: flex; flex-wrap: wrap; gap: 12px 24px; font-size: 15px; }
.social-link { display: inline-flex; align-items: center; gap: 8px; }
.social-link__icon { flex: none; object-fit: contain; }
.header-social { display: flex; align-items: center; gap: 4px; }
.header-social .social-link--icon { width: 34px; height: 34px; justify-content: center; border-radius: var(--radius); color: var(--text-muted); text-decoration: none; }
.header-social .social-link--icon:hover { color: var(--text); }

/* ---------- Thumbnails ---------- */
.thumb { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.thumb--sm { border-radius: var(--radius); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb__title { position: absolute; inset-inline: 14px; bottom: 12px; font-size: clamp(16px, 1.6vw, 19px); font-weight: 700; line-height: 1.12; letter-spacing: -.015em; color: #fff; text-wrap: balance; }
.thumb__title--lg { inset-inline: clamp(18px, 3vw, 32px); bottom: clamp(16px, 3vw, 28px); font-size: clamp(22px, 3vw, 38px); line-height: 1.06; letter-spacing: -.025em; }
.thumb__duration { position: absolute; inset-inline-end: 8px; bottom: 8px; font: 500 12px/1 var(--font-mono); color: #fff; background: rgba(0, 0, 0, .8); padding: 4px 6px; border-radius: var(--radius-xs); direction: ltr; }
.thumb__play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 36px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }

/* ---------- Lists & rows ---------- */
.row-list { display: flex; flex-direction: column; }
.row-list--top { border-top: 1px solid var(--border); }
.row-thumb { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.row-thumb--sm { grid-template-columns: 140px 1fr; gap: 12px; padding: 12px 0; }
.row-thumb:hover { color: var(--text-strong); }
.row-thumb h3 { font-size: 15px; line-height: 1.35; font-weight: 600; margin: 0 0 5px; }
.row-thumb--sm h3 { font-size: 14.5px; margin: 0 0 4px; }
.row-text { display: block; padding: 22px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.row-text:hover { color: var(--text-strong); }
.row-text h2 { font-size: 20px; font-weight: 600; letter-spacing: var(--tracking-h3); margin: 0 0 6px; }
.row-text p { font-size: 15px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.row-text .meta { margin-bottom: 6px; }
.row-split { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 32px; padding: 18px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.row-split:hover { color: var(--text-strong); }
.row-split > div { flex: 1 1 440px; min-width: 0; }
.row-split h3 { font-size: 17.5px; font-weight: 600; letter-spacing: var(--tracking-tight); margin: 0 0 5px; }
.row-split p { font-size: 14.5px; color: var(--text-muted); margin: 0; line-height: 1.5; }
.row-project { display: block; padding: 18px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.row-project:first-child { border-top: 1px solid var(--border); }
.row-project:hover { color: var(--text-strong); }
.row-project__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-bottom: 5px; }
.row-project h3, .row-project h2 { font-size: 19px; font-weight: 600; margin: 0; }
.row-project--lg h2 { font-size: 21px; letter-spacing: var(--tracking-h3); }
.row-project p { font-size: 15px; color: var(--text-muted); margin: 0; line-height: 1.55; }
.row-link { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.row-link:hover { color: var(--text-strong); }
.row-link > span:first-child { font-weight: 500; }
.row-link .meta { white-space: nowrap; }

.topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); column-gap: 48px; }
.topic-item { display: block; padding: 16px 0; border-top: 1px solid var(--border); text-decoration: none; }
.topic-item:hover { color: var(--text-strong); }
.topic-item__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.topic-item__head span:first-child { font-weight: 600; font-size: 16.5px; }
.topic-item__head .meta { white-space: nowrap; }
.topic-item__desc { font-size: 14.5px; line-height: 1.5; color: var(--text-muted); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 36px 22px; }
.card-grid--sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 32px 20px; }
.card-grid--xs { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 24px 18px; }
.video-card { display: flex; flex-direction: column; gap: 12px; text-decoration: none; }
.video-card:hover { color: var(--text-strong); text-decoration: underline; text-decoration-color: rgba(255, 255, 255, .4); }
.video-card h2, .video-card h3 { font-size: 17px; line-height: 1.35; font-weight: 600; margin: 0 0 6px; text-wrap: pretty; }
.card-grid--sm .video-card h3 { font-size: 16px; margin-bottom: 5px; }
.video-card p { font-size: 14.5px; line-height: 1.5; color: var(--text-muted); margin: 0 0 6px; }

/* ---------- Listing toolbar ---------- */
.list-page { width: var(--container); margin: 0 auto; padding: clamp(28px, 4vw, 44px) 0 64px; }
.list-page--narrow { width: var(--container-narrow); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.tabs { display: flex; gap: 22px; overflow-x: auto; max-width: 100%; }
.tabs a { flex: none; padding: 10px 0 12px; font-size: 14.5px; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; color: var(--text-muted); }
.tabs a[aria-current="page"] { border-color: var(--text); color: var(--text); font-weight: 500; }
.search-form { margin-bottom: 8px; display: flex; gap: 6px; }
.input, .search-input { width: min(100%, 240px); height: 36px; padding: 0 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-input); color: var(--text); font-size: 14.5px; font-family: inherit; outline: none; }
.input:focus, .search-input:focus { border-color: var(--border-focus); }
.empty { color: var(--text-muted); }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 40px; font-size: 15px; }

/* ---------- Detail layouts ---------- */
.detail { padding: clamp(20px, 3vw, 32px) 0 64px; }
.detail--article { padding: clamp(28px, 4vw, 44px) 0 64px; }
.video-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 3vw, 44px); align-items: start; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 56px; align-items: start; }
.article-main { min-width: 0; max-width: 700px; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface-2); }
.player__facade { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; padding: 0; background: none; cursor: pointer; }
.player__facade img { width: 100%; height: 100%; object-fit: cover; }
.player__btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 68px; height: 48px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.detail-meta { font-size: 13.5px; color: var(--text-muted); margin: 20px 0 8px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.detail-meta a { color: var(--text-muted); }
.h-video { font-size: clamp(26px, 3.2vw, 36px); line-height: 1.15; letter-spacing: var(--tracking-h1); font-weight: 700; margin: 0 0 16px; text-wrap: balance; }
.action-row { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.action-row a:not(.btn-yt) { font-size: 15px; }
.share-row { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 15px; margin-bottom: 36px; }
.toc { position: sticky; top: 84px; }
.toc__title { font-size: 13px; color: var(--text-subtle); margin-bottom: 10px; }
.toc nav { display: flex; flex-direction: column; gap: 9px; }
.toc a { color: var(--text-muted); font-size: 14px; line-height: 1.4; text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.toc--h3 { padding-inline-start: 12px; font-size: 13.5px; }
.watch-card { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: center; padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 32px; text-decoration: none; }
.watch-card:hover { color: var(--text-strong); }
.related-box { margin: 8px 0 22px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); font-size: 16px; }
.related-box__label { font-size: 13.5px; color: var(--text-muted); margin-bottom: 6px; }
.chapters { margin: 0 0 28px; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.chapters li { display: flex; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.chapters .ts { font: 500 13px/1.6 var(--font-mono); color: var(--text-muted); min-width: 52px; direction: ltr; }
.transcript { margin: 8px 0 24px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.transcript summary { cursor: pointer; padding: 14px 0; font-weight: 600; font-size: 16px; }
.transcript div { padding-bottom: 16px; font-size: 15.5px; line-height: 1.75; color: var(--text-soft); }
.facts { display: flex; flex-direction: column; border-top: 1px solid var(--border); margin-bottom: 28px; }
.exp-row { display: grid; grid-template-columns: 170px 1fr; gap: 24px; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 15.5px; }
.exp-row > div:first-child { color: var(--text-subtle); font-size: 14px; }
.exp-row > div:last-child { color: var(--text-body); }
.exp-row--job { padding: 20px 0; font-size: inherit; }
.exp-row--job > div:last-child { color: inherit; }
.exp-row--job h3 { font-size: 17px; font-weight: 600; margin: 0 0 2px; }
.exp-row--job .company { font-size: 14.5px; color: var(--text-muted); margin-bottom: 10px; }
.exp-row--job ul { margin: 0; padding-inline-start: 18px; font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.exp-row--job li { margin-bottom: 4px; }
.links-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 28px; font-size: 15.5px; }
.feature-list { margin: 0 0 28px; padding: 0; list-style: none; border-top: 1px solid var(--border); }
.feature-list li { padding: 12px 0; border-bottom: 1px solid var(--border); color: var(--text-body); font-size: 15.5px; }
.cover { width: 100%; border-radius: var(--radius-lg); margin-bottom: 28px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; margin: 8px 0 32px; }
.gallery img { width: 100%; border-radius: var(--radius); }

/* ---------- Prose (content blocks) ---------- */
.prose { max-width: 680px; font-size: 17px; line-height: 1.75; color: var(--text-body); }
.prose--article { max-width: none; line-height: 1.78; }
.prose--wide { max-width: 700px; }
:root[dir="rtl"] .prose { line-height: 1.95; }
.prose h2, .prose h3, .prose h4 { color: var(--text); letter-spacing: var(--tracking-h3); margin: 8px 0 10px; scroll-margin-top: 80px; font-weight: 700; }
.prose h2 { font-size: 20px; }
.prose--article h2 { font-size: 22px; }
.prose h3 { font-size: 18px; }
.prose h4 { font-size: 16.5px; }
.prose p { margin: 0 0 22px; text-wrap: pretty; }
.prose--article p { margin-bottom: 24px; }
.prose ul, .prose ol { margin: 0 0 24px; padding-inline-start: 20px; }
.prose li { margin: 0 0 6px; }
.prose blockquote { margin: 0 0 24px; padding-inline-start: 18px; border-inline-start: 2px solid var(--border-quote); color: var(--text); }
.prose blockquote cite { display: block; margin-top: 6px; font-size: 14px; color: var(--text-subtle); font-style: normal; }
.prose figure { margin: 4px 0 28px; }
.prose figcaption { font-size: 14px; color: var(--text-subtle); margin-top: 8px; }
.prose img { width: 100%; border-radius: var(--radius); }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface); border: 1px solid var(--border-code); border-radius: var(--radius-xs); padding: 1px 5px; direction: ltr; unicode-bidi: isolate; }
.code-block figcaption { font: 500 12.5px/1 var(--font-mono); color: var(--text-subtle); margin: 0 0 8px; direction: ltr; text-align: left; }
.code-block pre { margin: 0; padding: 16px 18px; background: var(--surface); border: 1px solid var(--border-code); border-radius: var(--radius); overflow-x: auto; font: 400 13.5px/1.65 var(--font-mono); color: var(--text-code); direction: ltr; text-align: left; tab-size: 4; }
.code-block pre code { background: none; border: 0; padding: 0; font-size: inherit; }
.tok-keyword { color: #FF7B72; }
.tok-string { color: #A5D6FF; }
.tok-comment { color: #6E7681; font-style: italic; }
.tok-number { color: #79C0FF; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 28px; font-size: 15px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: start; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text); font-weight: 600; border-bottom-color: var(--border-strong); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.prose .spacer-small { height: 16px; }
.prose .spacer-large { height: 48px; }
.prose .cta-block { margin: 8px 0 28px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.prose .cta-block strong { display: block; color: var(--text); font-size: 18px; }
.prose .cta-block p { margin: 4px 0 0; font-size: 15.5px; color: var(--text-muted); }
.prose .features { list-style: none; padding: 0; border-top: 1px solid var(--border); }
.prose .features li { padding: 12px 0; border-bottom: 1px solid var(--border); margin: 0; }
.prose .features strong { color: var(--text); display: block; }
.prose .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.prose .embed { margin: 4px 0 28px; }
.prose .refs { margin: 0 0 28px; border-top: 1px solid var(--border); }

/* ---------- Rich text (schema v1, rendered by RichTextRenderer) ---------- */
.prose::after { content: ""; display: block; clear: both; }
.prose .rt-ta-left { text-align: left; }
.prose .rt-ta-center { text-align: center; }
.prose .rt-ta-right { text-align: right; }
.prose .rt-ta-justify { text-align: justify; }
.prose u { text-decoration-color: var(--link-underline-hover); text-underline-offset: 3px; }
.prose mark { color: var(--text); border-radius: 3px; padding: 0 2px; }
.prose .rt-hl-yellow { background: #6b5a2e; }
.prose .rt-hl-red { background: #5c2b2e; }
.prose .rt-hl-green { background: #2e6b3f; }
.prose .rt-hl-blue { background: #2e4b6b; }
.prose .rt-c-red { color: #ff5c7a; }
.prose .rt-c-amber { color: #f2cc60; }
.prose .rt-c-green { color: #7ee2a8; }
.prose .rt-c-blue { color: #79c0ff; }
.prose .rt-c-purple { color: #d2a8ff; }
.prose .rt-c-muted { color: var(--text-muted); }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 6px 0 0; }
.prose .rt-image { margin: 4px auto 28px; max-width: 100%; }
.prose .rt-image img { width: 100%; height: auto; border-radius: var(--radius); }
.prose .rt-image.rt-align-left { float: left; margin: 6px 24px 16px 0; }
.prose .rt-image.rt-align-right { float: right; margin: 6px 0 16px 24px; }
.prose .rt-image a { display: block; }
.prose .rt-w-20 { width: 20%; }
.prose .rt-w-25 { width: 25%; }
.prose .rt-w-30 { width: 30%; }
.prose .rt-w-35 { width: 35%; }
.prose .rt-w-40 { width: 40%; }
.prose .rt-w-45 { width: 45%; }
.prose .rt-w-50 { width: 50%; }
.prose .rt-w-55 { width: 55%; }
.prose .rt-w-60 { width: 60%; }
.prose .rt-w-65 { width: 65%; }
.prose .rt-w-70 { width: 70%; }
.prose .rt-w-75 { width: 75%; }
.prose .rt-w-80 { width: 80%; }
.prose .rt-w-85 { width: 85%; }
.prose .rt-w-90 { width: 90%; }
.prose .rt-w-95 { width: 95%; }
.prose .rt-w-100 { width: 100%; }
.prose .rt-table { overflow-x: auto; margin: 0 0 28px; }
.prose .rt-table table { display: table; margin: 0; }
.prose .rt-table p { margin: 0; }
.prose .rt-card { margin: 0 0 24px; }
.prose .rt-card h3 { margin: 0; font-size: 19px; }
.prose .rt-card p { margin: 0; }
.prose .rt-file, .prose .rt-embed { padding: 12px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.prose .rt-file .meta { margin-inline-start: 8px; }
.prose .embed, .prose .rt-card, .prose .rt-file, .prose .rt-embed, .prose .rt-table, .prose .code-block { clear: both; }
@media (max-width: 760px) {
  .prose .rt-image, .prose .rt-image.rt-align-left, .prose .rt-image.rt-align-right { float: none; margin: 4px 0 24px; width: 100%; }
}

/* ---------- Forms (contact) ---------- */
.form { display: grid; gap: 18px; max-width: 640px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--text-muted); }
.form .input, .form textarea, .form select { width: 100%; height: 42px; font-size: 15.5px; }
.form textarea { height: auto; min-height: 160px; padding: 10px 12px; line-height: 1.6; resize: vertical; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-input); color: var(--text); font-family: inherit; outline: none; }
.form textarea:focus, .form select:focus { border-color: var(--border-focus); }
.form select { border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border-input); color: var(--text); padding: 0 10px; font-family: inherit; }
.form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .hp { position: absolute; inset-inline-start: -10000px; width: 1px; height: 1px; overflow: hidden; }
.field-error { color: #FF8A80; font-size: 13.5px; }
.notice { padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: 20px; }
.notice--ok { border-color: #2E6B3F; }
.notice--error { border-color: #6B2E2E; }
.notice--warn { border-color: #6B5A2E; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); }
.site-footer__brand { display: inline-flex; align-items: center; gap: 10px; }
.site-footer__bar { width: var(--container); margin: 0 auto; padding: 28px 0 32px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px 32px; font-size: 14px; color: var(--text-subtle); }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.site-footer nav a { color: var(--text-muted); }

/* ---------- Consent banner ---------- */
.consent { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 50; max-width: 560px; margin-inline-start: auto; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: 16px 18px; font-size: 14.5px; line-height: 1.55; color: var(--text-body); box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }
.consent[hidden] { display: none; }
.consent__actions { display: flex; gap: 12px; margin-top: 12px; }
.consent button { height: 34px; padding: 0 14px; border-radius: var(--radius); font: 600 14px var(--font-sans); cursor: pointer; }
.consent .accept { background: var(--text); color: var(--bg); border: 0; }
.consent .decline { background: none; color: var(--text); border: 1px solid var(--border-strong); }

/* ---------- Preview banner ---------- */
.preview-bar { background: #3A2A00; color: #FFE7A3; font-size: 14px; padding: 8px 4vw; text-align: center; }

/* ---------- Responsive (prototype breakpoints) ---------- */
@media (max-width: 1080px) {
  .brand__name { display: none; }
  .site-header__bar { gap: 20px; }
  .nav-links { gap: 18px; }
}
@media (max-width: 900px) {
  .feat-grid, .video-layout, .article-layout { grid-template-columns: 1fr; }
  .toc { display: none; }
  .prose .columns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .nav-links, .brand__name, .header-yt-label, .header-social .social-link--icon { display: none; }
  .menu-toggle { display: inline-flex; }
  .exp-row { grid-template-columns: 1fr; gap: 4px; }
  .row-thumb, .row-thumb--sm { grid-template-columns: 132px 1fr; }
  .watch-card { grid-template-columns: 120px 1fr; }
  .form .two { grid-template-columns: 1fr; }
  .site-header__bar { gap: 16px; }
}
@media (min-width: 761px) {
  .mobile-menu { display: none; }
}

/* ---------- Print (HTML resume) ---------- */
@media print {
  :root { --bg: #fff; --text: #111; --text-body: #222; --text-soft: #222; --text-muted: #444; --text-subtle: #555; --border: #ddd; }
  .site-header, .site-footer, .consent, .no-print { display: none !important; }
  body { background: #fff; color: #111; }
  a { color: #111; text-decoration: none; }
}
