/* ==========================================================================
   Site theme — mobile-first, light & dark, no frameworks
   ========================================================================== */

/* ---------- Fonts (self-hosted, only downloaded when used) ---------- */
@font-face { font-family: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-wght-normal.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: 'Plus Jakarta Sans'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/plus-jakarta-sans-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin-wght-normal.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: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/inter-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/lora-latin-wght-normal.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: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/assets/fonts/lora-latin-ext-wght-normal.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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Noto Sans Devanagari'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/assets/fonts/noto-sans-devanagari-devanagari-wght-normal.woff2) format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+A830-A839, U+A8E0-A8FF; }

/* ---------- Design tokens ---------- */
:root {
  --accent-base: #4f46e5;
  --accent: var(--accent-base);
  --accent-ink: #fff;
  --accent-strong: color-mix(in oklab, var(--accent) 82%, #000);
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-softer: color-mix(in oklab, var(--accent) 6%, transparent);

  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface-2: #f1f1f5;
  --surface-3: #e8e8ee;
  --text: #13131a;
  --text-2: #464655;
  --text-3: #6a6a7a;
  --border: #e6e6ec;
  --border-strong: #d6d6df;
  --header-bg: color-mix(in srgb, var(--bg) 82%, transparent);
  --overlay: rgb(10 10 16 / 0.55);

  --shadow-xs: 0 1px 2px rgb(16 16 32 / 0.05);
  --shadow-sm: 0 1px 3px rgb(16 16 32 / 0.07), 0 1px 2px rgb(16 16 32 / 0.04);
  --shadow-md: 0 14px 34px -14px rgb(16 16 32 / 0.2), 0 4px 10px -6px rgb(16 16 32 / 0.08);
  --shadow-lg: 0 30px 70px -24px rgb(16 16 32 / 0.32);

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --pill: 999px;

  --container: 1200px;
  --narrow: 740px;
  --gutter: clamp(16px, 4vw, 32px);
  --header-h: 68px;

  --font-fallback: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Plus Jakarta Sans', 'Noto Sans Devanagari', var(--font-fallback);
  --font-heading: var(--font-body);
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);

  color-scheme: light;
}
html.font-inter { --font-body: 'Inter', 'Noto Sans Devanagari', var(--font-fallback); }
html.font-lora { --font-body: 'Inter', 'Noto Sans Devanagari', var(--font-fallback); --font-heading: 'Lora', 'Noto Sans Devanagari', Georgia, 'Times New Roman', serif; }
html.font-system { --font-body: var(--font-fallback); }
html.radius-soft { --radius-xs: 6px; --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; }
html.radius-sharp { --radius-xs: 2px; --radius-sm: 3px; --radius: 4px; --radius-lg: 6px; }

html[data-theme='dark'] {
  --accent: color-mix(in oklab, var(--accent-base) 72%, #fff);
  --accent-strong: color-mix(in oklab, var(--accent-base) 60%, #fff);
  --accent-soft: color-mix(in oklab, var(--accent) 16%, transparent);
  --accent-softer: color-mix(in oklab, var(--accent) 8%, transparent);
  --bg: #0b0b10;
  --surface: #13131a;
  --surface-2: #1a1a23;
  --surface-3: #24242f;
  --text: #ededf3;
  --text-2: #b6b6c5;
  --text-3: #8e8e9f;
  --border: #23232d;
  --border-strong: #33333f;
  --overlay: rgb(0 0 0 / 0.65);
  --shadow-xs: 0 1px 2px rgb(0 0 0 / 0.4);
  --shadow-sm: 0 1px 3px rgb(0 0 0 / 0.5);
  --shadow-md: 0 16px 36px -14px rgb(0 0 0 / 0.7);
  --shadow-lg: 0 30px 70px -24px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
.site-main { flex: 1 0 auto; outline: none; }
img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); line-height: 1.2; margin: 0; letter-spacing: -0.02em; font-weight: 750; }
html.font-lora :is(h1, h2, h3, h4) { font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }

.icon { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -0.2em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 16px; border-radius: var(--radius-sm); font-weight: 600; transition: top 0.2s; }
.skip-link:focus { top: 12px; }
.muted { color: var(--text-3); }

.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 46px; padding: 0 1.25rem;
  border-radius: var(--pill); border: 1px solid transparent;
  background: var(--btn-bg); color: var(--btn-fg);
  font-weight: 650; font-size: 0.95rem; line-height: 1; white-space: nowrap;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { --btn-bg: var(--accent); --btn-fg: var(--accent-ink); box-shadow: 0 8px 20px -10px color-mix(in oklab, var(--accent) 70%, transparent); }
.btn-primary:hover { --btn-bg: var(--accent-strong); }
html[data-theme='dark'] .btn-primary { --btn-bg: var(--accent-base); --btn-fg: var(--accent-ink); }
html[data-theme='dark'] .btn-primary:hover { --btn-bg: color-mix(in oklab, var(--accent-base) 88%, #fff); }
.btn-secondary { border-color: var(--border-strong); }
.btn-secondary:hover { border-color: var(--text-3); background: var(--surface-2); }
.btn-ghost { --btn-bg: transparent; border-color: transparent; }
.btn-ghost:hover { --btn-bg: var(--surface-2); }
.btn-light { --btn-bg: #fff; --btn-fg: #13131a; }
.btn-light:hover { --btn-bg: #f1f1f5; }
.btn-sm { min-height: 36px; padding: 0 0.9rem; font-size: 0.85rem; }
.btn[disabled], .btn.is-loading { opacity: 0.65; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 42px; height: 42px; border-radius: var(--pill);
  background: transparent; border: 1px solid transparent; color: var(--text-2);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn.sm { width: 36px; height: 36px; }

.link-arrow { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 650; font-size: 0.95rem; }
.link-arrow .icon { transition: transform 0.2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

/* ---------- Badges, chips, tags ---------- */
.badge {
  --badge: var(--accent);
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--pill);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
  color: color-mix(in oklab, var(--badge) 78%, var(--text));
  background: color-mix(in oklab, var(--badge) 13%, transparent);
  transition: background-color 0.2s;
}
.badge:hover { background: color-mix(in oklab, var(--badge) 22%, transparent); }
html[data-theme='dark'] .badge { color: color-mix(in oklab, var(--badge) 55%, #fff); background: color-mix(in oklab, var(--badge) 22%, transparent); }
.badge-glass { color: #fff !important; background: rgb(255 255 255 / 0.18) !important; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgb(255 255 255 / 0.22); }
.badge-glass:hover { background: rgb(255 255 255 / 0.28) !important; }
.badge .icon { width: 13px; height: 13px; }

.eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.eyebrow .icon { width: 15px; height: 15px; }

.chips { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  --badge: var(--accent);
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  padding: 9px 16px; border-radius: var(--pill);
  background: var(--surface); border: 1px solid var(--border);
  font-size: 0.9rem; font-weight: 600; color: var(--text-2);
  scroll-snap-align: start; transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease), box-shadow 0.2s;
}
.chip:hover { border-color: color-mix(in oklab, var(--badge) 55%, var(--border)); color: var(--text); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.chip.is-active { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip .icon { width: 16px; height: 16px; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--badge, var(--accent)); flex: none; }
.chip-count { font-size: 0.75rem; color: var(--text-3); background: var(--surface-2); padding: 1px 7px; border-radius: var(--pill); }

.tag { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); font-size: 0.85rem; font-weight: 600; transition: background-color 0.2s, color 0.2s; }
.tag:hover { background: var(--accent-soft); color: var(--accent); }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Announcement & header ---------- */
.announcement { background: var(--text); color: var(--bg); font-size: 0.875rem; }
.announcement-inner { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; padding-block: 8px; text-align: center; flex-wrap: wrap; }
.announcement a { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: 0 6px 24px -18px rgb(16 16 32 / 0.35); }
.header-inner { display: flex; align-items: center; gap: 16px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 1 auto; min-width: 0; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: linear-gradient(135deg, var(--accent-base), color-mix(in oklab, var(--accent-base) 60%, #ec4899)); color: #fff; font-size: 1.05rem; font-weight: 800; box-shadow: 0 8px 18px -8px color-mix(in oklab, var(--accent-base) 80%, transparent); }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.brand-logo { height: var(--logo-h, 34px); width: auto; max-width: 200px; object-fit: contain; }
.brand-logo-dark { display: none; }
html[data-theme='dark'] .brand-logo.has-dark { display: none; }
html[data-theme='dark'] .brand-logo-dark { display: block; }

.main-nav { display: none; margin-left: 12px; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; }
.nav-item { position: relative; }
.nav-link { display: inline-flex; align-items: center; gap: 4px; padding: 9px 14px; border-radius: var(--pill); font-weight: 600; font-size: 0.95rem; color: var(--text-2); transition: background-color 0.2s, color 0.2s; }
.nav-link:hover, .nav-item:focus-within > .nav-link { color: var(--text); background: var(--surface-2); }
.nav-link.is-active { color: var(--text); }
.nav-link.is-active::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); margin-left: 4px; }
.nav-caret { width: 15px; height: 15px; transition: transform 0.2s; }
.nav-item:hover .nav-caret, .nav-item:focus-within .nav-caret { transform: rotate(180deg); }
.sub-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 220px; list-style: none;
  padding: 8px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity 0.18s, transform 0.18s var(--ease), visibility 0.18s;
}
.sub-menu::before { content: ''; position: absolute; inset: -10px 0 auto; height: 10px; }
.nav-item:hover > .sub-menu, .nav-item:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.sub-menu a { display: block; padding: 9px 12px; border-radius: var(--radius-sm); font-size: 0.93rem; font-weight: 550; color: var(--text-2); }
.sub-menu a:hover { background: var(--surface-2); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.theme-toggle .i-sun { display: none; }
html[data-theme='dark'] .theme-toggle .i-sun { display: block; }
html[data-theme='dark'] .theme-toggle .i-moon { display: none; }

@media (min-width: 960px) {
  .main-nav { display: block; }
  .menu-btn { display: none; }
}

/* ---------- Mobile drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 100; visibility: hidden; }
.drawer.is-open { visibility: visible; }
.drawer-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity 0.25s; }
.drawer.is-open .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(88vw, 380px);
  background: var(--surface); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 12px; padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  transform: translateX(100%); transition: transform 0.3s var(--ease);
}
.drawer.is-open .drawer-panel { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 8px; }
.drawer-title { font-weight: 800; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-3); }
.drawer-search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: 1rem; color: var(--text); }
.drawer-nav { list-style: none; display: flex; flex-direction: column; }
.drawer-nav > li { border-bottom: 1px solid var(--border); }
.drawer-row { display: flex; align-items: center; justify-content: space-between; }
.drawer-row a { flex: 1; padding: 15px 4px; font-size: 1.05rem; font-weight: 650; }
.drawer-row a.is-active { color: var(--accent); }
.drawer-row [aria-expanded='true'] .icon { transform: rotate(180deg); }
.drawer-sub { list-style: none; padding: 0 0 10px 12px; }
.drawer-sub a { display: block; padding: 10px 4px; color: var(--text-2); font-weight: 550; }
.drawer-social { margin-top: auto; padding-top: 16px; }

/* ---------- Search modal ---------- */
.search-modal { position: fixed; inset: 0; z-index: 110; visibility: hidden; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-modal.is-open { visibility: visible; }
.search-backdrop { position: absolute; inset: 0; background: var(--overlay); opacity: 0; transition: opacity 0.2s; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.search-modal.is-open .search-backdrop { opacity: 1; }
.search-panel {
  position: relative; width: 100%; max-width: 640px; max-height: 76vh; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); overflow: hidden;
  opacity: 0; transform: translateY(-10px) scale(0.98); transition: opacity 0.2s, transform 0.2s var(--ease);
}
.search-modal.is-open .search-panel { opacity: 1; transform: none; }
.search-bar { display: flex; align-items: center; gap: 12px; padding: 0 16px; height: 62px; border-bottom: 1px solid var(--border); color: var(--text-3); }
.search-bar .icon { width: 22px; height: 22px; }
.search-bar input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 1.1rem; color: var(--text); }
.search-bar input::-webkit-search-cancel-button { display: none; }
.kbd, kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--surface-2); font-family: var(--font-body); font-size: 0.75rem; font-weight: 600; color: var(--text-3); }
.search-results { overflow-y: auto; padding: 8px; }
.search-results:empty { display: none; }
.search-result { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: var(--radius-sm); }
.search-result:hover, .search-result.is-active { background: var(--surface-2); }
.search-result img, .search-result .sr-thumb { width: 64px; height: 44px; border-radius: 9px; object-fit: cover; flex: none; background: var(--surface-3); }
.search-result-title { font-weight: 650; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-result-meta { font-size: 0.8rem; color: var(--text-3); margin-top: 2px; }
.search-empty { padding: 26px 16px; text-align: center; color: var(--text-3); }
.search-all { display: block; text-align: center; padding: 12px; font-weight: 650; color: var(--accent); border-radius: var(--radius-sm); }
.search-all:hover { background: var(--accent-softer); }
mark { background: color-mix(in oklab, var(--accent) 22%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.search-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.78rem; color: var(--text-3); display: none; gap: 4px; align-items: center; }
.search-foot kbd { height: 20px; min-width: 20px; padding: 0 5px; }
@media (min-width: 720px) { .search-foot { display: flex; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(28px, 5vw, 56px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-title { font-size: clamp(1.45rem, 1.15rem + 1.2vw, 2rem); margin-top: 6px; display: flex; align-items: center; gap: 10px; }
.section-title .icon { color: var(--accent); width: 0.9em; height: 0.9em; }
.center-row { display: flex; justify-content: center; margin-top: 34px; }

.intro { text-align: center; padding-top: clamp(36px, 7vw, 80px); padding-bottom: 8px; max-width: 860px; }
.intro-title { font-size: clamp(2.1rem, 1.4rem + 3.4vw, 3.8rem); letter-spacing: -0.035em; line-height: 1.08; }
.intro-text { margin: 18px auto 0; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); color: var(--text-2); max-width: 620px; }
.intro-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(18px, 3vw, 32px); }
.hero-grid { display: grid; gap: 18px; }
.hero-main { position: relative; border-radius: var(--radius-lg); overflow: hidden; min-height: 420px; display: flex; isolation: isolate; background: var(--surface-3); box-shadow: var(--shadow-md); }
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media img, .hero-media .card-placeholder { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s var(--ease); }
.hero-main:hover .hero-media img { transform: scale(1.035); }
.hero-main::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(8 8 14 / 0.88) 0%, rgb(8 8 14 / 0.45) 45%, rgb(8 8 14 / 0.05) 75%); pointer-events: none; }
.hero-content { margin-top: auto; padding: clamp(20px, 4vw, 40px); color: #fff; max-width: 760px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.hero-title { font-size: clamp(1.6rem, 1.1rem + 2.4vw, 2.75rem); line-height: 1.12; letter-spacing: -0.03em; text-wrap: balance; }
.hero-title a { background-image: linear-gradient(currentColor, currentColor); background-size: 0 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size 0.35s var(--ease); }
.hero-title a::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.hero-main:hover .hero-title a { background-size: 100% 2px; }
.hero-excerpt { margin-top: 12px; color: rgb(255 255 255 / 0.85); font-size: 1.02rem; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; font-size: 0.88rem; color: rgb(255 255 255 / 0.85); }
.hero-meta .meta-sep { background: rgb(255 255 255 / 0.6); }
.hero-meta .meta-author { color: #fff; }
.hero-side { display: grid; gap: 14px; align-content: start; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
  .hero-grid.is-single { grid-template-columns: 1fr; }
  .hero-main { min-height: 520px; }
  .hero-side { align-content: stretch; grid-auto-rows: 1fr; }
}

.topics { padding-top: 28px; }

/* ---------- Cards ---------- */
.grid { display: grid; gap: clamp(18px, 2.4vw, 28px); grid-template-columns: 1fr; }
.grid-span { grid-column: 1 / -1; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-xs);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.cards-bordered .card { box-shadow: none; }
.cards-bordered .card:hover { box-shadow: none; transform: none; border-color: var(--accent); }
.cards-minimal .card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
.cards-minimal .card:hover { transform: none; box-shadow: none; }
.cards-minimal .card .card-media { border-radius: var(--radius); }
.cards-minimal .card-grid .card-body { padding-inline: 2px; }

.card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.card:hover .card-media img { transform: scale(1.045); }
.card-placeholder { display: grid; place-items: center; width: 100%; height: 100%; color: rgb(255 255 255 / 0.85); background: linear-gradient(135deg, hsl(var(--hue, 240) 70% 62%), hsl(calc(var(--hue, 240) + 40) 75% 48%)); }
.card-placeholder .icon { width: 36px; height: 36px; opacity: 0.8; }

.card-body { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.card-title { font-size: 1.16rem; line-height: 1.32; letter-spacing: -0.015em; text-wrap: pretty; }
.card-title a { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; transition: color 0.2s; }
.card-title a::after { content: ''; position: absolute; inset: 0; z-index: 0; }
.card:hover .card-title a { color: var(--accent); }
.card-excerpt { color: var(--text-2); font-size: 0.95rem; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; font-size: 0.82rem; color: var(--text-3); }
.meta-author { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--text-2); margin-right: 4px; }
a.meta-author:hover { color: var(--accent); }
.meta-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); opacity: 0.7; }
.card-meta time + .meta-sep, .hero-meta time + .meta-sep { display: inline-block; }

/* horizontal (hero side) */
.card-horizontal { flex-direction: row; align-items: stretch; }
.card-horizontal .card-media { width: 38%; max-width: 170px; aspect-ratio: auto; min-height: 110px; flex: none; }
.card-horizontal .card-body { padding: 14px 16px; gap: 8px; justify-content: center; }
.card-horizontal .card-title { font-size: 1.02rem; }
.card-horizontal .card-title a { -webkit-line-clamp: 3; line-clamp: 3; }
.card-horizontal .card-meta { margin-top: 0; padding-top: 0; }

/* search results */
.card-search { flex-direction: row; align-items: stretch; }
.card-search .card-media { width: 120px; aspect-ratio: auto; flex: none; }
.card-search .card-body { padding: 14px 16px; gap: 6px; }
.card-search .card-title { font-size: 1.05rem; }
@media (max-width: 520px) { .card-search .card-media { width: 92px; } }

/* ---------- Trending ---------- */
.trending { list-style: none; display: grid; gap: 14px; grid-template-columns: 1fr; counter-reset: trend; }
@media (min-width: 700px) { .trending { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .trending { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.trending-item { display: flex; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s; position: relative; }
.trending-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.trending-rank { font-size: 1.9rem; font-weight: 800; line-height: 1; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1.5px color-mix(in oklab, var(--accent) 65%, var(--text-3)); flex: none; }
.trending-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.trending-cat { --badge: var(--accent); position: relative; z-index: 1; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: color-mix(in oklab, var(--badge) 80%, var(--text)); }
.trending-title { font-size: 0.98rem; line-height: 1.38; letter-spacing: -0.01em; }
.trending-title a { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.trending-title a::after { content: ''; position: absolute; inset: 0; }
.trending-item:hover .trending-title a { color: var(--accent); }
.trending-meta { font-size: 0.78rem; color: var(--text-3); }

/* ---------- Newsletter ---------- */
.newsletter { padding-block: clamp(28px, 5vw, 56px); }
.newsletter-card {
  position: relative; overflow: hidden; isolation: isolate;
  display: grid; gap: 22px; align-items: center;
  padding: clamp(26px, 5vw, 52px);
  border-radius: var(--radius-lg); color: #fff;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent-base) 92%, #000), color-mix(in oklab, var(--accent-base) 55%, #ec4899));
  box-shadow: var(--shadow-md);
}
.newsletter-card::before, .newsletter-card::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; background: rgb(255 255 255 / 0.1); }
.newsletter-card::before { width: 380px; height: 380px; right: -120px; top: -160px; }
.newsletter-card::after { width: 220px; height: 220px; left: -80px; bottom: -120px; }
.newsletter-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: rgb(255 255 255 / 0.16); margin-bottom: 14px; }
.newsletter-icon .icon { width: 24px; height: 24px; }
.newsletter h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2.1rem); }
.newsletter-text p { margin-top: 8px; color: rgb(255 255 255 / 0.86); max-width: 520px; }
.newsletter-row { display: flex; gap: 8px; padding: 6px; border-radius: var(--pill); background: rgb(255 255 255 / 0.14); border: 1px solid rgb(255 255 255 / 0.22); }
.newsletter-row input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: #fff; padding: 0 14px; font-size: 1rem; }
.newsletter-row input::placeholder { color: rgb(255 255 255 / 0.7); }
.newsletter .form-status { color: #fff; margin-top: 10px; font-weight: 600; min-height: 1.4em; }
@media (min-width: 900px) { .newsletter-card { grid-template-columns: 1.2fr 1fr; } }
@media (max-width: 420px) { .newsletter-row { flex-direction: column; border-radius: var(--radius); } .newsletter-row input { height: 46px; } }

/* ---------- Archives ---------- */
.archive-hero { padding-top: clamp(24px, 5vw, 56px); padding-bottom: 8px; }
.archive-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem); letter-spacing: -0.035em; margin-top: 10px; text-wrap: balance; }
.archive-desc { margin-top: 12px; color: var(--text-2); font-size: 1.08rem; max-width: 680px; }
.archive-count { margin-top: 14px; font-size: 0.9rem; color: var(--text-3); font-weight: 600; }
.archive-hero.has-color .eyebrow { color: color-mix(in oklab, var(--badge) 80%, var(--text)); }
.archive-hero .chip-dot { background: var(--badge); }
.author-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.author-hero .avatar { box-shadow: 0 0 0 5px var(--surface), var(--shadow-md); }
.author-hero-links { display: flex; gap: 6px; margin-top: 12px; }

.topic-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .topic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.topic-card { --badge: var(--accent); position: relative; display: flex; align-items: flex-end; min-height: 210px; border-radius: var(--radius); overflow: hidden; isolation: isolate; color: #fff; background: linear-gradient(135deg, var(--badge), color-mix(in oklab, var(--badge) 50%, #000)); box-shadow: var(--shadow-sm); transition: transform 0.35s var(--ease), box-shadow 0.35s; }
.topic-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.topic-media { position: absolute; inset: 0; z-index: -2; }
.topic-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.topic-card:hover .topic-media img { transform: scale(1.05); }
.topic-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgb(8 8 14 / 0.85), rgb(8 8 14 / 0.15) 70%); }
.topic-body { display: flex; flex-direction: column; gap: 4px; padding: 22px; }
.topic-name { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; }
.topic-count { font-size: 0.85rem; opacity: 0.85; font-weight: 600; }
.topic-desc { font-size: 0.9rem; opacity: 0.8; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; }
.topic-arrow { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgb(255 255 255 / 0.18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: transform 0.3s var(--ease); }
.topic-card:hover .topic-arrow { transform: rotate(45deg); }

.empty-state { text-align: center; padding: clamp(40px, 8vw, 80px) 20px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface); }
.empty-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); margin-bottom: 16px; }
.empty-icon .icon { width: 30px; height: 30px; }
.empty-state h2 { font-size: 1.4rem; }
.empty-state p { color: var(--text-2); margin: 8px auto 20px; max-width: 420px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 40px; flex-wrap: wrap; }
.page-numbers { display: flex; gap: 6px; list-style: none; }
.page-num, .page-btn, .page-gap { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--pill); font-weight: 650; font-size: 0.93rem; }
.page-num, .page-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: border-color 0.2s, color 0.2s, background-color 0.2s; }
.page-num:hover, a.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-num.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
html[data-theme='dark'] .page-num.is-current { background: var(--accent-base); border-color: var(--accent-base); }
.page-btn.is-disabled { opacity: 0.45; }
.page-gap { color: var(--text-3); min-width: 24px; padding: 0; }
@media (max-width: 560px) { .page-btn span { display: none; } .page-btn { padding: 0; } .page-numbers .page-num:not(.is-current) { min-width: 40px; padding: 0 10px; } }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { margin-bottom: 18px; font-size: 0.85rem; color: var(--text-3); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .icon { width: 14px; height: 14px; opacity: 0.7; }
.breadcrumbs li:last-child span { display: inline-block; max-width: 46ch; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; color: var(--text-2); }

/* ---------- Single post ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; }
.read-progress span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #ec4899)); transform-origin: 0 50%; transform: scaleX(0); }

.preview-bar { background: #f59e0b; color: #1c1404; font-size: 0.9rem; }
.preview-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; flex-wrap: wrap; }
.preview-inner span { display: inline-flex; align-items: center; gap: 8px; }

.post-header { max-width: calc(860px + var(--gutter) * 2); padding-top: clamp(24px, 5vw, 56px); text-align: left; }
.post-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.4rem); line-height: 1.1; letter-spacing: -0.035em; margin-top: 16px; text-wrap: balance; }
.post-dek { margin-top: 16px; font-size: clamp(1.08rem, 1rem + 0.45vw, 1.3rem); color: var(--text-2); line-height: 1.55; }
.post-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); }
.post-author { display: inline-flex; align-items: center; gap: 12px; }
.post-author-text { display: flex; flex-direction: column; line-height: 1.3; }
.post-author-label { font-size: 0.78rem; color: var(--text-3); }
.post-author strong { font-weight: 700; }
.post-author:hover strong { color: var(--accent); }
.post-facts { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; font-size: 0.88rem; color: var(--text-3); }
.post-facts li, .post-facts a { display: inline-flex; align-items: center; gap: 6px; }
.post-facts a:hover { color: var(--accent); }
.post-facts .icon { width: 16px; height: 16px; }

.post-cover { max-width: calc(1100px + var(--gutter) * 2); margin-top: clamp(24px, 4vw, 40px); margin-bottom: 0; }
.post-cover img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--surface-2); }
.post-cover figcaption { margin-top: 10px; text-align: center; font-size: 0.85rem; color: var(--text-3); }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; margin-top: clamp(28px, 4vw, 48px); max-width: calc(var(--narrow) + var(--gutter) * 2); }
.post-main { min-width: 0; }
.post-rail { display: none; }
@media (min-width: 1400px) {
  .post-layout { max-width: calc(1320px + var(--gutter) * 2); grid-template-columns: minmax(0, 1fr) var(--narrow) minmax(0, 1fr); gap: 40px; }
  .post-main { grid-column: 2; }
  .post-rail { display: block; }
  .post-rail-left { grid-column: 1; justify-self: end; }
  .post-rail-right { grid-column: 3; }
  .post-rail > * { position: sticky; top: calc(var(--header-h) + 28px); }
  .post-layout.has-toc .post-main .toc { display: none; }
}

/* table of contents */
.toc { margin: 0 0 32px; border: 1px solid var(--border); background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.toc-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px; border: 0; background: transparent; font-weight: 750; font-size: 0.98rem; text-align: left; }
.toc-toggle span { display: inline-flex; align-items: center; gap: 10px; }
.toc-toggle .icon { color: var(--accent); }
.toc-caret { transition: transform 0.25s var(--ease); color: var(--text-3) !important; }
.toc.is-collapsed .toc-caret { transform: rotate(-90deg); }
.toc.is-collapsed .toc-list { display: none; }
.toc-list { list-style: none; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 2px; counter-reset: toc; }
.toc-list a { display: block; padding: 7px 10px 7px 14px; border-radius: var(--radius-xs); color: var(--text-2); font-size: 0.93rem; line-height: 1.45; border-left: 2px solid transparent; transition: color 0.2s, background-color 0.2s, border-color 0.2s; }
.toc-list a:hover { color: var(--text); background: var(--surface-2); }
.toc-list a.is-active { color: var(--accent); border-left-color: var(--accent); background: var(--accent-softer); }
.toc-l3 a { padding-left: 26px; font-size: 0.88rem; }
.toc-rail .toc-list a { font-size: 0.86rem; padding-block: 6px; }
.toc-rail .toc-l3 a { padding-left: 22px; font-size: 0.82rem; }
.toc-rail .toc { margin: 0; max-height: calc(100vh - var(--header-h) - 60px); overflow-y: auto; scrollbar-width: thin; }
.toc-rail .toc-toggle { cursor: default; pointer-events: none; }
.toc-rail .toc-caret { display: none; }

/* share */
.share { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.share-label { font-weight: 700; font-size: 0.95rem; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); transition: transform 0.2s var(--ease), color 0.2s, border-color 0.2s, background-color 0.2s; }
.share-btn:hover { transform: translateY(-2px); color: var(--accent); border-color: var(--accent); }
.share-btn .icon { width: 18px; height: 18px; }
.share-whatsapp:hover { color: #25d366; border-color: #25d366; }
.share-facebook:hover { color: #1877f2; border-color: #1877f2; }
.share-linkedin:hover { color: #0a66c2; border-color: #0a66c2; }
.share-telegram:hover { color: #229ed9; border-color: #229ed9; }
.share-pinterest:hover { color: #e60023; border-color: #e60023; }
.share-row { margin-top: 32px; padding: 20px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); justify-content: space-between; }
.share-rail .share-buttons { flex-direction: column; }

.post-tags { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 36px; }
.post-tags > .icon { color: var(--text-3); margin-right: 2px; }

.author-box { display: flex; gap: 20px; align-items: flex-start; margin-top: 36px; padding: clamp(20px, 3vw, 28px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.author-box-name { font-size: 1.25rem; margin-top: 4px; }
.author-box-name a:hover { color: var(--accent); }
.author-box p { margin-top: 8px; color: var(--text-2); font-size: 0.97rem; }
.author-box-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.author-box-links .link-arrow { margin-right: 8px; }
.author-social { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--text-3); transition: color 0.2s, background-color 0.2s; }
.author-social:hover { color: var(--accent); background: var(--accent-soft); }
.author-social .icon { width: 16px; height: 16px; }
@media (max-width: 520px) { .author-box { flex-direction: column; } }

.post-nav { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 36px; }
@media (min-width: 640px) { .post-nav { grid-template-columns: 1fr 1fr; } }
.post-nav-link { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color 0.2s, transform 0.3s var(--ease), box-shadow 0.3s; }
.post-nav-link:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.post-nav-link.next { text-align: right; align-items: flex-end; }
.post-nav-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.post-nav-title { font-weight: 700; line-height: 1.35; }

.related { border-top: 1px solid var(--border); margin-top: clamp(40px, 6vw, 72px); }

/* ---------- Prose (article content) ---------- */
.prose { font-size: clamp(1.0625rem, 1.01rem + 0.22vw, 1.15rem); line-height: 1.78; color: var(--text); overflow-wrap: break-word; }
.prose > * + * { margin-top: 1.3em; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3, .prose h4 { scroll-margin-top: calc(var(--header-h) + 24px); }
.prose h2 { font-size: 1.62em; margin-top: 2em; letter-spacing: -0.025em; }
.prose h3 { font-size: 1.3em; margin-top: 1.7em; }
.prose h4 { font-size: 1.1em; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.7em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent); transition: text-decoration-color 0.2s; }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.45em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose li > ul, .prose li > ol { margin-top: 0.45em; }
.prose blockquote { margin-inline: 0; padding: 0.4em 0 0.4em 1.3em; border-left: 4px solid var(--accent); font-size: 1.08em; color: var(--text-2); font-style: italic; }
.prose blockquote > * + * { margin-top: 0.7em; }
.prose hr { border: 0; height: auto; margin-block: 2.6em; text-align: center; }
.prose hr::before { content: '• • •'; letter-spacing: 0.6em; color: var(--text-3); }
.prose img { border-radius: var(--radius); }
.prose figure { margin-inline: 0; }
.prose figure img { margin-inline: auto; }
.prose figcaption, .prose .image figcaption { margin-top: 0.6em; text-align: center; font-size: 0.84em; color: var(--text-3); }
.prose .align-left { float: left; margin: 0.3em 1.4em 1em 0; max-width: 48%; }
.prose .align-right { float: right; margin: 0.3em 0 1em 1.4em; max-width: 48%; }
.prose .align-center { margin-inline: auto; display: block; }
.prose::after { content: ''; display: table; clear: both; }
@media (max-width: 600px) { .prose .align-left, .prose .align-right { float: none; margin: 1em auto; max-width: 100%; } }
.prose code { font-family: var(--font-mono); font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--border); padding: 0.12em 0.4em; border-radius: 6px; }
.prose pre { position: relative; font-family: var(--font-mono); font-size: 0.86em; line-height: 1.7; background: #0f1020; color: #e6e7f2; border-radius: var(--radius); padding: 1.15em 1.3em; overflow-x: auto; border: 1px solid #1f2036; tab-size: 2; }
.prose pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; }
.prose pre .copy-code { position: absolute; top: 8px; right: 8px; padding: 5px 10px; border-radius: 8px; border: 1px solid #2c2d48; background: #1a1b30; color: #c9cbe0; font-size: 0.75rem; font-family: var(--font-body); opacity: 0; transition: opacity 0.2s; }
.prose pre:hover .copy-code, .prose pre .copy-code:focus { opacity: 1; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92em; line-height: 1.55; min-width: 480px; }
.prose th, .prose td { padding: 0.75em 1em; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose thead th { background: var(--surface-2); font-weight: 700; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:nth-child(even) { background: color-mix(in oklab, var(--surface-2) 50%, transparent); }
.prose iframe { border: 0; border-radius: var(--radius); width: 100%; }
.prose iframe[src*='youtube'], .prose iframe[src*='vimeo'], .prose iframe[src*='dailymotion'], .prose iframe[src*='loom'] { aspect-ratio: 16 / 9; height: auto; }
.prose video { width: 100%; height: auto; border-radius: var(--radius); }
.prose details { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0.8em 1.1em; background: var(--surface); }
.prose summary { font-weight: 700; cursor: pointer; }
.prose mark { padding: 0.05em 0.25em; }
.prose kbd { font-size: 0.8em; }

/* code tokens (Prism) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #7d8099; font-style: italic; }
.token.punctuation { color: #a6aac3; }
.token.property, .token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #f78c6c; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #c3e88d; }
.token.operator, .token.entity, .token.url, .language-css .token.string, .style .token.string { color: #89ddff; }
.token.atrule, .token.attr-value, .token.keyword { color: #c792ea; }
.token.function, .token.class-name { color: #82aaff; }
.token.regex, .token.important, .token.variable { color: #ffcb6b; }

/* ---------- Pages & contact ---------- */
.page-header { max-width: calc(var(--narrow) + var(--gutter) * 2); padding-top: clamp(24px, 5vw, 56px); }
.page-title { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.1rem); letter-spacing: -0.035em; line-height: 1.12; text-wrap: balance; }
.page-dek { margin-top: 14px; color: var(--text-2); font-size: 1.12rem; }
.page-updated { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; font-size: 0.85rem; color: var(--text-3); padding: 6px 12px; border-radius: var(--pill); background: var(--surface-2); }
.page-updated .icon { width: 15px; height: 15px; }
.page-body { max-width: calc(var(--narrow) + var(--gutter) * 2); padding-top: 28px; padding-bottom: clamp(40px, 6vw, 72px); }
.page-wide .page-header, .page-wide .page-body { max-width: calc(var(--container) + var(--gutter) * 2); }
.template-contact .page-body { max-width: calc(1040px + var(--gutter) * 2); }
.template-contact .page-header { max-width: calc(1040px + var(--gutter) * 2); }
.template-contact .prose { max-width: var(--narrow); }

.contact-grid { display: grid; gap: 22px; margin-top: 36px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.6fr 1fr; align-items: start; } }
.contact-card { padding: clamp(20px, 4vw, 34px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.contact-title { font-size: 1.4rem; margin-bottom: 18px; }
.contact-info { display: grid; gap: 12px; }
.info-item { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); transition: border-color 0.2s; word-break: break-word; }
a.info-item:hover { border-color: var(--accent); }
.info-item > span:last-child { display: flex; flex-direction: column; gap: 2px; color: var(--text-2); font-size: 0.95rem; }
.info-item strong { color: var(--text); font-size: 0.95rem; }
.info-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; flex: none; background: var(--accent-soft); color: var(--accent); }
.info-social .social-links { margin-top: 6px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .field-full { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 0; }
.form-grid + .field, .field + .field { margin-top: 16px; }
.form-grid > .field + .field { margin-top: 0; }
.field label { font-size: 0.9rem; font-weight: 650; color: var(--text); }
.req { color: #e11d48; }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px 15px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s; outline: none;
}
.field textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.field input:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: var(--surface); }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field.has-error input, .field.has-error textarea { border-color: #e11d48; }
.form-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.form-note { font-size: 0.85rem; color: var(--text-3); }
.form-status { font-size: 0.92rem; font-weight: 600; margin-top: 12px; }
.form-status:empty { display: none; }
.form-status.is-success { color: #059669; }
.form-status.is-error { color: #e11d48; }
html[data-theme='dark'] .form-status.is-success { color: #34d399; }
html[data-theme='dark'] .form-status.is-error { color: #fb7185; }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 550; margin-bottom: 18px; border: 1px solid; }
.notice-success { background: color-mix(in oklab, #10b981 12%, transparent); border-color: color-mix(in oklab, #10b981 35%, transparent); color: color-mix(in oklab, #047857 85%, var(--text)); }
.notice-info { background: var(--accent-softer); border-color: color-mix(in oklab, var(--accent) 30%, transparent); color: var(--text); }
.notice-error { background: color-mix(in oklab, #e11d48 10%, transparent); border-color: color-mix(in oklab, #e11d48 35%, transparent); color: color-mix(in oklab, #be123c 85%, var(--text)); }

/* ---------- Comments ---------- */
.comments { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--border); }
.comments-head { margin-bottom: 20px; }
.comments .section-title { font-size: 1.5rem; }
.comment-list, .comment-replies { list-style: none; display: flex; flex-direction: column; }
.comment-list { gap: 22px; }
.comment { display: flex; gap: 14px; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.comment-author { font-weight: 700; }
a.comment-author:hover { color: var(--accent); }
.comment-badge { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: var(--pill); }
.comment-date { font-size: 0.82rem; color: var(--text-3); }
.comment-text { margin-top: 6px; color: var(--text-2); line-height: 1.7; overflow-wrap: anywhere; }
.comment-text p + p { margin-top: 0.7em; }
.comment-reply { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 10px 4px 6px; border: 0; border-radius: var(--pill); background: transparent; color: var(--text-3); font-size: 0.85rem; font-weight: 650; }
.comment-reply:hover { color: var(--accent); background: var(--accent-softer); }
.comment-reply .icon { width: 15px; height: 15px; }
.comment-replies { gap: 18px; margin-top: 18px; padding-left: 14px; border-left: 2px solid var(--border); }
.comment.is-new { animation: flash 2.2s var(--ease); border-radius: var(--radius-sm); }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
.comments-empty, .comments-closed { color: var(--text-3); padding: 6px 0 4px; display: flex; align-items: center; gap: 8px; }
.comment-form-wrap { margin-top: 32px; padding: clamp(18px, 3vw, 28px); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.comment .comment-form-wrap { margin-top: 18px; }
.respond-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.respond-title { font-size: 1.2rem; }

/* ---------- Avatars ---------- */
.avatar { --size: 40px; width: var(--size); height: var(--size); border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar-initials { display: inline-grid; place-items: center; width: var(--size); height: var(--size); font-size: calc(var(--size) * 0.38); font-weight: 750; letter-spacing: 0; color: #fff; background: linear-gradient(135deg, hsl(var(--hue) 62% 58%), hsl(calc(var(--hue) + 35) 66% 45%)); }

/* ---------- Search page & errors ---------- */
.search-page { max-width: calc(880px + var(--gutter) * 2); padding-top: clamp(24px, 5vw, 56px); padding-bottom: clamp(40px, 6vw, 72px); }
.search-big { display: flex; align-items: center; gap: 10px; margin-top: 22px; padding: 6px 6px 6px 18px; border-radius: var(--pill); background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm); color: var(--text-3); transition: border-color 0.2s, box-shadow 0.2s; }
.search-big:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-big input { flex: 1; min-width: 0; height: 46px; border: 0; outline: none; background: transparent; font-size: 1.05rem; color: var(--text); }
.search-list { display: grid; gap: 14px; margin-top: 18px; }
.search-tags { margin-top: 40px; }
.search-tags .footer-title { margin-bottom: 12px; }

.error-page { text-align: center; padding-top: clamp(40px, 8vw, 96px); padding-bottom: 20px; max-width: 680px; }
.error-code { font-size: clamp(5rem, 3rem + 10vw, 9rem); font-weight: 800; line-height: 1; letter-spacing: -0.06em; background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 50%, #ec4899)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-title { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-top: 8px; }
.error-text { color: var(--text-2); margin-top: 10px; font-size: 1.05rem; }
.error-page .search-big { max-width: 520px; margin-inline: auto; margin-top: 26px; }
.error-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* ---------- Ads ---------- */
.ad { margin-block: 24px; text-align: center; overflow: hidden; min-height: 0; }
.ad:empty { display: none; }
.ad-header { margin-top: 18px; margin-bottom: 0; }
.ad-in-content { margin-block: 2em; }
.ad-archive { margin-block: 0; }

/* ---------- Footer ---------- */
.site-footer { margin-top: clamp(40px, 6vw, 80px); background: var(--surface); border-top: 1px solid var(--border); }
.footer-grid { display: grid; gap: 34px; padding-block: clamp(40px, 6vw, 64px); grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; } .footer-brand { grid-column: auto; } }
.footer-about { margin-top: 14px; color: var(--text-2); max-width: 360px; font-size: 0.95rem; }
.footer-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-3); font-weight: 750; margin-bottom: 14px; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-links a { color: var(--text-2); font-weight: 550; transition: color 0.2s; }
.footer-links a:hover { color: var(--accent); }
.footer-note { color: var(--text-2); font-size: 0.95rem; margin-bottom: 12px; }
.footer-note a { color: var(--accent); font-weight: 600; }
.mini-subscribe { position: relative; display: flex; gap: 6px; flex-wrap: wrap; }
.mini-subscribe input[type='email'] { flex: 1; min-width: 0; height: 46px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--border-strong); background: var(--bg); outline: none; transition: border-color 0.2s, box-shadow 0.2s; }
.mini-subscribe input[type='email']:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mini-subscribe .btn { width: 46px; padding: 0; }
.mini-subscribe .form-status { flex-basis: 100%; margin-top: 6px; }
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.social-links a { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); transition: background-color 0.2s, color 0.2s, transform 0.2s var(--ease); }
.social-links a:hover { background: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.social-links .icon { width: 17px; height: 17px; }
.footer-bottom { border-top: 1px solid var(--border); }
.footer-bottom-inner { display: flex; flex-direction: column; gap: 12px; padding-block: 20px calc(20px + env(safe-area-inset-bottom)); font-size: 0.86rem; color: var(--text-3); }
.legal-links { display: flex; flex-wrap: wrap; gap: 8px 18px; list-style: none; }
.legal-links a:hover { color: var(--accent); }
@media (min-width: 900px) { .footer-bottom-inner { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ---------- Floating UI ---------- */
.to-top { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 40; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: var(--shadow-md); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { color: var(--accent); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 130; transform: translate(-50%, 20px); padding: 12px 18px; border-radius: var(--pill); background: var(--text); color: var(--bg); font-weight: 600; font-size: 0.92rem; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transition: opacity 0.25s, transform 0.25s var(--ease), visibility 0.25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.cookie { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 90; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: 0.9rem; color: var(--text-2); max-width: 520px; }
.cookie p { flex: 1 1 240px; }
@media (max-width: 639px) { .cookie { flex-wrap: nowrap; gap: 12px; padding: 12px 14px; font-size: 0.82rem; } .cookie p { flex: 1 1 auto; } .cookie .btn { flex: none; } }
.cookie a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
@media (min-width: 640px) { .cookie { left: 20px; right: auto; bottom: 20px; } }

.admin-pill { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 95; display: flex; gap: 4px; padding: 5px; border-radius: var(--pill); background: #13131a; color: #fff; box-shadow: var(--shadow-lg); font-size: 0.85rem; font-weight: 600; }
.admin-pill a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--pill); }
.admin-pill a:hover { background: rgb(255 255 255 / 0.12); }
.admin-pill .icon { width: 16px; height: 16px; }
body:has(.admin-pill) .cookie { bottom: calc(74px + env(safe-area-inset-bottom)); }
@media (max-width: 480px) { .admin-pill span { display: none; } }

/* ---------- Motion & print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .drawer, .search-modal, .post-rail, .share, .comments, .related, .newsletter, .to-top, .cookie, .admin-pill, .read-progress, .ad, .toc, .post-nav, .announcement { display: none !important; }
  body { background: #fff; color: #000; }
  .prose a { color: #000; }
  .post-cover img { box-shadow: none; }
}
