/* ========== Dark Theme Variables ========== */
:root {
  --bg: #0b0f14;
  --surface: #0e1520;
  --card: #111927;
  --text: #e6eef6;
  --muted: #9fb1c4;
  --border: #1e2a3a;
  --accent: #7dd3fc;   /* sky-300 */
  --accent-2: #a78bfa; /* violet-400 */
  --glow: 0 0 40px rgba(125, 211, 252, .15);
}

/* ========== Base ========== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, rgba(167,139,250,.08), transparent 60%),
              radial-gradient(800px 400px at 110% 10%, rgba(125,211,252,.08), transparent 60%),
              var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  line-height: 1.6;
}

.noise {
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' opacity='0.04'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.7' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
  z-index: 0;
}

.container { width: min(1100px, 92%); margin-inline: auto; position: relative; z-index: 1; }

/* ========== Header & Nav ========== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
  background: linear-gradient(to bottom, rgba(11,15,20,.8), rgba(11,15,20,.2));
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-family: "Playfair Display", serif;
  font-weight: 700; font-size: 1.4rem; letter-spacing: .3px;
  text-decoration: none; color: var(--text);
}
.logo span { color: var(--accent); }
.logo.small { font-size: 1.1rem; }

.top-nav a {
  color: var(--muted); text-decoration: none; margin-left: 1rem; padding: .4rem .6rem;
  border-radius: 10px; border: 1px solid transparent;
}
.top-nav a:hover, .top-nav a.active { color: var(--text); border-color: var(--border); background: rgba(255,255,255,.02); }

/* ========== Hero ========== */
.hero {
  display: grid; gap: 2rem; padding: 3rem 0 2rem;
  grid-template-columns: 1.2fr .8fr;
}
.hero-text h1 {
  font-size: clamp(1.8rem, 2.6vw + 1rem, 3rem);
  line-height: 1.15;
}
.hero-text p { color: var(--muted); margin-top: .6rem; }
.hero-art { border-radius: 20px; overflow: hidden; box-shadow: var(--glow); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ========== Sections ========== */
.section-head { margin: 2rem 0 1rem; }
.section-head h2 { margin: 0 0 .4rem; font-size: 1.4rem; }
.muted { color: var(--muted); }

/* ========== Post Grid ========== */
.post-grid {
  display: grid; gap: 1.6rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.post-card {
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.005));
  border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: rgba(167,139,250,.35);}
.post-image { display: block; position: relative; }
.post-image img { display: block; width: 100%; height: 200px; object-fit: cover; }
.tag {
  position: absolute; bottom: 10px; left: 10px;
  background: rgba(10, 17, 28, .7);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: .25rem .55rem; font-size: .75rem; border-radius: 999px; backdrop-filter: blur(6px);
}
.post-body { padding: 1rem 1rem 1.2rem; }
.post-body h3 { margin: .2rem 0 .5rem; font-size: 1.15rem; line-height: 1.3; }
.post-body h3 a { color: var(--text); text-decoration: none; }
.post-body h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.excerpt { color: var(--muted); margin: 0 0 .8rem; }
.meta { font-size: .85rem; color: var(--muted); }
.read-more {
  display: inline-block; margin-top: .8rem; text-decoration: none;
  color: var(--text); border: 1px solid var(--border); padding: .45rem .7rem; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,.01));
}
.read-more:hover { border-color: rgba(167,139,250,.4); box-shadow: var(--glow); }

/* ========== About Callout ========== */
.callout {
  display: grid; grid-template-columns: 160px 1fr; gap: 1rem;
  align-items: center; padding: 1rem;
  background: linear-gradient(180deg, rgba(167,139,250,.06), rgba(125,211,252,.04));
  border: 1px solid var(--border); border-radius: 18px;
}
.callout img { width: 100%; border-radius: 14px; height: 160px; object-fit: cover; }

/* ========== Footer ========== */
.site-footer { border-top: 1px solid var(--border); margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 1.2rem 0; }

/* ========== Article Page ========== */
.article-header {
  padding: 2.2rem 0 1rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.article-title { font-size: clamp(1.6rem, 2.2vw + 1rem, 2.5rem); margin: .5rem 0 .4rem; }
.article-meta { color: var(--muted); font-size: .95rem; }

.cover {
  border-radius: 18px; overflow: hidden; margin: 1rem 0 1.2rem;
  box-shadow: var(--glow);
}
.cover img { width: 100%; display: block; height: 420px; object-fit: cover; }

.prose {
  font-size: 1.05rem;
  color: var(--text);
  max-width: 76ch;
  margin: 0 auto;
}
.prose p { margin: 0 0 1em; }
.prose h2, .prose h3 { margin: 1.6em 0 .6em; line-height: 1.25; }
.prose h2 { font-size: 1.4rem; }
.prose h3 { font-size: 1.2rem; }
.prose ul, .prose ol { padding-left: 1.2rem; margin: .6rem 0 1rem; }
.prose li { margin: .3rem 0; }
.prose blockquote {
  margin: 1rem 0; padding: .8rem 1rem;
  border-left: 3px solid var(--accent); background: rgba(125,211,252,.06); color: var(--text);
  border-radius: 12px;
}
.fig {
  margin: 1rem 0 1.2rem; text-align: center; color: var(--muted); font-size: .9rem;
}
.fig img { width: 100%; border-radius: 14px; border: 1px solid var(--border); }

/* ========== Responsive ========== */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .top-nav { display: none; }
  .post-grid { grid-template-columns: 1fr; }
  .callout { grid-template-columns: 1fr; text-align: left; }
  .cover img { height: 240px; }
}
