/* ─── OD personal-tech-site — shared styles ──────────────────────────────
   Tech / Utility direction — Datadog / GitHub / Cloudflare inspired.
   One family for display + body, monospace for code & numerics.
   DESIGN.md-compliant token system.
   ──────────────────────────────────────────────────────────────────────── */


/* ─── self-hosted fonts ──────────────────────────────────────────── */
@font-face {
  font-family: 'Cascadia Code';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/cascadia-regular.woff2) format('woff2');
}
@font-face {
  font-family: 'Cascadia Code';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/cascadia-medium.woff2) format('woff2');
}

@font-face {
  font-family: 'Geist Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/fonts/geist-sans-regular.woff2) format('woff2');
}
@font-face {
  font-family: 'Geist Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/fonts/geist-sans-medium.woff2) format('woff2');
}
@font-face {
  font-family: 'Geist Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/fonts/geist-sans-semibold.woff2) format('woff2');
}
@font-face {
  font-family: 'Geist Sans';
  font-style: normal;
  font-display: swap;
  font-weight: 700;
  src: url(/fonts/geist-sans-bold.woff2) format('woff2');
}

/* ─── design tokens ───────────────────────────────────────────────────── */
:root {
  --bg:      oklch(97% 0.006 250);
  --surface: oklch(100% 0 0);
  --fg:      oklch(22% 0.02 240);
  --muted:   oklch(50% 0.018 240);
  --border:  oklch(90% 0.008 240);
  --accent:  oklch(58% 0.16 145);
  --accent2: oklch(58% 0.16 220);
  --accent3: oklch(55% 0.18 290);

  /* derived */
  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --fg-soft:     color-mix(in oklch, var(--fg) 6%, transparent);
  --accent-bg:   color-mix(in oklch, var(--accent) 8%, transparent);

  /* dark tokens (initialized to light; overridden by prefers-color-scheme) */
  --bg-dark:      oklch(10% 0.015 250);
  --surface-dark: oklch(18% 0.012 250);
  --fg-dark:      oklch(88% 0.006 250);
  --muted-dark:   oklch(55% 0.01 250);
  --border-dark:  oklch(28% 0.01 250);
  --code-bg:      oklch(18% 0.012 250);
  --code-fg:      oklch(80% 0.006 250);

  /* type — English-first, Chinese fallback */
  --font-display: 'Geist Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-body:    'Geist Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono:    'Cascadia Code', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --font-ui-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;

  /* scale */
  --fs-h1: clamp(40px, 5.5vw, 64px);
  --fs-h2: clamp(28px, 3.5vw, 42px);
  --fs-h3: 20px;
  --fs-lead: 18px;
  --fs-body: 16px;
  --fs-meta: 13px;
  --fs-small: 14px;

  /* spacing — 8-point grid */
  --gap-xs: 8px;
  --gap-sm: 12px;
  --gap-md: 20px;
  --gap-lg: 32px;
  --gap-xl: 56px;
  --gap-2xl: 64px;
  --container: 1120px;
  --gutter: 32px;

  --radius: 10px;
  --radius-lg: 16px;
}

/* ─── dark mode ──────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:      var(--bg-dark);
    --surface: var(--surface-dark);
    --fg:      var(--fg-dark);
    --muted:   var(--muted-dark);
    --border:  var(--border-dark);
    --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
    --fg-soft:     color-mix(in oklch, var(--fg) 10%, transparent);
    --accent-bg:   color-mix(in oklch, var(--accent) 12%, transparent);
  }
}

/* ─── forced dark mode via class (for manual toggle) ─────────────────── */
.dark-mode {
  --bg:      var(--bg-dark);
  --surface: var(--surface-dark);
  --fg:      var(--fg-dark);
  --muted:   var(--muted-dark);
  --border:  var(--border-dark);
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --fg-soft:     color-mix(in oklch, var(--fg) 10%, transparent);
  --accent-bg:   color-mix(in oklch, var(--accent) 12%, transparent);
}

/* ─── reset & base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent); }
button { font: inherit; cursor: pointer; }
p { text-wrap: pretty; margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* ─── selection ──────────────────────────────────────────────────────── */
::selection { background: var(--accent); color: #fff; }
::-moz-selection { background: var(--accent); color: #fff; }

/* ─── focus-visible (accessibility) ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius);
}
:focus:not(:focus-visible) { outline: none; }

/* ─── scrollbar (Webkit) ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── scroll-margin for anchor targets ───────────────────────────────── */
#blog-list,
[data-od-id] {
  scroll-margin-top: 80px;
}

/* ─── layout primitives ─────────────────────────────────────────────── */
/* surface background only inside .section (sides show body bg) */
.section .container {
  background: color-mix(in oklch, var(--surface) 84%, transparent);
  border: 1px solid color-mix(in oklch, var(--border) 78%, transparent);
  border-radius: var(--radius-lg);
  padding-block: var(--gap-xl);
}

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container-narrow {
  max-width: 760px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section {
  /* background moved to .container */
  padding-block: var(--gap-2xl);
}
.section + .section { border-top: 1px solid var(--border); }
.stack { display: flex; flex-direction: column; }
.stack > * + * { margin-top: var(--gap-md); }
.row { display: flex; align-items: center; gap: var(--gap-md); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--gap-md); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap-lg); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-lg); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap-md); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: var(--gap-xl); align-items: start; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: var(--gap-xl); align-items: start; }

/* ─── type ──────────────────────────────────────────────────────────── */
.h1, h1 { font-family: var(--font-display); font-size: var(--fs-h1); line-height: 1.08; letter-spacing: -0.025em; font-weight: 700; }
.h2, h2 { font-family: var(--font-display); font-size: var(--fs-h2); line-height: 1.15; letter-spacing: -0.02em; font-weight: 600; }
.h3, h3 { font-size: var(--fs-h3); font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.lead   { font-size: var(--fs-lead); line-height: 1.6; color: var(--muted); max-width: 60ch; margin: 0; }
.eyebrow {
  font-family: var(--font-ui-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 var(--gap-md);
}
.meta { font-family: var(--font-ui-mono); font-size: var(--fs-meta); color: var(--muted); }
.num  { font-family: var(--font-ui-mono); font-variant-numeric: tabular-nums; }
code { font-family: var(--font-ui-mono); }
pre, pre code { font-family: var(--font-mono); }

/* ─── HERO SECTION ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: var(--gap-2xl);
}
.hero-center {
  text-align: center;
  max-width: 44ch;
  margin-inline: auto;
  position: relative;
  z-index: 2;
}
.hero h1 { margin-bottom: var(--gap-md); }
.hero .lead { margin-bottom: var(--gap-lg); margin-inline: auto; }
.hero-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-2xl);
  align-items: center;
}
.hero-split .hero-content { max-width: 52ch; }
.hero-split .hero-visual { display: grid; place-items: center; }
.terminal {
  width: 100%;
  max-width: 480px;
  background: oklch(18% 0.012 250);
  border: 1px solid oklch(30% 0.01 250);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-ui-mono);
  font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
}
.terminal-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  background: oklch(22% 0.012 250);
  border-bottom: 1px solid oklch(30% 0.01 250);
}
.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.terminal-dot--red { background: #ff5f56; }
.terminal-dot--yellow { background: #ffbd2e; }
.terminal-dot--green { background: #27c93f; }
.terminal-title {
  margin-left: auto;
  color: oklch(55% 0.01 250);
  font-size: 11px;
  letter-spacing: 0.02em;
}
.terminal-body {
  padding: 16px 18px;
  color: oklch(75% 0.008 250);
  line-height: 1.7;
}
.terminal-line { display: flex; gap: 10px; }
.terminal-prompt { color: var(--accent); flex-shrink: 0; }
.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 16px;
  background: var(--accent);
  animation: blink-cursor 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}
@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.terminal-output { color: oklch(60% 0.01 250); }
.terminal-comment { color: oklch(45% 0.01 250); }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  background: var(--accent-bg);
  border-radius: 999px;
  font-family: var(--font-ui-mono);
  font-size: 11px;
  color: var(--accent);
  margin-bottom: var(--gap-lg);
  letter-spacing: 0.04em;
}
.hero-badge-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.hero-cta { display: inline-flex; gap: var(--gap-sm); flex-wrap: wrap; }
.hero-center .hero-cta { justify-content: center; }

@media (max-width: 920px) {
  .hero-split { grid-template-columns: 1fr; gap: var(--gap-lg); }
  .hero-split .hero-visual { display: none; }
}

/* ─── chrome: nav + footer ──────────────────────────────────────────── */
.topnav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklch, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 0.2s ease;
}
.topnav-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.topnav .logo {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  transition: color 0.15s ease;
}
.topnav .logo:hover { color: var(--accent); }
.topnav nav { display: flex; gap: var(--gap-lg); }
.topnav nav a {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  padding-block: 4px;
  position: relative;
  transition: color 0.15s ease;
}
.topnav nav a:hover,
.topnav nav a.active { color: var(--fg); }
.topnav nav a.active::after {
  content: "";
  position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  padding: 8px;
  color: var(--fg);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.15s ease;
}
.nav-toggle:hover { background: var(--fg-soft); }
.nav-toggle svg { width: 24px; height: 24px; display: block; }
.pagefoot {
  padding-block: var(--gap-lg);
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
}
.pagefoot .row-between { flex-wrap: wrap; gap: var(--gap-md); }
.pagefoot a { color: var(--muted); transition: color 0.15s ease; }
.pagefoot a:hover { color: var(--fg); }
.pagefoot .foot-links { display: flex; gap: var(--gap-md); flex-wrap: wrap; }

/* ─── buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: color-mix(in oklch, var(--accent) 85%, black); color: #fff; }
.btn-secondary { background: transparent; color: var(--fg); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--fg); background: var(--fg-soft); }
.btn-ghost { background: transparent; color: var(--fg); border-color: transparent; padding-inline: 8px; }
.btn-ghost:hover { color: var(--accent); }
.btn-arrow::after { content: "\2192"; transition: transform 0.15s ease; display: inline-block; }
.btn-arrow:hover::after { transform: translateX(3px); }

/* ─── utility classes (replaces inline style="...") ──────────────────── */
.gap-xs { gap: var(--gap-xs) !important; }
.gap-sm { gap: var(--gap-sm) !important; }
.gap-md { gap: var(--gap-md) !important; }
.gap-lg { gap: var(--gap-lg) !important; }

.mb-xs { margin-bottom: var(--gap-xs) !important; }
.mb-sm { margin-bottom: var(--gap-sm) !important; }
.mb-md { margin-bottom: var(--gap-md) !important; }
.mb-lg { margin-bottom: var(--gap-lg) !important; }
.mb-xl { margin-bottom: var(--gap-xl) !important; }
.mb-0 { margin-bottom: 0 !important; }

.mt-xs { margin-top: var(--gap-xs) !important; }
.mt-sm { margin-top: var(--gap-sm) !important; }
.mt-md { margin-top: var(--gap-md) !important; }
.mt-lg { margin-top: var(--gap-lg) !important; }

.mx-auto { margin-inline: auto !important; }
.text-center { text-align: center !important; }
.flex-1 { flex: 1 !important; }
.max-w-40ch { max-width: 40ch !important; }
.max-w-60ch { max-width: 60ch !important; }
.max-w-720 { max-width: 720px !important; }
.w-full { width: 100% !important; }
.justify-center { justify-content: center !important; }
.flex-wrap { flex-wrap: wrap !important; }
.pl-0 { padding-left: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.px-0 { padding-left: 0 !important; padding-right: 0 !important; }

/* ─── card / surface ─────────────────────────────────────────────────── */
.card {
  /* background moved to .container */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: box-shadow 0.2s ease;
}
.card:hover { box-shadow: 0 2px 12px var(--fg-soft); }
.card-flat { background: transparent; border: 0; padding: 0; }

/* ─── feature cell ───────────────────────────────────────────────────── */
.feature .feature-mark {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--accent);
  margin-bottom: var(--gap-md);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.feature:hover .feature-mark {
  border-color: var(--accent);
}
.feature .feature-mark svg { width: 18px; height: 18px; }
.feature h3 { margin-bottom: 6px; font-size: 17px; }
.feature p  { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ─── about avatar ───────────────────────────────────────────────────── */
.about-avatar {
  width: 140px; height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-bg));
  border: 2px solid var(--border);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
  text-transform: uppercase;
  flex-shrink: 0;
}

/* ─── pill / badge / tag ─────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 999px;
  font-family: var(--font-ui-mono);
  font-size: 11px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  font-weight: 500;
}
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tag:hover { border-color: var(--fg); color: var(--fg); }

/* ─── form field ─────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 500; }
.input, .textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* background moved to .container */
  color: var(--fg);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus, .textarea:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--accent-soft);
  border-color: var(--accent);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); opacity: 0.6; }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }

/* ─── blog post preview cards ────────────────────────────────────────── */
.post-card {
  padding: 24px 0;
  border-top: 1px solid var(--border);
}
.post-card:first-child { border-top: none; }
.post-card h3 a { color: var(--fg); transition: color 0.15s ease; }
.post-card h3 a:hover { color: var(--accent); }
.post-card .post-meta {
  display: flex;
  gap: var(--gap-sm);
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.post-card .post-excerpt {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
  line-height: 1.6;
  max-width: 65ch;
}



/* ─── filter bar (was inline <style>) ────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--fg); color: var(--fg); }
.filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ─── contact form ───────────────────────────────────────────────────── */
.contact-form { max-width: 560px; }
.contact-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gap-md);
}
.contact-form .field-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ripple-container { position: relative; overflow: hidden; }
.ripple-effect {
  position: absolute;
  border-radius: 50%;
  background: var(--accent-soft);
  transform: scale(0);
  animation: ripple-anim 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-anim { to { transform: scale(3); opacity: 0; } }
.contact-form .required-star { color: var(--accent); margin-left: 1px; }
.field.field-error .input,
.field.field-error .textarea {
  border-color: oklch(52% 0.18 27);
  box-shadow: 0 0 0 2px color-mix(in oklch, oklch(52% 0.18 27) 14%, transparent);
}
.field .field-error-msg {
  display: none;
  font-size: 12px;
  color: oklch(52% 0.18 27);
  margin-top: 2px;
}
.field.field-error .field-error-msg { display: flex; align-items: center; gap: 4px; }
.form-success {
  display: none;
  padding: var(--gap-md);
  background: var(--accent-bg);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: oklch(45% 0.14 160);
  font-weight: 500;
  text-align: center;
  animation: fadeIn 0.3s ease;
}
.form-success-icon { font-size: 28px; line-height: 1; margin-bottom: 8px; }
.form-success-title { font-weight: 600; font-size: 16px; margin-bottom: 4px; }
.form-success-desc { color: var(--muted); font-size: 14px; font-weight: 400; }
.btn.is-loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn.is-loading::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 16px; height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btn-spin 0.6s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes success-check {
  0% { transform: scale(0) rotate(-45deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(0deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.form-success .form-success-icon {
  display: inline-block;
  animation: success-check 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.contact-sidebar .sidebar-block {
  /* background moved to .container */
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.contact-sidebar .sidebar-block + .sidebar-block { margin-top: var(--gap-md); }
.contact-sidebar .sidebar-email {
  color: var(--fg);
  font-family: var(--font-ui-mono);
  font-size: 15px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border);
  transition: text-decoration-color 0.15s ease;
}
.contact-sidebar .sidebar-email:hover {
  text-decoration-color: var(--accent);
  color: var(--accent);
}
.contact-sidebar .sidebar-social a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  transition: color 0.15s ease;
}
.contact-sidebar .sidebar-social a:last-child { border-bottom: none; }
.contact-sidebar .sidebar-social a:hover { color: var(--fg); }
.contact-sidebar .sidebar-social .social-icon {
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-ui-mono);
  flex-shrink: 0;
}

/* ─── legal content ──────────────────────────────────────────────────── */
.legal-content h2 { font-size: 24px; margin-top: 40px; margin-bottom: 12px; font-weight: 600; }
.legal-content h3 { font-size: 18px; margin-top: 28px; margin-bottom: 8px; font-weight: 600; }
.legal-content p { margin-bottom: 16px; line-height: 1.7; color: var(--fg); }
.legal-content ul { list-style: disc; padding-left: 24px; margin-bottom: 16px; }
.legal-content ul li { margin-bottom: 8px; line-height: 1.6; color: var(--fg); }
.legal-content strong { font-weight: 600; }
.legal-content .highlight-box {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}
.legal-content .highlight-box p { margin-bottom: 0; }
.ds-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ds-table th, .ds-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.ds-table th { color: var(--muted); font-weight: 500; font-family: var(--font-ui-mono); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; }
.ds-table tbody tr:hover { background: var(--fg-soft); }

/* ─── article detail ─────────────────────────────────────────────────── */
.article-header {
  text-align: center;
  max-width: 720px;
  margin-inline: auto;
  padding-bottom: var(--gap-lg);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--gap-xl);
}
.article-header h1 { font-size: clamp(28px, 3.5vw, 42px); line-height: 1.15; margin-bottom: var(--gap-md); }
.article-header .article-meta {
  display: flex;
  justify-content: center;
  gap: var(--gap-md);
  flex-wrap: wrap;
  font-family: var(--font-ui-mono);
  font-size: 13px;
  color: var(--muted);
}
.article-body {
  max-width: 720px;
  margin-inline: auto;
  font-size: 17px;
  line-height: 1.75;
  color: var(--fg);
}
.article-body h2 { font-size: 24px; margin-top: 48px; margin-bottom: 16px; font-weight: 600; }
.article-body h3 { font-size: 20px; margin-top: 32px; margin-bottom: 12px; font-weight: 600; }
.article-body h4 { font-size: 18px; margin-top: 24px; margin-bottom: 10px; font-weight: 600; }
.article-body p { margin-bottom: 20px; }
.article-body p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { margin-bottom: 20px; padding-left: 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body ul li, .article-body ol li { margin-bottom: 8px; line-height: 1.65; }
.article-body li > ul,
.article-body li > ol { margin-bottom: 0; margin-top: 4px; }
.article-body strong { font-weight: 600; }
.article-body em { font-style: italic; }
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--accent-soft);
  transition: text-decoration-color 0.15s ease;
}
.article-body a:hover { text-decoration-color: var(--accent); }

/* ─── article body: code ─────────────────────────────────────────────── */
.article-body code {
  background: var(--fg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}
.article-body pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 20px 24px;
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
  border: 1px solid var(--border-dark);
}
.article-body pre code {
  background: none;
  padding: 0;
  font-size: inherit;
  line-height: inherit;
}
.article-body pre::-webkit-scrollbar { height: 6px; }
.article-body pre::-webkit-scrollbar-thumb { background: oklch(35% 0.01 250); border-radius: 3px; }

/* ─── article body: blockquote ───────────────────────────────────────── */
.article-body blockquote {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 24px;
  color: var(--fg);
}
.article-body blockquote p { margin-bottom: 0; }
.article-body blockquote p + p { margin-top: 12px; }
.article-body blockquote code { background: color-mix(in oklch, var(--accent) 12%, transparent); }

/* ─── article body: tables ───────────────────────────────────────────── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin-bottom: 24px;
}
.article-body th,
.article-body td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.article-body th {
  font-family: var(--font-ui-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--fg-soft);
}
.article-body tbody tr:hover { background: var(--fg-soft); }

/* ─── article body: images ───────────────────────────────────────────── */
.article-body img {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-block: 24px;
}

/* ─── article body: horizontal rule ──────────────────────────────────── */
.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* ─── article navigation ─────────────────────────────────────────────── */
.article-nav {
  max-width: 720px;
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: var(--gap-md);
  margin-top: var(--gap-xl);
  padding-top: var(--gap-lg);
  border-top: 1px solid var(--border);
}
.article-nav .btn-ghost {
  max-width: 45%;
  text-align: left;
  white-space: normal;
  word-break: break-word;
}

/* ─── highlight box (shared) ─────────────────────────────────────────── */
.highlight-box {
  background: var(--accent-bg);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
}
.highlight-box p { margin-bottom: 0; }

/* ─── responsive ─────────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .grid-2, .grid-3, .grid-4, .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .contact-form .form-row { grid-template-columns: 1fr; }
  .topnav nav { display: none; }
  .topnav nav.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; /* background moved to .container */ border-bottom: 1px solid var(--border); padding: var(--gap-md) var(--gutter); gap: var(--gap-sm); background: var(--surface); box-shadow: 0 12px 30px var(--fg-soft); }
  .nav-toggle { display: block; }
  .article-nav { flex-direction: column; }
  .article-nav .btn-ghost { max-width: 100%; }
  .article-body { font-size: 16px; }
  .article-body pre { font-size: 13px; padding: 16px; }
  .filter-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .hero-badge { font-size: 10px; padding: 3px 10px 3px 6px; }
  :root { --gutter: 20px; --gap-2xl: 44px; }
}

@media (max-width: 480px) {
  .hero-center { max-width: 100%; }
  .hero h1 { font-size: clamp(28px, 8vw, 36px); }
  .hero-cta { flex-direction: column; align-items: center; }
  .btn { width: 100%; justify-content: center; }
  .filter-bar { flex-wrap: wrap; }
}

/* ─── print styles ───────────────────────────────────────────────────── */
@media print {
  .topnav, .pagefoot, .nav-toggle, .hero-cta, .article-nav,
  .filter-bar, #navToggle, .btn { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  .section { padding-block: 1rem; break-inside: avoid; }
  .article-body { max-width: 100%; font-size: 12pt; }
  .article-body pre {
    background: #f5f5f5;
    color: #000;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
  .article-body code { background: #f0f0f0; }
  .article-body a { color: inherit; text-decoration: underline; }
  .article-body img { max-width: 100% !important; break-inside: avoid; }
  .container { max-width: 100%; padding-inline: 0; }
  h1, h2, h3 { page-break-after: avoid; }
}

/* ─── reduced motion ─────────────────────────────────────────────────── */
@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;
  }
}

/* ─── cookie consent banner ──────────────────────────────────────────── */
.cookie-notice {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  box-shadow: 0 -4px 20px var(--fg-soft);
  transform: translateY(100%);
  transition: transform 0.4s ease;
}
.cookie-notice.show {
  transform: translateY(0);
}
.cookie-notice .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap-md);
  flex-wrap: wrap;
}
.cookie-notice p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  flex: 1;
  min-width: 240px;
}
.cookie-notice p a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cookie-notice .btn {
  flex-shrink: 0;
}
.cookie-actions {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  flex-wrap: wrap;
  flex-shrink: 0;
}

@media print {
  .cookie-notice { display: none !important; }
}

/* ─── article author byline ──────────────────────────────────────────── */
.article-author {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-top: var(--gap-md);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}
.author-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), var(--accent-bg));
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}
.author-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  line-height: 1.2;
}
.author-label {
  font-family: var(--font-ui-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* ─── post card thumbnail ────────────────────────────────────────── */
.post-card {
  display: flex;
  gap: var(--gap-md);
  align-items: center;
}
.post-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  background: var(--accent-bg);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  margin-top: 4px;
  overflow: hidden;
}
.post-thumb-icon {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.post-card .post-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 480px) {
  .post-thumb { display: none; }
}

/* ─── post card thumbnail image ───────────────────────────────── */
.post-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.post-thumb:has(.post-thumb-img) {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

/* ─── manual theme control ─────────────────────────────────────────── */
html.light-mode {
  --bg: oklch(97% 0.006 250);
  --surface: oklch(100% 0 0);
  --fg: oklch(22% 0.02 240);
  --muted: oklch(50% 0.018 240);
  --border: oklch(90% 0.008 240);
  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --fg-soft: color-mix(in oklch, var(--fg) 6%, transparent);
  --accent-bg: color-mix(in oklch, var(--accent) 8%, transparent);
}
.theme-toggle {
  width: 34px;
  height: 34px;
  margin-left: var(--gap-sm);
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-bg);
}
.theme-toggle-icon { grid-area: 1 / 1; font-size: 16px; display: grid; place-items: center; }
.theme-toggle-icon svg { width: 16px; height: 16px; display: block; }
.theme-toggle-icon--moon { display: none; }
.dark-mode .theme-toggle-icon--sun { display: none; }
.dark-mode .theme-toggle-icon--moon { display: block; }

.newsletter-form { position: relative; }
.newsletter-status {
  flex-basis: 100%;
  min-height: 22px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}
.newsletter-status.is-success { color: var(--accent); }
.newsletter-status.is-error { color: #c43d3d; }
.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;
}

.post-thumb {
  width: 176px;
  height: 120px;
  margin-top: 0;
  border-radius: var(--radius);
  aspect-ratio: 3 / 2;
}
.post-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
@media (max-width: 640px) {
  .post-thumb {
    width: 112px;
    height: 76px;
  }
}
@media (max-width: 480px) {
  .post-thumb { display: grid; width: 88px; height: 60px; }
}


article.post-card.is-filtered-out { display: none !important; }
/* ─── interaction polish ────────────────────────────────────────────── */
.post-card {
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.post-card h3 a {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}
.post-card h3 a:hover {
  text-decoration-color: currentColor;
}
.post-thumb {
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.btn:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

@media (hover: hover) {
  .post-card:hover {
    background: color-mix(in oklch, var(--accent) 3%, transparent);
    border-radius: var(--radius);
  }
  .post-card:hover .post-thumb {
    border-color: color-mix(in oklch, var(--accent) 48%, var(--border));
    transform: translateY(-2px);
  }
}

@media (max-width: 640px) {
  .post-card .post-excerpt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .post-card .post-excerpt {
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
  }
}
