:root {
  --bg: #f5efe6;
  --bg-deep: #eadfce;
  --paper: rgba(255, 250, 244, 0.82);
  --paper-strong: rgba(255, 252, 248, 0.94);
  --ink: #162033;
  --ink-soft: #3b4a61;
  --muted: #6c6f7a;
  --line: rgba(22, 32, 51, 0.12);
  --line-strong: rgba(22, 32, 51, 0.18);
  --accent: #c55d3d;
  --accent-soft: rgba(197, 93, 61, 0.12);
  --accent-2: #2b6f77;
  --shadow: 0 24px 60px rgba(25, 32, 43, 0.12);
  --shadow-soft: 0 12px 28px rgba(25, 32, 43, 0.08);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --content-width: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 141, 94, 0.22), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(43, 111, 119, 0.18), transparent 26%),
    linear-gradient(180deg, #fbf5ee 0%, var(--bg) 54%, var(--bg-deep) 100%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  line-height: 1.72;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(22, 32, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(22, 32, 51, 0.045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.45), transparent 82%);
  opacity: 0.22;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

code {
  padding: 0.15rem 0.42rem;
  border-radius: 8px;
  background: rgba(22, 32, 51, 0.07);
  font-family: "Consolas", "SFMono-Regular", monospace;
  font-size: 0.92em;
}

pre {
  overflow-x: auto;
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: #111a29;
  color: #f7efe6;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

pre code {
  padding: 0;
  background: transparent;
  color: inherit;
}

.page-shell {
  width: min(calc(100% - 2rem), var(--content-width));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(20px);
  background: rgba(251, 245, 238, 0.86);
  border-bottom: 1px solid rgba(22, 32, 51, 0.08);
}

.header-inner,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.95rem;
  min-width: 0;
}

.brand-avatar {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 22px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand strong,
.hero-card h1,
.section-head h1,
.section-head h2,
.article-header h1,
.post-card h3,
.hero-meta h2 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Georgia", serif;
}

.brand strong {
  font-size: 1.08rem;
}

.brand small,
.meta-row,
.eyebrow,
.nav a,
.site-footer,
.article-summary,
.post-card p,
.text-link,
.profile-copy {
  color: var(--muted);
}

.nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 244, 0.74);
  box-shadow: var(--shadow-soft);
}

.nav a {
  padding: 0.48rem 0.9rem;
  border-radius: 999px;
  transition: 160ms ease;
}

.nav a:hover,
.text-link:hover,
.tag-row a:hover,
.term-card:hover,
.post-card h3 a:hover,
.post-link:hover {
  color: var(--accent);
}

main.page-shell {
  padding-bottom: 3rem;
}

.post-grid,
.stack-list,
.term-grid,
.article-nav {
  display: grid;
  gap: 1rem;
}

.hero-card {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(360px, 0.95fr);
  align-items: center;
  gap: 0.85rem;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  box-shadow: var(--shadow-soft);
  border-radius: 28px;
  padding: 1.1rem 1.35rem;
}

.post-card,
.article,
.term-card,
.empty-state {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  box-shadow: var(--shadow);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -2.4rem;
  bottom: -2.2rem;
  width: 10rem;
  height: 10rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(197, 93, 61, 0.16), transparent 70%);
}

.hero-main {
  min-width: 0;
}

.hero-card h1 {
  margin: 0.2rem 0 0.5rem;
  font-size: clamp(2.1rem, 4.2vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.34em;
}

.hero-title-suffix {
  margin-left: 0;
  font-size: 0.32em;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
  line-height: 1;
  white-space: nowrap;
  align-self: flex-end;
  padding-bottom: 0.05em;
}

.hero-copy {
  max-width: 28rem;
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  color: var(--accent-2);
  font-weight: 700;
}

.hero-actions,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero-actions {
  margin-top: 0.75rem;
  align-items: center;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 8.1rem;
  padding: 0.68rem 1.05rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff7f0;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
}

.button:hover {
  background: var(--accent);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  border: 1px solid var(--line);
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.6rem 0 0;
  padding: 0;
  list-style: none;
}

.hero-tags li {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.post-kicker {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.08);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 700;
}

.hero-side {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.avatar-frame {
  display: grid;
  place-items: center;
  padding: 0.55rem;
  border-radius: 18px;
  background: rgba(22, 32, 51, 0.06);
}

.author-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta avatar"
    "stats stats";
  column-gap: 0.8rem;
  row-gap: 0.55rem;
  width: min(100%, 430px);
  padding: 0.72rem 0.8rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.36);
  border: 1px solid rgba(22, 32, 51, 0.08);
  box-shadow: none;
}

.hero-avatar {
  grid-area: avatar;
  margin: 0;
  max-width: 112px;
  justify-self: end;
  align-self: center;
}

.avatar-frame img {
  width: min(100%, 280px);
  height: auto;
  border-radius: 16px;
}

.hero-meta {
  grid-area: meta;
  min-width: 0;
}

.hero-meta h2 {
  margin: 0.12rem 0 0;
  font-size: 1.26rem;
}

.profile-copy {
  margin: 0.2rem 0 0;
  max-width: none;
  text-align: left;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.author-stats {
  grid-area: stats;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
  margin: 0;
  padding-top: 0.38rem;
  border-top: 1px solid rgba(22, 32, 51, 0.08);
  color: var(--muted);
  font-size: 0.82rem;
}

.author-stats strong {
  color: var(--ink);
  font-weight: 700;
}

.post-card,
.term-card,
.empty-state {
  padding: 1.4rem;
  border-radius: var(--radius-lg);
}

.article {
  margin-top: 1.45rem;
  padding: 2rem;
  border-radius: var(--radius-xl);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0 1rem;
}

.section-head h1,
.section-head h2,
.article-header h1,
.post-card h3 {
  margin: 0.2rem 0 0;
}

.section-head-page {
  margin-top: 2rem;
}

.post-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.stack-list {
  grid-template-columns: minmax(0, 1fr);
}

.post-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 100%;
}

.post-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.post-card-top {
  display: grid;
  gap: 0.4rem;
}

.post-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 0;
  font-size: 0.92rem;
}

.post-card h3 {
  font-size: 1.5rem;
}

.post-card p {
  margin: 0;
}

.post-card-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  margin-top: auto;
}

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

.tag-row a {
  display: inline-flex;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.92rem;
}

.post-link {
  font-weight: 700;
}

.article-header {
  display: grid;
  gap: 0.9rem;
}

.article-header h1 {
  font-size: clamp(2.7rem, 7vw, 4.2rem);
  line-height: 0.98;
}

.article-summary {
  margin: 0;
}

.toc {
  margin: 1.8rem 0;
  padding: 1.25rem 1.4rem;
  border-radius: 22px;
  background: rgba(22, 32, 51, 0.045);
  border: 1px solid rgba(22, 32, 51, 0.07);
}

.toc h2 {
  margin-top: 0;
  font-size: 1rem;
}

.toc ul {
  padding-left: 1.1rem;
}

.prose h2,
.prose h3,
.prose h4 {
  margin-top: 2rem;
  line-height: 1.18;
}

.prose p,
.prose ul,
.prose ol,
.prose blockquote {
  margin: 1rem 0;
}

.prose blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--ink-soft);
}

.article-nav {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 2rem;
}

.nav-card {
  padding: 1rem 1.1rem;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(22, 32, 51, 0.03);
}

.nav-card span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.term-grid {
  margin-top: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.term-card span {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
}

.term-stack {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.term-expand {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--paper-strong), var(--paper));
  box-shadow: var(--shadow-soft);
  padding: 1.15rem 1.3rem;
}

.term-expand-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.term-expand-head h2 {
  margin: 0;
  font-size: 1.36rem;
}

.term-expand-head span {
  color: var(--muted);
  font-size: 0.92rem;
}

.term-post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.56rem;
}

.term-post-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.52rem 0;
  border-top: 1px solid rgba(22, 32, 51, 0.08);
}

.term-post-item a {
  font-weight: 700;
}

.term-post-item time {
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.site-footer {
  padding: 1.5rem 0 2rem;
}

@media (max-width: 920px) {
  .hero-card,
  .article-nav {
    grid-template-columns: 1fr;
  }

  .hero-side {
    justify-content: flex-start;
  }

  .author-card {
    width: 100%;
    max-width: 360px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "meta"
      "stats";
    row-gap: 0.55rem;
  }

  .profile-copy {
    white-space: normal;
  }

  .hero-avatar {
    justify-self: start;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .footer-inner,
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    border-radius: 22px;
  }

  .intro,
  .article {
    padding: 1.4rem;
  }

  .hero-card {
    padding: 1.35rem;
  }

  .author-stats {
    gap: 0.35rem;
  }

  .brand small {
    display: none;
  }
}
