:root {
  --bg: #f4f4f1;
  --bg-soft: #fbfaf6;
  --surface: rgba(255, 255, 255, 0.72);
  --text: #1f1f1b;
  --muted: #4f4d46;
  --line: #d8d5cc;
  --accent: #1f1f1b;
  --shadow: 0 18px 40px rgba(31, 31, 27, 0.08);
  --max-width: 760px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #111417;
  --bg-soft: #181d21;
  --surface: rgba(22, 27, 31, 0.76);
  --text: #ece8dd;
  --muted: #b5afa4;
  --line: #323940;
  --accent: #f5efe0;
  --shadow: 0 20px 44px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

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

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, var(--bg-soft), transparent 42%),
    var(--bg);
  line-height: 1.65;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.page-shell {
  width: min(var(--max-width), 92vw);
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 3rem;
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 0.1rem;
  border-bottom: 1px solid transparent;
}

.main-nav a[aria-current="page"],
.main-nav a:hover {
  color: var(--text);
  border-bottom-color: var(--text);
}

.theme-toggle {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  padding: 0.45rem 0.9rem;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.theme-toggle:hover {
  border-color: var(--text);
}

.hero {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: start;
  gap: 1.3rem;
  margin-bottom: 2rem;
}

.hero-simple {
  display: block;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
}

.hero-content h1 {
  margin: 0.15rem 0 0.75rem;
}

.profile-photo {
  width: 100%;
  max-width: 180px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}

h1 {
  margin: 0.15rem 0 0.75rem;
  font-size: clamp(2rem, 4vw, 2.8rem);
  line-height: 1.15;
}

h2 {
  margin: 0 0 0.7rem;
  font-size: 1.35rem;
  line-height: 1.2;
}

.lead {
  margin: 0;
  max-width: 62ch;
  color: var(--muted);
  font-size: 1.06rem;
}

.content-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.coming-soon {
  margin: 0;
  color: var(--muted);
}

.note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.social-icons {
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-link {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  color: var(--accent);
  text-decoration: none;
  background: var(--surface);
}

.icon-link:hover {
  border-color: var(--accent);
}

.icon-link svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: currentColor;
}

.post-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.post-list li {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  grid-template-areas:
    "image title"
    "image meta"
    "image excerpt";
  gap: 0.25rem 1rem;
  align-items: start;
  margin: 0 0 1.5rem;
}

.post-preview-media {
  grid-area: image;
  display: block;
  width: 11rem;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  justify-self: start;
  box-shadow: var(--shadow);
}

.post-preview-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.post-list p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.post-title {
  grid-area: title;
  color: var(--text);
  text-decoration: none;
  font-size: 1.15rem;
  font-weight: 600;
}

.post-title:hover {
  text-decoration: underline;
}

.post-meta {
  grid-area: meta;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-excerpt {
  grid-area: excerpt;
  max-width: 52ch;
}

.post-list a,
.essay-content a {
  color: var(--accent);
}

.essay-meta {
  margin: 0 0 0.45rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.essay-page .site-header {
  margin-bottom: 2rem;
}

.essay-content {
  max-width: 66ch;
}

.essay-cover {
  display: block;
  width: 100%;
  margin: 0 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow);
}

.essay-content p,
.essay-content ol {
  margin: 0 0 1.1rem;
}

.essay-content ol {
  padding-left: 1.35rem;
}

.essay-content li + li {
  margin-top: 0.65rem;
}

.site-footer {
  margin-top: 3rem;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

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

  .post-list li {
    grid-template-columns: 1fr;
    grid-template-areas:
      "image"
      "title"
      "meta"
      "excerpt";
  }

  .post-preview-media {
    width: 100%;
    justify-self: stretch;
  }

  .profile-photo {
    max-width: 150px;
  }

  .main-nav {
    gap: 0.8rem;
  }
}
