/* Fern Alley: dark "Night" palette from the Fern Alley design system */
@font-face { font-family: "Marcellus"; src: url(/fonts/marcellus-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url(/fonts/public-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(/fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --surface: #0b1220; --raised: #121b2c; --sunken: #070c16;
  --line: #26324a; --line-strong: #66748f;
  --ink: #e6ecf5; --muted: #9aa8bf; --slate: #8fa0bb;
  --navy: #2f4f80; --mist: #33415c;
  --fern: #c2ef5e; --on-fern: #0e1a2b;
  --display: Marcellus, "Iowan Old Style", Georgia, serif;
  --sans: "Public Sans", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; background: var(--surface); color: var(--ink); font: 16px/1.65 var(--sans); padding-bottom: env(safe-area-inset-bottom, 0px); }
img { max-width: 100%; height: auto; }
a { color: var(--fern); }
a:hover { color: var(--ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--fern); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; }
p { margin: 0; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.narrow { max-width: 760px; }
.muted, .small { color: var(--muted); }
.small { font-size: 13px; line-height: 1.4; }
.eyebrow { font-family: var(--display); font-size: 14px; letter-spacing: 0.08em; color: var(--fern); }
.lead { font-size: 19px; line-height: 1.6; color: var(--muted); }
.drule { height: 6px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }

/* Header */
.site-header { background: var(--raised); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }
.logo img { display: block; width: 180px; }
.site-header nav { display: flex; gap: 28px; flex-wrap: wrap; }
.site-header nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--fern); }

/* Buttons */
.btn { display: inline-flex; align-items: center; min-height: 48px; padding: 0 24px; border-radius: 4px; font: 600 15px/1 var(--sans); text-decoration: none; cursor: pointer; border: 1px solid transparent; }
.btn-primary { background: var(--fern); color: var(--on-fern); }
.btn-primary:hover { background: #d3f57f; color: var(--on-fern); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { border-color: var(--fern); color: var(--fern); }

/* Hero */
.hero { background: var(--raised); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: center; padding-top: 48px; padding-bottom: 72px; }
.hero-copy { display: flex; flex-direction: column; gap: 24px; }
.hero h1 { font-size: clamp(40px, 5vw, 56px); line-height: 1.08; }
.hero .lead { max-width: 34rem; }
.actions { display: flex; gap: 16px; flex-wrap: wrap; }
.hero-fern { display: block; width: 100%; max-width: 460px; margin: 0 auto; }

/* Sections */
.block { padding-top: 72px; padding-bottom: 72px; }
.block + .block { padding-top: 0; }
.section-rule { display: flex; align-items: center; gap: 24px; margin-bottom: 40px; }
.section-rule::before, .section-rule::after { content: ""; flex: 1; height: 6px; border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong); }
.section-rule span { font-family: var(--display); font-size: 15px; letter-spacing: 0.08em; color: var(--slate); }
.areas { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 24px; }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 4px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { font-size: 24px; line-height: 1.3; }
.card h2 a { color: var(--ink); text-decoration: none; }
.card h2 a:hover { color: var(--fern); }
.card p { color: var(--muted); }

.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 48px; align-items: start; }
.quote { margin: 0; background: var(--mist); border-radius: 4px; padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.quote blockquote { margin: 0; font: 30px/1.35 var(--display); }
.quote figcaption { font-size: 14px; color: #d6deea; }
.row-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.row-head h2 { font-size: 34px; line-height: 1.25; }
.row-head a { font-weight: 600; font-size: 15px; }

.post-row { padding: 22px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.post-row time { font: 13px/1.4 var(--mono); color: var(--muted); }
.post-row h3 { font-size: 24px; line-height: 1.3; }
.post-row h3 a { color: var(--ink); text-decoration: none; }
.post-row h3 a:hover { color: var(--fern); }
.post-row p { color: var(--muted); }

/* Pages and posts */
.page-head { padding-top: 64px; padding-bottom: 24px; display: flex; flex-direction: column; gap: 16px; }
.page-head h1, .post h1 { font-size: clamp(36px, 5vw, 52px); line-height: 1.1; }
.post { padding-top: 56px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 20px; }
.crumb { font: 13px var(--mono); }
.meta { font-size: 14px; color: var(--muted); padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags.end { padding-top: 16px; border-top: 1px solid var(--line); }
.tag { background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; padding: 4px 8px; border-radius: 2px; text-decoration: none; }
.tag-muted { background: var(--mist); color: var(--ink); }
.prose { font-size: 17px; line-height: 1.7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 28px; line-height: 1.3; margin-top: 1.6em; }
.prose h3 { font-size: 22px; margin-top: 1.4em; }
.prose img { border-radius: 4px; }
.prose code { font: 0.9em var(--mono); background: var(--sunken); padding: 2px 5px; border-radius: 2px; }
.prose pre { background: var(--sunken); border: 1px solid var(--line); border-radius: 4px; padding: 18px 22px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 14px; }
.prose blockquote { margin-left: 0; padding-left: 20px; border-left: 2px solid var(--fern); font-family: var(--display); font-size: 22px; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; }

/* Contribute form */
.form { display: flex; flex-direction: column; gap: 20px; padding-top: 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 15px; }
.form .req { font-weight: 400; color: var(--muted); }
.form input, .form select, .form textarea { font: 16px/1.5 var(--sans); color: var(--ink); background: var(--sunken); border: 1px solid var(--line-strong); border-radius: 4px; padding: 10px 12px; }
.form textarea { resize: vertical; }
.form .btn { align-self: flex-start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */
.site-footer { background: var(--sunken); padding-bottom: 40px; }
.foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; align-items: start; padding-top: 40px; }
.foot img { display: block; width: 160px; margin-bottom: 12px; }
.foot p { color: var(--muted); font-size: 14px; }
.foot nav { display: flex; flex-direction: column; gap: 8px; font-size: 15px; }

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