@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@1,7..72,200..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

h1, h2, h3, .brand {
  font-family: 'Literata', sans-serif;
  font-optical-sizing: auto;
  font-weight: 600;
  font-style: italic;
  letter-spacing: -.2px;
  font-size:2rem !important;
  line-height:2rem;
  color:#323929;

}

:root{
  --bg:#f7f3ea;          /* parchment */
  --ink:#2f2a28;         /* bark */
  --muted:#6b5f58;       /* lichen */
  --ring:#e3dccf;        /* twine */
  --card:#fffdf8;        /* soft paper */
  --link:#2b6a3f;        /* leaf */
  /* accents */
  --fern:#6a8f52;
  --moss:#8aa260;
  --moss2:#646e39;
  --bark:#4b3a32;
  --portraitgreen:#37514e;
  --toadstool:#d8c9b6;
  --shadow: rgba(35,30,28,.08);
  --shadow-strong: rgba(35,30,28,.16);
}
*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  color:var(--ink);
  font:16px/1.6 system-ui,-apple-system;
  font-family: 'Source Sans 3', Sego UI, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg);
  background-image: url('/assets/acorn-flat.png');
  background-repeat: repeat;
  background-position: center;
  background-size: 256px 384px;
}

/* ==== Sticky footer layout (global) ==== */
html { height: 100%; }

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Let the main content area expand to fill remaining space */
main,
body > .container,
main.container,
.site-content {
  flex: 1 0 auto;
}

/* Footer is pushed to the bottom when content is short */
.site-footer {
  margin-top: auto;
  flex-shrink: 0;
}

a.link{color:var(--link);text-decoration:none}
a.link:hover{text-decoration:underline}

.container{max-width:1200px;margin:0 auto;padding:28px 24px}
.hero-row{
  display:grid;
  gap:20px;
  grid-template-columns:2fr 1fr;
  align-items:stretch;
  grid-template-areas: "hero bio";
}
.hero-row .hero { grid-area: hero; }
.hero-row .bio  { grid-area: bio; }
.hero.card{padding:16px;border:1px solid var(--ring);border-radius:14px;background:var(--card);box-shadow:0 1px 2px rgba(0,0,0,.04)}
.bio.card{padding:16px;border:1px solid var(--ring);border-radius:14px;background:var(--card)}
.hero-img{width:100%;border-radius:10px;margin-bottom:12px}
.hero-title{margin:8px 0 6px;font-size:1.9rem}
.muted{color:var(--muted)}

.rail{
  margin-top:28px;
}
.rail h2{
  margin:0 0 12px;
  font-size:1.22em;
  letter-spacing:.2px;
  border-bottom: 2px solid transparent;
  padding-bottom: 6px;
}
.group{margin:14px 0 8px;color:#333;font-size:1rem}

.cards{display:grid;gap:16px;grid-template-columns:repeat(3,1fr)}
.cards.cards-4{grid-template-columns:repeat(4,1fr)}

.card{
  background:var(--card);
  border:1px solid var(--ring);
  border-radius:16px;
  padding:16px;
  box-shadow: 0 2px 4px var(--shadow), 0 12px 30px var(--shadow);
  position:relative;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 10px var(--shadow-strong), 0 18px 42px var(--shadow);
  border-color: color-mix(in oklab, var(--ring) 70%, var(--fern));
}
.card-img{
  width:100%;
  border-radius:12px;
  margin-bottom:10px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03) inset;
}
.card-title{
  margin:0px 0 6px;
  font-size:1.06rem;
  letter-spacing:.1px;
}

.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:6px}
.chip{
  border:1px solid var(--ring);
  background: linear-gradient(180deg, #fff, var(--card));
  padding:6px 10px;
  border-radius:999px;
  font-size:.85rem;
  color:var(--muted);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}

.bio-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content: flex-end; /* aligns all content to the right */
}

.hero-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
  justify-content:last baseline;
}

.mascot{position:absolute;right:8px;bottom:-7px;width:44px;opacity:.85;pointer-events:none}
@keyframes float-y { from { transform: translateY(0) } 50% { transform: translateY(-2px) } to { transform: translateY(0) } }
.card:hover .mascot{ transform: translateY(-1px) rotate(-1deg); transition: transform .15s ease }
.mascot{ filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); animation: float-y 6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .mascot{ animation:none }
}
.mascot { pointer-events:auto !important; } 

@media (max-width:900px){
  .hero-row{
    grid-template-columns:1fr;
    grid-template-areas:
      "bio"
      "hero";
  }
  .cards{grid-template-columns:repeat(2,1fr)}
  .cards.cards-4{grid-template-columns:repeat(2,1fr)}
}
@media (max-width:560px){
  .cards{grid-template-columns:1fr; gap:14px}
  .cards.cards-4{grid-template-columns:1fr}
}

/* --- Bio portrait behavior (explicit) --- */
/* Hidden by default when the layout is stacked (mobile/tablet) */
.bio-photo {
  display: none;
  margin: 0 0 12px 0;
  text-align: left;
  width: 100%;          /* constrain to the bio card column */
}
.bio-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--ring);
  box-shadow: 0 4px 18px var(--shadow);
}
/* When the hero and bio are side-by-side, show the portrait and stretch the bio card */
@media (min-width: 900px) {
  .bio-photo { display: block; }
  .bio.card { align-items: stretch; }
}

/* Writing cards: equalized layout without images */
.cards-writing .card { min-height: 220px; display: flex; background:
  linear-gradient(180deg, var(--card), #fffef9);
}
.cards-writing .card-link { display: flex; flex-direction: column; height: 100%; }
.cards-writing .date { margin: 4px 0 6px; color: var(--muted); }
.line-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
@media (max-width: 900px) {
  .cards-writing .card { min-height: 200px; }
}

/* Fully clickable cards:
   - Show hand cursor only when a card contains a .card-link wrapper
   - Keep internal links elsewhere styled normally */
.card:has(> .card-link):hover {
  cursor: pointer;
}

/* Remove link underlines only for the full-card link */
.card-link,
.card-link:link,
.card-link:visited,
.card-link:hover,
.card-link:active {
  text-decoration: none;
  color: inherit;
}

/* ===== Site Header / Top Nav ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: color-mix(in oklab, var(--moss), 88%, white);
  backdrop-filter: saturate(1.2) blur(4px);
  border-bottom: 1px solid var(--ring);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  max-width: 1200px;
  margin: 0 auto;
}
.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.site-nav a {
  display: inline-block;
  padding: 6px 2px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { border-bottom-color: color-mix(in oklab, var(--leaf, var(--link)) 80%, var(--ring)); color: var(--leaf, var(--link)); }
.site-nav a.active,
.site-nav a[aria-current="page"] {
  border-bottom-color: var(--leaf, var(--link));
  color: var(--leaf, var(--link));
  font-weight: 600;
}

/* === Mobile hamburger support === */
/* Hidden by default (desktop); shown under 720px. */
.nav-toggle {
  display: none;
  appearance: none;
  background: transparent;
  border: 0;
  padding: 6px 8px;
  margin: 0;
  border-radius: 8px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

/* Simple hamburger icon (3 bars) */
.nav-toggle .bar {
  display: block;
  width: 22px;
  height: 2px;
  background: currentColor;
  margin: 4px 0;
  transition: transform .2s ease, opacity .2s ease;
}

/* Container is relatively positioned so dropdown can anchor to it */
.nav-wrap { position: relative; }

/* On narrow screens, collapse the inline nav and show a dropdown */
@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }

  /* Make the nav a dropdown panel */
  .site-nav {
    position: absolute;
    top: 100%;
    right: 16px;
    z-index: 1200;
  }

  .site-nav ul {
    display: none;                 /* hidden by default */
    flex-direction: column;
    gap: 0;
    background: var(--card);
    border: 1px solid var(--ring);
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 200px;
    box-shadow: 0 6px 20px var(--shadow-strong);
  }

  /* Show when the header has .nav-open (toggled by JS) */
  .site-header.nav-open .site-nav ul { display: flex; }

  /* Larger hit targets when stacked */
  .site-nav a {
    padding: 10px 8px;
    border-bottom-width: 0;
  }

  .site-nav a:hover,
  .site-nav a[aria-current="page"] {
    background: color-mix(in oklab, var(--leaf, var(--link)) 7%, white);
    border-radius: 8px;
  }
}

/* Skip link (visible on focus for keyboard users) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 10px;
  width: auto;
  height: auto;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--card);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
  z-index: 1100;
}

/* Adjust main container top padding so content doesn't sit under sticky header */
body > .container,
main.container {
  padding-top: 16px;
}

/* Responsive: stack brand and nav on narrow screens */
@media (max-width: 720px) {
  .nav-wrap { padding: 10px 16px; }
  .site-nav ul { gap: 12px; }
  .brand { font-size: 1rem; }
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.section-head .view-all {
  font-size: 0.9rem;
  text-decoration: none;
}
.section-head .view-all:hover {
  text-decoration: underline;
}

/* ===== Site Footer ===== */
.site-footer {
  border-top: 1px solid var(--ring);
  background:
    radial-gradient(700px 400px at 100% 20%, rgba(106,143,82,.06), transparent 60%),
linear-gradient(to bottom, transparent 0%, var(--bg) 90%);
  backdrop-filter: saturate(1.2) blur(4px);
  padding: 28px 16px;
  color: var(--ink);
  font-size: 0.9rem;
}
.footer-wrap {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.copyright {
  flex: 1 1 auto;
}
.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-nav a {
  color: var(--ink);
  text-decoration: none;
}
.footer-nav a:hover {
  text-decoration: underline;
}
.footer-newsletter {
  width: 100%;
  max-width: none;
  margin: 0;
  background-color: var(--bg);
  min-height: 150px;
  display: flex;
  align-items: center;        /* vertical centering of children */
  justify-content: flex-end;  /* align all content to the right */
  gap: 1.5rem;                /* spacing between instruction and iframe */
}
.footer-newsletter-instruction {
  color: var(--ink);
  font-size: 0.9rem;
  text-align: right;
  margin: 0 0 40px 0; /* wide screens: push it upward */
}

.footer-newsletter-instruction {
  margin-bottom: 95px; /* small screens: smaller gap */
}

.footer-newsletter-iframe iframe {
  display: block;
  width: 100%;
  max-width: 560px;           /* or the provider’s recommended width */
  height: 150px;              /* fixed height */
  min-height: 0;              /* ensure no min-height overrides */
  max-height: none;           /* prevent caps beyond fixed height */
  border: 0;
  flex: 0 0 auto;             /* don't let flexbox stretch it */
}

@media (max-width: 700px) {
  .footer-newsletter {
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    text-align: center;
    gap: 0.75rem;
  }
  .footer-newsletter-instruction {
    margin-bottom: 0px; /* small screens: smaller gap */
    text-align: center;
  }
  .footer-newsletter-iframe iframe {
    max-width: 100%;
    height: 150px;
    min-height: 0;
  }
}
.social {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.social a {
  color: var(--ink);
  text-decoration: none;
}
.social a:hover {
  text-decoration: underline;
}
@media (max-width: 720px) {
  .footer-wrap {
    flex-direction: column;
    align-items: flex-start;
  }
}

a:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--leaf, var(--link)) 65%, var(--ring));
  outline-offset: 2px;
  border-radius: 4px;
}

/* Buttons (consolidated, flicker-free) */
.btn {
  /* rendering + accessibility */
  will-change: transform, box-shadow, background-color, color, border-color;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;

  /* base visuals */
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--link);
  border-radius: 8px;
  text-decoration: none;
  color: var(--link);
  background: transparent;
  cursor: pointer;
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    background-color .15s ease,
    color .15s ease,
    border-color .15s ease;
  width: 80%;
  margin: 0 auto;
  text-align: center;
}

/* Lift on hover & keyboard focus */
.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 3px 6px var(--shadow);
}

/* Default button hover: filled */
.btn:hover {
  background-color: var(--link);
  color: var(--card);
  border-color: var(--link);
}

/* Primary variant: solid color (no gradient) to avoid repaint flicker */
.btn.primary {
  background-image: none;
  background-color: var(--link);
  color: #fff;
  border-color: color-mix(in oklab, var(--link) 80%, var(--ring));
}

/* Primary hover/focus: deepen color + stronger shadow */
.btn.primary:hover,
.btn.primary:focus-visible {
  background-color: color-mix(in oklab, var(--link) 75%, black 10%);
  box-shadow: 0 4px 10px var(--shadow-strong);
}

.index-page .content-body {
  max-width: none; /* fill card width by default */
  font-size: 1.05rem;
  line-height: 1.65;
}

.index-page .content-body p + p { margin-top: 1rem; }

.index-page .content-body h2,
.index-page .content-body h3,
.index-page .content-h3 {
  margin: 2rem 0 .5rem 0;
  font-size: 1.15rem;
}

/* Links inside content should use site link style but not underline by default */
.index-page .content-body a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in oklab, var(--link) 65%, transparent);
}
.index-page .content-body a:hover {
  border-bottom-color: var(--link);
}
