/* ============================================================
   Black Swan Labs — blog / article styling
   Standalone stylesheet for the static /blogs/ pages.
   Tokens copied from src/styles.css so light/dark + accent match
   the React app exactly (theme set via [data-theme] on <html>).
   ============================================================ */

/* ---------------- tokens (mirror of src/styles.css) ---------------- */
:root {
  --sans: "Sora", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-smooth: cubic-bezier(0.33, 0, 0.18, 1);

  --acc: #3a5be0;
  --acc-2: color-mix(in srgb, #3a5be0 78%, white);
  --acc-soft: color-mix(in srgb, #3a5be0 13%, transparent);
  --acc-line: color-mix(in srgb, #3a5be0 32%, transparent);

  --radius: 18px;
  --radius-sm: 13px;

  --bg: #fbfaf8;
  --bg-2: #f4f2ec;
  --surface: #ffffff;
  --surface-2: #f7f6f1;
  --text: #0b0b0f;
  --text-2: #3a3a44;
  --text-3: #6b6b76;
  --text-4: #9a9aa4;
  --border: #e7e5df;
  --border-2: #d7d5cd;
  --ink-btn: #0b0b0f;
  --ink-btn-t: #ffffff;
  --grid-c: rgba(11, 11, 15, 0.045);
  --shadow: 0 24px 60px -32px rgba(11, 11, 15, 0.28);
  --shadow-sm: 0 10px 30px -18px rgba(11, 11, 15, 0.3);
}

[data-theme="dark"] {
  --bg: #07070a;
  --bg-2: #0d0d12;
  --surface: #121218;
  --surface-2: #16161d;
  --text: #f4f3ef;
  --text-2: #c7c6bf;
  --text-3: #908f89;
  --text-4: #66655f;
  --border: #23232b;
  --border-2: #2f2f39;
  --ink-btn: #f4f3ef;
  --ink-btn-t: #0b0b0f;
  --grid-c: rgba(255, 255, 255, 0.05);
  --shadow: 0 30px 70px -34px rgba(0, 0, 0, 0.7);
  --shadow-sm: 0 12px 34px -20px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); -webkit-font-smoothing: antialiased;
  transition: background .4s var(--ease), color .4s var(--ease);
}

/* diagonal grid texture, faded to the top like the home page */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    repeating-linear-gradient(45deg, var(--grid-c) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(-45deg, var(--grid-c) 0 1px, transparent 1px 84px);
  -webkit-mask-image: radial-gradient(circle at 50% 8%, #000 0%, transparent 55%);
          mask-image: radial-gradient(circle at 50% 8%, #000 0%, transparent 55%);
}
.page { position: relative; z-index: 1; }

a { color: var(--acc); }
::selection { background: var(--acc-soft); }

/* ---------------- skip link ---------------- */
.skip-link {
  position: fixed; top: -64px; left: 16px; z-index: 200;
  background: var(--acc); color: #fff; padding: 10px 16px; border-radius: 11px;
  font-size: 14px; font-weight: 600; text-decoration: none; transition: top .2s var(--ease);
}
.skip-link:focus-visible { top: 12px; outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------------- nav (simplified static version) ---------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
          backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  width: min(1120px, 92vw); margin: 0 auto; height: 72px;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.wordmark { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); white-space: nowrap; }
.wordmark .light { color: var(--text-3); font-weight: 500; }
.swan-badge {
  border-radius: 9px; background: #0b0b0f; flex: none;
  display: grid; place-items: center;
}
[data-theme="dark"] .swan-badge { background: #121218; border: 1px solid var(--border-2); }

.nav-links { display: flex; align-items: center; gap: 26px; margin: 0 auto; }
.nav-links a {
  position: relative; font-size: 14.5px; font-weight: 500; color: var(--text-3);
  text-decoration: none; transition: color .2s;
}
.nav-links a:hover, .nav-links a:focus-visible, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }

.theme-tg {
  width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
  display: grid; place-items: center; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--border-2);
  transition: color .2s, border-color .2s, transform .2s;
}
.theme-tg:hover { color: var(--text); border-color: var(--text-3); transform: translateY(-1px); }
.theme-tg .moon { display: block; }
.theme-tg .sun { display: none; }
[data-theme="dark"] .theme-tg .moon { display: none; }
[data-theme="dark"] .theme-tg .sun { display: block; }

/* ---------------- buttons ---------------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: -0.01em;
  border-radius: 13px; padding: 13px 22px; cursor: pointer; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease-smooth), box-shadow .25s var(--ease-smooth),
              background .2s, border-color .2s, color .2s;
}
.btn .arrow { transition: transform .25s var(--ease-smooth); }
.btn:hover .arrow { transform: translateX(3px); }
.btn-primary { background: var(--ink-btn); color: var(--ink-btn-t); box-shadow: var(--shadow-sm); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -18px rgba(11, 11, 15, 0.5); }
.btn-acc { background: var(--acc); color: #fff; box-shadow: 0 12px 30px -14px var(--acc); }
.btn-acc:hover { transform: translateY(-2px); background: var(--acc-2); }
.btn-sm { font-size: 14px; padding: 10px 17px; border-radius: 11px; }

/* ---------------- shared bits ---------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--acc);
}
.eyebrow .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--acc); }

/* ---------------- article ---------------- */
.article { width: min(760px, 92vw); margin: 0 auto; padding: 76px 0 40px; }
.article .back { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); text-decoration: none; letter-spacing: .04em; }
.article .back:hover { color: var(--text); }
.article h1 {
  font-size: clamp(32px, 5vw, 50px); font-weight: 600; letter-spacing: -0.035em;
  line-height: 1.05; text-wrap: balance; margin: 18px 0 0;
}
.article .meta { font-family: var(--mono); font-size: 12.5px; color: var(--text-4); margin: 18px 0 0; letter-spacing: .03em; }
.article .lede { font-size: 20px; line-height: 1.6; color: var(--text-2); margin: 26px 0 0; }
.article .body { margin-top: 8px; }
.article .body > * { max-width: 68ch; }
.article h2 {
  font-size: clamp(24px, 3vw, 32px); font-weight: 600; letter-spacing: -0.025em;
  line-height: 1.15; margin: 52px 0 0; text-wrap: balance;
}
.article h3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 34px 0 0; }
.article p { font-size: 17px; line-height: 1.75; color: var(--text-2); margin: 18px 0 0; }
.article ul, .article ol { margin: 18px 0 0; padding-left: 22px; }
.article li { font-size: 17px; line-height: 1.7; color: var(--text-2); margin: 10px 0 0; }
.article li::marker { color: var(--acc); }
.article strong { color: var(--text); font-weight: 600; }
.article a { color: var(--acc); text-underline-offset: 3px; }
.article blockquote {
  margin: 30px 0 0; padding: 4px 0 4px 22px; border-left: 3px solid var(--acc-line);
  font-size: 19px; line-height: 1.55; color: var(--text); font-weight: 500;
}
.article hr { border: none; border-top: 1px solid var(--border); margin: 48px 0 0; }

/* ---------------- inline CTA band ---------------- */
.cta-band {
  width: min(760px, 92vw); margin: 56px auto 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 34px 32px; box-shadow: var(--shadow-sm);
}
.cta-band h2 { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0; }
.cta-band p { font-size: 16px; line-height: 1.6; color: var(--text-3); margin: 12px 0 0; max-width: 56ch; }
.cta-band .btn { margin-top: 22px; }

/* ---------------- blog index ---------------- */
.blog-head { width: min(1120px, 92vw); margin: 0 auto; padding: 88px 0 8px; text-align: center; }
.blog-head h1 {
  font-size: clamp(34px, 4.4vw, 54px); font-weight: 600; letter-spacing: -0.035em;
  line-height: 1.05; margin: 18px 0 0; text-wrap: balance;
}
.blog-head p { font-size: 18.5px; line-height: 1.55; color: var(--text-3); max-width: 60ch; margin: 18px auto 0; }
.blog-head .eyebrow { justify-content: center; }

.post-grid {
  width: min(1120px, 92vw); margin: 44px auto 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px;
}
.post-card {
  display: flex; flex-direction: column; text-decoration: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 26px 24px; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease-smooth), box-shadow .25s var(--ease-smooth), border-color .2s;
}
.post-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); }
.post-card .tag { font-family: var(--mono); font-size: 11.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--acc); }
.post-card h2 { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.22; margin: 14px 0 0; color: var(--text); text-wrap: balance; }
.post-card p { font-size: 15px; line-height: 1.6; color: var(--text-3); margin: 12px 0 0; }
.post-card .read { margin-top: auto; padding-top: 18px; font-size: 14px; font-weight: 600; color: var(--acc); display: inline-flex; align-items: center; gap: 7px; }
.post-card:hover .read .arrow { transform: translateX(3px); }
.post-card .read .arrow { transition: transform .25s var(--ease-smooth); }

/* ---------------- sources / references ---------------- */
.article .body sup { font-size: 11px; line-height: 0; margin-left: 1px; }
.article .body sup a { color: var(--acc); text-decoration: none; font-weight: 600; }
.sources { width: min(760px, 92vw); margin: 46px auto 0; }
.sources h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 2px; }
.sources p { font-size: 13.5px; color: var(--text-4); margin: 10px 0 0; }
.sources ol { padding-left: 22px; margin: 16px 0 0; }
.sources li { font-size: 13.5px; line-height: 1.55; color: var(--text-3); margin: 9px 0 0; overflow-wrap: anywhere; }
.sources li::marker { color: var(--text-4); font-family: var(--mono); font-size: 12px; }
.sources a { color: var(--acc); text-underline-offset: 2px; }

/* ---------------- footer ---------------- */
.foot {
  width: min(1120px, 92vw); margin: 80px auto 0; padding: 30px 0 40px;
  border-top: 1px solid var(--border);
}
.foot-bot { font-size: 13.5px; color: var(--text-4); }
.foot-bot a { color: var(--text-3); text-decoration: none; }
.foot-bot a:hover { color: var(--text); }

/* ---------------- responsive ---------------- */
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-inner { justify-content: space-between; gap: 12px; }
  .article { padding-top: 40px; }
}

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