/* ── Fonts ─────────────────────────────────────────────────────────────────── */
/* Already loaded via <link> in base.html */

/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:        #1D9E75;
  --green-light:  #9FE1CB;
  --green-dark:   #0F6E56;
  --text:         #111110;      /* near-black for headings & body */
  --text-muted:   #3a3a37;      /* dark gray for excerpts & secondary text */
  --text-faint:   #5a5a56;      /* medium gray for dates, tags, meta */
  --border:       rgba(0,0,0,0.10);
  --border-mid:   rgba(0,0,0,0.18);
  --bg:           #faf9f6;
  --surface:      #ffffff;
  --radius:       4px;
  --mono:         'IBM Plex Mono', monospace;
  --serif:        'Source Serif 4', Georgia, serif;
  --display:      'Playfair Display', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text:       #e8e6df;
    --text-muted: #b8b6af;
    --text-faint: #888880;
    --border:     rgba(255,255,255,0.10);
    --border-mid: rgba(255,255,255,0.18);
    --bg:         #171715;
    --surface:    #1f1f1c;
  }
}

html { font-size: 16px; }

body {
  font-family: var(--serif);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ── Layout ────────────────────────────────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  padding: 1.5rem 0;
  border-bottom: 1.5px solid var(--border-mid);
  margin-bottom: 3rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
}
.logo-x { color: var(--green); font-size: 1.4em; font-weight: 700; line-height: 1; }
.logo-rest { color: var(--text-faint); }

.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--green); }

/* ── Hero ──────────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3.5rem;
  padding-bottom: 3.5rem;
  border-bottom: 0.5px solid var(--border);
}

.hero-thumb {
  border-radius: var(--radius);
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background-color: #1a1a18;
}

.hero-tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-light);
  background: rgba(0,0,0,0.40);
  padding: 3px 9px;
  border-radius: 2px;
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
}

.hero-meta {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.hero-title {
  font-family: var(--display);
  font-size: 1.9rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--text);
}
.hero-title a { color: var(--text); }
.hero-title a:hover { color: var(--green); }

.hero-excerpt {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-muted);
}

.hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Tags ──────────────────────────────────────────────────────────────────── */
.tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dark);
  background: rgba(29,158,117,0.10);
  padding: 2px 8px;
  border-radius: 2px;
}

/* ── Read link ─────────────────────────────────────────────────────────────── */
.read-link {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: gap 0.15s;
}
.read-link:hover { gap: 10px; }

/* ── Section label ─────────────────────────────────────────────────────────── */
.section-label {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 0.5px;
  background: var(--border);
}

/* ── Posts grid ────────────────────────────────────────────────────────────── */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.post-card {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s;
}
.post-card:hover { border-color: var(--border-mid); }

.post-thumb {
  display: block;
  aspect-ratio: 16 / 9;
  background-color: #1a1a18;
}

.post-body { padding: 1rem 1rem 0.875rem; }

.post-tag {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin-bottom: 0.35rem;
}

.post-title {
  font-family: var(--display);
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.post-title a { color: var(--text); }
.post-title a:hover { color: var(--green); }

.post-excerpt {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

.post-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 0.5px solid var(--border);
  padding-top: 0.625rem;
}

.post-date, .post-readtime {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
}

/* ── Pagination ────────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2rem 0 3rem;
  border-top: 0.5px solid var(--border);
}

.page-btn {
  font-family: var(--mono);
  font-size: 11px;
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
  transition: border-color 0.15s, color 0.15s;
}
.page-btn:hover { border-color: var(--border-mid); color: var(--text); }
.page-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ── Single post ───────────────────────────────────────────────────────────── */
.post-full { max-width: 800px; margin: 0 auto; padding-bottom: 4rem; }

.post-header { margin-bottom: 2.5rem; }
.post-header-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1rem; }

.post-full-title {
  font-family: var(--display);
  font-size: 2.4rem;
  line-height: 1.15;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.post-header-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.meta-sep { color: var(--border-mid); }

.post-full-excerpt {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.post-hero-thumb {
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: var(--radius);
  background-color: #1a1a18;
}

/* ── Post body typography ──────────────────────────────────────────────────── */
.post-content { font-size: 1.0625rem; line-height: 1.85; color: var(--text); }

.post-content h2 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 0.75rem;
  color: var(--text);
}

.post-content h3 {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.5rem;
  color: var(--text);
}

.post-content p { margin-bottom: 1.25rem; color: var(--text-muted); }

.post-content code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: rgba(29,158,117,0.08);
  color: var(--green-dark);
  padding: 1px 5px;
  border-radius: 2px;
}

.post-content pre {
  font-family: var(--mono);
  font-size: 0.875rem;
  background: #1a1a18;
  color: #e8e6df;
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.65;
}
.post-content pre code { background: none; color: inherit; padding: 0; }

.post-content blockquote {
  border-left: 3px solid var(--green);
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  color: var(--text-muted);
  font-style: italic;
}

.post-content ul, .post-content ol {
  margin: 0 0 1.25rem 1.5rem;
}
.post-content li { margin-bottom: 0.35rem; color: var(--text-muted); }

.post-content a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }

.post-content img { max-width: 100%; height: auto; display: block; }

.post-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 0.5px solid var(--border);
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer {
  border-top: 0.5px solid var(--border);
  padding: 2rem 0;
  margin-top: 2rem;
}
.site-footer .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-footer p {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .hero { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .posts-grid { grid-template-columns: 1fr; }
  .hero-title { font-size: 1.5rem; }
  .post-full-title { font-size: 1.75rem; }
}
/* ── About page ────────────────────────────────────────────────────────────── */
.about {
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.about-header {
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.about-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 20%;
  margin-bottom: 1.25rem;
  border: 2px solid var(--border-mid);
}

.about-social {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.about-social a {
  color: var(--text-faint);
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.about-social a:hover { color: var(--green); }
.about-social svg { width: 20px; height: 20px; }

.about-kicker {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.about-name {
  font-family: var(--display);
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.about-sub {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── Now block ─────────────────────────────────────────────────────────────── */
.about-now {
  border-left: 2px solid var(--green);
  padding: 0.75rem 1.25rem;
  margin-bottom: 2.5rem;
  border-radius: 0;
}

.about-now-label {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green);
  margin-bottom: 0.4rem;
}

.about-now p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── Two-col sections ──────────────────────────────────────────────────────── */
.about-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.about-section {
  border: 0.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.about-section-title {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-faint);
  margin-bottom: 0.75rem;
}

.about-section p {
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ── CTA ───────────────────────────────────────────────────────────────────── */
.about-cta {
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  margin-bottom: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.about-cta p {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
}

/* ── Contact links ─────────────────────────────────────────────────────────── */
.about-contact {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
  .about-name { font-size: 2.25rem; }
  .about-sections { grid-template-columns: 1fr; }
}
/* ── CV page ───────────────────────────────────────────────────────────────── */
.cv-page {
  max-width: 800px;
  margin: 0 auto;
  padding-bottom: 4rem;
}

.cv-page-header {
  border-bottom: 0.5px solid var(--border);
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
}

.cv-kicker {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  margin-bottom: 1rem;
}

.cv-name {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--text);
}

/* ── CV body — override post-content defaults where needed ─────────────────── */
.cv-body h2 {
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.4rem;
  border-bottom: 0.5px solid var(--border);
  font-size: 0.875rem;
  font-family: var(--mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}

.cv-body h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

/* role title + period lines */
.cv-body h3 + p {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.cv-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 1rem 0 1.5rem;
}

.cv-body th {
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  text-align: left;
  padding: 0 0.75rem 0.5rem 0;
  border-bottom: 0.5px solid var(--border);
}

.cv-body td {
  padding: 0.5rem 0.75rem 0.5rem 0;
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}

.cv-body tr:last-child td { border-bottom: none; }

@media (max-width: 540px) {
  .cv-name { font-size: 2.25rem; }
}
