:root {
  --bg: #f8f6f2;
  --paper: #fffdf9;

  --text: #1f1f1f;
  --muted: #6f6a63;

  --line: #e7e1d8;
  --accent: #7f1d1d;

  --max-width: 960px;
  --post-body-width: 700px;

  --shadow:
    0 2px 10px rgba(0,0,0,0.03),
    0 12px 40px rgba(0,0,0,0.04);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  margin: 0;

  background: var(--bg);
  color: var(--text);

  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  line-height: 1.75;

  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ======================
   Layout
====================== */

.container {
  width: min(var(--max-width), 92%);
  margin: 0 auto;
}

/* ======================
   Header
====================== */

.site-header {
  position: sticky;
  top: 0;

  backdrop-filter: blur(12px);
  background: rgba(248,246,242,0.88);

  border-bottom: 1px solid var(--line);

  z-index: 100;
}

.nav {
  display: flex;

  align-items: center;
  justify-content: space-between;

  padding: 1rem 0;
}

.brand {
  text-decoration: none;

  color: var(--text);

  font-size: 1rem;
  font-weight: 700;

  letter-spacing: -0.03em;
}

nav a {
  margin-left: 1.5rem;

  text-decoration: none;

  color: var(--muted);

  font-size: 0.95rem;

  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent);
}

/* ======================
   Hero
====================== */

.hero {
  padding-top: 5rem;
  padding-bottom: 4rem;

  border-bottom: 1px solid var(--line);
}

.eyebrow {
  color: var(--accent);

  text-transform: uppercase;
  letter-spacing: 0.08em;

  font-size: 0.78rem;
  font-weight: 700;

  margin-bottom: 1rem;
}

.home-hero h1 {
  margin: 0;

  max-width: 920px;

  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.lede {
  margin-top: 1.75rem;

  max-width: 38rem;

  color: var(--muted);

  font-size: 1.25rem;
}

/* ======================
   Posts list
====================== */

.post-list {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.post-card {
  background: var(--paper);

  border: 1px solid var(--line);
  border-radius: 24px;

  padding: 2rem;

  margin-bottom: 1.5rem;

  box-shadow: var(--shadow);

  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.post-card:hover {
  transform: translateY(-2px);

  box-shadow:
    0 4px 12px rgba(0,0,0,0.05),
    0 20px 50px rgba(0,0,0,0.06);
}

.post-card h2 {
  margin-top: 0.2rem;
  margin-bottom: 0.7rem;

  font-size: 2rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-date {
  color: var(--muted);

  font-size: 0.85rem;

  letter-spacing: 0.02em;
}

.subtitle {
  color: var(--muted);

  font-size: 1.05rem;
}

/* ======================
   Tags
====================== */

.tags {
  display: flex;

  flex-wrap: wrap;
  gap: 0.5rem;

  margin-top: 1rem;
}

.tags a {
  border: 1px solid var(--line);
  border-radius: 999px;

  padding: 0.3rem 0.7rem;

  font-size: 0.8rem;

  color: var(--muted);
  background: #fcfaf7;

  text-decoration: none;
}

.tags a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.big-tags {
  margin-top: 2rem;
}

/* ======================
   Post page
====================== */

.post {
  max-width: 1100px;

  margin: 0 auto;

  padding-top: 4rem;
  padding-bottom: 5rem;
}

.post-header {
  max-width: 920px;

  margin: 0 auto 3rem auto;
  padding-bottom: 2rem;

  border-bottom: 1px solid var(--line);
}

.post-header h1 {
  margin-top: 0.4rem;
  margin-bottom: 0.8rem;

  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.post-body {
  position: relative;

  max-width: var(--post-body-width);

  margin: 0 auto;

  font-family:
    Charter,
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    Georgia,
    serif;

  font-size: 1.15rem;
  line-height: 1.85;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.post-body h2 {
  margin-top: 3rem;
  margin-bottom: 1rem;

  font-size: 2rem;

  letter-spacing: -0.04em;
}

.post-body h3 {
  margin-top: 2rem;
}

.post-body a {
  color: var(--accent);
}

.post-body blockquote {
  margin-left: 2rem;

  padding-left: 0;

  border-left: none;

  color: var(--muted);

  font-style: italic;
}

.post-body code,
.post-body pre {
  font-family:
    "SFMono-Regular",
    Consolas,
    monospace;
}

.post-body code {
  background: #f1ece6;

  border-radius: 6px;

  padding: 0.15rem 0.4rem;

  font-size: 0.9em;
}

.post-body pre {
  overflow-x: auto;

  padding: 1rem;

  border-radius: 12px;

  background: #f3eee7;
}

.post-body img {
  width: 100%;

  border-radius: 18px;

  margin: 2rem 0;
}


.pinned-post::before {
  content: "Pinned";
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7a6845;
}
/* ======================
   Tufte-style elements
====================== */

.sidenote,
.marginnote {
  float: right;
  clear: right;

  width: 18rem;

  margin-right: -22rem;

  margin-top: 0.3rem;
  margin-bottom: 1rem;

  font-size: 0.85rem;
  line-height: 1.45;

  color: var(--muted);
}

.sidenote-number {
  vertical-align: super;

  font-size: 0.7em;

  color: var(--accent);

  cursor: pointer;
}

.post-body .fullwidth {
  width: 140%;

  max-width: none;

  margin-left: -20%;
}

.epigraph {
  max-width: 36rem;

  margin: 3rem auto;

  color: var(--muted);

  font-style: italic;
  text-align: center;
}

/* Optional: comment out if too decorative */
.post-body > p:first-of-type::first-letter {
  float: left;

  font-size: 4.5rem;
  line-height: 0.9;

  padding-right: 0.08em;

  font-weight: 600;
}

/* ======================
   About / generic pages
====================== */

.page {
  padding-top: 4rem;
  padding-bottom: 5rem;
}

.page h1 {
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.05em;
}

/* ======================
   Footer
====================== */

.site-footer {
  border-top: 1px solid var(--line);

  padding: 2rem 0;

  color: var(--muted);

  font-size: 0.9rem;
}

/* ======================
   Tablet / sidenote fallback
====================== */

@media (max-width: 1200px) {
  .sidenote,
  .marginnote {
    float: none;

    width: auto;

    margin-right: 0;

    display: block;

    padding-left: 1rem;

    border-left: 3px solid var(--line);
  }

  .post-body .fullwidth {
    width: 100%;
    margin-left: 0;
  }
}

/* ======================
   Mobile
====================== */

@media (max-width: 640px) {
  html {
    font-size: 17px;
  }

  .nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.7rem;
  }

  nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  .hero {
    padding-top: 3rem;
  }

  .home-hero h1 {
    font-size: clamp(2.4rem, 12vw, 3.6rem);
  }

  .lede {
    font-size: 1.1rem;
  }

  .post-card {
    padding: 1.4rem;
  }

  .post-card h2 {
    font-size: 1.6rem;
  }

  .post {
    padding-top: 2.5rem;
  }

  .post-header {
    margin-bottom: 2rem;
  }

  .post-header h1 {
    font-size: clamp(2.2rem, 12vw, 3.4rem);
  }

  .post-body {
    font-size: 1.05rem;
  }

  .post-body blockquote {
    margin-left: 1rem;
  }

  .post-body > p:first-of-type::first-letter {
    font-size: 3.5rem;
  }
}
