/* Next Pattern — the site's own stylesheet. kit.css (loaded first) holds the
   shared design and every token; this file sets only the accent and what a
   public, long-form reading site needs that the kit lacks. Same pattern as
   plate-and-glass's app.css.

   ACCENT: deep green. Checked by hand against the kit's backgrounds:
   light  white on --accent 6.3:1; --accent-strong on --bg 8.4:1, on
          --surface-sunken 7.8:1; --accent on --bg 5.9:1.
   dark   white on --accent 5.2:1; --accent-strong on --bg 9.1:1, on
          --surface 8.2:1. As in plate-and-glass, dark mode keeps the same
          structure as light (white on a deep fill) and --accent-strong is the
          bright tint used for text and edges. */

:root {
  --accent: #2f6b4a;
  --accent-strong: #235238;
  --accent-contrast: #ffffff;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #2f7a52;
    --accent-strong: #6fcf97;
    --accent-contrast: #ffffff;
  }
}

/* ---- page frame ---- */

/* kit.css pads body for a fixed bottom nav this site does not have. */
body { padding-bottom: 0; }

/* Wider than an app column; the article measure is set separately below. */
.site-main { max-width: 760px; padding: 20px 16px 32px; }

.topbar { max-width: 760px; margin: 0 auto; }
.topbar-name { text-decoration: none; color: var(--text); }
.topbar-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--space-2);
  font-weight: 600; color: var(--accent-strong);
}
.topbar-link[aria-current="page"] { text-decoration: none; }

.site-footer {
  max-width: 760px; margin: 0 auto; padding: 16px 16px 32px;
  color: var(--text-muted); font-size: var(--font-sm);
  border-top: 1px solid var(--border);
}
.site-footer p { margin: 0; }

/* Links in running text: kit resets <a> to inherit, so say what a link is. */
.site-main a { color: var(--accent-strong); text-underline-offset: 0.15em; }
.site-main a:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; border-radius: 2px; }

/* ---- landing page and other plain prose ---- */

.prose h1, .article h1 {
  font-size: 2rem; line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 var(--space-4);
}
.prose p { max-width: 36em; }

/* ---- blog list ---- */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-item { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.post-item:first-child { border-top: 0; }
.post-link { font-size: var(--font-lg); font-weight: 700; line-height: 1.3; }
.post-date { display: block; color: var(--text-muted); font-size: var(--font-sm); margin-top: var(--space-1); }
.post-summary { margin: var(--space-2) 0 0; max-width: 36em; }

/* ---- article: long-form reading ---- */

.article-head { margin-bottom: var(--space-5); }
.article-meta { margin: 0; color: var(--text-muted); font-size: var(--font-sm); }

/* Measure: ~65-70 characters per line is the readable range; 36em of this
   17px body font lands there. Applied to text blocks, not to code, tables
   and figures, which may use the full column. */
.article > p, .article > ul, .article > ol, .article > blockquote,
.article > h2, .article > h3, .article > dl {
  max-width: 36em;
}

/* Heading hierarchy below the h1 (set above): clear steps, and space above
   so a section break is visible without scanning for it. */
.article h2 { font-size: 1.5rem; line-height: 1.3; margin: var(--space-6) 0 var(--space-3); letter-spacing: -0.01em; }
.article h3 { font-size: 1.2rem; line-height: 1.35; margin: var(--space-5) 0 var(--space-2); }
.article p { margin: 0 0 var(--space-4); }

/* Lists: kit resets nothing here, but keep indent and rhythm explicit. */
.article ul, .article ol { margin: 0 0 var(--space-4); padding-left: 1.5em; }
.article li { margin-bottom: var(--space-1); }
.article li > ul, .article li > ol { margin-top: var(--space-1); margin-bottom: 0; }

/* Code, in the kit's tokens. Inline code is a small chip; blocks scroll
   sideways rather than wrapping or forcing the page wider on a phone. */
.article code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}
.article pre {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  line-height: 1.5;
  tab-size: 4;
}
.article pre code { background: none; border: 0; padding: 0; font-size: 0.88rem; }

/* Figures and captions. */
.article figure { margin: var(--space-5) 0; }
.article figure img { width: 100%; height: auto; border-radius: var(--radius-md); border: 1px solid var(--border); }
.article figcaption { margin-top: var(--space-2); color: var(--text-muted); font-size: var(--font-sm); line-height: 1.5; }
.article img { max-width: 100%; height: auto; }

/* Blockquote: accent rule at the edge, as the kit uses accent for edges. */
.article blockquote {
  margin: var(--space-5) 0;
  padding: var(--space-1) var(--space-4);
  border-left: 4px solid var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article blockquote p:last-child { margin-bottom: 0; }

/* Simple tables: horizontal scroll on narrow screens via display:block. */
.article table {
  display: block; overflow-x: auto; max-width: 100%;
  border-collapse: collapse; margin: 0 0 var(--space-4); font-size: 0.95rem;
}
.article th, .article td { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); text-align: left; vertical-align: top; }
.article th { background: var(--surface-sunken); font-weight: 700; }

.article hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

/* Wider screens: a little more air; the measure stays put. */
@media (min-width: 720px) {
  .site-main { padding-top: 32px; }
  .prose h1, .article h1 { font-size: 2.4rem; }
}

/* ---- landing page (coming soon) ----
   One idea: a Truchet-tile pattern in the accent, very faint, behind a large
   wordmark. Contrast: --text on --bg 13:1 light / 14:1 dark; --text-muted on
   --bg 4.9:1 light, 8:1 dark (the pattern sits at <=0.2 opacity under a mask
   that thins it behind the text, so text contrast is not materially reduced);
   the note uses --accent-strong, 8.4:1 / 9.1:1. */

.is-home .site-main { max-width: none; padding: 0; }
.is-home .site-footer { max-width: none; border-top: 0; text-align: center; padding-top: 0; }

.hero {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: calc(100svh - 90px);
  display: grid; align-items: center;
  padding: 48px 16px;
}
.hero-pattern {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1;
  fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round;
  opacity: 0.22;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0,0,0,0.25), #000 85%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, rgba(0,0,0,0.25), #000 85%);
}
@media (prefers-color-scheme: dark) { .hero-pattern { stroke: var(--accent-strong); opacity: 0.2; } }

.hero-inner { width: 100%; max-width: 1040px; margin: 0 auto; }
.hero-eyebrow {
  margin: 0 0 var(--space-3); font-size: var(--font-base); font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted);
}
.hero-title {
  margin: 0; font-weight: 800; line-height: 0.95; letter-spacing: -0.04em;
  font-size: clamp(3.4rem, 16vw, 9rem); color: var(--text);
  overflow-wrap: anywhere;
}
.hero-lede { margin-top: var(--space-5); font-size: clamp(1.3rem, 4.5vw, 2rem); line-height: 1.35; max-width: 20em; }
.hero-lede p { margin: 0; }
.hero-note {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin: var(--space-5) 0 0; padding: 6px 14px 6px 12px;
  border: 1px solid var(--accent-strong); border-radius: 999px;
  background: var(--surface); color: var(--accent-strong);
  font-size: var(--font-sm); font-weight: 600; letter-spacing: 0.03em;
}
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-strong); }

@media (min-width: 900px) {
  .hero { padding: 72px 48px; }
  .hero-note { font-size: var(--font-base); }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-pattern .row { opacity: 0; animation: row-in 1.6s ease-out forwards; animation-delay: calc(var(--r) * 90ms); }
  .hero-inner > * { opacity: 0; transform: translateY(8px); animation: rise 0.9s ease-out forwards; }
  .hero-eyebrow { animation-delay: 0.1s; } .hero-title { animation-delay: 0.2s; }
  .hero-lede { animation-delay: 0.4s; } .hero-note { animation-delay: 0.6s; }
  .hero-dot { animation: breathe 3.2s ease-in-out infinite; }
}
@keyframes row-in { to { opacity: 1; } }
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: 0.35; } }
