/* ==========================================================================
   Technical Simple — public site design system
   Look: "handcrafted indie blog" (warm paper, serif headings, hand-drawn details).
   The indie-specific touches live in the "Indie layer" at the end of this file.
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Handcrafted indie look: friendly serif headings + handwritten notes */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-hand: 'Caveat', 'Segoe Print', 'Bradley Hand', cursive;

  /* Warm paper & ink */
  --bg: #f6efe2;
  --surface: #fffaf1;
  --surface-2: #f2e8d5;
  --border: #e6d8bd;
  --border-strong: #cdb994;
  --text: #2a2018;
  --text-2: #4b3b2b;
  --muted: #74624c;

  --brand: #c2532b;          /* terracotta */
  --brand-hover: #9e3d1c;
  --brand-soft: #fbeadd;
  --brand-soft-2: #f4cdb2;
  --brand-ink: #a5441f;
  --on-brand: #fffaf1;
  --accent: #d99a1e;         /* mustard */
  --sage: #5d7a5a;
  --ink: #2a2018;            /* outlines, hard shadows, doodles */
  --highlight: #fde68a;      /* marker pen */

  --danger: #b42318;
  --danger-soft: #fdecea;
  --success: #3f6b3a;
  --success-soft: #eaf3e6;

  --code-bg: #2b241e;
  --code-text: #f1e6d4;
  --inline-code-bg: #f3e4cc;
  --inline-code-text: #a5441f;

  --radius-lg: 18px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 0 rgba(42, 32, 24, 0.05), 2px 3px 0 rgba(42, 32, 24, 0.06);
  --shadow: 0 1px 0 rgba(42, 32, 24, 0.05), 4px 5px 0 rgba(42, 32, 24, 0.08);
  --shadow-lg: 0 24px 40px -20px rgba(42, 32, 24, 0.38), 6px 8px 0 rgba(42, 32, 24, 0.07);

  --container: 1760px;
  --gutter: clamp(16px, 3.2vw, 56px);
  --header-h: 64px;
  color-scheme: light;
}

/* "Ink at night": warm charcoal paper, cream ink, glowing terracotta */
[data-theme='dark'] {
  --bg: #1b1713;
  --surface: #241e19;
  --surface-2: #2e2620;
  --border: #3b3128;
  --border-strong: #57483a;
  --text: #f3e9d9;
  --text-2: #ddcfbb;
  --muted: #a99880;

  --brand: #f0955f;
  --brand-hover: #f6b183;
  --brand-soft: rgba(240, 149, 95, 0.1);
  --brand-soft-2: rgba(240, 149, 95, 0.22);
  --brand-ink: #f6b183;
  --on-brand: #1b1713;
  --accent: #e8b44a;
  --sage: #9bb897;
  --ink: #0d0b09;
  --highlight: rgba(232, 180, 74, 0.32);

  --danger: #f28b7d;
  --danger-soft: rgba(242, 139, 125, 0.12);
  --success: #9bc591;
  --success-soft: rgba(155, 197, 145, 0.12);

  --code-bg: #14110e;
  --code-text: #f1e6d4;
  --inline-code-bg: #2e2620;
  --inline-code-text: #f6b183;

  --shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.35), 2px 3px 0 rgba(0, 0, 0, 0.3);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.35), 4px 5px 0 rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 40px -18px rgba(0, 0, 0, 0.7), 6px 8px 0 rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5 { color: var(--text); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -0.015em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.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; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: 56px 0; }
.section-sm { padding: 32px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.75rem; font-weight: 750; margin: 0; }
.section-head p { color: var(--muted); margin: 16px 0 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 600; font-size: .95rem; line-height: 1.2; cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .15s ease, box-shadow .15s ease;
  white-space: nowrap; text-decoration: none;
}
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary, a.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-hover); color: var(--on-brand); }
.btn-outline, a.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: .85rem; border-radius: 8px; }
.btn-lg { padding: 13px 22px; font-size: 1rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 10px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-size: .875rem; font-weight: 600; color: var(--text-2); }
.field .req { color: var(--danger); }
.input, .select, .textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font-size: .95rem; transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 120px; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-msg { font-size: .9rem; font-weight: 500; margin: 8px 0 0; }
.form-msg.ok { color: var(--success); }
.form-msg.err { color: var(--danger); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 24px; }
.card-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand-soft-2); }

/* ---------- Chips & tags ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; background: var(--brand-soft); color: var(--brand-ink);
  border: 1px solid var(--brand-soft-2); line-height: 1.4;
}
a.chip:hover { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.tag {
  display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 8px; font-size: .8rem; font-weight: 500;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
a.tag:hover { border-color: var(--brand); color: var(--brand); }
.tag::before { content: '#'; opacity: .5; margin-right: 1px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-top { display: flex; align-items: center; gap: 24px; height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.wordmark-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #0e7490, #0891b2 55%, #22d3ee); color: #fff;
  font-weight: 800; font-size: .95rem; letter-spacing: -.02em; box-shadow: 0 4px 12px rgba(8, 145, 178, .35);
}
.wordmark-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark-text strong { font-size: 1.05rem; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.wordmark-text span { font-size: .72rem; color: var(--muted); font-weight: 500; }
.header-search { flex: 1; max-width: 520px; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.menu-toggle { display: none; }

/* Site search (GlobalSearch) */
.header-search { position: relative; }
.gsearch {
  display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border); transition: border-color .15s, background .15s, box-shadow .15s;
}
.gsearch:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.gsearch > i { color: var(--muted); font-size: .9rem; }
.gsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font-size: .92rem; }
.gsearch input::-webkit-search-cancel-button { display: none; }
.gsearch-clear { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.gsearch-clear:hover { color: var(--text); background: var(--surface-2); }
.gsearch-kbd {
  font-family: var(--font-mono); font-size: .72rem; color: var(--muted); padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface);
}
.gsearch-panel {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 80; padding: 6px; max-height: min(70vh, 520px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
}
.gsearch-group + .gsearch-group { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.gsearch-label { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.gsearch-item { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 8px; color: var(--text-2) !important; }
.gsearch-item > i { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border-radius: 7px; background: var(--surface-2); color: var(--brand); font-size: .82rem; }
.gsearch-item.active { background: var(--brand-soft); }
.gsearch-item.active > i { background: var(--surface); }
.gsearch-text { display: flex; flex-direction: column; min-width: 0; }
.gsearch-title { font-size: .9rem; font-weight: 550; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-text small { font-size: .75rem; color: var(--muted); }
.gsearch-all {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; padding: 10px; border-radius: 8px;
  border-top: 1px solid var(--border); font-size: .86rem; font-weight: 600; color: var(--brand) !important;
}
.gsearch-all.active, .gsearch-all:hover { background: var(--brand-soft); }
.gsearch-empty { padding: 18px 12px; text-align: center; color: var(--muted); font-size: .9rem; }
.gsearch mark, .gsearch-panel mark, .search-result mark { background: var(--brand-soft); color: var(--brand); border-radius: 3px; padding: 0 1px; }

/* /search page */
.search-heading { margin-bottom: 18px !important; }
.search-field-lg { max-width: 680px; height: 52px; background: var(--surface); border-color: var(--border-strong); padding-right: 6px; }
.search-field-lg input { font-size: 1.02rem; }
.search-field-lg .btn { color: var(--on-brand); background: var(--brand); padding: 8px 18px; }
.search-count { margin: 12px 0 0; color: var(--muted); font-size: .9rem; }
.search-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.search-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; font-size: .86rem; font-weight: 550;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2) !important; transition: border-color .15s, color .15s;
}
.search-chip i { color: var(--brand); }
.search-chip small { font-size: .72rem; color: var(--muted); background: var(--surface-2); padding: 1px 7px; border-radius: 999px; }
.search-chip:hover { border-color: var(--brand); color: var(--brand) !important; }

.main-nav { border-top: 1px solid var(--border); }
.nav-list { list-style: none; margin: 0 -10px; padding: 0; display: flex; align-items: center; gap: 0; flex-wrap: wrap; min-height: 48px; }
.nav-item { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; white-space: nowrap;
  font-size: .86rem; font-weight: 550; color: var(--text-2) !important; background: none; border: 0; cursor: pointer;
}
.nav-link i { color: var(--muted); font-size: .85em; }
.nav-link:hover, .nav-item.open > .nav-link { background: var(--surface-2); color: var(--text) !important; }
.nav-link.active { color: var(--brand) !important; background: var(--brand-soft); }
.nav-link.active i { color: var(--brand); }
.nav-caret { font-size: .65rem !important; transition: transform .2s; }
.nav-item.open .nav-caret { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s, transform .15s, visibility .15s; z-index: 60;
}
.dropdown::before { content: ''; position: absolute; left: 0; right: 0; top: -8px; height: 8px; }
.nav-item.open > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown a { display: block; padding: 9px 12px; border-radius: 8px; font-size: .9rem; color: var(--text-2); }
.dropdown a:hover, .dropdown a.active { background: var(--brand-soft); color: var(--brand); }
/* Deep categories: one column per sub-category, its sub-topics listed underneath */
.dropdown-mega { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(190px, 1fr)); gap: 4px 10px; padding: 10px; }
/* Wide menus near the right edge open leftwards so they stay on screen */
.nav-item:nth-last-child(-n+3) > .dropdown-mega { left: auto; right: 0; }
.dropdown-group { display: flex; flex-direction: column; min-width: 0; }
.dropdown a.dropdown-heading { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 12px 4px; }
.dropdown a.dropdown-heading:hover, .dropdown a.dropdown-heading.active { color: var(--brand); }

/* Theme toggle */
.theme-toggle .fa-sun { display: none; }
[data-theme='dark'] .theme-toggle .fa-sun { display: inline-block; }
[data-theme='dark'] .theme-toggle .fa-moon { display: none; }

/* ==========================================================================
   Hero (home)
   ========================================================================== */
.hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(900px 400px at 85% -10%, var(--brand-soft-2), transparent 70%),
    radial-gradient(700px 400px at -10% 110%, rgba(245, 158, 11, .10), transparent 70%),
    var(--surface);
}
.hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: radial-gradient(ellipse at 70% 30%, #000 0%, transparent 65%);
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 72px var(--gutter) 80px; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.035em; margin: 14px 0 18px; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), #0891b2 50%, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lead { font-size: 1.1rem; color: var(--text-2); max-width: 600px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 26px; }
.hero-topics { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hero-topics span.muted { font-size: .85rem; margin-right: 4px; }

/* ---------- Animated code showcase (home hero) ---------- */
.code-showcase { position: relative; }
.code-showcase.tilt { transform: perspective(1400px) rotateY(-6deg) rotateX(2deg) rotate(1deg); transition: transform .6s ease; }
.code-showcase.tilt:hover { transform: none; }
.code-showcase::before {
  content: ''; position: absolute; inset: 10% -6% -8% 8%; z-index: -1; border-radius: 30px; filter: blur(40px); opacity: .55;
  background: radial-gradient(closest-side, rgba(34, 211, 238, .55), rgba(14, 116, 144, .25), transparent);
}
.code-window { background: #0f172a; border-radius: 16px; box-shadow: 0 30px 60px rgba(2, 6, 23, .35); border: 1px solid #1e293b; overflow: hidden; }
.code-window-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; background: #111c33; border-bottom: 1px solid #1e293b; }
.code-window-bar > i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cs-tab { margin-left: 10px; font-family: var(--font-mono); font-size: .76rem; color: #cbd5e1; display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; background: #0f172a; border: 1px solid #1e293b; border-radius: 7px; animation: cs-pop .35s ease; }
.cs-tab em { color: #67e8f9; font-style: normal; }
.cs-lang { margin-left: auto; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #64748b; }
.cs-body { padding: 18px 0 0; height: 330px; display: flex; flex-direction: column; transition: opacity .1s linear; }
.cs-pre { margin: 0; font-family: var(--font-mono); font-variant-ligatures: none; font-size: .84rem; line-height: 1.75; color: #cbd5e1; overflow: hidden; white-space: pre; }
.cs-line { display: flex; min-height: 1.75em; }
.cs-ln { width: 44px; flex-shrink: 0; text-align: right; padding-right: 16px; color: #334155; user-select: none; }
.cs-code { flex: 1; min-width: 0; padding-right: 18px; }
.cs-caret { display: inline-block; width: 8px; height: 1.1em; margin-left: 1px; vertical-align: -0.18em; background: #22d3ee; border-radius: 1px; animation: cs-blink 1s steps(1) infinite; }
.cs-output { margin: auto 16px 16px; padding: 12px 14px; border-radius: 10px; background: #020617; border: 1px solid #1e293b; font-family: var(--font-mono); font-size: .8rem; color: #cbd5e1; }
.cs-output::before { content: 'OUTPUT'; display: block; font-size: .62rem; font-weight: 700; letter-spacing: .12em; color: #475569; margin-bottom: 8px; font-family: var(--font-sans); }
.cs-out-line { line-height: 1.7; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.cs-table { border-collapse: collapse; width: 100%; }
.cs-table th { text-align: left; color: #94a3b8; font-weight: 500; border-bottom: 1px solid #1e293b; padding: 3px 10px 5px 0; }
.cs-table td { padding: 4px 10px 2px 0; color: #e2e8f0; }
.cs-table td.tok-n { color: #fbbf24; }
.cs-caption { margin-top: 6px; color: #64748b; font-size: .74rem; }
.cs-reveal { animation: cs-in .3s ease both; }
.cs-controls { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #0b1324; border-top: 1px solid #1e293b; }
.cs-play { width: 28px; height: 28px; border-radius: 8px; border: 1px solid #1e293b; background: #111c33; color: #cbd5e1; cursor: pointer; display: grid; place-items: center; font-size: .7rem; flex-shrink: 0; }
.cs-play:hover { background: #0e7490; color: #fff; border-color: #0e7490; }
.cs-segments { flex: 1; display: flex; gap: 5px; }
.cs-seg { flex: 1; height: 16px; padding: 6px 0; border: 0; background: none; cursor: pointer; }
.cs-seg::before { content: ''; display: block; height: 4px; border-radius: 99px; background: #1e293b; }
.cs-seg span { display: block; height: 4px; margin-top: -4px; border-radius: 99px; background: linear-gradient(90deg, #0891b2, #22d3ee); transform-origin: left; }
.cs-seg:hover::before { background: #334155; }
.cs-time { font-family: var(--font-mono); font-size: .72rem; color: #64748b; min-width: 76px; text-align: right; }
@keyframes cs-blink { 50% { opacity: 0; } }
@keyframes cs-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes cs-pop { from { opacity: 0; transform: translateY(-3px); } }
.tok-k { color: #c084fc; } .tok-f { color: #67e8f9; } .tok-s { color: #86efac; } .tok-c { color: #64748b; font-style: italic; }
.tok-n { color: #fbbf24; } .tok-v { color: #f9a8d4; } .tok-t { color: #7dd3fc; } .tok-p { color: #e2e8f0; }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 20px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Topic tiles */
.topic-card { display: flex; align-items: center; gap: 16px; padding: 20px; color: var(--text) !important; }
.topic-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--brand-soft); color: var(--brand); font-size: 1.5rem; border: 1px solid var(--brand-soft-2);
  transition: background .2s, color .2s;
}
.topic-card:hover .topic-icon { background: var(--brand); color: var(--on-brand); }
.topic-card h3 { font-size: 1.02rem; font-weight: 700; margin: 0 0 2px; }
.topic-card p { margin: 0; font-size: .85rem; color: var(--muted); }

/* Tool cards */
.tool-card { display: flex; flex-direction: column; gap: 10px; padding: 22px; height: 100%; color: var(--text) !important; }
.tool-card .topic-icon { width: 44px; height: 44px; font-size: 1.15rem; border-radius: 12px; }
.tool-card h3 { font-size: 1.02rem; font-weight: 700; margin: 6px 0 0; }
.tool-card p { margin: 0; font-size: .9rem; color: var(--muted); flex: 1; }
.tool-card .more { font-size: .875rem; font-weight: 600; color: var(--brand); display: inline-flex; align-items: center; gap: 6px; }
.tool-card:hover .more i { transform: translateX(3px); }
.tool-card .more i { transition: transform .2s; }

/* Post card (grid) */
.post-card { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
.post-card-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); display: block; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; display: block; }
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-media .chip { position: absolute; top: 12px; left: 12px; background: var(--surface); box-shadow: var(--shadow-sm); }
.post-card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-card-title a { color: var(--text) !important; }
.post-card-title a:hover { color: var(--brand) !important; }
.post-card-excerpt { font-size: .9rem; color: var(--muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .82rem; color: var(--muted); }
.meta span { display: inline-flex; align-items: center; gap: 6px; }
.meta i { font-size: .9em; opacity: .8; }
.post-card .meta { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* Post row (list) */
.post-row { display: grid; grid-template-columns: 220px 1fr; overflow: hidden; }
.post-row + .post-row { margin-top: 16px; }
.post-row-media { display: block; background: var(--surface-2); min-height: 100%; }
.post-row-media img { width: 100%; height: 100%; object-fit: cover; display: block; aspect-ratio: 4 / 3; }
.post-row-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.post-row-title { font-size: 1.2rem; font-weight: 700; margin: 0; line-height: 1.35; }
.post-row-title a { color: var(--text) !important; }
.post-row-title a:hover { color: var(--brand) !important; }
.post-row-excerpt { color: var(--muted); font-size: .93rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.read-more { font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }

/* Pagination */
.pager { display: flex; justify-content: center; gap: 10px; margin-top: 32px; }
.pager .btn[aria-disabled='true'] { opacity: .45; pointer-events: none; }

/* Newsletter band */
.cta-band {
  position: relative; overflow: hidden; border-radius: 20px; padding: 44px;
  background: linear-gradient(120deg, #0e7490, #0891b2 60%, #06b6d4); color: #fff;
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center;
}
.cta-band::after { content: ''; position: absolute; width: 360px; height: 360px; right: -120px; top: -160px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.cta-band h2 { color: #fff !important; font-size: 1.7rem; font-weight: 800; margin: 0 0 8px; }
.cta-band p { color: rgba(255, 255, 255, .85); margin: 0; }
.cta-form { position: relative; z-index: 1; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cta-form .input { flex: 1; min-width: 200px; border-color: transparent; background: #fff; color: #0f172a; height: 48px; }
.cta-form .btn { height: 48px; background: #0f172a; color: #fff; }
.cta-form .btn:hover:not(:disabled) { background: #020617; color: #fff; }
.cta-form .form-msg { width: 100%; color: #fff; }
.cta-form .form-msg.err { color: #fecaca; }

/* ==========================================================================
   Page header & article layout
   ========================================================================== */
.page-hero { background: var(--surface); border-bottom: 1px solid var(--border); padding: 36px 0 32px; }
.page-hero h1 { font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.03em; margin: 10px 0 6px; }
.page-hero p { color: var(--muted); margin: 0; max-width: 720px; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .85rem; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; opacity: .5; }
.breadcrumb li:last-child { color: var(--text-2); font-weight: 500; }

.layout-3 { display: grid; grid-template-columns: 260px minmax(0, 1fr) 340px; gap: clamp(24px, 2.4vw, 44px); align-items: start; padding: 36px var(--gutter) 64px; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 2.4vw, 44px); align-items: start; padding: 36px var(--gutter) 64px; }
.sticky { position: sticky; top: calc(var(--header-h) + 64px); }
.aside-stack { display: flex; flex-direction: column; gap: 20px; }

.side-nav { padding: 10px; }
.side-nav h4 { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 8px 10px 6px; margin: 0; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; font-size: .9rem; font-weight: 500; color: var(--text-2); border-left: 3px solid transparent; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--brand-soft); color: var(--brand); border-left-color: var(--brand); font-weight: 600; }

.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.recent-list li:first-child { border-top: 0; padding-top: 0; }
.recent-list img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; flex-shrink: 0; background: var(--surface-2); }
.recent-list a { color: var(--text) !important; font-size: .9rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.recent-list a:hover { color: var(--brand) !important; }
.recent-list small { color: var(--muted); font-size: .78rem; }

.newsletter-card { background: linear-gradient(160deg, var(--brand-soft), var(--surface) 60%); }
.newsletter-card .card-title i { color: var(--brand); }
.newsletter-card p { color: var(--muted); font-size: .9rem; }

.empty-state { text-align: center; padding: 56px 24px; color: var(--muted); }
.empty-state i { font-size: 2rem; margin-bottom: 12px; color: var(--border-strong); }

/* ---------- Article ---------- */
.article { padding: 36px 40px 40px; }
.article-header h1 { font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; margin: 14px 0 16px; }
.author-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--border); margin-bottom: 26px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0e7490, #22d3ee); flex-shrink: 0; }
.author-line strong { display: block; font-size: .95rem; color: var(--text); }
.article-cover { border-radius: 12px; overflow: hidden; margin: 0 0 28px; border: 1px solid var(--border); }
.article-cover img { width: 100%; display: block; max-height: 460px; object-fit: cover; }
.article-footer { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 20px; }
.share { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.share > span { font-weight: 600; font-size: .9rem; margin-right: 6px; color: var(--text-2); }
.share a, .share button {
  width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer;
  background: var(--surface-2); color: var(--text-2) !important; border: 1px solid var(--border); transition: all .15s;
}
.share a:hover, .share button:hover { background: var(--brand); color: var(--on-brand) !important; border-color: var(--brand); }

/* Long-form content written in the admin editor */
.prose { color: var(--text-2); font-size: clamp(1.02rem, 0.35vw + 0.95rem, 1.12rem); line-height: 1.8; overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); font-weight: 750; margin: 1.8em 0 .6em; line-height: 1.3; }
.prose h1 { font-size: 1.8rem; } .prose h2 { font-size: 1.5rem; } .prose h3 { font-size: 1.25rem; } .prose h4 { font-size: 1.08rem; }
.prose p { margin: 0 0 1.15em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--brand-soft-2); }
.prose a:hover { text-decoration-color: var(--brand); }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--brand); }
.prose strong, .prose b { color: var(--text); }
.prose blockquote { margin: 1.5em 0; padding: 12px 20px; border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.prose img { border-radius: 10px; border: 1px solid var(--border); margin: .5em 0; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.prose th { background: var(--surface-2); color: var(--text); }
.prose code { font-family: var(--font-mono); font-size: .86em; background: var(--inline-code-bg); color: var(--inline-code-text); padding: .15em .4em; border-radius: 6px; }
.prose pre, .prose .ql-syntax {
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.7; background: var(--code-bg) !important; color: var(--code-text);
  padding: 18px 20px; border-radius: 12px; overflow-x: auto; margin: 1.4em 0; border: 1px solid #1e293b;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }
.prose pre code.hljs, .prose pre.hljs code { background: transparent !important; padding: 0 !important; }
.prose pre.hljs { padding: 18px 20px !important; }
.prose big { font-size: inherit; }

/* ---------- Contact ---------- */
.info-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.info-list li { display: flex; gap: 14px; align-items: flex-start; }
.info-list .topic-icon { width: 44px; height: 44px; font-size: 1.05rem; border-radius: 12px; }
.info-list strong { display: block; font-size: .9rem; color: var(--text); }
.info-list span, .info-list a { font-size: .92rem; color: var(--muted); }
.social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.captcha-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.captcha-img { background: #f2f2f2; border-radius: 10px; border: 1px solid var(--border); height: 50px; overflow: hidden; display: flex; align-items: center; }
.captcha-img svg { display: block; height: 50px; width: auto; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #0b1120; color: #94a3b8; margin-top: 0; border-top: 1px solid #1e293b; }
.site-footer a { color: #cbd5e1; }
.site-footer a:hover { color: #67e8f9; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.4fr; gap: 40px; padding: 56px var(--gutter) 40px; }
.site-footer h5 { color: #f1f5f9 !important; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; margin: 0 0 16px; }
.site-footer .wordmark-text strong { color: #fff; }
.site-footer .wordmark-text span { color: #64748b; }
.footer-about { font-size: .9rem; line-height: 1.7; margin: 16px 0 20px; max-width: 340px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .92rem; }
.footer-social a { width: 38px; height: 38px; border-radius: 10px; display: inline-grid; place-items: center; background: #111c33; border: 1px solid #1e293b; color: #cbd5e1; transition: all .15s; }
.footer-social a:hover { background: #0e7490; border-color: #0e7490; color: #fff; }
.footer-contact { font-size: .9rem; display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.footer-contact i { width: 18px; color: #67e8f9; }
.footer-form { display: flex; gap: 8px; }
.footer-form .input { background: #111c33; border-color: #1e293b; color: #e2e8f0; height: 44px; }
.footer-form .input::placeholder { color: #64748b; }
.footer-form .btn { height: 44px; background: #0e7490; color: #fff; }
.footer-form .btn:hover:not(:disabled) { background: #0891b2; }
.site-footer .form-msg.ok { color: #4ade80; }
.site-footer .form-msg.err { color: #f87171; }
.footer-bottom { border-top: 1px solid #1e293b; }
.footer-bottom .container { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 20px; padding-bottom: 20px; font-size: .85rem; flex-wrap: wrap; }
.footer-bottom nav { display: flex; gap: 20px; flex-wrap: wrap; }

.to-top {
  position: fixed; right: 24px; bottom: 24px; z-index: 40; width: 44px; height: 44px; border-radius: 12px; border: 0; cursor: pointer;
  background: var(--brand); color: var(--on-brand); box-shadow: var(--shadow-lg); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ==========================================================================
   Modal
   ========================================================================== */
.ts-modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(2, 6, 23, .6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; animation: fade .15s ease; }
.ts-modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); overflow: hidden; animation: pop .18s ease; }
.ts-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.ts-modal-head h3 { margin: 0; font-size: 1.05rem; }
.ts-modal-body { padding: 20px; text-align: center; }
.ts-modal-body img { max-height: 420px; width: auto; border-radius: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } }

/* ==========================================================================
   Tools
   ========================================================================== */
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(24px, 2.4vw, 44px); align-items: start; padding: 32px var(--gutter) 64px; }
.tool-panel { padding: 24px; }
.tool-textarea { width: 100%; min-height: 240px; font-size: 1rem; line-height: 1.65; padding: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented .btn { background: var(--surface-2); border-color: var(--border); color: var(--text-2); font-weight: 550; }
.segmented .btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.toolbar .btn-row .btn { background: var(--surface); border-color: var(--border); color: var(--text-2); }
.toolbar .btn-row .btn:hover { border-color: var(--brand); color: var(--brand); }
.toolbar .btn.recording { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .2); } }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.3rem; color: var(--text); font-weight: 750; }
.stat span { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.stat.warn b { color: var(--danger); }
.output-box { position: relative; font-family: var(--font-mono); font-size: .92rem; background: var(--code-bg); color: var(--code-text); border-radius: 12px; padding: 18px 56px 18px 18px; min-height: 60px; word-break: break-all; }
.output-box .copy { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.08); color: #e2e8f0; border: 1px solid rgba(255,255,255,.12); }
.output-box .copy:hover { background: rgba(255,255,255,.16); }
.form-row-5 { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr 1fr 1fr; gap: 12px; }
.feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; color: var(--text-2); }
.feature-list i { color: var(--success); margin-top: 4px; }

.editor-shell { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.editor-pane { min-width: 0; display: flex; flex-direction: column; }
.editor-pane + .editor-pane { border-left: 1px solid var(--border); }
.pane-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); display: flex; align-items: center; gap: 8px; }
.editor-pane .CodeMirror { height: 560px; font-family: var(--font-mono); font-size: .9rem; background: var(--surface); color: var(--text); }
.editor-pane .CodeMirror-gutters { background: var(--surface-2); border-right: 1px solid var(--border); }
.editor-pane .CodeMirror-cursor { border-left-color: var(--text); }
[data-theme='dark'] .editor-pane .cm-tag { color: #f472b6; }
[data-theme='dark'] .editor-pane .cm-attribute { color: #67e8f9; }
[data-theme='dark'] .editor-pane .cm-string { color: #86efac; }
[data-theme='dark'] .editor-pane .cm-bracket, [data-theme='dark'] .editor-pane .CodeMirror-linenumber { color: #64748b; }
.editor-pane iframe { width: 100%; height: 560px; border: 0; background: #fff; }

.todo-input { display: flex; gap: 10px; }
.todo-filters { display: flex; gap: 6px; }
.todo-filters .btn { background: transparent; color: var(--muted); border-color: transparent; }
.todo-filters .btn.active { background: var(--brand-soft); color: var(--brand); border-color: var(--brand-soft-2); }
.todo-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); transition: border-color .15s; }
.todo-item:hover { border-color: var(--border-strong); }
.todo-item input[type='checkbox'] { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; cursor: pointer; }
.todo-item .todo-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.todo-item.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-item time { font-size: .78rem; color: var(--muted); white-space: nowrap; }
.todo-item .btn-icon { width: 32px; height: 32px; border-radius: 8px; }
.progress { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #22d3ee); border-radius: inherit; transition: width .3s; }

.toast-stack { position: fixed; top: calc(var(--header-h) + 60px); right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); font-size: .9rem; font-weight: 500; display: flex; align-items: center; gap: 10px; animation: pop .18s ease; }
.toast.ok i { color: var(--success); }
.toast.err i { color: var(--danger); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .layout-3 { grid-template-columns: minmax(0, 1fr) 300px; }
  .layout-3 > .side-col { grid-column: 1 / -1; }
  .layout-3 > .side-col .sticky { position: static; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; }
  .side-nav h4 { width: 100%; }
  .side-nav a { border-left: 0; border: 1px solid var(--border); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 56px; gap: 32px; }
  .hero-art { display: none; }
  .layout-3, .layout-2, .tool-layout { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .cta-band { grid-template-columns: 1fr; padding: 32px 24px; }
  .article { padding: 24px 20px 28px; }
  .editor-shell { grid-template-columns: 1fr; }
  .editor-pane + .editor-pane { border-left: 0; border-top: 1px solid var(--border); }
  .editor-pane .CodeMirror, .editor-pane iframe { height: 380px; }
  .form-row-5 { grid-template-columns: 1fr 1fr; }

  .menu-toggle { display: inline-flex; }
  .header-top { gap: 12px; }
  .header-search { display: none; }
  .main-nav { display: none; }
  .site-header.menu-open .main-nav, .site-header.menu-open .mobile-search { display: block; }
  .mobile-search { display: none; padding: 8px 0 4px; }
  .mobile-search .header-search { display: block; max-width: none; }
  .nav-list { flex-direction: column; align-items: stretch; padding: 8px 0 14px; gap: 2px; margin: 0; }
  .nav-link { width: 100%; justify-content: flex-start; padding: 11px 12px; }
  .nav-link .nav-caret { margin-left: auto; }
  .dropdown { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; padding: 0 0 4px 16px; display: none; min-width: 0; background: transparent; }
  .nav-item.open > .dropdown { display: block; }
  .dropdown-mega { grid-template-columns: 1fr; padding: 0 0 4px 16px; }
  .main-nav { max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
}
@media (min-width: 901px) { .mobile-search { display: none !important; } }

@media (max-width: 640px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .post-row { grid-template-columns: 1fr; }
  .post-row-media img { aspect-ratio: 16 / 9; }
  .form-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .section { padding: 40px 0; }
  .wordmark-text span { display: none; }
  .hide-sm { display: none !important; }
  .form-row-5 { grid-template-columns: 1fr; }
  .footer-form { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ==========================================================================
   Topic & tag listing
   ========================================================================== */
.topic-hero {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--border); padding: 32px 0 0;
  background:
    radial-gradient(700px 300px at 90% -20%, var(--brand-soft-2), transparent 70%),
    var(--surface);
}
.topic-hero-main { display: flex; align-items: center; gap: 20px; margin: 22px 0 18px; }
.topic-hero h1 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); font-weight: 800; letter-spacing: -0.03em; margin: 4px 0 6px; }
.topic-hero p { color: var(--muted); margin: 0; max-width: 680px; font-size: 1.02rem; }
.topic-icon-lg { width: 72px; height: 72px; border-radius: 20px; font-size: 2rem; box-shadow: var(--shadow); background: var(--surface); }
.topic-icon b { font-size: 1.2em; }

.topic-stats { list-style: none; margin: 0 0 22px; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.topic-stats li {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); font-size: .85rem; color: var(--muted);
}
.topic-stats i { color: var(--brand); }
.topic-stats b { color: var(--text); font-weight: 700; }

.topic-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: -1px; }
.topic-tabs::-webkit-scrollbar { display: none; }
.topic-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 16px; white-space: nowrap;
  font-size: .92rem; font-weight: 600; color: var(--muted) !important; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s;
}
.topic-tab span { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.topic-tab:hover { color: var(--text) !important; }
.topic-tab.active { color: var(--brand) !important; border-bottom-color: var(--brand); }
.topic-tab.active span { background: var(--brand); color: var(--on-brand); border-color: var(--brand); }

.list-toolbar { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-field { flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px; padding: 0 12px; height: 42px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; transition: border-color .15s, background .15s; }
.search-field:focus-within { border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft-2); }
.search-field i { color: var(--muted); }
.search-field input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); font-size: .95rem; min-width: 0; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-field button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 4px; }
.list-toolbar-right { display: flex; align-items: center; gap: 8px; }
.sort-field { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.sort-field select { border: 0; background: transparent; color: var(--text); font-weight: 600; font-size: .9rem; outline: none; cursor: pointer; }
.sort-field select option { color: #0f172a; }
.view-switch { display: flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.view-switch button { width: 36px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.view-switch button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.result-count { font-size: .88rem; color: var(--muted); margin: 0 0 14px 4px; }
.result-count b { color: var(--text); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.empty-state h3 { color: var(--text); font-size: 1.1rem; margin: 4px 0 6px; }

/* Whole card clickable; inner links (tags, read more) stay clickable above the overlay */
.post-row, .post-card { position: relative; }
.stretched::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.post-row .tag-list, .post-row .read-more, .post-card .chip, .post-row .chip { position: relative; z-index: 2; }
.post-row:hover .post-row-title a, .post-card:hover .post-card-title a { color: var(--brand) !important; }
.post-row-media img { transition: transform .4s ease; }
.post-row:hover .post-row-media img { transform: scale(1.04); }
.post-row-media { overflow: hidden; }
.read-time { font-weight: 500; }

.badge-new {
  position: absolute; top: 12px; right: 12px; padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; color: #fff; background: linear-gradient(135deg, #f59e0b, #ef4444); box-shadow: var(--shadow-sm);
}
.badge-new.static { position: static; }

.popular-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.popular-list li { display: grid; grid-template-columns: 22px 56px 1fr; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.popular-list li:first-child { border-top: 0; padding-top: 0; }
.popular-list .rank { font-weight: 800; font-size: 1.1rem; color: var(--border-strong); text-align: center; }
.popular-list li:first-child .rank { color: var(--accent); }
.popular-list img { width: 56px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.popular-list a { color: var(--text) !important; font-size: .88rem; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.popular-list a:hover { color: var(--brand) !important; }
.popular-list small { color: var(--muted); font-size: .76rem; }

.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.topic-chip { padding: 6px 12px; border-radius: 999px; font-size: .84rem; font-weight: 500; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2) !important; transition: all .15s; }
.topic-chip:hover { border-color: var(--brand); color: var(--brand) !important; background: var(--brand-soft); }

@media (max-width: 900px) {
  .topic-hero-main { gap: 14px; }
  .topic-icon-lg { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 16px; }
}
@media (max-width: 640px) {
  .grid-2 { grid-template-columns: 1fr; }
  .list-toolbar-right { width: 100%; justify-content: space-between; }
  .topic-stats li { padding: 6px 12px; font-size: .8rem; }
}

/* ==========================================================================
   Motion — text & scroll animations (public site)
   ========================================================================== */
/* Word-by-word heading entrance (AnimatedText) */
.aw {
  display: inline-block; opacity: 0; translate: 0 .42em; filter: blur(8px);
  animation: aw-in .75s cubic-bezier(.2, .75, .2, 1) forwards;
  animation-delay: calc(var(--d, 0ms) + var(--i, 0) * var(--step, 70ms));
}
@keyframes aw-in { to { opacity: 1; translate: 0 0; filter: blur(0); } }

/* Gradient words keep shimmering after they land */
.hero h1 .grad.aw, .stage h1 .grad {
  background-size: 220% 100%;
  animation: aw-in .75s cubic-bezier(.2, .75, .2, 1) forwards, grad-flow 7s ease-in-out 1.2s infinite alternate;
  animation-delay: calc(var(--d, 0ms) + var(--i, 0) * var(--step, 70ms)), 1.4s;
}
@keyframes grad-flow { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }

/* Eyebrow labels ease their letter-spacing in */
.eyebrow { animation: eyebrow-in .9s cubic-bezier(.2, .75, .2, 1) both; }
@keyframes eyebrow-in { from { opacity: 0; letter-spacing: .3em; } }

/* Page intro paragraphs follow their heading */
.hero-lead, .page-hero p, .topic-hero p, .hero-cta, .hero .meta, .topic-stats, .topic-tabs, .author-line {
  animation: fade-up .7s cubic-bezier(.2, .75, .2, 1) both; animation-delay: .45s;
}
.hero-cta, .topic-stats { animation-delay: .6s; }
.hero .meta, .topic-tabs { animation-delay: .75s; }
@keyframes fade-up { from { opacity: 0; translate: 0 14px; } }

/* Typewriter in the hero lead */
.rotating { display: inline-flex; align-items: baseline; font-weight: 700; color: var(--brand); white-space: nowrap; }
.rotating-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; align-self: center; background: var(--brand); animation: caret-blink 1s steps(1) infinite; }
.rotating-caret.idle { opacity: .0; animation: none; }
@keyframes caret-blink { 50% { opacity: 0; } }

/* Count-up numbers: visible after a beat even if scripts never run */
.count-up { font-variant-numeric: tabular-nums; }

/* Scroll reveal (ScrollReveal.js adds .reveal, then .in). Uses `translate` so hover `transform`s still work. */
.reveal { opacity: 0; translate: 0 22px; }
.reveal.in { animation: reveal-up .65s cubic-bezier(.2, .75, .2, 1) var(--rd, 0ms) both; }
@keyframes reveal-up { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }

/* Section titles: underline grows in when revealed */
.section-head h2 { position: relative; display: block; width: fit-content; margin-top: 4px; }
.section-head h2::after {
  content: ''; position: absolute; left: 0; bottom: -8px; height: 3px; width: 44px; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), #22d3ee); transform-origin: left; transform: scaleX(1);
}
.section-head.reveal h2::after { transform: scaleX(0); }
.section-head.reveal.in h2::after { transition: transform .7s cubic-bezier(.2, .75, .2, 1) .35s; transform: scaleX(1); }

@media (prefers-reduced-motion: reduce) {
  .aw, .reveal, .reveal.in, .eyebrow, .hero-lead, .page-hero p, .topic-hero p, .hero-cta, .hero .meta, .topic-stats, .topic-tabs, .author-line {
    opacity: 1 !important; translate: none !important; filter: none !important;
  }
  .section-head.reveal h2::after { transform: scaleX(1); }
}

/* ==========================================================================
   Logo
   ========================================================================== */
.ts-logo { display: block; flex-shrink: 0; overflow: visible; filter: drop-shadow(0 4px 10px rgba(8, 145, 178, .28)); }
.ts-logo-chevron, .ts-logo-spark, .ts-logo-cursor { transform-box: fill-box; transform-origin: center; }
.ts-logo.is-animated .ts-logo-cursor { animation: logo-blink 1.1s steps(1) infinite; }
.ts-logo.is-animated .ts-logo-spark { animation: logo-twinkle 3.2s ease-in-out infinite; }
.ts-logo .ts-logo-chevron { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
a:hover .ts-logo .ts-logo-chevron, .ts-lockup:hover .ts-logo-chevron { transform: translateX(2.5px); }
@keyframes logo-blink { 0%, 55% { opacity: 1; } 56%, 100% { opacity: .15; } }
@keyframes logo-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: .95; } 50% { transform: scale(.55) rotate(45deg); opacity: .55; } }

.ts-lockup { display: inline-flex; align-items: center; gap: 11px; }
.ts-lockup-text { display: flex; flex-direction: column; line-height: 1; }
.ts-lockup-name { font-size: 1.22rem; letter-spacing: -.035em; white-space: nowrap; }
.ts-lockup-a { font-weight: 500; color: var(--text); }
.ts-lockup-b {
  font-weight: 800; margin-left: .24em;
  background: linear-gradient(90deg, var(--brand), #06b6d4 70%, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ts-lockup-tag { margin-top: 4px; font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.site-footer .ts-lockup-a { color: #f1f5f9; }
.site-footer .ts-lockup-b { background: linear-gradient(90deg, #22d3ee, #67e8f9); -webkit-background-clip: text; background-clip: text; }
.site-footer .ts-lockup-tag { color: #64748b; }
@media (max-width: 640px) { .ts-lockup-tag { display: none; } .ts-lockup-name { font-size: 1.1rem; } }
@media (prefers-reduced-motion: reduce) { .ts-logo.is-animated .ts-logo-cursor, .ts-logo.is-animated .ts-logo-spark { animation: none; } }

/* Wide screens: use the extra room */
@media (min-width: 1500px) {
  .grid-auto { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .grid-2 { grid-template-columns: repeat(3, 1fr); }
  .post-row { grid-template-columns: 280px 1fr; }
  .article { padding: 44px 56px 48px; }
  .article-cover img { max-height: 540px; }
}

/* ===================== Reading experience ===================== */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200; pointer-events: none; }
.reading-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #22d3ee); transform-origin: 0 50%; transition: transform .1s linear; }

/* Table of contents */
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.toc-list a { display: block; padding: 6px 10px; border-left: 2px solid var(--border); font-size: .86rem; line-height: 1.4; color: var(--text-2) !important; }
.toc-list .toc-l3 a { padding-left: 22px; font-size: .83rem; }
.toc-list a:hover { color: var(--brand) !important; border-left-color: var(--brand-soft-2); }
.toc-list .active a { color: var(--brand) !important; border-left-color: var(--brand); font-weight: 600; background: var(--brand-soft); }
.toc-inline { display: none; margin: 0 0 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.toc-inline summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.toc-inline summary small { margin-left: auto; color: var(--muted); font-weight: 500; }
.toc-inline .toc-list { padding: 0 12px 12px; max-height: none; }
.post-description h2, .post-description h3 { scroll-margin-top: calc(var(--header-h) + 64px); }
@media (max-width: 900px) {
  .toc-aside { display: none; }
  .toc-inline { display: block; }
}

/* Code blocks: copy button + language label */
.prose pre.has-copy { position: relative; padding-top: 38px; }
.code-copy, .code-lang { position: absolute; top: 8px; font-family: var(--font-sans); font-size: .74rem; }
.code-lang { left: 14px; color: #94a3b8; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.code-copy {
  right: 8px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 7px; cursor: pointer;
  background: rgba(255,255,255,.06); color: #cbd5e1; border: 1px solid rgba(255,255,255,.12); transition: background .15s, color .15s;
}
.code-copy:hover { background: rgba(255,255,255,.14); color: #fff; }
.code-copy.done { color: #4ade80; border-color: rgba(74,222,128,.4); }

/* Bookmark */
.author-line .bookmark-btn { margin-left: auto; }
.bookmark-btn.saved { color: var(--brand) !important; border-color: var(--brand) !important; background: var(--brand-soft); }
.bookmarks-link { position: relative; }
.count-badge {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand); font-size: .65rem; font-weight: 700; line-height: 1;
}
.bookmark-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.bookmark-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.bookmark-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; }
.bookmark-title { font-weight: 700; font-size: 1.05rem; color: var(--text) !important; display: block; margin-bottom: 6px; }
.bookmark-title:hover { color: var(--brand) !important; }

/* Helpful */
.helpful { margin-top: 32px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 12px; background: var(--surface-2); font-weight: 600; color: var(--text); }
.helpful > span:first-child { margin-right: 6px; }
.helpful-thanks { font-weight: 500; color: var(--text-2); }
.helpful-thanks i { color: #e11d48; }

/* Prev / next + related */
.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.prev-next-link { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; color: var(--text) !important; }
.prev-next-link small { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.prev-next-link span { font-weight: 650; line-height: 1.4; }
.prev-next-link.next { text-align: right; grid-column: 2; }
.prev-next-link:hover span { color: var(--brand); }
.related { margin-top: 36px; }
.related-title, .comments-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 16px; display: flex; align-items: center; gap: 10px; color: var(--text); }
.related-title i, .comments-title i { color: var(--brand); }

/* Comments */
.comments { margin-top: 36px; }
.comment-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.comment { display: flex; gap: 12px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; }
.comment-head small { color: var(--muted); }
.comment p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text-2); }
.comment-form { margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--border); }
.comment-form h3 { font-size: 1.05rem; margin: 0 0 14px; }
.comment-note { font-size: .82rem; margin: 10px 0 0; }
.hp-field { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }

@media (max-width: 640px) {
  .prev-next { grid-template-columns: 1fr; }
  .prev-next-link.next { grid-column: 1; }
  .author-line .bookmark-btn { margin-left: 0; }
}

/* ===================== Flashcards ===================== */
.quiz-cta { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-top: 24px; color: var(--text) !important; }
.quiz-cta > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.quiz-cta small { color: var(--muted); }
.quiz-cta > i { color: var(--brand); }
.quiz-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.quiz-known { color: var(--success); font-weight: 600; }
.quiz-bar { height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 20px; }
.quiz-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #22d3ee); transition: width .3s; }
.quiz-card { padding: 28px clamp(20px, 4vw, 40px); }
.quiz-question { font-size: clamp(1.3rem, 2.6vw, 1.75rem); font-weight: 800; letter-spacing: -.02em; margin: 6px 0 24px; }
.quiz-reveal kbd, .quiz-actions kbd {
  font-family: var(--font-mono); font-size: .7rem; padding: 1px 6px; border-radius: 5px; border: 1px solid currentColor; opacity: .7; margin-left: 4px;
}
.quiz-answer { max-height: 60vh; overflow-y: auto; padding: 4px 16px 4px 0; border-top: 1px solid var(--border); padding-top: 16px; }
.quiz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.quiz-done { text-align: center; padding: 40px 24px; }
.quiz-done > i { font-size: 2.6rem; color: #f59e0b; }
.quiz-done h2 { margin: 12px 0 16px; }
.quiz-done .quiz-bar { max-width: 360px; margin: 0 auto 20px; }
.quiz-done .quiz-actions { justify-content: center; }

/* ===================== Tools ===================== */
.mono { font-family: var(--font-mono) !important; font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--text-2); cursor: pointer; user-select: none; }
.check code { font-family: var(--font-mono); font-size: .8rem; background: var(--surface-2); padding: 0 5px; border-radius: 4px; }
.output-pre { white-space: pre-wrap; word-break: break-word; max-height: 480px; overflow: auto; margin: 0; }
.re-input { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); color: var(--muted); }
.re-input .input { flex: 1; }
.re-preview { font-family: var(--font-mono); font-size: .88rem; white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin: 0; max-height: 360px; overflow: auto; }
.re-hit { background: rgba(250, 204, 21, .35); color: inherit; border-radius: 3px; box-shadow: 0 0 0 1px rgba(234, 179, 8, .6); }
.table-wrap { overflow-x: auto; }
.re-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.re-table th, .re-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.re-table th { background: var(--surface-2); }
.jwt-status { padding: 10px 14px; border-radius: 10px; font-weight: 600; margin-bottom: 12px; }
.jwt-status.good { background: var(--success-soft); color: var(--success); }
.jwt-status.bad { background: var(--danger-soft); color: var(--danger); }
.jwt-times { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 4px; font-size: .9rem; }
.jwt-times code { font-size: .78rem; background: var(--surface-2); padding: 0 5px; border-radius: 4px; margin: 0 6px; }
.cron-input { font-size: 1.3rem !important; letter-spacing: .08em; text-align: center; height: 56px; }
.cron-fields { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; font-size: .75rem; color: var(--muted); }
.cron-fields span { display: flex; flex-direction: column; gap: 2px; }
.cron-fields code { font-family: var(--font-mono); font-size: .95rem; color: var(--brand); font-weight: 600; }
.cron-text { font-size: 1.1rem; font-weight: 650; color: var(--text); background: var(--brand-soft); padding: 14px 16px; border-radius: 12px; }
.cron-text i { color: var(--brand); }
.cron-runs { margin: 0; padding-left: 22px; font-family: var(--font-mono); font-size: .9rem; line-height: 1.9; }

/* ==========================================================================
   Indie layer — handcrafted blog look
   Paper grain, serif headings, hand-drawn squiggles, sticker tags, pressable buttons.
   Everything above still defines layout; this section only restyles.
   ========================================================================== */
:root {
  /* Hand-drawn shapes, used as masks so they take any colour via background-color */
  --squiggle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8C12 2 22 2 32 7s20 5 30 0 20-5 30 0 20 4 26-1' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
  --wave: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 8'%3E%3Cpath d='M0 4q10-4 20 0t20 0' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E");
  --scribble-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 80' preserveAspectRatio='none'%3E%3Cpath d='M30 14C70-2 170 2 190 30s-40 46-110 44S2 58 8 34 64 6 120 8' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .16 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --dots: radial-gradient(color-mix(in srgb, var(--border-strong) 70%, transparent) 1px, transparent 1.6px);
}

body {
  background-color: var(--bg);
  background-image: var(--grain);
  background-attachment: fixed;
}
::selection { background: var(--highlight); color: var(--text); }

/* ---------- Type ---------- */
h1, h2, h3, h4, h5,
.section-head h2, .post-card-title, .post-row-title, .card-title, .comments-title, .related-title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  letter-spacing: -0.01em;
}
h1 { font-weight: 650; }
h2, h3 { font-weight: 620; }
.post-card-title, .post-row-title { font-weight: 600; }
.hand, .eyebrow {
  font-family: var(--font-hand);
  font-size: 1.45rem; font-weight: 700; line-height: 1;
  letter-spacing: 0; text-transform: none;
  color: var(--brand);
}
.eyebrow { animation: fade-up .7s cubic-bezier(.2, .75, .2, 1) both; transform: rotate(-2deg); transform-origin: left; }
.eyebrow i { font-size: .8em; }
mark { background: linear-gradient(transparent 45%, var(--highlight) 45%, var(--highlight) 88%, transparent 88%); color: inherit; padding: 0 .1em; }

/* Hand-drawn underline under a word (hero accent, section titles) */
.squiggle, .hero h1 .grad {
  position: relative; display: inline-block;
  background: none !important; color: var(--brand) !important; -webkit-text-fill-color: currentColor;
  font-style: italic;
}
.squiggle::after, .hero h1 .grad::after {
  content: ''; position: absolute; left: -2%; right: -2%; bottom: -.08em; height: .28em;
  background: var(--accent); -webkit-mask: var(--squiggle) center / 100% 100% no-repeat; mask: var(--squiggle) center / 100% 100% no-repeat;
  z-index: -1;
}
.section-head h2::after {
  width: 96px; height: 10px; bottom: -12px; border-radius: 0;
  background: var(--accent); -webkit-mask: var(--squiggle) left / 100% 100% no-repeat; mask: var(--squiggle) left / 100% 100% no-repeat;
}

/* ---------- Buttons: ink outline + hard shadow you can "press" ---------- */
.btn { border-radius: 10px; font-weight: 650; }
.btn-primary, a.btn-primary, .btn-outline, a.btn-outline {
  border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease, color .15s ease;
}
[data-theme='dark'] .btn-primary, [data-theme='dark'] .btn-outline { border-color: var(--border-strong); }
.btn-primary:hover:not(:disabled), .btn-outline:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn-primary:active:not(:disabled), .btn-outline:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-outline:hover:not(:disabled) { border-color: var(--ink); color: var(--brand); background: var(--surface); }
.btn-sm.btn-primary, .btn-sm.btn-outline { box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--brand-soft); color: var(--brand-ink); }

/* ---------- Cards: paper sheets that tilt a little on hover ---------- */
.card { border: 1px solid var(--border-strong); box-shadow: var(--shadow); }
[data-theme='dark'] .card { border-color: var(--border); }
.card-hover:hover { transform: translateY(-3px) rotate(-.4deg); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.grid > .card-hover:nth-child(even):hover, .grid > *:nth-child(even) > .card-hover:hover { transform: translateY(-3px) rotate(.4deg); }

/* Post cards: polaroid photo with a tape label */
.post-card { overflow: visible; }
.post-card-media { margin: 10px 10px 0; border-radius: 8px; border: 1px solid var(--border); }
.post-card-media .chip {
  top: -8px; left: 14px; transform: rotate(-3deg); border-radius: 3px; padding: 3px 10px;
  background: color-mix(in srgb, var(--accent) 78%, transparent); color: #2a2018; border: 0; box-shadow: none;
  font-family: var(--font-hand); font-size: 1.05rem; font-weight: 700; letter-spacing: .01em;
}
.post-card .meta { border-top: 1px dashed var(--border-strong); }
.post-row-media { margin: 10px 0 10px 10px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.post-row .chip { font-family: var(--font-hand); font-size: 1.05rem; font-weight: 700; border-radius: 4px; transform: rotate(-2deg); }

/* ---------- Chips & sticker tags ---------- */
.chip { background: var(--brand-soft); color: var(--brand-ink); border: 1px dashed var(--brand-soft-2); }
.tag {
  border-radius: 6px; border: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent); color: #3b2e22; font-weight: 600;
  background: #fde1cf; transition: transform .15s ease;
}
.tag-list > .tag:nth-child(4n+2) { background: #e3ecd8; transform: rotate(1.2deg); }
.tag-list > .tag:nth-child(4n+3) { background: #fbefc2; transform: rotate(-1deg); }
.tag-list > .tag:nth-child(4n+4) { background: #e6e1f3; transform: rotate(.8deg); }
.tag-list > .tag:nth-child(4n+1) { transform: rotate(-1.2deg); }
a.tag:hover { transform: rotate(0) scale(1.06) !important; color: #2a2018; border-color: var(--ink); }
[data-theme='dark'] .tag { background: rgba(240, 149, 95, .16); color: var(--text); }
[data-theme='dark'] .tag-list > .tag:nth-child(4n+2) { background: rgba(155, 184, 151, .18); }
[data-theme='dark'] .tag-list > .tag:nth-child(4n+3) { background: rgba(232, 180, 74, .18); }
[data-theme='dark'] .tag-list > .tag:nth-child(4n+4) { background: rgba(175, 160, 220, .18); }
[data-theme='dark'] a.tag:hover { color: var(--text); border-color: var(--brand); }

.badge-new {
  background: var(--highlight); color: #2a2018; border: 1.5px solid #2a2018; transform: rotate(4deg);
  font-family: var(--font-hand); font-size: 1rem; text-transform: none; letter-spacing: 0; padding: 1px 10px;
}
[data-theme='dark'] .badge-new { background: #e8b44a; }

.topic-icon { background: var(--brand-soft); border: 1.5px dashed var(--brand-soft-2); transition: transform .2s ease, background .2s, color .2s; }
.card-hover:hover .topic-icon { transform: rotate(-6deg) scale(1.05); }
.avatar { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fffaf1; font-family: var(--font-display); }

/* ---------- Header with a wavy hand-drawn edge ---------- */
.site-header { background: color-mix(in srgb, var(--bg) 90%, transparent); border-bottom: 0; }
.site-header::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -6px; height: 8px; pointer-events: none;
  background: var(--border-strong); -webkit-mask: var(--wave) repeat-x 0 0 / 40px 8px; mask: var(--wave) repeat-x 0 0 / 40px 8px;
}
.main-nav { border-top: 1px dashed var(--border); }
.nav-link { font-weight: 600; }
.nav-link:hover, .nav-item.open > .nav-link { background: transparent; color: var(--brand) !important; }
.nav-link.active { background: linear-gradient(transparent 55%, var(--highlight) 55%, var(--highlight) 90%, transparent 90%); color: var(--text) !important; }
.nav-link.active i { color: var(--brand); }
.dropdown { border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg); }
.gsearch { background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 999px; }
.gsearch-panel { border: 1px solid var(--border-strong); }

/* Logo: retint the shared SVG badge (public site only) and write "simple" by hand */
.ts-logo { filter: drop-shadow(2px 3px 0 rgba(42, 32, 24, .18)); }
.ts-logo linearGradient:first-of-type stop:nth-child(1) { stop-color: #9e3d1c; }
.ts-logo linearGradient:first-of-type stop:nth-child(2) { stop-color: #c2532b; }
.ts-logo linearGradient:first-of-type stop:nth-child(3) { stop-color: #e07a45; }
.ts-lockup-a { font-family: var(--font-display); font-weight: 600; }
.ts-lockup-b {
  font-family: var(--font-hand); font-size: 1.45em; font-weight: 700; margin-left: .18em;
  background: none; -webkit-text-fill-color: currentColor; color: var(--brand); display: inline-block; transform: rotate(-4deg) translateY(1px);
}

/* ---------- Hero: notebook page with doodles ---------- */
.hero {
  border-bottom: 0;
  background:
    var(--dots) 0 0 / 22px 22px,
    radial-gradient(900px 420px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    var(--bg);
}
.hero::after {
  opacity: 1; mask-image: none; -webkit-mask-image: none; background-size: auto;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 3l4 12 13 1-10 8 4 13-11-7-11 7 4-13L3 16l13-1z' fill='none' stroke='%23d99a1e' stroke-width='2.4' stroke-linejoin='round'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Cpath d='M2 15c6-12 12-12 18 0s12 12 18 0 12-12 20 0' fill='none' stroke='%235d7a5a' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Ccircle cx='20' cy='20' r='14' fill='none' stroke='%23c2532b' stroke-width='2.4' stroke-dasharray='6 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 4% 14%, 46% 90%, 96% 8%;
  background-size: 34px, 70px, 46px;
}
.hero::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 10px; z-index: 2;
  background: var(--border-strong); -webkit-mask: var(--wave) repeat-x 0 0 / 40px 8px; mask: var(--wave) repeat-x 0 0 / 40px 8px;
}
.hero h1 { font-weight: 650; letter-spacing: -0.02em; font-size: clamp(2.4rem, 5vw, 3.8rem); }
.hero-lead { font-size: 1.15rem; }
.rotating { color: var(--brand); font-family: var(--font-display); font-style: italic; }
.rotating-caret { background: var(--accent); }
.hand-note {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-hand); font-size: 1.35rem; font-weight: 700;
  color: var(--sage); transform: rotate(-3deg); margin-left: 6px;
}
.hand-note svg { width: 42px; height: 26px; color: var(--sage); }

/* Code window: taped onto the page */
.code-showcase::before {
  inset: auto; width: 110px; height: 28px; top: -12px; left: 50%; z-index: 3; border-radius: 2px;
  filter: none; opacity: .85; transform: translateX(-50%) rotate(-3deg);
  background: color-mix(in srgb, var(--accent) 55%, #fff 20%);
}
.code-window { background: #2b241e; border: 1.5px solid #1a1511; box-shadow: 8px 10px 0 rgba(42, 32, 24, .22); }
.code-window-bar { background: #352c25; border-bottom-color: #1a1511; }
.cs-tab { background: #2b241e; border-color: #1a1511; }
.cs-tab em { color: #f0955f; }
.cs-caret { background: #f0955f; }
.cs-output, .cs-controls { background: #211b16; border-color: #1a1511; }
.cs-play { background: #352c25; border-color: #1a1511; }
.cs-play:hover { background: #c2532b; border-color: #c2532b; }
.cs-seg::before { background: #3b3128; }
.cs-seg span { background: linear-gradient(90deg, #c2532b, #e8b44a); }
.cs-ln { color: #5a4b3e; }

/* ---------- Page headers ---------- */
.topic-hero, .page-hero {
  border-bottom: 0;
  background: var(--dots) 0 0 / 22px 22px, radial-gradient(700px 300px at 90% -20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%), var(--bg);
  position: relative;
}
.topic-hero::after, .page-hero::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 10px;
  background: var(--border-strong); -webkit-mask: var(--wave) repeat-x 0 0 / 40px 8px; mask: var(--wave) repeat-x 0 0 / 40px 8px;
}
.topic-hero h1, .page-hero h1, .article-header h1 { font-weight: 650; letter-spacing: -0.02em; }
.topic-icon-lg { background: var(--surface); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-3deg); }
[data-theme='dark'] .topic-icon-lg { border-color: var(--border-strong); }
.topic-stats li { background: var(--surface); border: 1px dashed var(--border-strong); }
.topic-tab.active { border-bottom-color: var(--accent); }
.topic-tab.active span { background: var(--accent); border-color: var(--accent); color: #2a2018; }
.breadcrumb li + li::before { content: '›'; }

/* ---------- Article ---------- */
.article { position: relative; }
.article-header h1 { font-size: clamp(2rem, 3.8vw, 2.9rem); line-height: 1.15; }
.author-line { border-bottom: 1px dashed var(--border-strong); }
.article-cover { border: 1px solid var(--border-strong); padding: 8px; background: var(--surface); box-shadow: var(--shadow); transform: rotate(-.6deg); }
.article-cover img { border-radius: 6px; }
.article-footer { border-top: 1px dashed var(--border-strong); }
.prose { font-size: clamp(1.04rem, 0.35vw + 0.97rem, 1.14rem); }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 620; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.32rem; }
.prose a { text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.prose a:hover { background: var(--highlight); text-decoration-color: var(--brand); border-radius: 2px; }
.prose li::marker { color: var(--accent); }
.prose blockquote {
  position: relative; border-left: 0; border-radius: 12px; background: var(--surface-2); padding: 18px 22px 18px 54px;
  font-family: var(--font-display); font-style: italic; font-size: 1.08em; border: 1px dashed var(--border-strong);
}
.prose blockquote::before { content: '“'; position: absolute; left: 14px; top: -6px; font-size: 3.4rem; color: var(--accent); font-family: var(--font-display); line-height: 1; }
.prose hr { border-top: 0; height: 10px; background: var(--border-strong); -webkit-mask: var(--wave) repeat-x center / 40px 8px; mask: var(--wave) repeat-x center / 40px 8px; }
.prose pre, .prose .ql-syntax { border: 1.5px solid #1a1511; box-shadow: 5px 6px 0 rgba(42, 32, 24, .14); }
[data-theme='dark'] .prose pre { box-shadow: 5px 6px 0 rgba(0, 0, 0, .35); }
.prose code { border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.prose pre code { border: 0; }
.prose img { border: 1px solid var(--border-strong); padding: 6px; background: var(--surface); box-shadow: var(--shadow-sm); }

.helpful { background: transparent; border: 1.5px dashed var(--border-strong); }
.prev-next-link small, .comment-head small { font-family: var(--font-hand); font-size: 1.15rem; text-transform: none; letter-spacing: 0; color: var(--brand); }
.related-title i, .comments-title i { color: var(--accent); }
.toc-list .active a { background: linear-gradient(90deg, var(--highlight), transparent); border-left-color: var(--accent); color: var(--text) !important; }
.reading-progress span, .quiz-bar span, .progress span { background: linear-gradient(90deg, var(--brand), var(--accent)); }
.code-copy { font-family: var(--font-sans); }
.side-nav a.active { background: var(--brand-soft); border-left: 3px solid var(--accent); }
.side-nav h4, .gsearch-label { font-family: var(--font-hand); font-size: 1.2rem; text-transform: none; letter-spacing: 0; color: var(--brand); }
.popular-list .rank { font-family: var(--font-hand); font-size: 1.7rem; color: var(--border-strong); }
.popular-list li:first-child .rank { color: var(--brand); }
.newsletter-card { background: var(--surface); position: relative; }
.newsletter-card::before {
  content: ''; position: absolute; top: -10px; right: 22px; width: 64px; height: 22px; transform: rotate(6deg);
  background: color-mix(in srgb, var(--sage) 45%, transparent); border-radius: 2px;
}

/* ---------- Newsletter band: a terracotta envelope ---------- */
.cta-band {
  background: var(--grain), var(--brand); border: 1.5px solid var(--ink); box-shadow: 8px 10px 0 var(--ink);
  border-radius: 22px;
}
.cta-band::after { background: none; border: 2px dashed rgba(255, 250, 241, .35); width: auto; height: auto; inset: 12px; right: 12px; top: 12px; border-radius: 14px; }
.cta-band h2 { font-family: var(--font-display); font-weight: 650; }
.cta-form .btn { background: var(--ink); border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 rgba(0, 0, 0, .25); }
.cta-form .input { background: #fffaf1; color: #2a2018; border: 1.5px solid var(--ink); }
[data-theme='dark'] .cta-band { color: #1b1713; }
[data-theme='dark'] .cta-band h2 { color: #1b1713 !important; }
[data-theme='dark'] .cta-band p { color: rgba(27, 23, 19, .8); }

/* ---------- Footer: dark ink paper with a wavy top ---------- */
.site-footer { position: relative; background: var(--grain), #2a2018; color: #c9b9a2; border-top: 0; margin-top: 24px; }
.site-footer::before {
  content: ''; position: absolute; left: 0; right: 0; top: -9px; height: 10px;
  background: #2a2018; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 10V5q10-5 20 0t20 0v5z'/%3E%3C/svg%3E") repeat-x 0 0 / 40px 10px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 10'%3E%3Cpath d='M0 10V5q10-5 20 0t20 0v5z'/%3E%3C/svg%3E") repeat-x 0 0 / 40px 10px;
}
[data-theme='dark'] .site-footer, [data-theme='dark'] .site-footer::before { background-color: #120f0c; }
[data-theme='dark'] .site-footer::before { background: #120f0c; }
.site-footer a { color: #ecdcc4; }
.site-footer a:hover { color: #f0955f; }
.site-footer h5 { font-family: var(--font-hand); font-size: 1.4rem; text-transform: none; letter-spacing: 0; color: #f0955f !important; font-weight: 700; }
.site-footer .wordmark-text span, .site-footer .ts-lockup-tag { color: #9c8a72; }
.site-footer .ts-lockup-a { color: #f3e9d9; }
.footer-social a { background: #352a21; border-color: #4a3c30; color: #ecdcc4; }
.footer-social a:hover { background: #c2532b; border-color: #c2532b; color: #fffaf1; }
.footer-contact i { color: #e8b44a; }
.footer-form .input { background: #352a21; border-color: #4a3c30; color: #f3e9d9; }
.footer-form .input::placeholder { color: #9c8a72; }
.footer-form .btn { background: #c2532b; border: 1.5px solid #120f0c; box-shadow: 3px 3px 0 #120f0c; color: #fffaf1; }
.footer-form .btn:hover:not(:disabled) { background: #9e3d1c; }
.footer-bottom { border-top: 1px dashed #4a3c30; }

/* ---------- Small pieces ---------- */
.to-top { border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); border-radius: 50%; }
.input, .select, .textarea { border: 1.5px solid var(--border-strong); background: var(--surface); }
.search-field { background: var(--surface); border: 1.5px solid var(--border-strong); border-radius: 999px; }
.view-switch, .sort-field { border-color: var(--border-strong); }
.topic-chip:hover, .search-chip:hover { transform: rotate(-1.5deg); }
.topic-chip, .search-chip { transition: transform .15s ease, border-color .15s, color .15s, background .15s; }
.empty-state i { color: var(--accent); }
.empty-state h3 { font-family: var(--font-display); }
.quiz-card { border: 1.5px solid var(--ink); box-shadow: 6px 7px 0 var(--ink); }
[data-theme='dark'] .quiz-card { border-color: var(--border-strong); box-shadow: 6px 7px 0 rgba(0, 0, 0, .45); }
.quiz-question { font-family: var(--font-display); font-weight: 620; }
.cron-text { font-family: var(--font-display); }
.ts-modal { border: 1.5px solid var(--ink); box-shadow: 8px 10px 0 var(--ink); }
.ts-modal-backdrop { background: rgba(27, 23, 19, .55); }
.toast { border: 1.5px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.count-badge { border: 1.5px solid var(--bg); }

@media (max-width: 900px) {
  .hero::after { background-position: 92% 6%, 80% 96%, 6% 96%; }
}
@media (max-width: 640px) {
  .article-cover { transform: none; }
  .cta-band { box-shadow: 5px 6px 0 var(--ink); }
}
@media (prefers-reduced-motion: reduce) {
  .card-hover:hover, .grid > .card-hover:nth-child(even):hover { transform: none; }
}

/* Tape label sits half outside the photo, so the photo box must not clip it */
.post-card-media { overflow: visible; }
.post-card-media img { border-radius: 7px; }
.post-card:hover .post-card-media img { transform: none; }
.badge-new { top: -8px; right: 10px; }
/* (beats the generic ".post-card .chip { position: relative }" used for the clickable-card overlay) */
.post-card .post-card-media .chip { position: absolute; z-index: 3; }

/* Article without its own cover: a shorter notebook-page banner */
.article-cover.is-placeholder img { aspect-ratio: 16 / 5; object-fit: cover; max-height: 220px; }

/* Article without its own cover: a shorter notebook-page banner */
.article-cover.is-placeholder img { aspect-ratio: 16 / 5; object-fit: cover; max-height: 220px; }
