:root {
  --paper: #f7f4ed;
  --paper-shade: #efeadd;
  --ink: #2b2520;
  --muted: #766b5e;
  --accent: #7a3e3e;
  --accent-hover: #5e2d2d;
  --gold: #a68b4b;
  --border: #ddd6c6;
  --code-bg: #f3efe6;
  --code-border: #e7e0d1;
  --shadow: rgba(43, 37, 32, 0.06);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1915;
    --paper-shade: #242019;
    --ink: #e8e2d8;
    --muted: #9e9486;
    --accent: #c9a96e;
    --accent-hover: #ddb97d;
    --gold: #c9a96e;
    --border: #3b342c;
    --code-bg: #242019;
    --code-border: #332d26;
    --shadow: rgba(0, 0, 0, 0.2);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper) radial-gradient(ellipse at top, rgba(255, 255, 255, 0.6), transparent 60%);
  background-attachment: fixed;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
}

@media (prefers-color-scheme: dark) {
  body {
    background: var(--paper) radial-gradient(ellipse at top, rgba(255, 255, 255, 0.04), transparent 60%);
  }
}

::selection {
  background: var(--gold);
  color: var(--paper);
}

header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  position: relative;
}

header::after {
  content: "❧";
  position: absolute;
  left: 50%;
  bottom: -0.7em;
  transform: translateX(-50%);
  padding: 0 0.75rem;
  background: var(--paper);
  color: var(--gold);
  font-size: 1.15rem;
  line-height: 1;
}

nav a {
  display: inline-block;
  margin-right: 1.75rem;
  color: var(--ink);
  text-decoration: none;
  font-variant: small-caps;
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 0.95rem;
}

nav a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a {
  color: var(--accent);
  text-underline-offset: 0.12em;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 1.15;
  margin: 2.5rem 0 1rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-ligatures: common-ligatures discretionary-ligatures;
}

h1 {
  font-size: 2.6rem;
  margin-top: 0;
  font-weight: 700;
}

h2 {
  font-size: 1.9rem;
}

h3 {
  font-size: 1.45rem;
}

h4 {
  font-size: 1.2rem;
}

h5 {
  font-size: 1.05rem;
}

h6 {
  font-size: 1rem;
}

p, ul, ol, pre {
  margin: 0 0 1.25rem;
}

ul, ol {
  padding-left: 1.75rem;
}

li {
  margin-bottom: 0.35rem;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

time {
  color: var(--muted);
  font-size: 0.9rem;
  font-style: italic;
  display: block;
  margin-bottom: 0.5rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.85em;
  color: var(--ink);
}

pre {
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85em;
  box-shadow: inset 0 0 0 1px var(--paper-shade), 0 2px 6px var(--shadow);
}

pre code {
  background: transparent;
  border: 0;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
  color: inherit;
}

article {
  margin-bottom: 3rem;
}

article:not(:last-of-type) {
  border-bottom: 1px dashed var(--border);
  padding-bottom: 2.5rem;
}

article h2 {
  margin-bottom: 0.25rem;
}

article h2 a {
  color: var(--ink);
  text-decoration: none;
}

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

article:has(> h1) > p:first-of-type::first-letter {
  float: left;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 3.6rem;
  line-height: 0.8;
  padding-right: 0.55rem;
  padding-top: 0.15rem;
  font-weight: 700;
  color: var(--accent);
  font-variant: small-caps;
}

.pagination {
  display: flex;
  justify-content: space-between;
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-variant: small-caps;
  letter-spacing: 0.04em;
  font-weight: 600;
}

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  font-variant: small-caps;
  letter-spacing: 0.04em;
}

footer a {
  color: var(--muted);
}

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

@media (max-width: 600px) {
  body {
    font-size: 16px;
    padding: 1.25rem 1rem 2rem;
  }

  h1 {
    font-size: 2.1rem;
  }

  h2 {
    font-size: 1.6rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  nav a {
    margin-right: 1.25rem;
  }

  article:has(> h1) > p:first-of-type::first-letter {
    font-size: 2.8rem;
  }
}
