/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
  --bg:        #0d0f14;
  --bg-card:   #13161e;
  --bg-hover:  #1a1e29;
  --border:    #1f2535;
  --accent:    #5afa8e;   /* terminal green — the signature */
  --accent-dim:#2a6644;
  --text:      #e2e6f0;
  --text-muted:#7a8299;
  --text-faint:#3d4459;
  --tag-bg:    #161c2e;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

  --radius: 6px;
  --max-w:  1080px;
  --gap:    clamp(1rem, 3vw, 2rem);
}

/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img, video { max-width: 100%; display: block; }

/* ─── LAYOUT ─────────────────────────────────────────────── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--gap); }
.section    { padding: 4rem 0; }

/* ─── NAV ────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  border-bottom: 1px solid var(--border);
  background: rgba(13,15,20,.85);
  backdrop-filter: blur(12px);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.nav-logo {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -.02em;
  color: var(--text);
}
.nav-logo span { color: var(--accent); }
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  font-size: .875rem;
  color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* ─── HERO ───────────────────────────────────────────────── */
.hero {
  padding: clamp(4rem, 10vw, 8rem) 0 clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
/* subtle grid texture — the one aesthetic risk */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .35;
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 680px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: .5rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .5; transform: scale(.8); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 500px;
}

/* ─── SECTION LABEL ──────────────────────────────────────── */
.section-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}

/* ─── TAGS ───────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 3px;
  background: var(--tag-bg);
  color: var(--accent);
  border: 1px solid var(--accent-dim);
}

/* ─── POST CARDS ─────────────────────────────────────────── */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: border-color .2s, background .2s, transform .2s;
}
.post-card:hover {
  border-color: var(--accent-dim);
  background: var(--bg-hover);
  transform: translateY(-2px);
}
.post-card--featured {
  border-color: var(--accent-dim);
  padding: 2.5rem;
  margin-bottom: 0;
}
.post-card__meta {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem;
}
.post-date {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-faint);
}
.post-card__title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: .75rem;
}
.post-card--featured .post-card__title { font-size: clamp(1.5rem, 3vw, 2rem); }
.post-card__title a { transition: color .2s; }
.post-card__title a:hover { color: var(--accent); }
.post-card__excerpt { color: var(--text-muted); margin-bottom: 1.25rem; }

.btn-read {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .8rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  padding: .5rem 1.1rem;
  border-radius: 3px;
  transition: opacity .2s;
}
.btn-read:hover { opacity: .85; }

.post-link {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  transition: letter-spacing .2s;
}
.post-link:hover { letter-spacing: .04em; }

/* ─── POST GRID ──────────────────────────────────────────── */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

/* ─── FOOTER ─────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2.5rem 0;
  margin-top: 2rem;
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 1rem;
}
.footer-inner p { font-size: .8rem; color: var(--text-faint); }

/* ─── ARTICLE PAGE ───────────────────────────────────────── */
.article-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.article-header .tag { margin-bottom: 1rem; display: inline-block; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}
.article-meta {
  display: flex; align-items: center; gap: 1.5rem;
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--text-muted);
}

/* ─── ARTICLE BODY ───────────────────────────────────────── */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 3rem var(--gap);
}
.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin: 2.5rem 0 .75rem;
  color: var(--text);
}
.article-body h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 2rem 0 .5rem;
  color: var(--text);
}
.article-body p { color: var(--text-muted); margin-bottom: 1.25rem; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol { padding-left: 1.5rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.article-body li { margin-bottom: .4rem; }

/* ─── CODE BLOCKS ────────────────────────────────────────── */
.article-body pre {
  background: #090b10;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  position: relative;
}
.article-body pre code {
  font-family: var(--font-mono);
  font-size: .875rem;
  color: #b8c4e0;
  line-height: 1.65;
}
.article-body code:not(pre code) {
  font-family: var(--font-mono);
  font-size: .85em;
  background: #0e1118;
  border: 1px solid var(--border);
  padding: .15em .4em;
  border-radius: 3px;
  color: var(--accent);
}

/* Copy button on code blocks */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute; top: .75rem; right: .75rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: .25rem .6rem;
  border-radius: 3px;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.copy-btn:hover { color: var(--accent); border-color: var(--accent-dim); }

/* ─── MEDIA EMBEDS ───────────────────────────────────────── */
.article-body .media-block {
  margin: 2rem 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}
.article-body .media-block img {
  width: 100%;
  object-fit: cover;
}
.article-body .media-block video {
  width: 100%;
  display: block;
  background: #000;
}
.media-caption {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-faint);
  padding: .6rem 1rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}
/* Responsive video embed (YouTube/Vimeo) */
.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin: 2rem 0;
}
.video-embed iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: 0;
}

/* ─── ARCHIVE / ABOUT ────────────────────────────────────── */
.page-header {
  padding: 4rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}
.archive-list { list-style: none; padding: 0; }
.archive-item {
  display: flex; align-items: baseline;
  gap: 1rem;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  transition: padding-left .2s;
}
.archive-item:hover { padding-left: .5rem; }
.archive-item time {
  font-family: var(--font-mono);
  font-size: .75rem;
  color: var(--text-faint);
  min-width: 90px;
}
.archive-item a { font-size: 1rem; transition: color .2s; }
.archive-item a:hover { color: var(--accent); }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .nav-links { gap: 1.25rem; }
  .post-card--featured { padding: 1.5rem; }
  .footer-inner { flex-direction: column; }
  .post-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
