/* ---------------------------------------------------------------
   Minimal personal blog — plain CSS, mobile-first, reading-first
   No web fonts: uses a high-quality native serif stack so pages
   stay instant to load while reading like a well-set book.
   --------------------------------------------------------------- */

:root {
  --ink:        #1a1a1a;  /* body text — near-black, gentle on the eyes */
  --ink-soft:   #3a3a3a;  /* secondary prose */
  --muted:      #767676;  /* dates, footer, labels */
  --rule:       #ebebeb;  /* hairline dividers */
  --bg:         #ffffff;  /* pure white */
  --select:     #fdf3d3;  /* warm selection highlight */

  --serif: "Iowan Old Style", "Palatino Linotype", "Palatino", "Charter",
           "Georgia", "Times New Roman", serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --measure: 38rem;        /* ideal reading width (~66 characters) */
}

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

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

body {
  margin: 0 auto;
  padding: 0 1.4rem;
  max-width: var(--measure);

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

  font-family: var(--serif);
  /* Fluid type: ~17px on phones, ~19px on desktop */
  font-size: clamp(1.0625rem, 1.01rem + 0.28vw, 1.1875rem);
  line-height: 1.75;

  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* Nice touches where supported */
  hanging-punctuation: first last;
}

::selection {
  background: var(--select);
}

/* Comfortable paragraph rhythm and tidier wrapping */
p {
  margin: 0 0 1.35rem;
  text-wrap: pretty;
  overflow-wrap: break-word;
}

/* Links — quiet, but unmistakably clickable */
a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: #c9c9c9;
  text-underline-offset: 0.18em;
  transition: text-decoration-color 0.15s ease, color 0.15s ease;
}

a:hover {
  text-decoration-color: var(--ink);
}

/* ---------------------------------------------------------------
   Header
   --------------------------------------------------------------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  padding: 2.75rem 0 1.4rem;
  border-bottom: 1px solid var(--rule);
}

.site-name {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.site-name a {
  text-decoration: none;
}

.site-nav {
  font-family: var(--sans);
  font-size: 0.9rem;
}

.site-nav a {
  margin-left: 1.25rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:first-child {
  margin-left: 0;
}

.site-nav a:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Intro
   --------------------------------------------------------------- */
.intro {
  padding: 2.25rem 0 1.25rem;
}

.intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08em;
}

/* ---------------------------------------------------------------
   Blog list — the main focus
   --------------------------------------------------------------- */
.posts {
  padding: 0.75rem 0 2rem;
}

.posts h2 {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 1.75rem;
}

.post {
  padding: 1.85rem 0;
  border-bottom: 1px solid var(--rule);
}

.post:first-of-type {
  padding-top: 0;
}

.post:last-child {
  border-bottom: none;
}

.post-title {
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}

.post-title a {
  text-decoration: none;
}

.post-title a:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.post-date {
  display: block;
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.post-excerpt {
  margin: 0 0 0.7rem;
  color: var(--ink-soft);
}

.read-more {
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
}

.read-more:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Article (single post page)
   --------------------------------------------------------------- */
.article {
  padding: 2.75rem 0 1rem;
}

.article-title {
  font-size: clamp(1.8rem, 1.5rem + 1.4vw, 2.3rem);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin: 0 0 0.6rem;
}

.article-date {
  display: block;
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 2.5rem;
}

.article p {
  margin: 0 0 1.5rem;
}

/* A gentle lead-in: the opening paragraph sits a touch larger */
.article > p:first-of-type {
  font-size: 1.06em;
  color: var(--ink);
}

.article h2 {
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.9rem;
}

.article blockquote {
  margin: 1.8rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--rule);
  color: var(--ink-soft);
  font-style: italic;
}

.article hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 2.5rem auto;
  width: 5rem;
}

.back-link {
  display: inline-block;
  margin: 2rem 0 0;
  font-family: var(--sans);
  font-size: 0.88rem;
  text-decoration: none;
  color: var(--muted);
}

.back-link:hover {
  color: var(--ink);
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */
.site-footer {
  margin-top: 2rem;
  padding: 1.75rem 0 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--muted);
}

.site-footer p {
  margin: 0;
}

/* ---------------------------------------------------------------
   Roomier spacing on larger screens
   --------------------------------------------------------------- */
@media (min-width: 40rem) {
  .site-header {
    padding-top: 3.75rem;
  }
}
