/* ================================================================
   FxMath Harmonic Hunter Blog — main stylesheet
   Dark trading-terminal aesthetic: deep navy + cyan/violet accents.
   ================================================================ */

:root {
  --bg: #060a16;
  --bg-soft: #0a1122;
  --bg-card: #0d1526;
  --bg-card-2: #111b33;
  --bg-input: #0b1324;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --cyan: #22d3ee;
  --violet: #818cf8;
  --indigo: #6366f1;
  --grad: linear-gradient(100deg, #22d3ee 0%, #6366f1 55%, #a78bfa 100%);
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 20px 50px -20px rgba(2, 8, 23, 0.9);
  --shadow-glow: 0 0 0 1px rgba(34, 211, 238, 0.25), 0 20px 60px -20px rgba(34, 211, 238, 0.25);
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #ffffff;
  --bg-card: #ffffff;
  --bg-card-2: #f0f5fb;
  --bg-input: #ffffff;
  --border: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.24);
  --text: #0f172a;
  --text-dim: #475569;
  --text-faint: #64748b;
  --shadow: 0 20px 50px -24px rgba(15, 23, 42, 0.25);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.2), 0 20px 60px -24px rgba(99, 102, 241, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}
img { max-width: 100%; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
.container { width: min(1180px, 92vw); margin: 0 auto; }
section.section { padding: 72px 0; }

::selection { background: rgba(34, 211, 238, 0.3); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 4px; }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- utilities ---------- */
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--cyan); font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--grad); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }
.muted { color: var(--text-dim); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.1); color: var(--cyan);
  border: 1px solid rgba(34, 211, 238, 0.25);
  cursor: pointer; transition: all 0.2s ease;
}
.tag-chip:hover { background: rgba(34, 211, 238, 0.2); text-decoration: none; }
.tag-chip.violet { background: rgba(129, 140, 248, 0.1); color: var(--violet); border-color: rgba(129, 140, 248, 0.3); }
.tag-chip.violet:hover { background: rgba(129, 140, 248, 0.2); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 650; font-size: 15px; border-radius: 10px;
  padding: 10px 18px; border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-accent { background: var(--grad); color: #fff; box-shadow: 0 8px 24px -8px rgba(99, 102, 241, 0.6); }
.btn-accent:hover { box-shadow: 0 12px 30px -8px rgba(99, 102, 241, 0.75); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-card-2); }
.btn-danger { background: rgba(248, 113, 113, 0.12); color: var(--red); border-color: rgba(248, 113, 113, 0.4); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.22); }
.btn-sm { font-size: 13px; padding: 7px 13px; }
.btn-lg { font-size: 16px; padding: 13px 24px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 10px;
  background: transparent; border: 1px solid var(--border);
  color: var(--text-dim); transition: all 0.2s ease;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.08); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 20px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-logo { display: inline-flex; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 15.5px; font-weight: 750; letter-spacing: -0.01em; }
.brand-text strong em { font-style: normal; color: var(--cyan); }
.brand-text small { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.16em; text-transform: uppercase; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.main-nav a {
  color: var(--text-dim); font-size: 14px; font-weight: 550;
  padding: 8px 12px; border-radius: 8px; transition: all 0.18s ease;
}
.main-nav a:hover { color: var(--text); background: var(--bg-card-2); text-decoration: none; }
.main-nav a.active { color: var(--cyan); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; }
#buyBtn .ico { margin-left: 2px; }

/* theme icons */
html[data-theme="dark"] .ico-sun { display: block; }
html[data-theme="dark"] .ico-moon { display: none; }
html[data-theme="light"] .ico-sun { display: none; }
html[data-theme="light"] .ico-moon { display: block; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 96px 0 80px; text-align: center; }
.hero-bg {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(700px 380px at 18% -10%, rgba(34, 211, 238, 0.16), transparent 60%),
    radial-gradient(760px 420px at 88% 8%, rgba(99, 102, 241, 0.2), transparent 62%),
    radial-gradient(600px 500px at 55% 115%, rgba(167, 139, 250, 0.12), transparent 60%);
}
.hero-bg::after {
  content: ""; position: absolute; inset: 0; opacity: 0.5;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(700px 420px at 50% 30%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(700px 420px at 50% 30%, #000 20%, transparent 75%);
}
.hero-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 62px); line-height: 1.08; font-weight: 800; letter-spacing: -0.03em; margin: 6px 0 0; }
.hero-sub { max-width: 640px; color: var(--text-dim); font-size: 17px; margin: 0; }
.hero-sub a { color: var(--violet); }
.hero-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; justify-content: center; }
.hero-stats {
  margin-top: 42px; display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 14px; width: min(760px, 100%);
}
.stat {
  background: color-mix(in srgb, var(--bg-card) 70%, transparent);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 10px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.stat b { display: block; font-size: 28px; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat span { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.12em; }

/* ---------- section headers ---------- */
.section-head { text-align: center; max-width: 660px; margin: 0 auto 46px; }
.section-head h2 { font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -0.02em; margin: 10px 0 10px; }
.section-head p { color: var(--text-dim); margin: 0; }

/* ---------- blog grid ---------- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.blog-grid.cols-1 { grid-template-columns: 1fr; }
.blog-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
  color: inherit;
}
a.card:hover { text-decoration: none; transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); color: inherit; }
.card-cover { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-card-2); }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.card:hover .card-cover img { transform: scale(1.05); }
.card-cover .cover-fallback {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(120% 120% at 20% 0%, rgba(34,211,238,.18), transparent 55%),
              radial-gradient(120% 120% at 90% 100%, rgba(99,102,241,.25), transparent 60%),
              var(--bg-card-2);
}
.card-cover .cover-fallback svg { width: 58px; height: 58px; opacity: 0.85; }
.card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.card h3 { font-size: 18.5px; line-height: 1.35; letter-spacing: -0.01em; margin: 0; }
.card p.summary { color: var(--text-dim); font-size: 14.5px; margin: 0; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 14px; font-size: 12.5px; color: var(--text-faint); }
.card-meta .date { display: inline-flex; align-items: center; gap: 5px; }
.card-meta .views { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.badge-featured {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  background: rgba(6, 10, 22, 0.78); color: var(--amber);
  padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(251, 191, 36, 0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.badge-status {
  position: absolute; top: 12px; left: 12px; z-index: 2; font-size: 11px;
  padding: 3px 9px; border-radius: 999px; font-weight: 700; letter-spacing: 0.04em;
}

/* pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.page-btn {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-dim);
  font-weight: 600; transition: all 0.18s ease;
}
.page-btn:hover:not(:disabled):not(.active) { border-color: var(--cyan); color: var(--cyan); }
.page-btn.active { background: var(--grad); color: #fff; border-color: transparent; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- post layout ---------- */
.post-hero { padding: 56px 0 40px; text-align: left; }
.post-hero .container { max-width: 860px; }
.post-title { font-size: clamp(28px, 4.4vw, 46px); line-height: 1.15; letter-spacing: -0.025em; margin: 14px 0 14px; }
.post-sub { color: var(--text-dim); font-size: 18px; max-width: 720px; margin: 0 0 22px; }
.post-meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; color: var(--text-faint); font-size: 13.5px; }
.post-cover-frame { margin-top: 34px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.post-cover-frame img { width: 100%; max-height: 460px; object-fit: cover; }

.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 44px; align-items: start; padding: 52px 0 90px; }
.post-article { min-width: 0; }

/* prose */
.prose { font-size: 17px; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h1, .prose h2, .prose h3, .prose h4 { line-height: 1.3; letter-spacing: -0.015em; margin: 1.6em 0 0.6em; }
/* Blog-generated headings get the "# " prefix + underline; headings that
   arrive with their own inline styles (AI-generated HTML) keep their look. */
.prose h2:not([style]) { font-size: 27px; padding-bottom: 0.4em; border-bottom: 1px solid var(--border); }
.prose h2:not([style])::before { content: "# "; color: var(--cyan); font-weight: 700; }
.prose h3:not([style]) { font-size: 21px; }
.prose p { margin: 0; }
.prose a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--cyan); }
.prose strong { color: #fff; font-weight: 700; }
html[data-theme="light"] .prose strong { color: #0f172a; }
.prose blockquote {
  margin: 0; padding: 14px 22px; border-left: 3px solid var(--cyan);
  background: color-mix(in srgb, var(--bg-card-2) 60%, transparent);
  border-radius: 0 10px 10px 0; color: var(--text-dim); font-style: italic;
}
.prose code {
  font-family: var(--font-mono); font-size: 0.85em;
  background: var(--bg-card-2); border: 1px solid var(--border);
  padding: 0.15em 0.45em; border-radius: 6px; color: var(--cyan);
}
.prose pre {
  background: #0a1220; border: 1px solid var(--border); border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; line-height: 1.55;
}
html[data-theme="light"] .prose pre { background: #0f172a; }
.prose pre code { background: transparent; border: 0; padding: 0; color: #dbe4f0; font-size: 0.86em; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.95em; overflow: hidden; border-radius: 10px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-card-2); font-family: var(--font-mono); font-size: 0.82em; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.prose tr:nth-child(even) td { background: color-mix(in srgb, var(--bg-card-2) 35%, transparent); }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.2em 0; }
.prose img { border-radius: 10px; border: 1px solid var(--border); }

/* AI-generated HTML posts: keep their rich cards, but let text inherit the
   blog font + theme so the wrapper doesn't look "foreign" to the site.
   Only the top-level wrapper is normalized; inner inline styles are kept. */
.post-view[data-format="html"] .prose > div {
  font-family: var(--font-sans) !important;
  color: var(--text) !important;
}

/* share bar + tags */
.post-footer { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
/* prominent share row at the top of each article */
.share-row {
  display: flex; align-items: center; gap: 12px; margin: 22px 0 6px; padding: 12px 16px;
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
  border: 1px solid var(--border); border-radius: 12px; max-width: 560px;
}
.share-row .share-label {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-faint); white-space: nowrap;
}
.share-btns { display: flex; gap: 7px; flex-wrap: wrap; }
.share-btns button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border-radius: 9px;
  border: 1px solid var(--border); background: var(--bg-card-2); color: var(--text-dim);
  transition: all 0.18s ease; text-decoration: none; cursor: pointer;
}
.share-row .share-btns button { background: var(--bg-input); }
.share-btns button:hover { transform: translateY(-2px); text-decoration: none; }
/* brand hover colors */
.share-btns button[data-share="fb"]:hover { color: #1877f2; border-color: #1877f2; background: rgba(24, 119, 242, 0.12); }
.share-btns button[data-share="x"]:hover { color: var(--text); border-color: var(--text-dim); }
.share-btns button[data-share="tg"]:hover { color: #229ed9; border-color: #229ed9; background: rgba(34, 158, 217, 0.12); }
.share-btns button[data-share="wa"]:hover { color: #25d366; border-color: #25d366; background: rgba(37, 211, 102, 0.12); }
.share-btns button[data-share="in"]:hover { color: #0a66c2; border-color: #0a66c2; background: rgba(10, 102, 194, 0.12); }
.share-btns button[data-share="rd"]:hover { color: #ff4500; border-color: #ff4500; background: rgba(255, 69, 0, 0.12); }
.share-btns button[data-share="link"]:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(34, 211, 238, 0.1); }
/* social media buttons: black/white icon sits well in both themes */
html[data-theme="light"] .share-btns button { color: #475569; }

/* sidebar */
.post-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 26px; }
.widget {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px;
}
.widget h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.widget-tags { display: flex; flex-wrap: wrap; gap: 7px; }
.widget .related-post { display: block; padding: 11px 0; border-bottom: 1px dashed var(--border); color: var(--text); }
.widget .related-post:last-child { border-bottom: 0; padding-bottom: 0; }
.widget .related-post small { display: block; color: var(--text-faint); font-size: 12px; margin-top: 3px; }
.widget .related-post:hover { color: var(--cyan); text-decoration: none; }
.cta-widget { background: linear-gradient(150deg, rgba(34,211,238,.10), rgba(99,102,241,.16)); border: 1px solid rgba(99,102,241,.35); }
.cta-widget .btn { width: 100%; }
.cta-widget .tg-link { display: block; margin-top: 10px; text-align: center; font-size: 13px; }

/* toc */
.toc { font-size: 14px; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.toc a { color: var(--text-dim); padding: 5px 10px; border-radius: 7px; display: block; border-left: 2px solid transparent; }
.toc a:hover { color: var(--cyan); text-decoration: none; background: var(--bg-card-2); }
.toc a.active { color: var(--cyan); border-left-color: var(--cyan); background: color-mix(in srgb, var(--bg-card-2) 60%, transparent); }

/* ---------- comments ---------- */
.comments { margin-top: 60px; padding-top: 34px; border-top: 1px solid var(--border); }
.comments h2 { font-size: 22px; margin: 0 0 22px; }
.comment-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.comment-form-grid .field-full { grid-column: 1 / -1; }
.cm { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cm:last-of-type { border-bottom: 0; }
.cm-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: var(--grad); font-size: 16px; text-transform: uppercase;
}
.cm-main { flex: 1; min-width: 0; }
.cm-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.cm-author { font-weight: 700; color: var(--text); }
.cm-date { font-size: 12px; color: var(--text-faint); }
.cm-body { margin: 6px 0 0; color: var(--text-dim); font-size: 15px; overflow-wrap: anywhere; white-space: pre-line; }
.empty-state { color: var(--text-faint); text-align: center; padding: 26px 0; font-style: italic; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 650; color: var(--text-dim); }
.input, .textarea, .select {
  background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 11px 14px; font-size: 15px; font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 100%;
}
.textarea { resize: vertical; min-height: 120px; line-height: 1.55; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.field-hint { font-size: 12px; color: var(--text-faint); }
.form-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 6px; flex-wrap: wrap; }

/* ---------- toast ---------- */
.toast-root { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--bg-card-2); color: var(--text);
  border: 1px solid var(--border-strong); border-left: 3px solid var(--cyan);
  padding: 13px 18px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 14px; max-width: 380px; animation: slideIn 0.25s ease;
  display: flex; align-items: center; gap: 10px;
}
.toast.error { border-left-color: var(--red); }
.toast.success { border-left-color: var(--green); }
.toast.out { animation: slideOut 0.3s ease forwards; }
@keyframes slideIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(24px); } }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 44px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-col h4 { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 14px; }
.footer-col a { display: block; color: var(--text-dim); font-size: 14px; padding: 5px 0; }
.footer-col a:hover { color: var(--cyan); }
.disclaimer { font-size: 12.5px; color: var(--text-faint); max-width: 380px; margin: 14px 0 0; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-bottom p { margin: 0; font-size: 13px; color: var(--text-faint); }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: var(--text-faint); }
.footer-links a:hover { color: var(--cyan); }

/* ---------- skeleton loading ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(148,163,184,0.10) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ---------- error / empty ---------- */
.state-box { text-align: center; padding: 90px 20px; color: var(--text-dim); }
.state-box h2 { color: var(--text); }
.state-box .big { font-size: 56px; margin-bottom: 10px; }

/* ---------- newsletter / CTA band ---------- */
.band { margin-top: 40px; }
.band-inner {
  border-radius: var(--radius); padding: 40px; text-align: center;
  background:
    radial-gradient(600px 260px at 50% -60%, rgba(34, 211, 238, 0.2), transparent 70%),
    var(--bg-card);
  border: 1px solid var(--border);
}
.band-inner h3 { margin: 0 0 8px; font-size: 26px; }
.band-inner p { color: var(--text-dim); margin: 0 auto 22px; max-width: 520px; }
.newsletter-form { display: flex; gap: 10px; max-width: 460px; margin: 0 auto; }
.newsletter-form .input { flex: 1; }

/* ---------- search & controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 34px; }
.search-box { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search-box svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search-box .input { padding-left: 40px; }
.controls .tag-filter { display: flex; flex-wrap: wrap; gap: 7px; }
.controls .tag-chip.active { background: var(--grad); color: #fff; border-color: transparent; }
.controls .tag-chip.active:hover { background: var(--grad); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(3, 7, 18, 0.72);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: 24px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow); max-width: 480px; width: 100%;
  padding: 26px; animation: popIn 0.22s ease;
}
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
.modal h3 { margin: 0 0 8px; }
.modal p { color: var(--text-dim); margin: 0 0 18px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .post-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 30px; }
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .main-nav {
    position: fixed; top: 68px; left: 0; right: 0; z-index: 55;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 12px 4vw 18px; display: none; box-shadow: var(--shadow);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; font-size: 16px; }
  .menu-btn { display: inline-flex; }
  .post-layout { grid-template-columns: 1fr; }
  .post-side { position: static; order: -1; flex-direction: row; flex-wrap: wrap; }
  .post-side .widget { flex: 1 1 240px; }
  .widget.toc-widget { display: none; }
}
@media (max-width: 640px) {
  .blog-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  section.section { padding: 48px 0; }
  .hero { padding: 64px 0 56px; }
  .newsletter-form { flex-direction: column; }
  #buyBtn { display: none; }
  .comment-form-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
