:root {
  color-scheme: dark;
  --bg: #0d0d14;
  --surface: #151522;
  --surface-2: #1d1b2d;
  --text: #f4f2ff;
  --muted: #aaa5bd;
  --line: rgba(255, 255, 255, 0.11);
  --brand: #a78bfa;
  --brand-strong: #7c3aed;
  --pink: #ec4899;
  --green: #34d399;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(124, 58, 237, 0.18), transparent 34rem),
    radial-gradient(circle at 95% 20%, rgba(236, 72, 153, 0.12), transparent 28rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.7;
}

a { color: inherit; }
a:focus-visible,
button:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  left: 16px;
  top: -70px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: white;
  color: #111;
  font-weight: 800;
}
.skip-link:focus { top: 16px; }

.blog-shell { width: min(calc(100% - 32px), var(--max)); margin: 0 auto; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 13, 20, 0.88);
  backdrop-filter: blur(18px);
}
.site-header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand-strong), var(--pink));
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.35);
}
.site-nav { display: flex; align-items: center; gap: 18px; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.site-nav a[aria-current="page"],
.site-nav a:hover { color: var(--text); }
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-strong), #9333ea);
  color: white !important;
  text-decoration: none;
  font-weight: 800;
  box-shadow: 0 10px 28px rgba(124, 58, 237, 0.28);
}

.hero { padding: 92px 0 58px; }
.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.hero h1,
.article-header h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}
.hero-copy,
.article-deck {
  max-width: 760px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(17px, 2.3vw, 21px);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.secondary-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  padding: 0 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 750;
}
.secondary-link:hover { background: var(--surface); }

.section { padding: 34px 0 76px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.04em; }
.section-heading p { max-width: 560px; margin: 0; color: var(--muted); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.post-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(29, 27, 45, 0.96), rgba(21, 21, 34, 0.96));
  text-decoration: none;
  transition: transform 180ms ease, border-color 180ms ease;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(167, 139, 250, 0.55); }
.post-visual {
  display: grid;
  min-height: 170px;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.72), rgba(236, 72, 153, 0.46)),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(255, 255, 255, 0.06) 30px);
  color: white;
  font-size: 48px;
  font-weight: 900;
}
.post-card:nth-child(2) .post-visual { background: linear-gradient(135deg, #4338ca, #0891b2); }
.post-card:nth-child(3) .post-visual { background: linear-gradient(135deg, #6d28d9, #059669); }
.post-card-body { display: flex; flex: 1; flex-direction: column; padding: 22px; }
.post-meta { margin: 0 0 10px; color: var(--brand); font-size: 12px; font-weight: 800; }
.post-card h2 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -0.025em; }
.post-card p { margin: 12px 0 20px; color: var(--muted); font-size: 14px; }
.post-read { margin-top: auto; font-size: 13px; font-weight: 850; }

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 20px 0 90px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--line);
}
.trust-item { padding: 24px; background: var(--surface); }
.trust-item strong { display: block; margin-bottom: 6px; font-size: 16px; }
.trust-item span { color: var(--muted); font-size: 13px; }

.breadcrumbs { padding-top: 42px; color: var(--muted); font-size: 13px; }
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.article-header { padding: 42px 0 34px; }
.article-header h1 { max-width: 930px; font-size: clamp(36px, 6.2vw, 66px); }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 22px; color: var(--muted); font-size: 13px; }
.article-layout { display: grid; grid-template-columns: minmax(0, 760px) 250px; gap: 72px; align-items: start; padding-bottom: 90px; }
.article-content { min-width: 0; }
.article-content h2 { margin: 48px 0 13px; font-size: clamp(26px, 4vw, 36px); line-height: 1.22; letter-spacing: -0.035em; }
.article-content h3 { margin: 32px 0 10px; font-size: 22px; line-height: 1.3; }
.article-content p,
.article-content li { color: #d3cede; font-size: 17px; }
.article-content ul,
.article-content ol { padding-left: 24px; }
.article-content code { padding: 2px 6px; border-radius: 6px; background: var(--surface-2); color: #ddd6fe; font-size: 0.88em; }
.article-content pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #09090f;
  color: #ddd6fe;
  line-height: 1.6;
}
.article-content pre code { padding: 0; background: none; }
.article-callout {
  margin: 30px 0;
  padding: 20px 22px;
  border-left: 4px solid var(--brand);
  border-radius: 0 14px 14px 0;
  background: rgba(124, 58, 237, 0.12);
}
.article-callout strong { display: block; margin-bottom: 5px; }
.article-toc {
  position: sticky;
  top: 96px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(21, 21, 34, 0.86);
}
.article-toc strong { display: block; margin-bottom: 10px; }
.article-toc a { display: block; padding: 6px 0; color: var(--muted); font-size: 13px; text-decoration: none; }
.article-toc a:hover { color: var(--brand); }

.share-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 34px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.share-panel strong { margin-right: 4px; font-size: 13px; }
.share-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
}
.share-button:hover { border-color: var(--brand); }
.share-status { width: 100%; min-height: 20px; color: var(--green); font-size: 12px; }

.related-posts { padding: 58px 0 82px; border-top: 1px solid var(--line); }
.related-posts h2 { margin-top: 0; font-size: 30px; }
.site-footer { border-top: 1px solid var(--line); }
.site-footer-inner {
  display: flex;
  min-height: 100px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: var(--muted);
  font-size: 13px;
}
.site-footer a { color: var(--brand); text-decoration: none; }

@media (max-width: 900px) {
  .post-grid { grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: 1fr; gap: 20px; }
  .article-toc { position: static; order: -1; }
}

@media (max-width: 640px) {
  .site-header-inner { min-height: 62px; }
  .site-nav > a:not(.button-link) { display: none; }
  .button-link { min-height: 38px; padding: 0 13px; font-size: 12px; }
  .hero { padding-top: 62px; }
  .post-grid,
  .trust-strip { grid-template-columns: 1fr; }
  .section-heading,
  .site-footer-inner { align-items: flex-start; flex-direction: column; }
  .site-footer-inner { justify-content: center; padding: 26px 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
