:root {
  color-scheme: light;
  --paper: #faf9f6;
  --ink: #272b29;
  --muted: #6c706a;
  --line: #dddfd7;
  --accent: #465b4d;
  --font: "Avenir Next", Avenir, ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }
::selection { background: #dce4d7; }
.site-shell { width: min(100% - 64px, 720px); margin: 0 auto; }
.skip-link { position: absolute; top: 12px; left: 20px; padding: 12px; background: var(--paper); transform: translateY(-200%); }
.skip-link:focus { transform: translateY(0); }
.site-header {
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  border-bottom: 1px solid var(--line);
}
.nav-link { display: inline-block; padding: 10px 0; font-size: 13px; text-decoration: none; border-bottom: 1px solid var(--accent); }
.nav-link:hover { color: var(--accent); }
.essay-header { margin: 0; padding: 52px 0 32px; text-align: left; }
.back-link { display: inline-block; margin-bottom: 24px; color: var(--accent); font-size: 12px; text-decoration: none; }
.back-link:hover { text-decoration: underline; }
h1 { margin: 0; font-family: var(--font); font-size: clamp(29px, 4.5vw, 44px); font-weight: 500; line-height: 1.2; letter-spacing: -1.2px; text-wrap: balance; }
.essay-body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.85; text-align: left; overflow-wrap: break-word; }
.essay-body p { margin: 0 0 24px; }
.essay-body a { color: var(--accent); text-decoration-thickness: 1px; }
.essay-body a:hover { text-decoration-thickness: 2px; }
.site-footer { margin-top: 76px; padding: 28px 0 36px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 24px; color: var(--muted); font-size: 12px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.redirect { padding-top: 88px; }

@media (max-width: 600px) {
  .site-shell { width: calc(100% - 40px); }
  .site-header { min-height: 72px; }
  .essay-header { padding: 36px 0 28px; }
  h1 { letter-spacing: -1px; }
  .essay-body { font-size: 16px; line-height: 1.8; }
  .site-footer { margin-top: 48px; }
}

/* The collection grows naturally as more articles are added. */
.writings-page .site-shell { max-width: none; width: calc(100% - 64px); min-height: 100svh; display: flex; flex-direction: column; }
.writings-page main { flex: 1; padding: 28px 0 40px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 344px)); gap: 28px; list-style: none; padding: 0; margin: 0; }
.article-card { display: block; height: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fffefa; text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease; }
.article-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; }
.article-card h2 { margin: 0; padding: 18px 20px 22px; font-size: 17px; font-weight: 500; line-height: 1.5; letter-spacing: -0.25px; }
.article-card:hover { border-color: #929f92; box-shadow: 0 4px 16px #272b290a; }

/* Fade only the decorative image; keep all article text fully opaque. */
.article-page { isolation: isolate; padding-bottom: 48px; }
.article-page::before { content: ""; position: fixed; inset: 0; z-index: -1; background: url("assets/mountain-landscape.png") center center / cover no-repeat; opacity: 0.085; pointer-events: none; }

@media (max-width: 600px) {
  .writings-page .site-shell { width: calc(100% - 40px); }
  .writings-page main { padding-top: 20px; }
  .article-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .article-card { transition: none; }
}
