/* ==========================================================================
   SCAI post stylesheet — the one design system for /blog/.

   WHY THIS FILE EXISTS
   The blog was running two RETIRED generations at once: 171 posts in the
   Orbitron / Exo 2 / #00F0FF neon look, and 18 in a bare Arial fallback.
   The homepage had already moved to Inter + #06b6d4 on #09090b. So every
   post a visitor landed on from search looked like a different, older site
   than the one it claimed to be. One system now, matching index.html.

   Design intent: credibility, not spectacle. Long line-length discipline,
   restrained accent use, real hierarchy. An engineer who ships, not a
   sci-fi poster.
   ========================================================================== */

:root {
  --bg: #09090b;
  --bg-raised: rgba(255, 255, 255, 0.03);
  --bg-raised-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);
  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --primary: #06b6d4;
  --primary-glow: rgba(6, 182, 212, 0.15);
  --accent: #ef4444;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --measure: 46rem; /* ~72ch, the readable column */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .bar {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.site-header .logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.site-header .logo-mark {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--primary), #0891b2);
  color: #04121a;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
}

.site-header nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.35rem;
  font-size: 0.9rem;
}

.site-header nav a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-header nav a:hover { color: var(--text); }

.site-header nav a.cta {
  color: #04121a;
  background: var(--primary);
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: 7px;
}

.site-header nav a.cta:hover { background: #22d3ee; color: #04121a; }

@media (max-width: 720px) {
  .site-header nav { gap: 0.9rem; font-size: 0.82rem; }
  .site-header nav a.hide-sm { display: none; }
}

/* ---------- article ---------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}

.back,
a.back {
  display: inline-block;
  margin-bottom: 1.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  text-decoration: none;
}

.back:hover { color: var(--primary); }

.series,
.kicker {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.85rem;
}

h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.022em;
  color: #fff;
  margin-bottom: 1.1rem;
  text-wrap: balance;
}

/* byline: the E-E-A-T signal, a real licensed human behind the words */
.byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-bottom: 1.6rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
  color: var(--text-muted);
}

.byline strong { color: var(--text-secondary); font-weight: 600; }
.byline .dot { color: var(--text-muted); opacity: 0.5; }

h2 {
  font-size: clamp(1.3rem, 2.6vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.012em;
  color: #fff;
  margin: 2.75rem 0 0.9rem;
  text-wrap: balance;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  margin: 2rem 0 0.7rem;
}

p { margin-bottom: 1.35rem; color: #dcdce2; }

.wrap > p:first-of-type,
.lede {
  font-size: 1.17rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

ul, ol { margin: 0 0 1.35rem 1.3rem; color: #dcdce2; }
li { margin-bottom: 0.55rem; }

strong, b { color: #fff; font-weight: 650; }

blockquote {
  margin: 2rem 0;
  padding: 0.3rem 0 0.3rem 1.35rem;
  border-left: 3px solid var(--primary);
  color: var(--text-secondary);
  font-size: 1.08rem;
}

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.12em 0.4em;
  color: #e4e4e7;
}

pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

pre code { background: none; border: 0; padding: 0; }

img, svg, video { max-width: 100%; height: auto; }

hr { border: 0; border-top: 1px solid var(--border); margin: 2.75rem 0; }

table { width: 100%; border-collapse: collapse; margin-bottom: 1.6rem; font-size: 0.95rem; }
th, td { text-align: left; padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--border); }
th { color: #fff; font-weight: 650; }

/* ---------- content blocks carried over from the old generations ---------- */

.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.4rem 1.5rem;
  margin: 1.5rem 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card:hover { border-color: var(--border-strong); background: var(--bg-raised-hover); }
.card h2 { margin-top: 0; font-size: 1.16rem; }
.card h3 { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }

.note {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 10px;
  padding: 1rem 1.2rem;
  margin: 1.6rem 0;
  color: #fecdd3;
}

.note > p:last-child { margin-bottom: 0; }

/* ---------- post footer: CTA + nav ---------- */

#scai-post-footer { margin-top: 3.5rem; border-top: 1px solid var(--border); padding-top: 2.25rem; }

#scai-post-footer .cta {
  background: linear-gradient(160deg, rgba(6, 182, 212, 0.1), var(--bg-raised));
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 14px;
  padding: 1.6rem 1.7rem;
}

#scai-post-footer .cta h2 { margin: 0 0 0.5rem; font-size: 1.28rem; }
#scai-post-footer .cta p { margin: 0 0 1.25rem; color: var(--text-secondary); font-size: 0.98rem; }

#scai-post-footer .cta a.book {
  display: inline-block;
  background: var(--primary);
  color: #04121a;
  font-weight: 700;
  font-size: 0.97rem;
  text-decoration: none;
  padding: 0.78rem 1.5rem;
  border-radius: 9px;
  transition: background 0.15s ease, transform 0.15s ease;
}

#scai-post-footer .cta a.book:hover { background: #22d3ee; transform: translateY(-1px); text-decoration: none; }

#scai-post-footer nav {
  margin-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

#scai-post-footer nav a { color: var(--text-secondary); }
#scai-post-footer nav a:hover { color: var(--primary); }

/* CalDRE disclosure — required on every public page, never style it away.
   .disc is the legacy class name used by 14 posts from the older generation. */
.disclosure,
.disc {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.6;
  margin: 2.5rem auto 0;
  max-width: 48rem;
  padding: 0 1rem;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
