:root {
  --bg: #f3f4f1;
  --text: #0f1110;
  --muted: #676a67;
  --card: #ffffff;
  --card2: #f8f9f6;
  --hairline: rgba(0,0,0,.08);
  --link: #0b57d0;
  --ring: rgba(11,87,208,.20);
}
:root[data-theme="dark"] {
  --bg: #0c0d0d;
  --text: #f2f2ef;
  --muted: #b5b7b3;
  --card: #141515;
  --card2: #181919;
  --hairline: rgba(255,255,255,.12);
  --link: #9bb7ff;
  --ring: rgba(155,183,255,.25);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Source Serif 4", ui-serif, Georgia, 'Times New Roman', serif;
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.container { width: min(980px, 92vw); margin: 3rem auto; }
.site-header, .site-footer {
  width: min(1100px, 96vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 0;
}
.brand {
  font-family: "Big Caslon", "Libre Caslon Display", Georgia, serif;
  font-size: 1.9rem;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.01em;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--hairline);
  color: var(--text);
  border-radius: 999px;
  padding: .45rem .75rem;
  cursor: pointer;
}
.theme-toggle:focus { outline: 3px solid var(--ring); outline-offset: 2px; }
h1, h2, h3, .essay-title { 
  font-family: "Big Caslon", "Libre Caslon Display", Georgia, serif;
  letter-spacing: .01em;
}
.hero-title { font-size: clamp(2.2rem, 5.8vw, 3.6rem); margin: 0 0 .4rem 0; }
.intro { margin: 0 0 2.4rem 0; color: var(--muted); max-width: 60ch; }
.essay-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}
@media (min-width: 820px) {
  .essay-list { grid-template-columns: 1fr 1fr; }
}
.card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: .85rem;
  padding: .9rem;
  background: linear-gradient(180deg, var(--card), var(--card2));
  border: 1px solid var(--hairline);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--muted);
  box-shadow: 0 8px 20px -12px rgba(0,0,0,.25);
}
.thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 10px;
  background: #cfcfcf20;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.meta { display: flex; flex-direction: column; gap: .45rem; }
.meta .date { color: var(--muted); font-size: .95rem; }
.meta .title { font-size: clamp(1.15rem, 2.6vw, 1.6rem); margin: 0; }
.meta .title a { color: inherit; text-decoration: none; }
.meta .title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.meta .summary { color: var(--muted); }
hr.hairline { border: 0; border-top: 1px solid var(--hairline); margin: 1.6rem 0; }
.article { width: min(760px, 92vw); margin: 2rem auto; }
.article .banner {
  aspect-ratio: 2.2/1;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  background: #cfcfcf20;
}
.article .banner img { width:100%; height:100%; object-fit: cover; }
.article .eyebrow { color: var(--muted); margin: .3rem 0 1rem 0; font-size: .95rem; }
.article h1 { font-size: clamp(2rem, 4.2vw, 3rem); margin: .2rem 0 0 0; }
.article p { margin: 1rem 0; }

/* Markdown content column */
.md {
  width: 100%;
  max-width: 70ch;        /* match/compliment your text line length */
  margin: 0 auto;         /* center the content column */
}

/* Keep all embedded media within the text width, no distortion */
.md :where(img, video, canvas, iframe) {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.25rem auto;   /* nice breathing room & centered */
  border-radius: 10px;    /* optional: match your card radius */
}

/* Optional: figure/figcaption polish */
.md figure {
  margin: 1.5rem auto;
  max-width: 100%;
}
.md figure > img { margin: 0; }
.md figcaption {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.5rem;
  text-align: center;
}

/* Keep the hero/banner styling separate so it can be wider if you like */
.article .banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
