/* Gastronaut Blog Stylesheet - served at /blog.css for dynamic blog Functions */
/* Extracted from src/styles/global.css + Layout.astro patterns */

/* ===== DESIGN TOKENS ===== */
:root {
  --font-sans: 'Inter', -apple-system, system-ui, sans-serif;
  --font-display: 'Inter', -apple-system, system-ui, sans-serif;
  --font-editorial: 'EB Garamond', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', monospace;
  --green: #2EB85C;
  --cyan: #87DEFF;
  --navy: #060F1A;
  --void: #030810;
  --off-white: #F1F3F4;
  --silver: #D4D4D3;
}

/* ===== GLOBAL BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: #030810;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: #F1F3F4;
  background: #030810;
  line-height: 1.6;
  overflow-x: hidden;
  /* no cursor:none - custom cursor JS not loaded in Functions */
}

/* ===== DEEP COSMIC BACKGROUND (replaces three.js starfield) ===== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(46,184,92,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(135,222,255,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(200,70,255,0.02) 0%, transparent 50%),
    linear-gradient(180deg, #030810 0%, #060F1A 50%, #030810 100%);
}

/* Simulate scattered stars via pseudo-element pattern */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 10% 15%, rgba(135,222,255,0.4) 0%, transparent 100%),
    radial-gradient(1px 1px at 25% 40%, rgba(135,222,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 40% 10%, rgba(255,255,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 55% 60%, rgba(135,222,255,0.35) 0%, transparent 100%),
    radial-gradient(1px 1px at 70% 25%, rgba(255,255,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 82% 70%, rgba(135,222,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 92% 45%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 15% 75%, rgba(135,222,255,0.25) 0%, transparent 100%),
    radial-gradient(1px 1px at 60% 85%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 35% 95%, rgba(135,222,255,0.15) 0%, transparent 100%),
    radial-gradient(2px 2px at 48% 32%, rgba(135,222,255,0.5) 0%, transparent 100%),
    radial-gradient(2px 2px at 78% 88%, rgba(46,184,92,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 5% 55%, rgba(255,255,255,0.2) 0%, transparent 100%),
    radial-gradient(1px 1px at 88% 12%, rgba(135,222,255,0.3) 0%, transparent 100%),
    radial-gradient(1px 1px at 65% 48%, rgba(255,255,255,0.15) 0%, transparent 100%);
}

/* Ensure all content sits above background layers */
nav, main, footer, #telemetry, #progress, #loader, #cursor-dot, #cursor-ring {
  position: relative;
  z-index: 1;
}

/* ===== SCROLL PROGRESS ===== */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; z-index: 1000;
  background: linear-gradient(90deg, #2EB85C, #87DEFF, #C846FF);
  width: 0; transition: width 0.1s;
  box-shadow: 0 0 8px rgba(135,222,255,0.8);
}

/* ===== TELEMETRY STRIP ===== */
#telemetry {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  height: 26px;
  background: rgba(3,8,16,0.95);
  border-bottom: 1px solid rgba(135,222,255,0.06);
  display: flex; align-items: center; justify-content: center;
  gap: 32px; overflow: hidden;
  font-family: var(--font-mono);
  font-size: 9px; letter-spacing: 2.5px; text-transform: uppercase;
  color: rgba(135,222,255,0.45);
  backdrop-filter: blur(12px);
}
#telemetry .tele-item { display: flex; align-items: center; gap: 6px; }
#telemetry .tele-val { color: #2EB85C; font-weight: 700; }
#telemetry .tele-sep { color: rgba(135,222,255,0.15); }
@media (max-width: 768px) { .tele-hide-sm { display: none !important; } }

/* ===== NAV ===== */
#nav {
  position: fixed; top: 26px; left: 0; right: 0; z-index: 800;
  padding: 0 5vw;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
  background: rgba(3,8,16,0.7);
  border-bottom: 1px solid rgba(135,222,255,0.05);
  backdrop-filter: blur(20px) saturate(1.4);
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
}
#nav.scrolled {
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  width: min(900px, 90vw);
  border-radius: 40px;
  background: rgba(3,8,16,0.92);
  border: 1px solid rgba(135,222,255,0.12);
  box-shadow: 0 0 40px rgba(135,222,255,0.06);
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.nav-logo img.nav-icon { height: 48px; filter: drop-shadow(0 0 14px rgba(46,184,92,0.55)); transition: filter 0.3s, transform 0.3s; }
.nav-logo a:hover img.nav-icon { filter: drop-shadow(0 0 22px rgba(46,184,92,0.85)); transform: scale(1.05); }
.nav-logo img.nav-wordmark { height: 22px; opacity: 0.95; }
.nav-links {
  display: flex; align-items: center; gap: 28px;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  font-family: var(--font-mono);
}
.nav-links a {
  color: rgba(212,212,211,0.6); text-decoration: none;
  transition: color 0.2s;
  position: relative;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 1px; background: #2EB85C;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
}
.nav-links a:hover { color: #87DEFF; }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-cta {
  padding: 9px 22px; border-radius: 40px;
  background: rgba(46,184,92,0.1);
  border: 1px solid rgba(46,184,92,0.4);
  color: #2EB85C; font-size: 11px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(.4,0,.2,1);
}
.nav-cta:hover {
  background: rgba(46,184,92,0.2);
  border-color: #2EB85C;
  box-shadow: 0 0 24px rgba(46,184,92,0.3);
  transform: translateY(-1px);
}
@media (max-width: 768px) {
  #nav.scrolled { width: 92vw; }
  .nav-links a:not(.nav-cta) { display: none; }
}

/* ===== REVEAL ANIMATION ===== */
.reveal {
  opacity: 0; transform: translateY(48px);
  transition: opacity 0.9s cubic-bezier(.4,0,.2,1), transform 0.9s cubic-bezier(.4,0,.2,1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ===== SECTION LABELS ===== */
.section-label {
  font-size: 10px; letter-spacing: 6px; text-transform: uppercase;
  color: #2EB85C; margin-bottom: 20px; font-weight: 700;
  font-family: var(--font-mono);
  display: flex; align-items: center; gap: 12px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 24px; height: 1px;
  background: #2EB85C;
  box-shadow: 0 0 8px rgba(46,184,92,0.8);
}

h1 { font-family: var(--font-display); font-size: clamp(2.4rem, 5.5vw, 5rem); font-weight: 800; line-height: 1.05; letter-spacing: -0.025em; }
h2 { font-family: var(--font-display); font-size: clamp(1.8rem, 3.6vw, 3.4rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 24px; }
h3 { font-family: var(--font-display); font-size: clamp(1.1rem, 1.9vw, 1.6rem); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; margin-bottom: 14px; }

/* ===== FOOTER ===== */
footer {
  background: #030810; border-top: 1px solid rgba(135,222,255,0.06);
  padding: 80px 5vw 48px;
  position: relative; z-index: 1;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 32px;
}
footer .footer-logo { display: flex; align-items: center; gap: 12px; }
footer .footer-logo img { height: 28px; opacity: 0.7; }
footer .footer-links { display: flex; gap: 24px; align-items: center; }
footer .footer-links a { font-size: 12px; color: rgba(135,222,255,0.4); text-decoration: none; transition: color 0.2s; letter-spacing: 1px; }
footer .footer-links a:hover { color: #87DEFF; }
.footer-bottom {
  max-width: 1280px; margin: 40px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(135,222,255,0.04);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.footer-bottom p { font-size: 11px; color: rgba(135,222,255,0.2); font-family: var(--font-mono); letter-spacing: 1px; }

/* ===== BLOG INDEX ===== */
#blog-index {
  padding: 110px 5vw 120px;
  min-height: 100svh;
}
.blog-featured {
  margin-bottom: 64px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(135,222,255,0.1);
  position: relative;
  height: 480px;
  display: flex; align-items: flex-end;
}
.blog-featured-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform 0.6s cubic-bezier(.4,0,.2,1);
}
.blog-featured:hover .blog-featured-bg { transform: scale(1.04); }
.blog-featured-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3,8,16,0.95) 0%, rgba(3,8,16,0.5) 50%, transparent 100%);
}
.blog-featured-content {
  position: relative; z-index: 2;
  padding: 40px 48px;
}
.blog-featured-content .blog-date {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 3px;
  text-transform: uppercase; color: #2EB85C; margin-bottom: 12px;
}
.blog-featured-content h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem); font-weight: 800; color: #F1F3F4;
  margin-bottom: 16px; line-height: 1.1;
}
.blog-featured-content p { font-size: 15px; color: rgba(212,212,211,0.7); max-width: 600px; line-height: 1.6; }
.blog-featured a { position: absolute; inset: 0; z-index: 3; }
.blog-featured-tag {
  display: inline-block;
  font-size: 10px; letter-spacing: 2px; text-transform: uppercase;
  color: #2EB85C; background: rgba(46,184,92,0.08); padding: 4px 10px;
  border-radius: 4px; border: 1px solid rgba(46,184,92,0.2);
  margin-right: 6px; margin-bottom: 12px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 900px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blog-grid { grid-template-columns: 1fr; } }

.blog-card {
  border-radius: 16px; overflow: hidden;
  background: rgba(6,15,26,0.7);
  border: 1px solid rgba(135,222,255,0.07);
  display: flex; flex-direction: column;
  transition: all 0.4s cubic-bezier(.4,0,.2,1);
}
.blog-card:hover {
  border-color: rgba(46,184,92,0.3);
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0,0,0,0.4), 0 0 0 1px rgba(46,184,92,0.1);
}
.blog-card-img-wrap {
  position: relative; overflow: hidden; aspect-ratio: 16/9;
  background: rgba(3,8,16,0.8);
}
.blog-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(.4,0,.2,1); }
.blog-card:hover .blog-card-img-wrap img { transform: scale(1.08); }
.blog-card-img-wrap .card-img-glow {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(6,15,26,0.6) 0%, transparent 50%);
  pointer-events: none;
}
.blog-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-date { font-family: var(--font-mono); font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #2EB85C; margin-bottom: 8px; }
.blog-card-title { font-size: 1.1rem; font-weight: 700; color: #F1F3F4; margin-bottom: 10px; line-height: 1.3; flex: 1; }
.blog-card-excerpt { font-size: 13px; color: rgba(212,212,211,0.55); line-height: 1.6; }
.blog-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 16px; }
.blog-card-tag { font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; color: rgba(135,222,255,0.5); background: rgba(135,222,255,0.05); padding: 3px 8px; border-radius: 4px; border: 1px solid rgba(135,222,255,0.1); }
.blog-card a { text-decoration: none; color: inherit; }

/* ===== BLOG POST ===== */
.blog-post-hero {
  position: relative; height: 60svh; min-height: 400px;
  overflow: hidden;
  margin-bottom: 0;
  margin-top: 86px;
}
.blog-post-hero img { width: 100%; height: 100%; object-fit: cover; }
.blog-post-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, rgba(3,8,16,1) 100%);
}
.blog-post-header {
  max-width: 800px; margin: 0 auto;
  padding: 0 5vw 64px;
  position: relative;
  margin-top: -160px; z-index: 2;
}
.blog-post-header-no-hero {
  max-width: 800px; margin: 0 auto;
  padding: 0 5vw 64px;
  margin-top: 140px;
}

/* Single-column reading layout (no TOC) */
.prose-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 5vw 120px;
}

.prose {
  max-width: 720px; font-size: 1.05rem; line-height: 1.9; color: rgba(212,212,211,0.8);
}
.prose h1, .prose h2, .prose h3 { color: #F1F3F4; margin: 2.5em 0 0.8em; font-family: var(--font-display); }
.prose h2 { font-size: 1.8rem; }
.prose h3 { font-size: 1.3rem; }
.prose p { margin-bottom: 1.6em; }
.prose a { color: #87DEFF; text-decoration: none; border-bottom: 1px solid rgba(135,222,255,0.3); transition: border-color 0.2s; }
.prose a:hover { border-bottom-color: #87DEFF; }
.prose strong { color: #F1F3F4; }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 2px solid #2EB85C; padding-left: 1.5em;
  margin: 2em 0; color: #87DEFF; font-style: italic;
  font-size: 1.1em;
}
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.5em; }
.prose li { margin-bottom: 0.6em; }
.prose img { width: 100%; border-radius: 16px; margin: 2em 0; border: 1px solid rgba(135,222,255,0.08); }
.prose code { font-family: var(--font-mono); font-size: 0.88em; color: #87DEFF; background: rgba(135,222,255,0.06); padding: 2px 6px; border-radius: 4px; }
.prose hr { border: none; border-top: 1px solid rgba(135,222,255,0.08); margin: 2.5em 0; }

/* ===== POST FOOTER NAV ===== */
.post-footer-nav {
  max-width: 760px; margin: 0 auto; padding: 0 5vw 80px;
}
.post-footer-nav-inner {
  padding-top: 32px;
  border-top: 1px solid rgba(135,222,255,0.07);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}

/* ===== 404 PAGE ===== */
.not-found {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 60vh;
  padding: 120px 5vw;
  text-align: center;
}
.not-found h1 { font-size: clamp(4rem, 10vw, 8rem); color: rgba(135,222,255,0.15); margin-bottom: 16px; }
.not-found p { color: rgba(212,212,211,0.5); font-size: 1.1rem; margin-bottom: 32px; }
.btn-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  background: rgba(46,184,92,0.1); border: 1px solid rgba(46,184,92,0.3);
  border-radius: 40px; color: #2EB85C; text-decoration: none;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  transition: all 0.3s;
}
.btn-back:hover { background: rgba(46,184,92,0.2); box-shadow: 0 0 24px rgba(46,184,92,0.3); }
