/* ─────────────────────────────────────────────────────────────────────────
   Pith — Satsuma Ventures thought-leadership publication
   Tokens mirror studio/design-system/colors_and_type.css
   ───────────────────────────────────────────────────────────────────────── */
:root {
  --grove:      #2E5428;
  --grove-700:  #1E371A;
  --satsuma:    #D4681E;
  --deep-ink:   #1C2818;
  --linen:      #F2ECDD;
  --mist:       #F6F8F3;
  --warm-bark:  #E8DED0;
  --rule:       #D8DDD0;
  --muted:      #5A6B52;

  --font-display: 'Libre Baskerville', Georgia, 'Times New Roman', serif;   /* nameplate + titles */
  --font-ui:      'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; /* labels, nav, bio */
  --font-read:    'Average', Georgia, 'Times New Roman', serif;             /* Pith reading copy */

  --tracking-label: 0.14em;
  --measure: 40rem;               /* reading measure for prose */
  --gutter: clamp(1.5rem, 5vw, 3rem);
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; }
body {
  background: var(--linen);
  color: var(--deep-ink);
  font-family: var(--font-ui);
  line-height: 1.75;
  min-height: 100vh;
  min-height: 100dvh; /* fill the viewport even with mobile browser chrome */
  display: flex;
  flex-direction: column;
}
a { color: var(--grove); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── Faded tree — sticks to the viewport bottom while reading, then rests on
      the footer at the end. Sticky (not fixed) so it lives in the scrollable
      document and rides the browser's rubber-band overscroll with the page.
      A zero-height slot placed just above the footer; the tree overflows upward
      from it via ::before, so it never affects layout. ────────────────────── */
.tree-bg {
  position: sticky;
  bottom: 0;
  align-self: stretch;  /* full width, so the tree anchors to the viewport's right edge */
  height: 0;            /* no layout impact — the visual overflows this slot */
  z-index: -1;
  pointer-events: none;
}
.tree-bg::before {
  content: "";
  position: absolute;
  right: 0; bottom: 0;
  width: min(46vw, 560px);
  aspect-ratio: 1600 / 1534;
  background: var(--grove);
  opacity: 0.09;
  -webkit-mask: url(/assets/satsuma-tree-outline.svg) no-repeat right bottom / contain;
          mask: url(/assets/satsuma-tree-outline.svg) no-repeat right bottom / contain;
}
@media (max-width: 40rem) { .tree-bg::before { width: 62vw; } }

.wrap { width: 100%; max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter); }

/* ── Masthead ─────────────────────────────────────────────────────────── */
.masthead {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem var(--gutter);
  max-width: 46rem; margin: 0 auto; width: 100%;
  border-bottom: 1px solid var(--rule);
}
.masthead-left { display: inline-flex; align-items: baseline; gap: 1rem; }
.masthead-name {
  font-family: var(--font-display);
  font-size: 1.75rem; font-weight: 700; color: var(--deep-ink);
  letter-spacing: 0.02em;
}
.masthead-name:hover { text-decoration: none; color: var(--grove); }
.masthead-nav {
  font-family: var(--font-ui);
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--muted);
}
.masthead-nav:hover { text-decoration: none; color: var(--grove); }
.masthead-brand {
  display: inline-flex; flex-direction: column; align-items: flex-end; gap: 0.3rem;
  text-align: right;
}
.masthead-brand:hover { text-decoration: none; }
.masthead-brand-label {
  font-size: 0.62rem; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--muted);
}
.masthead-lockup { display: block; height: 1.5rem; width: auto; }

/* ── Archive ──────────────────────────────────────────────────────────── */
main.wrap { flex: 1 0 auto; } /* absorbs slack so the footer never floats mid-page */
.kicker {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--satsuma); font-weight: 600; margin-bottom: 1rem;
}
.archive .kicker { padding-top: clamp(2.5rem, 7vw, 4rem); }
.archive-empty { padding: 2rem 0; color: var(--muted); }
.entries { list-style: none; padding: 0.5rem 0 4rem; }
.entry { border-bottom: 1px solid var(--rule); }
.entry-link { display: block; padding: 2rem 0; color: inherit; }
.entry-link:hover { text-decoration: none; }
.entry-link:hover .entry-title { color: var(--grove); }
.entry-num {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--satsuma); font-weight: 600;
}
.entry-title {
  font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1.2;
  margin: 0.5rem 0 0; transition: color var(--ease-out) 180ms;
}
.entry-dek { font-family: var(--font-read); font-size: 1.18rem; line-height: 1.5; margin-top: 0.6rem; color: var(--muted); }
.entry-meta {
  display: block; margin-top: 0.75rem;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--muted);
}

/* ── Piece ────────────────────────────────────────────────────────────── */
.piece-head { padding: clamp(3rem, 8vw, 5rem) 0 2rem; text-align: center; }
.piece-num {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: var(--tracking-label);
  color: var(--satsuma); font-weight: 600; margin-bottom: 1rem;
}
.piece-title {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.12; letter-spacing: -0.01em;
  max-width: 24ch; margin: 0 auto;
}
.piece-byline {
  margin-top: 1.25rem; font-size: 0.8rem; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--muted);
}

.prose { font-family: var(--font-read); font-size: 1.3rem; line-height: 1.5; }
.prose > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
.prose p { margin: 0 auto 1.5rem; }
.prose p:first-of-type::first-letter {
  font-family: var(--font-display); font-weight: 700;
  font-size: 4.4rem; line-height: 0.8; float: left;
  padding: 0.35rem 0.55rem 0 0; color: var(--grove);
}
.prose a { color: var(--grove); text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--grove); }
.prose em { font-style: italic; }
.prose strong { font-weight: 600; }
.prose blockquote {
  border-left: 3px solid var(--satsuma); padding-left: 1.25rem; margin: 2rem auto;
  color: var(--grove-700); font-style: italic;
}
.prose h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  line-height: 1.25; margin: 3rem auto 1rem;
}
.prose h3 { font-size: 1.2rem; font-weight: 600; margin: 2.25rem auto 0.75rem; }
.prose ul, .prose ol { margin: 0 auto 1.5rem; padding-left: 1.5rem; }
.prose li { margin-bottom: 0.5rem; }
/* horizontal rules become a centered ornament between movements */
.prose hr {
  border: 0; margin: 2.75rem auto; max-width: 8rem; text-align: center;
}
.prose hr::before {
  content: "* * *"; display: block; text-align: center;
  color: var(--muted); letter-spacing: 0.5em; font-size: 0.9rem;
}

/* ── Colophon / bio box (piece end — Plus Jakarta, upright, boxed) ─────── */
.colophon {
  max-width: var(--measure); margin: 3.25rem auto 0;
  font-family: var(--font-ui); font-style: normal;
  background: var(--warm-bark);
  border-radius: 10px; padding: 1.5rem 1.75rem;
}
.colophon p { font-style: normal; margin: 0; }
.colophon em, .colophon i { font-style: normal; }
.colophon-bio { font-size: 0.95rem; line-height: 1.6; color: var(--deep-ink); }
.colophon-note {
  margin-top: 0.85rem !important; padding-top: 0.85rem;
  border-top: 1px solid #CDC0AB; /* darker shade of the warm-bark box, not the green rule */
  font-size: 0.82rem; line-height: 1.6; color: var(--deep-ink);
}

/* ── Piece nav + back ─────────────────────────────────────────────────── */
.piece-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  margin: 3.5rem auto 0; max-width: var(--measure);
  border-top: 1px solid var(--rule); padding-top: 1.75rem;
}
.piece-nav a { display: block; color: inherit; }
.piece-nav a:hover { text-decoration: none; }
.piece-nav a:hover strong { color: var(--grove); }
.piece-nav span { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: var(--tracking-label); color: var(--muted); }
.piece-nav strong { display: block; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; margin-top: 0.35rem; }
.piece-nav-next { text-align: right; }
.piece-back { text-align: center; margin: 2.5rem auto 4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: var(--tracking-label); }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-foot {
  flex-shrink: 0; border-top: 1px solid var(--rule); padding: 1.75rem 0; margin-top: auto;
  font-size: 0.8rem; color: var(--muted);
}
.site-foot .wrap { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.site-foot-note { font-style: italic; }

@media (max-width: 32rem) {
  .piece-nav { grid-template-columns: 1fr; }
  .piece-nav-next { text-align: left; }
}
