/* ============================================================
   Trinity Cadence — Legacy blog post stylesheet
   Re-skins the 10 static post HTMLs to match the new Cadence site:
   Geist + Geist Mono, electric violet single-accent, off-white,
   theme-toggle compatible via [data-theme="dark"] overrides.
   ============================================================ */

:root {
  --bg-base: #FAFAF9;
  --bg-surface: #FFFFFF;
  --bg-sunken: #F2F2F0;
  --border: rgba(10, 10, 11, 0.08);
  --border-hi: rgba(10, 10, 11, 0.18);
  --border-faint: rgba(10, 10, 11, 0.04);
  --text-1: #0A0A0B;
  --text-2: #52525B;
  --text-3: #8A8A93;
  --accent: #5B3CE6;
  --accent-hi: #4A2DCC;
  --accent-lo: rgba(91, 60, 230, 0.10);
  --accent-ink: rgba(91, 60, 230, 0.35);
  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Geist Mono', 'JetBrains Mono', ui-monospace, monospace;
  --container: 720px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

[data-theme="dark"] {
  --bg-base: #08090C;
  --bg-surface: #10131C;
  --bg-sunken: #050608;
  --border: rgba(255, 255, 255, 0.10);
  --border-hi: rgba(255, 255, 255, 0.22);
  --border-faint: rgba(255, 255, 255, 0.04);
  --text-1: #F5F5F4;
  --text-2: #B6B6BD;
  --text-3: #7C7C86;
  --accent: #8B6CFF;
  --accent-hi: #A78BFA;
  --accent-lo: rgba(139, 108, 255, 0.18);
  --accent-ink: rgba(139, 108, 255, 0.55);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  background: var(--bg-base);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
:where(a, button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Top nav (matches main site shape) ---------- */
nav.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-base) 78%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--border-faint);
  padding: 0;
}
nav.site-header .nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
  gap: 28px;
}
nav.site-header .wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--text-1);
  text-decoration: none;
}
nav.site-header .wordmark img { width: 56px; height: auto; flex-shrink: 0; }
nav.site-header .links {
  display: flex;
  align-items: center;
  gap: 28px;
}
nav.site-header .links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.2s;
}
nav.site-header .links a:hover { color: var(--text-1); }
nav.site-header .links .nav-cta {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border: 1px solid var(--border-hi);
  border-radius: 100px;
  color: var(--text-1);
  font-weight: 500;
}
nav.site-header .links .nav-cta:hover {
  background: var(--text-1);
  color: var(--bg-base);
  border-color: var(--text-1);
}

/* ---------- Post hero ---------- */
.post-hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px 24px;
  text-align: center;
}
.post-hero .post-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 22px;
}
.post-hero .post-tag::before { content: '\\\\'; color: var(--accent); }
.post-hero h1 {
  font-family: var(--font-sans);
  font-size: clamp(2rem, 4.4vw, 3.25rem);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.08;
  color: var(--text-1);
  margin-bottom: 22px;
}
.post-hero .post-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-3);
}
.post-hero .post-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-3);
  opacity: 0.5;
}

/* ---------- Article body ---------- */
article.post-body {
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px 32px 64px;
}
article.post-body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text-2);
  margin-bottom: 1.25rem;
}
article.post-body p strong { color: var(--text-1); font-weight: 600; }
article.post-body h2 {
  font-family: var(--font-sans);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text-1);
  margin: 2.75rem 0 1rem;
}
article.post-body h3 {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  color: var(--text-1);
  margin: 2rem 0 0.75rem;
}
article.post-body ul, article.post-body ol {
  margin: 1rem 0 1.5rem 1.5rem;
  color: var(--text-2);
}
article.post-body li { margin-bottom: 0.5rem; }
article.post-body blockquote {
  font-family: var(--font-sans);
  font-size: 1.125rem;
  font-style: italic;
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.25rem 0 0.25rem 1.5rem;
  color: var(--text-1);
}
article.post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--accent-lo);
  text-decoration-thickness: 1.5px;
}
article.post-body a:hover { color: var(--accent-hi); }
article.post-body code {
  font-family: var(--font-mono);
  background: var(--bg-sunken);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.92em;
}

/* ---------- CTA box (replaces old gradient-purple block) ---------- */
.cta-box {
  max-width: var(--container);
  margin: 3rem auto;
  padding: 0 32px;
}
.cta-box .cta-inner {
  background: var(--text-1);
  color: #FAFAF9;
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-box .cta-inner::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(91, 60, 230, 0.30), transparent 60%);
  filter: blur(20px);
  pointer-events: none;
}
.cta-box h3 {
  position: relative;
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #FAFAF9;
  margin-bottom: 0.75rem;
}
.cta-box .cta-inner > p {
  position: relative;
  color: rgba(250, 250, 249, 0.7);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}
.cta-box .cta-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 100px;
  text-decoration: none;
  box-shadow: 0 6px 20px -8px var(--accent-ink);
  transition: background 0.2s, transform 0.2s;
}
.cta-box .cta-btn:hover { background: var(--accent-hi); transform: translateY(-1px); }
.cta-box .cta-inner > p:last-of-type {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(250, 250, 249, 0.5);
  margin-top: 0.85rem;
  margin-bottom: 0;
}

/* ---------- Author bio ---------- */
.author {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px 64px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.author .avatar {
  width: 54px;
  height: 54px;
  border-radius: 100px;
  background: linear-gradient(140deg, #a78bfa, var(--accent));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 600;
  font-size: 19px;
  flex-shrink: 0;
}
.author-info h4 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-1);
  margin-bottom: 4px;
}
.author-info p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.55;
}

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--bg-base);
  border-top: 1px solid var(--border);
  padding: 48px 32px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
}
footer.site-footer p { margin-bottom: 0.5rem; }
footer.site-footer a { color: var(--accent); text-decoration: none; }
footer.site-footer a:hover { color: var(--accent-hi); }

/* ---------- Theme toggle (same as main site) ---------- */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: 100px;
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.theme-toggle:hover { color: var(--text-1); border-color: var(--text-1); transform: translateY(-1px); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .t-sun { display: none; }
.theme-toggle .t-moon { display: block; }
[data-theme="dark"] .theme-toggle { border-color: rgba(255, 255, 255, 0.22); color: rgba(255, 255, 255, 0.7); }
[data-theme="dark"] .theme-toggle:hover { color: #fff; border-color: #fff; }
[data-theme="dark"] .theme-toggle .t-sun { display: block; }
[data-theme="dark"] .theme-toggle .t-moon { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  nav.site-header .nav-inner { height: 72px; padding: 0 20px; gap: 16px; }
  nav.site-header .wordmark img { width: 44px; }
  nav.site-header .wordmark { font-size: 17px; }
  nav.site-header .links { gap: 16px; }
  nav.site-header .links a:not(.nav-cta) { display: none; }
  .post-hero { padding: 48px 24px 16px; }
  .post-hero h1 { font-size: 2rem; }
  article.post-body { padding: 16px 24px 48px; }
  article.post-body p { font-size: 16px; }
  .cta-box .cta-inner { padding: 32px 24px; }
  .author { padding: 0 24px 48px; }
}
