/* ==========================================================
   style.css — the whole look of the blog lives in this file.
   Colors, type, and column width are all set in :root below,
   so start there if you want to make it yours.
   ========================================================== */

:root {
  /* Palette — cool paper with green ink */
  --paper: #f6f6f1;   /* page background */
  --ink:   #20261f;   /* main text */
  --soft:  #5c6659;   /* dates, excerpts, footer */
  --leaf:  #33684b;   /* links and small details */
  --leaf-dark: #27503a;
  --line:  #dcdfd3;   /* hairline separators */
  --pane:  #eceee3;   /* code block background */

  /* Type */
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Layout */
  --page: 41rem;      /* width of the reading column */
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.14rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

main { flex: 1; width: 100%; }

::selection { background: rgba(51, 104, 75, 0.18); }

:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: var(--page);
  margin-inline: auto;
  padding-inline: 1.4rem;
}

/* ---------- Header ---------- */

.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.wordmark {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.wordmark .leaf { color: var(--leaf); }

.site-nav { display: flex; gap: 1.3rem; }

.site-nav a {
  font-size: 1rem;
  color: var(--soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a:hover { color: var(--leaf); text-decoration: underline; text-underline-offset: 0.2em; }
.site-nav a[aria-current="page"] { color: var(--ink); }

/* ---------- Front page ---------- */

.intro { padding-block: 2.8rem 1.8rem; }

.intro p {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.55;
  max-width: 32rem;
}

.post-list {
  list-style: none;
  margin: 0 0 4rem;
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.post-list li {
  padding-block: 1.5rem;
  border-top: 1px solid var(--line);
}

.post-date {
  display: block;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--soft);
  margin-bottom: 0.25rem;
}

.post-list h2 {
  margin: 0 0 0.3rem;
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.post-list h2 a {
  color: var(--ink);
  text-decoration: none;
  transition: color 0.15s ease;
}

.post-list h2 a:hover { color: var(--leaf); }

.post-excerpt { margin: 0; color: var(--soft); font-size: 1.05rem; }

/* ---------- A single post ---------- */

.post-header { padding-block: 3rem 0; }

.post-header h1 {
  margin: 0.4rem 0 0;
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.015em;
}

.post-content { padding-block: 1.9rem 3.5rem; }

.post-content p { margin: 0 0 1.4em; }

.post-content a {
  color: var(--leaf);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.15s ease;
}

.post-content a:hover { color: var(--leaf-dark); }

.post-content h2 {
  margin: 2.1em 0 0.6em;
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.post-content ul,
.post-content ol { margin: 0 0 1.4em; padding-left: 1.4rem; }

.post-content li { margin: 0.35em 0; }
.post-content li::marker { color: var(--leaf); }

.post-content blockquote {
  margin: 1.8em 0;
  padding: 0.1em 0 0.1em 1.2em;
  border-left: 2px solid var(--leaf);
  font-style: italic;
}

.post-content code {
  font-family: var(--mono);
  font-size: 0.84em;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.post-content pre {
  margin: 1.9em 0;
  padding: 1.05rem 1.2rem;
  background: var(--pane);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.55;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2.6em 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

/* A small leaf closes each post */
.post-content > p:last-of-type::after {
  content: " ❦";
  color: var(--leaf);
}

/* ---------- Footer ---------- */

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-block: 1.4rem 2rem;
  border-top: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--soft);
}

.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--leaf); text-decoration: underline; text-underline-offset: 0.2em; }

/* ---------- Small screens & preferences ---------- */

@media (max-width: 600px) {
  body { font-size: 1.06rem; }
  .intro { padding-block: 2.2rem 1.4rem; }
  .intro p { font-size: 1.18rem; }
  .post-header { padding-top: 2.2rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
