/* ─── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

/* ─── Tokens ──────────────────────────────────────────────── */
:root {
  --bg:      #F0EAE0;
  --bg-2:    #E5DDD1;
  --ink:     #1C1917;
  --ink-2:   #6B635A;
  --ink-3:   #7A726B;
  --accent:  #C4622D;
  --border:  #D5CCC0;

  --f-display: 'Fraunces', Georgia, serif;
  --f-body:    'DM Sans', system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', monospace;

  --w:   740px;
  --pad: clamp(1.25rem, 5vw, 2.5rem);

  color-scheme: light;
}

/* ─── Dark mode ───────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:     #1B1512;
    --bg-2:   #251F1A;
    --ink:    #EAE0D4;
    --ink-2:  #A89B8E;
    --ink-3:  #8A7D72;
    --accent: #D4723D;
    --border: #3D3028;
    color-scheme: dark;
  }
}

[data-theme="dark"] {
  --bg:     #1B1512;
  --bg-2:   #251F1A;
  --ink:    #EAE0D4;
  --ink-2:  #A89B8E;
  --ink-3:  #8A7D72;
  --accent: #D4723D;
  --border: #3D3028;
  color-scheme: dark;
}

/* ─── Base ────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1rem;
  line-height: 1.7;
  transition: background-color .2s, color .2s;
}
a { color: inherit; }

/* ─── Wrapper ─────────────────────────────────────────────── */
.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ─── Header ──────────────────────────────────────────────── */
.site-header {
  padding: 2.25rem 0 2rem;
}
.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.site-name {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  transition: color .2s;
}
.site-name:hover { color: var(--accent); }

.nav { display: flex; gap: 1.75rem; }
.nav a {
  font-family: var(--f-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  text-decoration: none;
  color: var(--ink-2);
  transition: color .2s;
}
.nav a:hover,
.nav a[aria-current] { color: var(--ink); }

.theme-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  transition: color .2s;
  line-height: 1;
}
.theme-toggle:hover { color: var(--ink); }

/* ─── Rule ────────────────────────────────────────────────── */
hr { border: none; border-top: 1px solid var(--border); }

/* ─── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 2.5rem 0 2rem;
}
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.035em;
  line-height: 1.18;
}


/* ─── Post List ───────────────────────────────────────────── */
.post {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0 2rem;
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--border);
}

.post-date {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding-top: .3rem;
  line-height: 1;
}
.post-title {
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  line-height: 1.3;
  margin-bottom: .5rem;
}
.post-title a {
  text-decoration: none;
  color: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: background-size .35s ease, color .2s;
}
.post-title a:hover {
  background-size: 100% 1px;
  color: var(--accent);
}
.post-excerpt {
  font-size: .88rem;
  color: var(--ink-2);
  line-height: 1.65;
  margin-bottom: .65rem;
}
.read-more {
  font-family: var(--f-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--accent);
  text-decoration: none;
  transition: opacity .2s;
}
.read-more:hover { opacity: .65; }

/* ─── Footer ──────────────────────────────────────────────── */
.site-footer { padding: 2.5rem 0 3rem; }
.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.footer-copy,
.footer-links a {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  transition: color .2s;
}
.footer-links { display: flex; gap: 1.25rem; align-items: center; }
.footer-links a:hover { color: var(--accent); }
.footer-icon { display: inline-flex; align-items: center; color: var(--ink-3); transition: color .2s; }

/* ─── Progress Bar (post pages) ───────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  background: var(--accent);
  width: 0%;
  transition: width .1s linear;
  z-index: 100;
}

/* ─── Article Header ──────────────────────────────────────── */
.article-header {
  padding: 1.25rem 0 1.25rem;
}
.article-meta {
  margin-top: .5rem;
}
.article-meta span {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.article-title {
  font-family: var(--f-display);
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  font-weight: 500;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: .4rem;
}

/* ─── Article Body ────────────────────────────────────────── */
.article-body {
  padding-top: 1.75rem;
  padding-bottom: 5rem;
}
.article-body > * + * { margin-top: 1.4rem; }
.article-body p { font-size: 1.05rem; line-height: 1.78; }
.article-body h2 {
  font-family: var(--f-display);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-top: 2.75rem !important;
}
.article-body h3 {
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-top: 2rem !important;
}
.article-body blockquote {
  border-left: 2px solid var(--accent);
  padding-left: 1.25rem;
  color: var(--ink-2);
  font-style: italic;
}
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body code {
  font-family: var(--f-mono);
  font-size: .84em;
  background: var(--bg-2);
  padding: .1em .35em;
  border-radius: 3px;
}
.article-body pre {
  background: #131110;
  border-radius: 6px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0 !important;
}
.article-body pre code {
  background: none;
  color: #E8DDD2;
  font-size: .85rem;
  padding: 0;
}
.article-body ul,
.article-body ol { padding-left: 1.5rem; }
.article-body li { margin-bottom: .35rem; font-size: 1.05rem; line-height: 1.75; }

/* ─── Back Link ───────────────────────────────────────────── */
.back {
  font-family: var(--f-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin: 0;
  transition: color .2s;
}
.back:hover { color: var(--accent); }

/* ─── About Page ──────────────────────────────────────────── */
.about-content {
  padding: 3.5rem 0 5rem;
  max-width: 580px;
}
.about-content h1 {
  font-family: var(--f-display);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 2rem;
}
.about-content p {
  font-size: 1.05rem;
  line-height: 1.78;
  margin-bottom: 1.4rem;
  color: var(--ink);
}
.about-content p:last-of-type { margin-bottom: 0; }
.about-links {
  margin-top: 2.5rem;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.about-links a {
  font-family: var(--f-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: .2rem;
  transition: color .2s, border-color .2s;
}
.about-links a:hover { color: var(--accent); border-color: var(--accent); }


/* ─── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  font-family: var(--f-body);
  font-size: .875rem;
}
.pagination a {
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: .1rem;
  transition: color .2s, border-color .2s;
}
.pagination a:hover { color: var(--accent); border-color: var(--accent); }
.pagination-current {
  color: var(--accent);
  font-weight: 600;
}
.pagination-prev  { margin-right: auto; }
.pagination-next  { margin-left: auto; }

/* ─── Mobile ──────────────────────────────────────────────── */
@media (max-width: 520px) {
  .post { grid-template-columns: 1fr; gap: .3rem 0; }
  .post-date { padding-top: 0; }
}
