/* =====================================================================
   Norva blog — shared stylesheet for /blog/ and /blog/<slug>/.
   Reuses the landing design system's dark, glass, electric-blue identity
   (tokens mirror public/css/landing.css) so the blog feels first-party.
   Served immutable + content-hashed via /css/* (see public/_headers).
   ===================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/outfit-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --bg: #05080f;
  --glass: rgba(18, 27, 51, 0.55);
  --glass-2: rgba(13, 20, 40, 0.62);
  --glass-strong: rgba(20, 30, 58, 0.78);
  --hi: rgba(255, 255, 255, 0.14);
  --border: rgba(150, 172, 230, 0.16);
  --border-strong: rgba(120, 156, 255, 0.46);
  --text: #f4f7ff;
  --muted: #aab4cf;
  --soft: #7c87a0;
  --blue: #3b82ff;
  --blue-bright: #5b9bff;
  --cyan: #36c6ff;
  --violet: #7c6bff;
  --grad-accent: linear-gradient(135deg, #1769d3 0%, #5538c8 100%);
  --radius: 14px;
  --radius-lg: 20px;
  --card-shadow: inset 0 1px 0 0 var(--hi), 0 1px 2px rgba(0, 0, 0, 0.4), 0 26px 60px -28px rgba(0, 0, 0, 0.85);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 720px at 50% -10%, rgba(59, 130, 255, 0.30), transparent 58%),
    radial-gradient(900px 620px at 84% 4%, rgba(124, 107, 255, 0.18), transparent 55%),
    linear-gradient(180deg, #0a1330 0%, #070d20 36%, #05080f 100%);
  background-attachment: fixed;
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--blue); color: #fff; padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Header ---- */
.blog-nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(6, 10, 22, 0.72);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.blog-nav .brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; font-family: Outfit, Inter, sans-serif; }
.blog-nav .brand img { width: 34px; height: 34px; border-radius: 8px; }
.blog-nav .brand:hover { text-decoration: none; }
.blog-nav .nav-right { display: flex; align-items: center; gap: clamp(12px, 3vw, 26px); }
.blog-nav .nav-right a { color: var(--muted); font-weight: 600; font-size: 15px; }
.blog-nav .nav-right a:hover { color: var(--text); text-decoration: none; }
.blog-nav .cta {
  background: var(--grad-accent); color: #fff !important; padding: 9px 16px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--card-shadow);
}
.blog-nav .cta:hover { filter: brightness(1.08); }

/* ---- Layout ---- */
main { width: min(760px, 100%); margin: 0 auto; padding: 28px clamp(16px, 5vw, 24px) 80px; overflow-wrap: break-word; }
.wide { width: min(1120px, 100%); }
main, article, .toc, .card, .post-card, .breadcrumb, .related-grid, .post-grid { min-width: 0; }
article a, .sources a, .breadcrumb a, .breadcrumb span { overflow-wrap: anywhere; word-break: break-word; }

.breadcrumb { font-size: 13.5px; color: var(--soft); margin: 8px 0 26px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--muted); }
.breadcrumb span[aria-current] { color: var(--text); }
.breadcrumb .sep { color: var(--soft); }

/* ---- Article ---- */
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 13.5px; color: var(--soft); margin-bottom: 14px; }
.tag {
  display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--blue-bright); background: rgba(59, 130, 255, 0.12); border: 1px solid rgba(59, 130, 255, 0.28);
}
.article-meta .dot { color: var(--soft); }

article h1, .page-title {
  font-family: Outfit, Inter, sans-serif; font-weight: 800; letter-spacing: -0.02em;
  font-size: clamp(30px, 5.2vw, 46px); line-height: 1.12; margin: 6px 0 18px; color: var(--text);
}
.lede { font-size: clamp(18px, 2.4vw, 20px); color: var(--muted); margin: 0 0 26px; line-height: 1.6; }

article { font-size: 17px; }
article h2 {
  font-family: Outfit, Inter, sans-serif; font-weight: 700; letter-spacing: -0.01em;
  font-size: clamp(23px, 3.4vw, 29px); line-height: 1.2; margin: 44px 0 14px; color: var(--text);
  scroll-margin-top: 92px;
}
article h3 {
  font-family: Outfit, Inter, sans-serif; font-weight: 700;
  font-size: clamp(19px, 2.6vw, 22px); line-height: 1.25; margin: 30px 0 10px; color: #dfe6fb;
  scroll-margin-top: 92px;
}
article p { margin: 0 0 18px; color: #d7def1; }
article ul, article ol { margin: 0 0 20px; padding-left: 26px; color: #d7def1; }
article li { margin: 0 0 9px; }
article li::marker { color: var(--blue-bright); }
article strong { color: var(--text); font-weight: 700; }
article a { color: var(--blue-bright); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(91, 155, 255, 0.4); }
article a:hover { text-decoration-color: var(--blue-bright); }

article blockquote {
  margin: 0 0 26px; padding: 18px 22px;
  background: linear-gradient(135deg, rgba(59, 130, 255, 0.10), rgba(124, 107, 255, 0.08));
  border: 1px solid rgba(91, 155, 255, 0.28); border-left: 4px solid var(--blue); border-radius: var(--radius);
  color: #e6ecff; font-size: 17.5px;
}
article blockquote p { margin: 0; color: #e6ecff; }
article blockquote strong { color: #fff; }

article code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em;
  background: rgba(124, 107, 255, 0.14); border: 1px solid rgba(124, 107, 255, 0.22);
  padding: 1px 6px; border-radius: 6px; color: #cfd8ff;
}
article pre {
  margin: 0 0 24px; padding: 16px 18px; overflow-x: auto;
  background: var(--glass-2); border: 1px solid var(--border); border-radius: var(--radius);
}
article pre code { background: none; border: none; padding: 0; color: #cbd5f5; font-size: 14px; line-height: 1.6; }

article hr { border: none; border-top: 1px solid var(--border); margin: 34px 0; }

.table-wrap { overflow-x: auto; margin: 0 0 26px; border: 1px solid var(--border); border-radius: var(--radius); }
article table { border-collapse: collapse; width: 100%; font-size: 15px; }
article th, article td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
article thead th { background: var(--glass-2); color: var(--text); font-weight: 700; font-family: Outfit, Inter, sans-serif; }
article tbody tr:last-child td { border-bottom: none; }
article tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }

/* ---- Table of contents ---- */
.toc {
  margin: 0 0 34px; padding: 16px 20px; background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--card-shadow);
}
.toc strong { display: block; font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--soft); margin-bottom: 10px; font-weight: 700; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: 0 0 7px; }
.toc a { color: var(--muted); font-size: 15px; }
.toc a:hover { color: var(--blue-bright); text-decoration: none; }

/* ---- CTA + related + sources ---- */
.article-cta {
  margin: 40px 0 0; padding: 26px; text-align: center;
  background: linear-gradient(135deg, rgba(59, 130, 255, 0.12), rgba(124, 107, 255, 0.10));
  border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--card-shadow);
}
.article-cta a.btn {
  display: inline-block; margin-top: 6px; background: var(--grad-accent); color: #fff; font-weight: 700;
  padding: 12px 26px; border-radius: 999px; box-shadow: var(--card-shadow);
}
.article-cta a.btn:hover { filter: brightness(1.08); text-decoration: none; }

.related { margin-top: 54px; }
.related h2 { font-size: 22px; margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card {
  display: block; padding: 18px 20px; background: var(--glass); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--card-shadow); color: var(--text); transition: border-color .18s, transform .18s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); text-decoration: none; }
.card .card-title { font-family: Outfit, Inter, sans-serif; font-weight: 700; font-size: 17px; line-height: 1.3; margin: 8px 0 6px; }
.card p { color: var(--muted); font-size: 14.5px; margin: 0; }
.card .card-meta { color: var(--soft); font-size: 12.5px; margin-top: 10px; }

.sources { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--border); }
.sources h2 { font-size: 18px; }
.sources ul { padding-left: 22px; }
.sources li { color: var(--muted); font-size: 15px; }

/* ---- Index page ---- */
.blog-hero { text-align: center; padding: 20px 0 8px; }
.blog-hero .eyebrow { color: var(--blue-bright); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; }
.blog-hero p { color: var(--muted); font-size: clamp(16px, 2.4vw, 19px); max-width: 620px; margin: 12px auto 0; }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-top: 40px; }
.post-card { display: flex; flex-direction: column; }
.post-card .card-title { font-size: 19px; margin: 10px 0 8px; }
.post-card p { font-size: 15px; flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }

/* ---- Footer ---- */
.blog-footer {
  border-top: 1px solid var(--border); background: rgba(6, 10, 22, 0.5);
  padding: 34px clamp(16px, 5vw, 40px); color: var(--soft); font-size: 14px;
}
.blog-footer .foot-inner { width: min(1120px, 100%); margin: 0 auto; }
.blog-footer .foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: 14px; }
.blog-footer a { color: var(--muted); }
.blog-footer .disclaimer { color: var(--soft); font-size: 13px; max-width: 720px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .blog-nav .nav-right a.hide-sm { display: none; }
}
