:root {
  --bg: #f7f1e8;
  --bg-strong: #efe4d3;
  --paper: rgba(255, 252, 247, 0.9);
  --line: rgba(58, 43, 28, 0.16);
  --ink: #1f1b16;
  --muted: #6d6256;
  --accent: #8b3f2f;
  --accent-soft: #f3d6be;
  --shadow: 0 20px 50px rgba(45, 30, 16, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(139, 63, 47, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(83, 123, 99, 0.1), transparent 30%),
    linear-gradient(180deg, var(--bg-strong), var(--bg));
  font-family: "IBM Plex Sans", "Avenir Next", sans-serif;
  line-height: 1.65;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #6d2f21;
}

img {
  max-width: 100%;
  height: auto;
}

.page-shell {
  width: min(1080px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 1rem 0 3rem;
}

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

.site-name {
  color: var(--ink);
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  text-decoration: none;
}

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

.site-nav a,
.site-footer {
  color: var(--muted);
  text-decoration: none;
}

.hero,
.panel,
.article-shell {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.hero {
  padding: clamp(2rem, 4vw, 4rem);
}

.eyebrow,
.post-date,
.article-kicker,
.article-meta,
.panel-header p,
.site-footer {
  color: var(--muted);
  font-size: 0.95rem;
}

h1,
h2,
h3 {
  font-family: "Fraunces", Georgia, serif;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}

.hero h1 {
  font-size: clamp(3rem, 7vw, 5.4rem);
  margin-top: 0.35rem;
  max-width: none;
  white-space: nowrap;
}

.hero-copy {
  margin-top: 1.5rem;
  max-width: 42rem;
  font-size: 1.08rem;
}

.panel,
.article-shell {
  margin-top: 1.25rem;
  padding: clamp(1.4rem, 2.4vw, 2rem);
}

.writing-block + .writing-block {
  margin-top: 1.5rem;
}

.featured-writing {
  display: block;
  margin-bottom: 1.5rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid rgba(139, 63, 47, 0.26);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(139, 63, 47, 0.12), rgba(139, 63, 47, 0.04));
  color: var(--ink);
  text-decoration: none;
}

.featured-writing strong {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.55rem;
  line-height: 1.1;
}

.featured-writing-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.writing-label {
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2,
.panel-header h1,
.post-card h2,
.post-card h3,
.article-header h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.link-grid,
.post-list {
  display: grid;
  gap: 1rem;
}

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

.link-card,
.post-card {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.58);
}

.link-card {
  display: block;
  padding: 1rem 1.1rem;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.link-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 63, 47, 0.35);
  background: #fffdf9;
}

.contact-line {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-weight: 600;
}

.post-card {
  padding: 1.1rem 1.2rem;
}

.post-card h2,
.post-card h3 {
  margin-top: 0.2rem;
  font-size: 1.45rem;
}

.post-card p {
  margin: 0.55rem 0 0;
}

.article-kicker {
  margin: 0 0 1rem;
}

.article-header h1 {
  max-width: 18ch;
}

.article-meta {
  margin: 0.6rem 0 0;
}

.article-body {
  margin-top: 1.75rem;
  font-size: 1.03rem;
}

.article-body > :first-child {
  margin-top: 0;
}

.article-body h2,
.article-body h3,
.article-body h4 {
  margin: 2rem 0 0.8rem;
}

.article-body pre,
.article-body code {
  font-family: "IBM Plex Mono", monospace;
}

.article-body :not(pre) > code {
  display: inline-block;
  padding: 0.05rem 0.38rem;
  border: 1px solid rgba(139, 63, 47, 0.18);
  border-radius: 0.42rem;
  background: rgba(139, 63, 47, 0.08);
  color: #6d2f21;
  font-size: 0.94em;
}

.article-body a code {
  color: inherit;
}

.article-body pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 18px;
  background: #f4ece2;
  border: 1px solid var(--line);
}

.article-body blockquote {
  margin: 1.25rem 0;
  padding-left: 1rem;
  border-left: 4px solid rgba(139, 63, 47, 0.25);
  color: var(--muted);
}

.article-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.equation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #f4ece2;
  font-size: 1.05rem;
}

.equation-symbol {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.15em;
}

.article-body th,
.article-body td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100vw - 1rem, 100%);
  }

  .site-header,
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero h1 {
    max-width: none;
  }
}
