@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=JetBrains+Mono:wght@400;600&family=Manrope:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #f2ead3;
  --card: #f7f0de;
  --text0: #3b2f20;
  --text1: #5f4d36;
  --text2: #867359;
  --border: #cbb692;
  --shadow: #3b2f20;
  --amber: #c2a676;
  --amber-deep: #8d7248;
  --grid-line: rgba(59, 47, 32, 0.07);

  --serif: "Fraunces", "Iowan Old Style", "Times New Roman", serif;
  --sans: "Manrope", "Avenir Next", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Menlo, Monaco, monospace;

  --content-width: 680px;
  --site-width: 1100px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  color: var(--text0);
  font-family: var(--sans);
  line-height: 1.55;
  background-color: var(--bg);
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 30px 30px;
}

img,
svg,
video {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
  text-underline-offset: 0.15em;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

::selection {
  color: var(--text0);
  background: rgba(194, 166, 118, 0.45);
}

.blog-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: transparent;
  border-bottom: 3px solid var(--border);
}

.blog-nav-inner {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: baseline;
}

.blog-nav-brand {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.blog-nav-brand .slash {
  color: var(--text2);
  font-weight: 500;
}

.blog-nav-brand .blog-label {
  color: var(--amber-deep);
}

.blog-nav-brand:hover {
  text-decoration: none;
}

.post-list-page {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 2.25rem 1.25rem 4rem;
}

.page-hero {
  margin-bottom: 1.75rem;
  padding: 2.2rem 0 1.5rem;
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 5.8vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.02em;
  color: var(--text0);
}

.page-hero p {
  max-width: 62ch;
  margin-top: 1rem;
  color: var(--text1);
  font-size: 1.13rem;
  line-height: 1.7;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.35rem;
}

.post-card {
  min-height: 100%;
  padding: 1.3rem 1.3rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  background: var(--card);
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.post-card:hover,
.post-card:focus-within {
  transform: translate(-2px, -2px);
  border-color: var(--amber-deep);
  box-shadow: 8px 8px 0 var(--shadow);
}

.post-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-card-title {
  color: var(--text0);
  font-family: var(--serif);
  font-size: clamp(1.55rem, 1.1rem + 1.1vw, 2.15rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.post-card-title a:hover {
  color: var(--amber-deep);
  text-decoration: none;
}

.post-card-excerpt {
  color: var(--text1);
  font-size: 1rem;
  line-height: 1.7;
}

.post-card-link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--amber-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(141, 114, 72, 0.6);
}

.post-card-link::after {
  content: "->";
  transition: transform 120ms ease;
}

.post-card:hover .post-card-link::after,
.post-card:focus-within .post-card-link::after {
  transform: translateX(2px);
}

.post-page {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem 1.25rem 4.5rem;
}

.post-hero {
  margin: 1rem 0 2rem;
  padding: 1.5rem 1.5rem 1.25rem;
  background: linear-gradient(145deg, rgba(194, 166, 118, 0.2), rgba(247, 240, 222, 0.95));
  border: 3px solid var(--border);
  box-shadow: 6px 6px 0 var(--shadow);
}

.post-hero h1 {
  color: var(--text0);
  font-family: var(--serif);
  font-size: clamp(2.3rem, 5.2vw, 4.6rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.post-hero-meta {
  margin-top: 0.95rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  color: var(--text2);
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.article-body > * + * {
  margin-top: 1.2rem;
}

.article-body p {
  color: var(--text1);
  font-size: 18px;
  line-height: 1.75;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin-top: 2.35rem;
  color: var(--text0);
  font-family: var(--serif);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.article-body h2 {
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
}

.article-body h3 {
  font-size: clamp(1.4rem, 2.8vw, 1.85rem);
}

.article-body h4 {
  font-size: clamp(1.2rem, 2.4vw, 1.45rem);
}

.article-body blockquote {
  margin: 2rem 0;
  padding: 0.35rem 0 0.35rem 1.2rem;
  border-left: 4px solid var(--amber-deep);
  color: var(--text1);
  font-family: var(--serif);
  font-style: italic;
}

.article-body blockquote p {
  color: inherit;
}

.article-body a {
  color: var(--amber-deep);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-decoration-color: rgba(141, 114, 72, 0.65);
}

.article-body a:hover {
  color: #6e5636;
  text-decoration-color: currentColor;
}

.article-body strong {
  color: #2f2518;
  font-weight: 700;
}

.article-body :not(pre) > code,
.article-body li > code {
  padding: 0.12em 0.35em;
  color: var(--text0);
  font-family: var(--mono);
  font-size: 0.9em;
  background: rgba(194, 166, 118, 0.2);
  border: 1px solid rgba(141, 114, 72, 0.35);
  border-radius: 0.3rem;
}

.article-body pre {
  margin: 1.6rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  background: #1e1a14;
  color: #f7f1e2;
  border: 2px solid #3a2f22;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.article-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.65;
  white-space: pre;
}

.article-body ul,
.article-body ol {
  padding-left: 1.35rem;
  color: var(--text1);
  font-size: 1.05rem;
  line-height: 1.75;
}

.article-body li + li {
  margin-top: 0.55rem;
}

.article-body hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 2px solid var(--border);
}

.blog-footer {
  max-width: var(--site-width);
  margin: 3.5rem auto 2rem;
  padding: 1.4rem 1.25rem 0;
  text-align: center;
  color: var(--text2);
  font-size: 0.95rem;
  border-top: 3px solid var(--border);
}

.blog-footer a {
  color: var(--amber-deep);
  text-decoration: underline;
}

@media (max-width: 1024px) {
  .post-list-page {
    padding: 1.8rem 1rem 3rem;
  }

  .page-hero {
    padding-top: 1.4rem;
  }

  .posts-grid {
    gap: 1rem;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-card {
    padding: 1.1rem;
  }

  .post-page {
    padding-top: 1.5rem;
  }

  .post-hero {
    padding: 1.25rem;
  }
}

@media (max-width: 768px) {
  .blog-nav-inner {
    padding: 0.85rem 0.9rem;
  }

  .blog-nav-brand {
    font-size: 1.1rem;
  }

  .post-list-page,
  .post-page {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .page-hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .page-hero p {
    font-size: 1rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .post-card-title {
    font-size: clamp(1.4rem, 8.5vw, 1.8rem);
  }

  .post-hero h1 {
    font-size: clamp(2rem, 10vw, 3.1rem);
  }

  .article-body p {
    font-size: 1rem;
    line-height: 1.8;
  }

  .article-body pre {
    padding: 0.9rem;
    border-radius: 8px;
  }

  .blog-footer {
    margin-top: 2.5rem;
    padding-top: 1.1rem;
  }
}
