/* TechSteff blog, v2 theme (Apps/Website-v2). Shared by /blog/ and every post.
   Tokens, nav and footer follow Apps/Website-v2/index.html (the Pulse Core look, 2026-09-16);
   everything below the footer matches themes/v1/blog.css except for colour values. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent:         #9B5DE5;
  --accent-dim:     #7C3AED;
  --accent-bright:  #B47CF7;
  --accent-lav:     #C4A0FF;
  --accent-glow:    rgba(155, 93, 229, 0.35);
  --accent-faint:   rgba(155, 93, 229, 0.08);
  --bg:             #0A0A0F;
  --bg2:            #0F0F1A;
  --bg3:            #13131F;
  --border:         rgba(255, 255, 255, 0.08);
  --border-strong:  rgba(180, 124, 247, 0.45);
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --head:           #F5F2FB;
  --text:           #E2E2F0;
  --text-muted:     #8A8AA8;
  --text-dim:       #76769A;
  --green:          #22C55E;
  --green-text:     #4ADE80;
  --grad-word:      linear-gradient(90deg, #C4A0FF 0%, #B47CF7 45%, #7C3AED 100%);
  --grad-text:      linear-gradient(90deg, #F5F2FB 0%, #B47CF7 55%, #7C3AED 100%);
  --font-mono:      'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
  --font-sans:      'Inter', 'Segoe UI', system-ui, sans-serif;
  --radius:         16px;
  --radius-sm:      13px;
  --nav-h:          72px;
  --measure:        44rem;
}

html { scroll-padding-top: calc(var(--nav-h) + 1rem); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(60% 45% at 80% 0%, rgba(124, 58, 237, 0.14), rgba(10, 10, 15, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-bright); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; }

/* ─── Nav (same look as the home page) ────────────────────────────── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  background: rgba(10, 10, 15, 0.66);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-logo { display: flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; flex-shrink: 0; }
.nav-mark { display: block; height: 32px; width: 32px; }
.nav-word,
.footer-word {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1;
}
.nav-word .n-tech,
.footer-word .n-tech  { color: var(--head); }
.nav-word .n-steff,
.footer-word .n-steff { background: var(--grad-word); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  color: #A9A7C0;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--head); }
.nav-links a[aria-current="page"] { color: var(--accent-bright); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px; height: 44px;
  cursor: pointer;
  background: rgba(245, 242, 251, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
}
.nav-toggle span {
  display: block;
  width: 18px; height: 1.6px;
  background: var(--text);
  border-radius: 2px;
}

/* ─── Footer (same look as the home page) ─────────────────────────── */
#footer {
  border-top: 1px solid var(--border);
  padding: 2rem 2.5rem 2.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  position: relative;
  z-index: 1;
}
.footer-brand { display: inline-flex; align-items: center; gap: 10px; }
.footer-brand img { display: block; height: 28px; width: 28px; }
.footer-tagline {
  margin-top: 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--text-muted);
}
.footer-tagline .chev { color: var(--accent-bright); letter-spacing: 0; margin: 0 0.75em; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.footer-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--green-text);
}
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.8);
  flex-shrink: 0;
}
.footer-meta a,
.footer-copy {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
}
.footer-meta a:hover { color: var(--head); }

/* ─── Shared headings ─────────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.9rem;
}
.section-label::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--accent-bright); box-shadow: 0 0 10px rgba(180, 124, 247, 0.8); }
.section-title {
  font-size: clamp(2.4rem, 5.6vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--head);
  margin-bottom: 1rem;
}
.section-sub { color: #A9A7C0; font-size: 1rem; }

.post-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.draft-tag {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  border-radius: 4px;
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* ─── Blog index ──────────────────────────────────────────────────── */
.blog-main,
.post-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: calc(var(--measure) + 4rem);
  margin: 0 auto;
  padding: calc(var(--nav-h) + 4rem) 2rem 5rem;
}

.blog-head { margin-bottom: 3rem; }

.post-list { list-style: none; display: flex; flex-direction: column; gap: 1.25rem; }

.post-item article {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012)), rgba(15, 15, 26, 0.58);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 70px rgba(124, 58, 237, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.6rem;
  position: relative;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.post-item article:hover {
  border-color: rgba(155, 93, 229, 0.55);
  box-shadow: 0 8px 32px rgba(155, 93, 229, 0.18);
}

.post-item-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0.4rem 0 0.5rem;
}
.post-item-title a { color: var(--head); text-decoration: none; }
.post-item-title a::after { content: ''; position: absolute; inset: 0; }
.post-item-title a:focus-visible { outline: none; }
.post-item article:focus-within { outline: 2px solid var(--accent-bright); outline-offset: 2px; }

.post-item-summary { color: var(--text-muted); font-size: 0.93rem; }

.empty { color: var(--text-muted); }

/* ─── Post ────────────────────────────────────────────────────────── */
.draft-banner {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.9rem;
  margin-bottom: 2rem;
}

.post-head { margin-bottom: 2.5rem; padding-bottom: 1.75rem; border-bottom: 1px solid var(--border); }

.post-back,
.post-foot a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--accent-bright);
}
.post-back:hover,
.post-foot a:hover { text-decoration: underline; }

.post-title {
  font-size: clamp(2rem, 5.4vw, 3.25rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.045em;
  color: var(--head);
  margin: 1.25rem 0 0.75rem;
  text-wrap: balance;
}

.post-foot {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* ─── Prose ───────────────────────────────────────────────────────── */
.prose { font-size: 1.0625rem; line-height: 1.75; color: #C9C7DC; overflow-wrap: break-word; }

.prose > * + * { margin-top: 1.25rem; }

.prose h2,
.prose h3,
.prose h4 { color: var(--head); line-height: 1.3; }
.prose h2 { font-size: 1.6rem; font-weight: 500; letter-spacing: -0.03em; margin-top: 3rem; }
.prose h3 { font-size: 1.15rem; margin-top: 2.25rem; }
.prose h4 { font-size: 1rem; margin-top: 1.75rem; font-family: var(--font-mono); }

.prose strong { color: var(--text); }
.prose a { text-underline-offset: 3px; }
.prose a:hover { color: var(--head); }

.prose ul,
.prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: 0.4rem; }
.prose li::marker { color: var(--accent); }

.prose blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.2rem;
  color: var(--text);
}
.prose blockquote > * + * { margin-top: 0.75rem; }

.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2.5rem 0; }

.prose code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--accent-faint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.08em 0.35em;
}

.prose pre.code {
  position: relative;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  overflow-x: auto;
  font-size: 0.85rem;
  line-height: 1.6;
}
.prose pre.code[data-lang] { padding-top: 2.2rem; }
.prose pre.code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 0.55rem; left: 1.2rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.prose pre.code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: inherit;
  color: var(--text);
  white-space: pre;
}

.prose figure { margin-top: 2rem; margin-bottom: 2rem; }
.prose figure img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prose figure.diagram {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.prose figure.diagram svg { display: block; width: 100%; height: auto; max-width: 34rem; margin: 0 auto; }
.prose figcaption {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.75rem;
}

.prose .table-wrap { overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: 0.93rem; }
.prose th,
.prose td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.04em; color: var(--text); }

/* ─── Callouts: > [!NOTE] / [!TRADEOFF] / [!LESSON] ───────────────── */
.prose .callout {
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--bg2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.9rem 1.2rem 1rem;
  color: var(--text);
}
.prose .callout > * + * { margin-top: 0.6rem; }
.prose .callout-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
}
.prose .callout-tradeoff { border-left-color: #fbbf24; background: rgba(251, 191, 36, 0.05); border-color: rgba(251, 191, 36, 0.22); }
.prose .callout-tradeoff .callout-label { color: #fbbf24; }

/* ─── Post hero image (front matter `image`) ──────────────────────── */
.post-hero { margin: 0 0 2.5rem; }
.post-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 630;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* ─── Diagram colours: SVG classes, so each theme recolours every diagram.
   The SVG's own fill/stroke attributes are the fallback (feed readers, raw file). */
.prose figure.diagram .d-box      { fill: var(--bg3); stroke: var(--accent); }
.prose figure.diagram .d-title    { fill: var(--head); }
.prose figure.diagram .d-line     { stroke: var(--accent-bright); }
.prose figure.diagram .d-link     { stroke: var(--accent); }
.prose figure.diagram .d-head     { fill: var(--accent-bright); }
.prose figure.diagram .d-box-hl   { fill: #1C1330; stroke: var(--accent-bright); }
.prose figure.diagram .d-text     { fill: #B3B1C8; }
.prose figure.diagram .d-text-hl  { fill: #C9C7DC; }
.prose figure.diagram .d-note     { fill: var(--text-muted); }

/* ─── Mobile ──────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(10, 10, 15,0.97);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
  }
  .nav-links.open { display: flex; }
  #nav { padding: 0 1.25rem; }
  #footer { padding: 1.75rem 1.25rem 2rem; }
  .nav-links a { display: flex; padding: 0 1.25rem; min-height: 52px; }
  .nav-links a::after { display: none; }
  .nav-toggle { display: flex; }
  .nav-mark { height: 26px; width: 26px; }
  .nav-word { font-size: 17px; }

  .blog-main,
  .post-main { padding: calc(var(--nav-h) + 2.5rem) 1rem 3.5rem; }
  .post-item article { padding: 1.25rem; }
  .prose { font-size: 1rem; }
  .prose pre.code { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
  .prose figure.diagram { padding: 0.75rem 0.25rem; margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
}
