/* Shared styles for the generated blog pages (scripts/build_blog.py).
   Design tokens mirror :root in index.html and about.html. */
:root {
  --bg: #0c151e;
  --surface: #162030;
  --surface-light: #1c2a3c;
  --teal: #4ecdc4;
  --teal-dark: #2d8f8f;
  --teal-glow: rgba(78, 205, 196, 0.25);
  --coral: #e85d5d;
  --coral-soft: #f0837a;
  --coral-glow: rgba(232, 93, 93, 0.21);
  --coral-deep: #c94444;
  --text: #e8eff5;
  --text-body: #c3d1de;
  --text-muted: #8fa3b8;
  --text-dim: #5a7a94;
  --border: rgba(78, 205, 196, 0.10);
  --border-coral: rgba(232, 93, 93, 0.12);
}

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

::selection { background: var(--coral); color: var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', 'Avenir', system-ui, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main { position: relative; z-index: 1; }

/* ── Ambient orbs ── */
.ambient-orb {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.ambient-orb--coral-tr {
  top: -15%; right: -10%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--coral-glow) 0%, transparent 65%);
  animation: pulse 8s ease infinite;
}
.ambient-orb--teal-l {
  top: 50%; left: -8%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, var(--teal-glow) 0%, transparent 70%);
  animation: pulse 10s ease 3s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}
@keyframes gradShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Top nav ── */
.site-nav {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-nav-links { display: flex; gap: 24px; }
.site-nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.site-nav-links a:hover { color: var(--coral); }

.logo-mark { animation: spinSlow 30s linear infinite; }
.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}
.logo-text {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.logo-pipe { color: var(--coral); }

/* ── Blog index ── */
.page-header {
  text-align: center;
  padding: 80px 24px 40px;
  max-width: 880px;
  margin: 0 auto;
}
.page-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.4rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(135deg, var(--coral), var(--teal));
  background-size: 200% 200%;
  animation: gradShift 6s ease infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 640px;
  margin: 24px auto 0;
  font-weight: 300;
}

.post-list {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  gap: 20px;
}
.post-card a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 32px;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s;
}
.post-card a:hover {
  border-color: rgba(232, 93, 93, 0.25);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3), 0 0 40px var(--coral-glow);
  transform: translateY(-4px);
}
.post-card time {
  font-size: 12px;
  color: var(--coral);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.post-card h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.3;
  margin: 8px 0 10px;
}
.post-card p {
  color: var(--text-muted);
  line-height: 1.7;
  font-weight: 300;
}
.post-list-empty {
  text-align: center;
  color: var(--text-muted);
}

/* ── Post ── */
.post {
  max-width: 720px;
  margin: 0 auto;
  padding: 64px 24px 0;
}
.post-back {
  display: inline-block;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 28px;
}
.post-back:hover { color: var(--coral); }
.post-header h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 4.5vw, 3.2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.post-meta {
  margin-top: 20px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-coral);
  color: var(--text-dim);
  font-size: 14px;
}
.post-meta a { color: var(--text-muted); text-decoration: none; }
.post-meta a:hover { color: var(--coral); }

.prose {
  padding-top: 32px;
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-body);
}
.prose > * + * { margin-top: 1.2em; }
.prose h2, .prose h3, .prose h4 {
  color: var(--text);
  line-height: 1.3;
  margin-top: 2em;
}
.prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 500;
}
.prose h3 { font-size: 1.3rem; font-weight: 600; }
.prose h4 { font-size: 1.1rem; font-weight: 600; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: rgba(78, 205, 196, 0.4);
  text-underline-offset: 3px;
}
.prose a:hover { color: var(--coral); text-decoration-color: var(--coral); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li::marker { color: var(--coral); }
.prose blockquote {
  border-left: 3px solid var(--coral);
  padding-left: 1.2em;
  color: var(--text-muted);
  font-style: italic;
}
.prose code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-light);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.4em;
}
.prose pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  overflow-x: auto;
  line-height: 1.6;
}
.prose pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
}
.prose img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}
.prose hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-coral), var(--border), transparent);
  margin: 2.5em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.prose th, .prose td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.prose th { color: var(--text); font-weight: 600; }

/* ── CTA ── */
.back-cta {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 80px 24px 40px;
}
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--coral), var(--coral-deep));
  color: #fff;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.2s, box-shadow 0.3s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--coral-glow);
}

/* ── Footer ── */
.site-footer {
  position: relative;
  z-index: 1;
  padding: 40px 24px;
  border-top: 1px solid var(--border-coral);
  text-align: center;
  font-size: 13px;
  color: var(--text-dim);
}
.footer-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.footer-brand span {
  font-weight: 500;
  color: var(--text-muted);
}
.site-footer p + p { margin-top: 4px; }
.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-coral);
}
.site-footer a:hover { color: var(--coral); }

@media (max-width: 768px) {
  .page-header { padding: 60px 20px 24px; }
  .post { padding: 40px 20px 0; }
  .post-card a { padding: 24px; }
  .prose { font-size: 1.05rem; }
  .ambient-orb--coral-tr { width: 400px; height: 400px; }
  .ambient-orb--teal-l { width: 300px; height: 300px; }
}
