:root {
  --bg: #0d1117;
  --surface: #161b27;
  --surface-2: #111723;
  --border: #242c3d;
  --accent: #6366f1;
  --accent-light: #a5b4fc;
  --violet: #8b5cf6;
  --text: #f1f5f9;
  --muted: #a7b2c4;
  --subtle: #718096;
  --white: #fff;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "Inter", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.7 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.skip-link {
  position: fixed; left: 1rem; top: -4rem; z-index: 1000;
  padding: .7rem 1rem; border-radius: 8px; background: var(--white); color: var(--bg);
}
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 3px; }

.site-nav {
  position: sticky; top: 0; z-index: 100;
  height: 64px; padding: 0 5%;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  background: rgba(13,17,23,.9); backdrop-filter: blur(14px);
}
.brand {
  font: 700 1.1rem/1 var(--display); letter-spacing: -.02em; text-decoration: none;
}
.brand span, .footer-brand span { color: var(--accent-light); }
.nav-links { display: flex; align-items: center; gap: 1.8rem; margin: 0; padding: 0; list-style: none; }
.nav-links a { color: var(--muted); font-size: .9rem; font-weight: 600; text-decoration: none; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--white); }
.nav-cta {
  padding: .48rem 1rem; border-radius: 8px; background: var(--accent); color: var(--white) !important;
}

.blog-hero, .article-header {
  position: relative; overflow: hidden; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(circle at 50% 0%, rgba(99,102,241,.16), transparent 52%),
    linear-gradient(rgba(99,102,241,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,.035) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
}
.blog-hero-inner, .article-header-inner, .shell { width: min(1120px, 90%); margin-inline: auto; }
.blog-hero-inner { padding: 7rem 0 5.5rem; text-align: center; }
.eyebrow {
  margin: 0 0 1rem; color: var(--accent-light);
  font: 700 .78rem/1.4 var(--display); letter-spacing: .14em; text-transform: uppercase;
}
.blog-hero h1, .article-header h1, .archive-title {
  margin: 0; font-family: var(--display); color: var(--white); letter-spacing: -.035em;
}
.blog-hero h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); line-height: 1.05; }
.blog-hero p:last-child { max-width: 650px; margin: 1.4rem auto 0; color: var(--muted); font-size: 1.08rem; }

.archive { padding: 5rem 0 6rem; }
.archive-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.archive-title { font-size: clamp(1.8rem, 4vw, 2.5rem); }
.archive-count { color: var(--subtle); font-size: .9rem; }
.post-card {
  display: grid; grid-template-columns: minmax(240px, 38%) 1fr; overflow: hidden;
  border: 1px solid var(--border); border-radius: 22px; background: var(--surface);
  box-shadow: 0 20px 60px rgba(0,0,0,.18); transition: transform .2s, border-color .2s;
}
.post-card:hover { transform: translateY(-3px); border-color: rgba(129,140,248,.5); }
.post-card-media { min-height: 350px; background: var(--surface-2); }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; }
.post-card-content { display: flex; flex-direction: column; justify-content: center; padding: clamp(2rem, 5vw, 4rem); }
.post-meta { display: flex; flex-wrap: wrap; gap: .55rem 1rem; margin-bottom: 1rem; color: var(--subtle); font-size: .82rem; }
.post-category { color: var(--accent-light); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.post-card h2 { margin: 0 0 1rem; font: 700 clamp(1.65rem, 3vw, 2.35rem)/1.18 var(--display); letter-spacing: -.025em; }
.post-card h2 a { text-decoration: none; }
.post-card p { margin: 0 0 1.5rem; color: var(--muted); }
.read-more { display: inline-flex; align-items: center; gap: .5rem; color: var(--accent-light); font-weight: 700; text-decoration: none; }
.read-more span { transition: transform .2s; }
.read-more:hover span { transform: translateX(4px); }

.breadcrumbs { padding: 1.1rem 0; color: var(--subtle); font-size: .85rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: .45rem; color: #475569; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--white); }
.article-header-inner { padding-bottom: 4rem; }
.article-header-content { max-width: 900px; }
.article-header h1 { max-width: 900px; font-size: clamp(2.35rem, 5.7vw, 4.5rem); line-height: 1.08; }
.article-deck { max-width: 760px; margin: 1.35rem 0 1.6rem; color: var(--muted); font-size: 1.1rem; }
.byline { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; color: var(--subtle); font-size: .88rem; }
.byline strong { color: var(--text); }

.article-shell { width: min(1120px, 90%); margin: 0 auto; }
.featured-figure { margin: -1.25rem auto 0; position: relative; }
.featured-figure img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border: 1px solid var(--border); border-radius: 22px; box-shadow: 0 24px 80px rgba(0,0,0,.35); }
.featured-figure figcaption, .inline-figure figcaption { margin-top: .7rem; color: var(--subtle); font-size: .78rem; text-align: center; }
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 260px; gap: 4.5rem; justify-content: center; padding: 4rem 0 6rem; }
.article-prose { min-width: 0; color: #cbd5e1; font-size: 1.04rem; }
.article-prose > p:first-child { color: var(--text); font-size: 1.18rem; }
.article-prose p { margin: 0 0 1.35rem; }
.article-prose h2 { scroll-margin-top: 90px; margin: 3.4rem 0 1rem; color: var(--white); font: 700 clamp(1.55rem, 3vw, 2rem)/1.2 var(--display); letter-spacing: -.02em; }
.article-prose h3 { scroll-margin-top: 90px; margin: 2rem 0 .7rem; color: var(--white); font: 700 1.18rem/1.3 var(--display); }
.article-prose ul, .article-prose ol { margin: .4rem 0 1.6rem; padding-left: 1.35rem; }
.article-prose li { margin: .55rem 0; padding-left: .3rem; }
.article-prose li::marker { color: var(--accent-light); font-weight: 700; }
.article-prose a { color: var(--accent-light); text-underline-offset: 3px; }
.article-prose strong { color: var(--text); }
.inline-figure { margin: 2.6rem 0; }
.inline-figure img { width: 100%; aspect-ratio: 3/2; object-fit: cover; border: 1px solid var(--border); border-radius: 18px; }
.callout {
  margin: 2rem 0; padding: 1.5rem 1.6rem; border: 1px solid rgba(129,140,248,.35); border-radius: 14px;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(139,92,246,.07));
}
.callout p:last-child { margin-bottom: 0; }
.cta-box { margin-top: 3.5rem; padding: 2rem; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.cta-box h2 { margin-top: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: .78rem 1.2rem; border-radius: 9px; background: var(--accent); color: var(--white) !important; font-weight: 700; text-decoration: none; }
.button:hover { background: #5558e8; }
.toc { position: sticky; top: 92px; align-self: start; padding: 1.25rem; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.toc h2 { margin: 0 0 .8rem; color: var(--white); font: 700 .85rem/1.3 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.toc ol { margin: 0; padding: 0; list-style: none; }
.toc li + li { margin-top: .5rem; }
.toc a { color: var(--muted); font-size: .82rem; line-height: 1.4; text-decoration: none; }
.toc a:hover { color: var(--accent-light); }

.site-footer { border-top: 1px solid var(--border); padding: 2.5rem 5%; }
.footer-inner { width: min(1080px, 100%); margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.3rem; }
.footer-brand { font: 700 1rem/1 var(--display); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--muted); font-size: .85rem; text-decoration: none; }
.footer-links a:hover { color: var(--white); }
.footer-copy { width: 100%; margin: .4rem 0 0; padding-top: 1.3rem; border-top: 1px solid var(--border); color: var(--subtle); font-size: .8rem; text-align: center; }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
}
@media (max-width: 720px) {
  .nav-links li:not(:last-child) { display: none; }
  .post-card { grid-template-columns: 1fr; }
  .post-card-media { min-height: auto; aspect-ratio: 16/10; }
  .blog-hero-inner { padding: 5rem 0 4rem; }
  .article-header-inner { padding-bottom: 3rem; }
  .article-layout { padding-top: 2.7rem; }
  .footer-inner { justify-content: center; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
