/* ============================================================
   PORTFOLIO — style.css
   Minimal monochrome with a single muted-green accent.
   Edit variables at the top to retheme everything.
   ============================================================ */

:root {
  --bg:        #F8F8F6;
  --text:      #1A1A1A;
  --muted:     #6A6A6A;
  --faint:     #E2E2DE;
  --accent:    #4A6741;        /* muted terminal green */
  --accent-lt: #EDF2EC;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  --max-w:     720px;
  --pad:       clamp(1.25rem, 5vw, 2.5rem);
}

/* ── 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;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.2rem, 6vw, 3.5rem); margin-bottom: 1.2rem; }
h2 { font-size: 1.1rem; margin-bottom: 2rem; }
h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
p  { margin-bottom: 1rem; }

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* ── CURSOR ── */
.cursor { color: var(--accent); }
.cursor.blink { animation: blink 1.1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* ── NAV ── */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.8rem 0 1.5rem;
  border-bottom: 1px solid var(--faint);
  margin-bottom: 4rem;
}
.nav-name {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.05em;
}
.nav-links { display: flex; gap: 1.8rem; }
.nav-links a {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ── HERO ── */
header {
  padding: 3rem 0 3.5rem;
}
.hero-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.75;
  margin-bottom: 2rem;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── TAGS ── */
.hero-tags span,
.card-tags span {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-lt);
  border: 1px solid #c5d9c2;
  padding: 0.2rem 0.65rem;
  border-radius: 2px;
  letter-spacing: 0.03em;
}

/* ── DIVIDER ── */
.divider {
  height: 1px;
  background: var(--faint);
  margin: 3.5rem 0;
}

/* ── SECTION LABEL ── */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
  font-weight: 400;
}

/* ── PROJECT CARDS ── */
.card-grid {
  display: grid;
  gap: 1.5rem;
}
.card {
  border: 1px solid var(--faint);
  padding: 1.6rem;
  border-radius: 3px;
  transition: border-color 0.2s;
}
.card:hover { border-color: #c0c0bb; }
.card-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-bottom: 0.6rem;
  text-transform: uppercase;
}
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { font-size: 0.93rem; color: var(--muted); margin: 0.6rem 0 1rem; }
.card-tags { margin-bottom: 1rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.read-more {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* ── ARTICLE LIST ── */
.article-list { display: flex; flex-direction: column; gap: 0; }

.article-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--faint);
}
.article-row:first-child { border-top: 1px solid var(--faint); }
.article-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.25rem;
  letter-spacing: 0.02em;
}
.article-title {
  font-family: var(--font-mono);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  display: block;
  margin-bottom: 0.5rem;
}
.article-title:hover { color: var(--accent); text-decoration: none; }
.article-excerpt { font-size: 0.88rem; color: var(--muted); margin-bottom: 0.7rem; }

/* ── CONTACT ── */
#contact p { color: var(--muted); max-width: 480px; }
.contact-links {
  display: flex;
  gap: 2rem;
  margin-top: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

/* ── FOOTER ── */
footer {
  padding: 2.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  border-top: 1px solid var(--faint);
  margin-top: 3rem;
}

/* ── ARTICLE / PROJECT PAGE STYLES ── */
.page-header { padding: 3rem 0 2rem; }
.page-header .back {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  display: block;
  margin-bottom: 2rem;
}
.page-header .back:hover { color: var(--text); }
.page-header h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.page-meta {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 1rem 0 0.5rem;
  letter-spacing: 0.04em;
}

/* ── PROSE (for article/project pages) ── */
.prose { padding: 1rem 0 4rem; }
.prose h2 {
  font-size: 1.15rem;
  margin: 2.5rem 0 0.8rem;
  font-weight: 600;
}
.prose h3 { margin: 1.8rem 0 0.5rem; }
.prose p { color: #333; line-height: 1.8; margin-bottom: 1.2rem; }
.prose ul, .prose ol {
  padding-left: 1.4rem;
  margin-bottom: 1.2rem;
  color: #333;
}
.prose li { margin-bottom: 0.4rem; }

/* Code block */
.prose pre {
  background: #1A1A1A;
  color: #E8E8E2;
  padding: 1.2rem 1.4rem;
  border-radius: 3px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.83rem;
  line-height: 1.6;
}
.prose code {
  background: var(--faint);
  padding: 0.15em 0.4em;
  border-radius: 2px;
  font-size: 0.85em;
}
.prose pre code { background: none; padding: 0; font-size: inherit; }

/* Math block */
.math-block {
  background: var(--accent-lt);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.4rem;
  margin: 1.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  overflow-x: auto;
}

/* Image in prose */
.prose img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--faint);
  border-radius: 3px;
  margin: 1.5rem 0;
  display: block;
}
.img-caption {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  margin-top: -1rem;
  margin-bottom: 1.5rem;
}

/* Video embed */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--faint);
  border-radius: 3px;
}
.video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  .article-row { grid-template-columns: 1fr; gap: 0.3rem; }
  .article-date { padding-top: 0; }
  .nav-links { gap: 1rem; }
  .contact-links { flex-direction: column; gap: 0.8rem; }
}
