:root {
  color-scheme: light;
  --paper: #ffefd5;
  --paper-deep: #f7dfbc;
  --ink: #38251d;
  --muted: #795b4d;
  --line: #dcbf99;
  --cider: #b86432;
  --cider-soft: #d99a64;
  --page: 42rem;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 20rem;
  background: var(--paper);
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--cider) 40%, transparent);
  outline-offset: 4px;
}

.site-shell {
  width: min(calc(100% - 2.5rem), var(--page));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  padding: 2.25rem 0 1.35rem;
}

.fruit-mark {
  display: block;
  width: 1.75rem;
  height: 1.75rem;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.fruit-link {
  display: inline-block;
  text-decoration: none;
}

.home-main {
  padding: clamp(3.5rem, 10vw, 7rem) 0 7rem;
}

.home-main section + section { margin-top: 4.5rem; }

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--ink);
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(2.3rem, 7vw, 3.7rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: 1.05rem;
}

.bio {
  max-width: 37rem;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 3vw, 1.42rem);
  line-height: 1.7;
}

.topics,
#writing { padding-top: 0; }

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1rem;
}

.filter {
  appearance: none;
  min-height: 2rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cider);
  cursor: pointer;
  font: inherit;
  font-size: 1rem;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--cider) 35%, transparent);
  text-underline-offset: 0.2em;
  transform: scale(1);
  transform-origin: left center;
  transition: color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.filter:hover {
  color: var(--ink);
  text-decoration-color: var(--cider-soft);
}

.filter[aria-pressed="true"] {
  color: var(--muted);
  opacity: 0.78;
  transform: scale(0.8);
}

.post-list {
  display: grid;
  justify-items: start;
  gap: 0.75rem;
}

.post-title {
  color: var(--ink);
  font-size: clamp(1.08rem, 2.5vw, 1.22rem);
  font-weight: 520;
  line-height: 1.45;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

.post-title:hover {
  color: var(--cider);
  text-decoration-color: var(--cider);
}

.post-title[hidden] { display: none; }

.empty-state {
  margin: 1rem 0 0;
  color: var(--muted);
  font-style: italic;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.7rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
}

.article-shell {
  width: min(calc(100% - 2.5rem), var(--page));
  margin-inline: auto;
  padding: clamp(3.5rem, 9vw, 6rem) 0 7rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 4rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

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

.article-header { margin-bottom: 3.5rem; }

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--cider);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.article-header h1 {
  max-width: 14ch;
  margin-bottom: 1.4rem;
  font-size: clamp(2.5rem, 8vw, 4.6rem);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.article-meta a {
  color: var(--cider);
  text-decoration-color: var(--cider-soft);
  text-underline-offset: 0.18em;
}

.prose {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.08rem, 2.3vw, 1.22rem);
  line-height: 1.85;
}

.prose h2,
.prose h3 {
  margin: 3.2rem 0 1rem;
  font-family: Inter, ui-sans-serif, sans-serif;
}

.prose h2 { font-size: 1.55rem; }
.prose h3 { font-size: 1.25rem; }
.prose p { margin: 0 0 1.6rem; }
.prose a { color: var(--cider); text-underline-offset: 0.18em; }
.prose blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 3px solid var(--cider-soft); color: var(--muted); }
.prose code { padding: 0.15em 0.3em; border-radius: 0.22rem; background: var(--paper-deep); font-family: ui-monospace, monospace; font-size: 0.9em; }
.prose pre { overflow-x: auto; padding: 1.2rem; border-radius: 0.35rem; background: var(--ink); color: var(--paper); }
.prose pre code { padding: 0; background: transparent; }

.article-footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 5rem;
  padding-top: 1.35rem;
  border-top: 1px solid var(--line);
}

.article-footer a {
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
}

.article-footer a:hover { color: var(--cider); }

@media (max-width: 560px) {
  .site-shell,
  .article-shell { width: min(calc(100% - 2rem), var(--page)); }
  .home-main { padding-top: 3.5rem; }
  .home-main section + section { margin-top: 3.5rem; }
  .back-link { margin-bottom: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
