/* ── Tokens ──────────────────────────────────────────────────── */
:root {
  --primary:       #3730a3;
  --primary-dark:  #2d268f;
  --primary-light: #eef2ff;
  --accent:        #f59e0b;
  --bg:            #f8f7ff;
  --surface:       #ffffff;
  --border:        #ddd9f5;
  --text:          #1e1b4b;
  --muted:         #6b7280;
  --success:       #16a34a;
  --warning:       #d97706;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.06);
  --shadow-md:     0 8px 28px rgba(0,0,0,0.09);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.13);
  --radius:        12px;
  --radius-sm:     8px;
  --radius-lg:     20px;
}

html[data-theme="dark"] {
  --primary:       #818cf8;
  --primary-dark:  #6366f1;
  --primary-light: #1e1b4b;
  --accent:        #fbbf24;
  --bg:            #0f0e1a;
  --surface:       #1a1830;
  --border:        #2d2b52;
  --text:          #f0eeff;
  --muted:         #9ca3af;
  --success:       #34d399;
  --warning:       #fbbf24;
  --shadow-sm:     0 2px 8px rgba(0,0,0,0.45);
  --shadow-md:     0 8px 28px rgba(0,0,0,0.55);
  --shadow-lg:     0 24px 64px rgba(0,0,0,0.65);
}

html[data-theme="dark"] .nav-logo-stop-start { stop-color: #818cf8; }
html[data-theme="dark"] .nav-logo-dot { fill: #fbbf24; }

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Utilities ───────────────────────────────────────────────── */
.container       { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.container--post { max-width: 740px;  margin: 0 auto; padding: 0 24px; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 600; cursor: pointer;
  border: none; transition: all 0.15s ease; white-space: nowrap;
  text-decoration: none; letter-spacing: -0.01em;
}
.btn--primary { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(55,48,163,0.3); }
.btn--primary:hover { background: var(--primary-dark); transform: scale(1.02); text-decoration: none; }
.btn--ghost { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn--ghost:hover { background: var(--primary-light); transform: scale(1.02); text-decoration: none; }
.btn--lg { padding: 15px 32px; font-size: 1.0625rem; }
.btn--white { background: #fff; color: var(--primary); }
.btn--white:hover { background: #f5f3ff; text-decoration: none; }

html[data-theme="dark"] .btn--white { background: var(--surface); color: var(--primary); }
html[data-theme="dark"] .btn--white:hover { background: var(--border); }

/* ── Nav ─────────────────────────────────────────────────────── */
nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] nav { background: rgba(15,14,26,0.85); border-bottom-color: var(--border); }

.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.nav-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.375rem; font-weight: 800;
  color: var(--text); letter-spacing: -0.02em; text-decoration: none;
}
.nav-logo:hover { text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 32px; list-style: none; }
.nav-links a { color: var(--muted); font-size: 0.9375rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--text); font-weight: 600; }
.nav-actions { display: flex; align-items: center; gap: 12px; }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; outline: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: background 0.2s, border-color 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--primary-light); border-color: var(--primary); transform: scale(1.1); }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-actions .btn--primary { display: none; }
}

/* ── Blog index ──────────────────────────────────────────────── */
.blog-hero {
  padding: 72px 0 56px;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  position: relative; overflow: hidden;
}
html[data-theme="dark"] .blog-hero { background: linear-gradient(180deg, #1a1830 0%, var(--bg) 100%); }
.blog-hero::before {
  content: '';
  position: absolute; top: -120px; right: -160px;
  width: 600px; height: 600px; border-radius: 50%;
  background: radial-gradient(circle, rgba(55,48,163,0.09) 0%, transparent 68%);
  pointer-events: none;
}
html[data-theme="dark"] .blog-hero::before {
  background: radial-gradient(circle, rgba(129,140,248,0.15) 0%, transparent 68%);
}
.blog-hero > .container { position: relative; z-index: 1; }
.blog-eyebrow {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--primary); margin-bottom: 12px;
}
.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.15;
  color: var(--text); margin-bottom: 16px;
}
.blog-hero-sub { font-size: 1.0625rem; color: var(--muted); max-width: 520px; line-height: 1.7; }

/* ── Post grid ───────────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 56px 0 96px;
}
@media (max-width: 900px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .post-grid { grid-template-columns: 1fr; } }

/* ── Post card ───────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex; flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-decoration: none; color: inherit;
}
.post-card:hover {
  box-shadow: 0 16px 40px rgba(0,0,0,0.12);
  transform: translateY(-4px);
  text-decoration: none;
}
.post-card__tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-light); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 14px;
  align-self: flex-start;
}
.post-card__title {
  font-size: 1.0625rem; font-weight: 800;
  letter-spacing: -0.02em; line-height: 1.3;
  color: var(--text); margin-bottom: 10px;
}
.post-card__excerpt {
  font-size: 0.9rem; color: var(--muted);
  line-height: 1.65; flex: 1; margin-bottom: 20px;
}
.post-card__meta {
  display: flex; align-items: center; gap: 12px;
  font-size: 0.8125rem; color: var(--muted); font-weight: 500;
  border-top: 1px solid var(--border); padding-top: 16px; margin-top: auto;
}
.post-card__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border); }

/* ── Post article ────────────────────────────────────────────── */
.post-header { padding: 64px 0 40px; background: linear-gradient(180deg, #fff 0%, var(--bg) 100%); }
html[data-theme="dark"] .post-header { background: linear-gradient(180deg, #1a1830 0%, var(--bg) 100%); }

.post-back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--muted);
  margin-bottom: 28px; text-decoration: none;
}
.post-back:hover { color: var(--primary); text-decoration: none; }

.post-tag {
  display: inline-block;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--primary);
  background: var(--primary-light); border-radius: 999px;
  padding: 3px 10px; margin-bottom: 16px;
}
.post-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 900;
  letter-spacing: -0.04em; line-height: 1.15;
  color: var(--text); margin-bottom: 20px;
}
.post-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.875rem; color: var(--muted); font-weight: 500;
  flex-wrap: wrap;
}
.post-meta time { color: var(--muted); }
.post-meta-sep { color: var(--border); }

/* ── Prose ───────────────────────────────────────────────────── */
.prose-wrap { padding: 48px 0 80px; }

.prose {
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--text);
}
.prose p { margin-bottom: 1.5em; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.25;
  margin: 2em 0 0.75em; color: var(--text);
}
.prose h3 {
  font-size: 1.125rem; font-weight: 700;
  margin: 1.75em 0 0.5em; color: var(--text);
}
.prose ul, .prose ol {
  padding-left: 1.5em; margin-bottom: 1.5em;
}
.prose li { margin-bottom: 0.5em; }
.prose strong { font-weight: 700; color: var(--text); }
.prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--primary-dark); }
.prose hr {
  border: none; border-top: 1px solid var(--border);
  margin: 2.5em 0;
}
.prose blockquote {
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  margin: 2em 0;
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: var(--shadow-sm);
  font-style: italic;
  font-size: 1.0625rem;
  color: var(--text);
}
html[data-theme="dark"] .prose blockquote { background: rgba(255,255,255,0.05); }
.prose code {
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 0.875em;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
}
.prose pre {
  background: #1e1b4b;
  color: #e0e7ff;
  border-radius: var(--radius);
  padding: 20px 24px;
  overflow-x: auto;
  margin-bottom: 1.5em;
  font-size: 0.875rem;
  line-height: 1.7;
}
.prose pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* ── Checklist (ported from getgild.app marketing pages) ────── */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.9375rem; color: var(--text); line-height: 1.6;
}
.checklist li::before {
  content: '✓';
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary);
  font-size: 0.75rem; font-weight: 700;
  flex-shrink: 0; margin-top: 2px;
}

/* ── Post CTA ────────────────────────────────────────────────── */
.post-cta {
  background: linear-gradient(135deg, #3730a3 0%, #1e1b4b 60%, #4c1d95 100%);
  color: #fff; text-align: center; padding: 72px 0;
  margin-top: 24px;
}
.post-cta h2 {
  font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 900;
  letter-spacing: -0.03em; color: #fff; margin-bottom: 12px;
}
.post-cta p { color: rgba(255,255,255,0.8); font-size: 1.0625rem; margin-bottom: 32px; }
.cta-form {
  display: flex; gap: 12px; max-width: 420px; margin: 0 auto;
  flex-wrap: wrap; justify-content: center;
}
.cta-note { font-size: 0.8125rem; color: rgba(255,255,255,0.55); margin-top: 12px; }

/* ── Footer ──────────────────────────────────────────────────── */
footer { background: #0f172a; color: #94a3b8; padding: 56px 0 28px; }
html[data-theme="dark"] footer { background: #07060f; }
.footer-inner {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 40px; flex-wrap: wrap; margin-bottom: 40px;
}
.footer-brand {}
.footer-logo {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.125rem; font-weight: 800; color: #fff;
  margin-bottom: 8px; text-decoration: none;
}
.footer-logo:hover { text-decoration: none; }
.footer-tagline { font-size: 0.8125rem; line-height: 1.6; max-width: 280px; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; align-items: center; }
.footer-links a { font-size: 0.875rem; color: #94a3b8; }
.footer-links a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 24px;
  font-size: 0.8125rem; color: #64748b;
}

/* ── Transitions ─────────────────────────────────────────────── */
body.theme-transitioning * {
  transition: background-color 0.25s ease, color 0.18s ease,
              border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* ── Scroll reveal ───────────────────────────────────────────── */
.reveal {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.25, 0.1, 0.25, 1),
              transform 0.6s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
