:root {
  --bg: #0b0e14;
  --panel: #141824;
  --panel-2: #1a1f2e;
  --text: #dde1ec;
  --muted: #8a90a3;
  --accent: #f7931a;
  --accent-soft: rgba(247, 147, 26, .12);
  --link: #7fb3ff;
  --border: #242a3c;
  --up: #3ddc84;
  --down: #ff5c6c;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 500px at 80% -10%, rgba(247,147,26,.07), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(64,110,255,.06), transparent 55%),
    var(--bg);
  color: var(--text);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px; }
a { color: var(--link); }
img { max-width: 100%; }

/* reading progress */
#progress { position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--accent), #ffc46b); z-index: 99; transition: width .1s linear; }

/* header */
.site-header { border-bottom: 1px solid var(--border); background: rgba(20,24,36,.85);
  backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 50; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding: 13px 20px; }
.logo { font-weight: 800; font-size: 23px; color: var(--accent); text-decoration: none; letter-spacing: .3px; }
.logo::before { content: "◉ "; }
.site-header nav a { margin-left: 18px; color: var(--muted); text-decoration: none; font-size: 15px; }
.site-header nav a:hover { color: var(--text); }

/* live ticker */
.ticker { overflow: hidden; border-bottom: 1px solid var(--border); background: var(--panel);
  height: 34px; display: none; }
.ticker-live { display: block; }
.ticker-track { display: inline-flex; gap: 34px; align-items: center; height: 34px;
  white-space: nowrap; animation: ticker 45s linear infinite; font-size: 13px; color: var(--muted); }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.tk b { color: var(--text); margin-right: 4px; }
.tk i { font-style: normal; margin-left: 4px; }
.tk .up { color: var(--up); } .tk .down { color: var(--down); }

/* featured story */
.featured { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; margin: 26px 0 10px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; transition: transform .18s, border-color .18s; }
.featured:hover { transform: translateY(-3px); border-color: var(--accent); }
.featured-img { min-height: 280px; }
.featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-body { padding: 26px 28px; display: flex; flex-direction: column; justify-content: center; }
.featured-label { display: inline-block; align-self: flex-start; background: var(--accent-soft);
  color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; border-radius: 20px; padding: 3px 12px; margin-bottom: 12px; }
.featured h2 { margin: 0 0 10px; font-size: 27px; line-height: 1.25; color: var(--text); }
.featured p { margin: 0 0 12px; color: var(--muted); font-size: 15px; }

/* cards grid */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; margin: 20px 0 8px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; display: flex; flex-direction: column;
  transition: transform .18s, border-color .18s, box-shadow .18s; }
.card:hover { transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(0,0,0,.35); }
.thumb { position: relative; height: 165px; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.card:hover .thumb img { transform: scale(1.05); }
.thumb-fallback { height: 100%; background:
  linear-gradient(135deg, #1c2334 0%, #232b42 50%, #1c2334 100%); }
.card-tag { position: absolute; top: 10px; left: 10px; background: rgba(11,14,20,.8);
  color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; padding: 3px 10px; border-radius: 20px; backdrop-filter: blur(4px); }
.card-body { padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h2 { margin: 0; font-size: 18px; line-height: 1.35; color: var(--text); }
.card-body p { margin: 0; color: var(--muted); font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12.5px !important; color: var(--muted); margin-top: auto !important; }
.card-meta time { color: var(--muted); }

.pagination { display: flex; justify-content: space-between; margin: 26px 0; }

/* article page */
.article-page { padding-top: 30px; padding-bottom: 40px; }
.post-title { font-size: 34px; line-height: 1.22; margin: 8px 0 10px; letter-spacing: -.3px; }
.meta { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.tags { margin-left: 8px; }
a.tag { display: inline-block; background: var(--panel-2); color: var(--muted); border-radius: 20px;
  padding: 1px 11px; font-size: 12px; margin-left: 6px; text-decoration: none; }
a.tag:hover { color: var(--accent); }
.hero { margin: 0 0 26px; }
.hero img { width: 100%; border-radius: var(--radius); display: block;
  border: 1px solid var(--border); }
.hero figcaption { color: var(--muted); font-size: 12px; text-align: right; margin-top: 6px; }

.toc { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 20px; margin: 0 0 28px; font-size: 15px; }
.toc strong { display: block; margin-bottom: 6px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted); }
.toc ol { margin: 0; padding-left: 20px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.post-body h2 { margin-top: 38px; font-size: 23px; color: var(--accent); scroll-margin-top: 80px; }
.post-body p { margin: 14px 0; }
.post-body blockquote { border-left: 3px solid var(--accent); margin: 20px 0; padding: 4px 20px;
  color: var(--muted); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.post-body code { background: var(--panel); padding: 2px 6px; border-radius: 4px; font-size: 15px; }
.post-body pre { background: var(--panel); padding: 14px; border-radius: 8px; overflow-x: auto; }
.post-body table { border-collapse: collapse; width: 100%; margin: 18px 0; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.post-body th { background: var(--panel); }
.post-body a { text-decoration: underline; text-underline-offset: 3px; }

/* share */
.share { display: flex; align-items: center; gap: 10px; margin: 32px 0 8px;
  padding-top: 18px; border-top: 1px solid var(--border); }
.share span { color: var(--muted); font-size: 14px; }
.share a { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--panel-2); color: var(--text); text-decoration: none;
  font-size: 16px; border: 1px solid var(--border); transition: all .15s; }
.share a:hover { background: var(--accent); color: #0b0e14; transform: translateY(-2px); }

/* related */
.related { margin-top: 40px; }
.related h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.related-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 10px; text-decoration: none; align-items: center; transition: border-color .15s; }
.related-card:hover { border-color: var(--accent); }
.related-card img, .related-card .thumb-fallback { width: 84px; height: 60px; border-radius: 8px;
  object-fit: cover; flex-shrink: 0; }
.related-card .thumb-fallback { background: linear-gradient(135deg, #1c2334, #2a3350); }
.related-card span { color: var(--text); font-size: 14px; line-height: 1.4; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.affiliate-box { background: var(--panel); border: 1px dashed var(--accent); border-radius: 8px;
  padding: 12px 16px; margin: 22px 0; font-size: 15px; }
.disclosure { color: var(--muted); font-size: 13px; border-top: 1px solid var(--border);
  margin-top: 30px; padding-top: 14px; }
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0;
  color: var(--muted); font-size: 13px; background: var(--panel); }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* breadcrumbs */
.breadcrumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span { margin: 0 4px; }

/* tag pages */
.tag-page-title { color: var(--accent); }
.tag-count { color: var(--muted); font-size: 14px; margin-top: -8px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud .tag { font-size: 13px; padding: 4px 14px; }
.tag-cloud-title { margin-top: 36px; font-size: 15px; text-transform: uppercase;
  letter-spacing: .8px; color: var(--muted); }

.archive { list-style: none; padding: 0; }
.archive li { padding: 8px 0; border-bottom: 1px solid var(--border); }
.archive time { color: var(--muted); margin-right: 12px; font-size: 14px; }

/* ad slots — render nothing when empty, neat dashed box when filled */
.ad-slot { margin: 24px 0; min-height: 100px; display: flex; align-items: center;
  justify-content: center; background: var(--panel); border: 1px dashed var(--border);
  border-radius: 10px; overflow: hidden; }
.ad-slot ins { width: 100%; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .featured { grid-template-columns: 1fr; }
  .featured-img { min-height: 200px; }
  .post-title { font-size: 26px; }
  .cards { grid-template-columns: 1fr; }
}

/* 404 page */
.nf { text-align: center; padding: 60px 0 30px; }
.nf-code { font-size: 84px; color: var(--accent); margin: 0; line-height: 1; }
.nf-text { color: var(--muted); margin-bottom: 30px; }
.nf h2 { font-size: 18px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); }
.nf .archive { max-width: 560px; margin: 10px auto 30px; text-align: left; }
.nf-home { display: inline-block; padding: 10px 24px; background: var(--accent); color: #12161f;
  border-radius: 8px; font-weight: 700; text-decoration: none; }
.nf-home:hover { filter: brightness(1.1); }

/* social links in footer */
.social { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 0 0 14px; }
.social a { display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: border-color .2s, transform .2s; }
.social a:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.social a span { font-size: 16px; }

/* ---------- comments ---------- */
.comments { margin: 34px 0 10px; border-top: 1px solid var(--border); padding-top: 22px; }
.cmt-title { font-size: 1.25rem; margin: 0 0 14px; display: flex; align-items: center; gap: 10px; }
.cmt-count { background: var(--accent-soft); color: var(--accent); font-size: .85rem;
  padding: 2px 10px; border-radius: 999px; font-weight: 700; }
.cmt-cta { display: inline-block; background: var(--accent); color: #12141c; font-weight: 700;
  padding: 11px 22px; border-radius: 10px; text-decoration: none; margin: 4px 0 8px;
  transition: transform .12s ease, filter .12s ease; }
.cmt-cta:hover { transform: translateY(-1px); filter: brightness(1.08); }
.cmt-note { color: var(--muted); font-size: .86rem; margin: 4px 0 18px; }
.cmt-empty { color: var(--muted); font-style: italic; margin: 14px 0; }
.cmt { display: flex; gap: 12px; margin: 16px 0; }
.cmt-avatar { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; color: #10131c;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.05rem; }
.cmt-body { flex: 1; background: var(--panel); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; }
.cmt-meta { display: flex; gap: 10px; align-items: baseline; margin-bottom: 6px; flex-wrap: wrap; }
.cmt-name { font-weight: 700; color: var(--text); }
.cmt-time { color: var(--muted); font-size: .78rem; }
.cmt-text { color: var(--text); line-height: 1.55; font-size: .95rem; word-wrap: break-word; }
.cmt-powered { color: var(--muted); font-size: .78rem; margin-top: 16px; }

/* ---------- email sign-in + comment form ---------- */
.cmt-auth { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; margin: 6px 0 18px; }
.cmt-auth.signed { border-color: var(--accent); }
.cmt-auth-title { margin: 0 0 12px; font-weight: 600; font-size: .98rem; color: var(--text); }
.cmt-auth-form { display: flex; gap: 10px; flex-wrap: wrap; }
.cmt-input { flex: 1; min-width: 200px; background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); padding: 11px 14px; font-size: .95rem; font-family: inherit; }
.cmt-input:focus { outline: none; border-color: var(--accent); }
.cmt-code { letter-spacing: 4px; text-align: center; font-weight: 700; max-width: 180px; }
.cmt-area { width: 100%; resize: vertical; min-height: 74px; line-height: 1.5; }
.cmt-btn { background: var(--accent); color: #12141c; font-weight: 700; border: none;
  border-radius: 9px; padding: 11px 20px; font-size: .92rem; cursor: pointer;
  transition: transform .12s ease, filter .12s ease; font-family: inherit; }
.cmt-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.cmt-btn:disabled { opacity: .6; cursor: default; }
.cmt-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }
.cmt-btn.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
.cmt-form-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; }
.cmt-counter { color: var(--muted); font-size: .8rem; }
.cmt-msg { margin: 10px 0 0; font-size: .88rem; min-height: 1.2em; }
.cmt-msg.ok { color: var(--up); }
.cmt-msg.err { color: var(--down); }
.cmt-link { background: none; border: none; color: var(--muted); font-size: .8rem;
  cursor: pointer; text-decoration: underline; padding: 0; font-family: inherit; }
.cmt-link:hover { color: var(--down); }
.cmt-list { margin: 8px 0 4px; }

/* ---------- accessibility & polish ---------- */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #0b0e14; font-weight: 700; padding: 10px 16px;
  border-radius: 0 0 8px 0; text-decoration: none; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .featured:hover { transform: none; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- prev/next article navigation ---------- */
.prevnext { display: flex; gap: 14px; margin: 28px 0 8px; flex-wrap: wrap; }
.pn { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--border, #1c2333); border-radius: 12px;
  background: rgba(255,255,255,.02); text-decoration: none; transition: border-color .15s; }
.pn:hover { border-color: var(--accent); }
.pn.next { text-align: right; align-items: flex-end; }
.pn.empty { border: none; background: none; pointer-events: none; }
.pn-dir { font-size: 12px; letter-spacing: .6px; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.pn-title { color: var(--text, #d7dce6); font-weight: 600; font-size: 15px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- on-site search ---------- */
.search-box { max-width: 720px; }
.search-input { width: 100%; padding: 14px 16px; font-size: 17px; color: var(--text, #d7dce6);
  background: rgba(255,255,255,.03); border: 1px solid var(--border, #1c2333); border-radius: 12px; }
.search-input:focus { border-color: var(--accent); outline: none; }
.search-hint { color: #8b93a7; font-size: 13.5px; margin: 10px 2px 16px; }
.search-results { display: flex; flex-direction: column; gap: 10px; }
.search-item { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px;
  border: 1px solid var(--border, #1c2333); border-radius: 12px; text-decoration: none;
  background: rgba(255,255,255,.02); transition: border-color .15s; }
.search-item:hover { border-color: var(--accent); }
.search-title { color: var(--text, #d7dce6); font-weight: 700; font-size: 16px; }
.search-desc { color: #a8b0c2; font-size: 14px; line-height: 1.45; }
.search-meta { color: #6f7891; font-size: 12.5px; }

/* ---------- image aspect stability ---------- */
.hero img { aspect-ratio: 16/9; object-fit: cover; height: auto; }
.thumb img, .related-grid img { aspect-ratio: 16/9; object-fit: cover; height: auto; width: 100%; }
.featured-img img { aspect-ratio: 16/9; object-fit: cover; height: auto; width: 100%; }
