/* Strike Atlas — Ghost theme
   Brand tokens + motion matched 1:1 to the strikeatlas.ai landing. */

:root {
  --canvas: #0A0B0E;
  --surface-1: #121317;
  --surface-2: #1A1C21;
  --surface-3: #23262D;
  --border: #2E323A;
  --primary: #BCF53A;
  --secondary: #7BD6D1;
  --tertiary: #FFB4AB;
  --success: #22C55E;
  --warning: #F59E0B;
  --critical-strong: #EF4444;
  --pure: #FFFFFF;
  --inverse: #F5F6F8;
  --text-strong: #E4E7EC;
  --text-body: #B8BDC7;
  --text-muted: #7C828E;
  --text-faint: #4A4F59;

  /* honours Ghost custom-font settings, falls back to brand fonts */
  --font-headline: var(--gh-font-heading, "Space Grotesk", system-ui, sans-serif);
  --font-body: var(--gh-font-body, "Inter", system-ui, sans-serif);
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --wrap: 1120px;
  --wrap-narrow: 720px;
  --radius: 12px;
  --radius-lg: 24px;
  --grid-cell: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text-body);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Signature grid backdrop + radial vignette (matches landing hero) */
.site-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(46, 50, 58, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 50, 58, 0.35) 1px, transparent 1px);
  background-size: var(--grid-cell) var(--grid-cell);
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 75%);
}
body::before {
  content: "";
  position: fixed;
  top: -22vh; left: 50%;
  width: 90vw; height: 60vh;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(188, 245, 58, 0.05), transparent 60%);
  z-index: -2;
  pointer-events: none;
}

a { color: var(--primary); text-decoration: none; transition: color .2s var(--ease-out); }
a:hover { color: var(--text-strong); }
img { max-width: 100%; height: auto; display: block; }
::selection { background: var(--primary); color: var(--canvas); }

h1, h2, h3, h4 { font-family: var(--font-headline); color: var(--text-strong); font-weight: 500; line-height: 1.08; letter-spacing: -0.03em; }
.mono { font-family: var(--font-mono); font-weight: 500; }
.accent { color: var(--primary); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 24px; }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 16px; top: 16px; background: var(--primary); color: var(--canvas); padding: 8px 14px; border-radius: 8px; z-index: 100; }

/* live pulse dot (verbatim from landing) */
@keyframes sa-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(188, 245, 58, 0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(188, 245, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(188, 245, 58, 0); }
}
.pulse-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--primary); display: inline-block; animation: sa-pulse 2.4s var(--ease-out) infinite; }

/* ---------- Floating pill header (matches .sa-nav) ---------- */
.site-header { position: fixed; top: 18px; left: 0; right: 0; z-index: 50; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.header-inner { pointer-events: auto; display: flex; align-items: center; gap: 4px; background: rgba(26, 28, 33, 0.85); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-radius: 999px; padding: 8px; box-shadow: inset 0 0 0 1px rgba(46, 50, 58, 0.8); max-width: 100%; }
.brand { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 8px; height: 40px; color: var(--text-strong); }
.brand:hover { color: var(--text-strong); }
.brand-logo { height: 26px; width: auto; }
.brand-mark-img { width: 26px; height: 26px; }
.brand-word { font-family: var(--font-headline); font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.nav-divider { width: 1px; height: 24px; background: var(--border); margin: 0 4px; }

.site-nav ul { list-style: none; display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; }
.site-nav a { padding: 0 14px; height: 40px; display: flex; align-items: center; font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--text-body); border-radius: 999px; transition: color .2s var(--ease-out), background-color .2s var(--ease-out); }
.site-nav a:hover { color: var(--text-strong); }
.site-nav .nav-current a { color: var(--primary); background: rgba(188, 245, 58, 0.08); }

.header-cta { padding: 0 16px; height: 40px; border-radius: 999px; border: 0; font-family: var(--font-body); font-weight: 600; font-size: 13px; background: var(--primary); color: var(--canvas); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; transition: filter .2s var(--ease-out); }
.header-cta:hover { filter: brightness(1.06); color: var(--canvas); }
.header-cta svg { width: 13px; height: 13px; }

.nav-toggle { display: none; position: relative; width: 40px; height: 40px; background: none; border: 0; cursor: pointer; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after { position: absolute; left: 11px; width: 18px; height: 2px; background: var(--text-strong); border-radius: 2px; transition: transform .25s var(--ease-out), top .25s var(--ease-out), background .25s var(--ease-out); }
.nav-toggle span { top: 19px; }
.nav-toggle span::before { content: ""; top: -6px; }
.nav-toggle span::after { content: ""; top: 6px; }
.nav-open .nav-toggle span { background: transparent; }
.nav-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-body); font-size: 14px; font-weight: 600; padding: 12px 22px; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer; transition: filter .2s var(--ease-out), color .2s var(--ease-out), border-color .2s var(--ease-out); }
.btn-primary { background: var(--primary); color: var(--canvas); }
.btn-primary:hover { filter: brightness(1.06); color: var(--canvas); }
.btn-ghost { border-color: var(--border); color: var(--text-strong); background: transparent; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Feed hero (+ agent-network canvas) ---------- */
.site-main { padding: 122px 0 80px; }
.feed-hero { position: relative; padding-bottom: 40px; border-bottom: 1px solid var(--border); margin-bottom: 44px; }
.hero-canvas { position: absolute; top: -70px; left: 50%; transform: translateX(-50%); width: 100vw; height: 320px; z-index: -1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 70% 100% at 50% 30%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse 70% 100% at 50% 30%, #000 0%, transparent 72%); }
.eyebrow { font-family: var(--font-mono); font-weight: 500; color: var(--primary); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 14px; display: inline-flex; align-items: center; gap: 8px; }
.feed-title { font-size: clamp(2.6rem, 6vw, 3.8rem); margin: 0 0 14px; letter-spacing: -0.035em; line-height: 1.0; }
.feed-sub { color: var(--text-muted); font-size: 1.05rem; max-width: 640px; margin: 0; }

/* ---------- Post feed / cards ---------- */
.post-feed { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.post-card { background: var(--surface-1); border-radius: var(--radius-lg); overflow: hidden; position: relative; box-shadow: inset 0 0 0 1px var(--border); transition: background-color .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.post-card:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px rgba(188, 245, 58, 0.5); }
.card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.card-image { aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-meta { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-faint); }
.card-tag { color: var(--secondary); }
.card-title { font-size: 1.25rem; margin: 0; color: var(--text-strong); transition: color .2s var(--ease-out); }
.post-card:hover .card-title { color: var(--primary); }
.card-excerpt { color: var(--text-muted); font-size: 0.95rem; margin: 0; flex: 1; }
.card-more { color: var(--primary); font-size: 12.5px; margin-top: 4px; font-family: var(--font-mono); }

/* ---------- Post page ---------- */
.post-header { padding-top: 8px; }
.post-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-faint); margin-bottom: 20px; }
.post-tag { color: var(--secondary); }
.post-title { font-size: clamp(2rem, 5vw, 3rem); margin: 0 0 18px; letter-spacing: -0.035em; line-height: 1.02; }
.post-excerpt { font-size: 1.2rem; color: var(--text-muted); margin: 0 0 20px; line-height: 1.5; }
.post-byline { color: var(--text-muted); font-size: 13px; }
.byline-author { color: var(--text-body); }
.post-feature { margin: 44px auto; }
.post-feature img { width: 100%; border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--border); }
.post-feature figcaption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 10px; font-family: var(--font-mono); }

/* ---------- Prose (Koenig content) ---------- */
.gh-content { padding-top: 8px; }
.gh-content > * { margin-top: 0; margin-bottom: 1.5em; }
.gh-content p, .gh-content ul, .gh-content ol { color: var(--text-body); }
.gh-content h2 { font-size: 1.7rem; margin-top: 2.2em; }
.gh-content h3 { font-size: 1.32rem; margin-top: 1.8em; }
.gh-content a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(188, 245, 58, 0.4); text-underline-offset: 3px; }
.gh-content a:hover { text-decoration-color: var(--primary); }
.gh-content strong { color: var(--text-strong); }
.gh-content blockquote { margin: 1.8em 0; padding: 6px 0 6px 22px; border-left: 3px solid var(--primary); color: var(--text-strong); font-size: 1.15rem; font-style: italic; }
.gh-content img, .gh-content .kg-card { border-radius: var(--radius); }
.gh-content figure { margin: 2em 0; }
.gh-content figcaption { text-align: center; color: var(--text-faint); font-size: 13px; margin-top: 10px; font-family: var(--font-mono); }
.gh-content hr { border: none; border-top: 1px solid var(--border); margin: 2.6em 0; }
.gh-content code { font-family: var(--font-mono); font-size: 0.88em; background: var(--surface-2); color: var(--primary); padding: 2px 6px; border-radius: 5px; border: 1px solid var(--border); }
.gh-content pre { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; overflow-x: auto; font-family: var(--font-mono); font-size: 0.88rem; line-height: 1.6; color: var(--text-body); }
.gh-content pre code { background: none; border: none; color: inherit; padding: 0; }
.gh-content ul li::marker { color: var(--primary); }
.gh-content .kg-callout-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); }
.gh-content .kg-width-wide { position: relative; left: 50%; transform: translateX(-50%); width: min(1000px, 92vw); }
.gh-content .kg-width-full { position: relative; left: 50%; transform: translateX(-50%); width: 100vw; max-width: 100vw; }
.gh-content .kg-width-full img { border-radius: 0; }

/* ---------- Content: tables ----------
   Ghost emits a bare <table>; main.js wraps it in .table-scroll. Without JS the
   table still gets its type + rules, it just cannot scroll — so min-width lives
   on the wrapped case only. */
.gh-content .table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-1); }
.gh-content .table-scroll table { min-width: 480px; }
.gh-content table { width: 100%; border-collapse: collapse; font-size: 0.92rem; line-height: 1.55; }
.gh-content th, .gh-content td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gh-content thead th { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-muted); font-weight: 500; background: var(--surface-2); white-space: nowrap; }
.gh-content td { color: var(--text-body); }
.gh-content tbody tr:last-child td { border-bottom: none; }
.gh-content tbody tr:hover td { background: rgba(188, 245, 58, 0.035); }
.gh-content table code { font-size: 0.85em; white-space: nowrap; }

/* ---------- Content: syntax highlighting (Prism) ---------- */
.gh-content pre[data-lang] { position: relative; padding-top: 40px; }
.gh-content pre[data-lang]::before { content: attr(data-lang); position: absolute; top: 0; left: 0; padding: 5px 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: var(--radius) 0 var(--radius) 0; }
.gh-content .token.comment, .gh-content .token.prolog, .gh-content .token.doctype, .gh-content .token.cdata { color: var(--text-faint); font-style: italic; }
.gh-content .token.punctuation, .gh-content .token.operator { color: var(--text-muted); }
.gh-content .token.keyword, .gh-content .token.tag, .gh-content .token.selector, .gh-content .token.important, .gh-content .token.atrule { color: var(--primary); }
.gh-content .token.string, .gh-content .token.char, .gh-content .token.attr-value, .gh-content .token.regex { color: var(--secondary); }
.gh-content .token.number, .gh-content .token.boolean, .gh-content .token.constant, .gh-content .token.symbol { color: var(--tertiary); }
.gh-content .token.property, .gh-content .token.attr-name, .gh-content .token.class-name, .gh-content .token.builtin { color: var(--warning); }
.gh-content .token.function, .gh-content .token.url, .gh-content .token.variable { color: var(--text-strong); }
.gh-content .token.deleted { color: var(--critical-strong); }
.gh-content .token.inserted { color: var(--success); }
/* HTTP blocks: the method and the status code are what you scan for. */
.gh-content .token.method { color: var(--primary); font-weight: 600; }
.gh-content .token.header-name { color: var(--text-muted); }
.gh-content .token.status-code { color: var(--tertiary); font-weight: 600; }

/* ---------- Content: copy button ---------- */
.gh-content pre[data-lang] .code-copy { position: absolute; top: 7px; right: 8px; padding: 4px 11px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; cursor: pointer; opacity: 0; transition: opacity .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out); }
.gh-content pre[data-lang]:hover .code-copy, .gh-content .code-copy:focus-visible { opacity: 1; }
.gh-content .code-copy:hover { color: var(--primary); border-color: var(--primary); }
@media (hover: none) { .gh-content pre[data-lang] .code-copy { opacity: 1; } }

/* ---------- Content: heading anchors ---------- */
.gh-content h2, .gh-content h3 { scroll-margin-top: 104px; }
.gh-content .heading-anchor { margin-left: 10px; font-family: var(--font-mono); font-size: 0.7em; font-weight: 400; color: var(--text-faint); text-decoration: none; opacity: 0; transition: opacity .18s var(--ease-out), color .18s var(--ease-out); }
.gh-content h2:hover .heading-anchor, .gh-content h3:hover .heading-anchor, .gh-content .heading-anchor:focus-visible { opacity: 1; }
.gh-content .heading-anchor:hover { color: var(--primary); }

/* ---------- Post: sticky table of contents ----------
   Sits in the left gutter, so it only appears once the gutter is wide enough
   to hold it without crowding the 720px column. */
.post-toc { display: none; }
@media (min-width: 1260px) {
  .post-toc { display: block; position: fixed; top: 132px; left: calc(50% - 596px); width: 208px; max-height: calc(100vh - 210px); overflow-y: auto; font-size: 13px; }
  .post-toc .toc-label { display: block; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 12px; }
  .post-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
  .post-toc a { display: block; padding: 7px 0 7px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-muted); line-height: 1.4; }
  .post-toc a:hover { color: var(--text-strong); }
  .post-toc a.is-active { color: var(--primary); border-left-color: var(--primary); }
}

/* ---------- Post footer ---------- */
.post-footer { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border); }
.post-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-chip { font-size: 12.5px; color: var(--text-muted); border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Pagination ---------- */
.pagination { display: flex; justify-content: center; gap: 16px; align-items: center; margin-top: 56px; font-family: var(--font-mono); font-size: 13px; }
.pagination a { border: 1px solid var(--border); padding: 8px 16px; border-radius: 999px; color: var(--text-strong); transition: border-color .2s var(--ease-out), color .2s var(--ease-out); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .page-number { color: var(--text-faint); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 40px; background: rgba(18, 19, 23, 0.4); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.foot-brand { color: var(--primary); }
.foot-meta { color: var(--text-faint); }
.foot-link { color: var(--text-muted); }
.foot-link:hover { color: var(--text-strong); }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--surface-1); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .post-feed { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .post-feed { grid-template-columns: 1fr; }
  .nav-divider, .site-nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .site-main { padding: 96px 0 60px; }
  .site-header.nav-open .site-nav { display: block; position: absolute; top: 64px; left: 16px; right: 16px; background: rgba(26, 28, 33, 0.96); backdrop-filter: blur(24px); border-radius: 20px; box-shadow: inset 0 0 0 1px var(--border); padding: 12px; }
  .site-header.nav-open .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-header.nav-open .site-nav a { height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .pulse-dot { animation: none; }
  html { scroll-behavior: auto; }
}
