/* Leaf & Ledger static site. Self-hosted fonts only; no third-party requests. */

@font-face { font-family: "Alice"; src: url("../fonts/alice-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-300-italic.woff2") format("woff2"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --green: #228b22;
  --green-ink: #1d7a1d; /* green for text on white: 5.4:1 contrast (WCAG AA needs 4.5:1) */
  --green-card: #218a21;
  --green-deep: #023007;
  --green-button: #2c5e44;
  --green-submit: #286c38;
  --beige: #e0e0db;
  --navy: #02254f;
  --ink: #000;
  --muted: #5a5a5a;
  --line: #d6d6d0;
  --serif: "Alice", Georgia, "Times New Roman", serif;
  --sans: "Aptos", "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --nav: "Poppins", "Aptos", "Inter", system-ui, sans-serif;
  --wrap: 1000px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: #fff; line-height: 1.5; }
img, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; margin: 0; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: calc(var(--wrap) + 48px); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; color: #000; padding: 8px 12px; }

/* ---------- Header ---------- */
.site-header { position: absolute; top: 0; left: 0; right: 0; z-index: 10; padding-top: 96px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.logo img { width: 125px; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.nav a { display: block; padding: 10px 30px 12px; font-family: var(--nav); font-size: 18px; letter-spacing: 1.8px; text-transform: uppercase; text-decoration: none; color: #fff; border-bottom: 2.4px solid transparent; }
.nav a:hover, .nav a:focus-visible { border-bottom-color: rgba(255,255,255,.6); }
.nav a[aria-current="page"] { border-bottom-color: #fff; }

/* Solid header band for pages without a hero image */
.band { background: var(--green-deep); min-height: 300px; position: relative; }

/* ---------- Heroes ---------- */
.hero { position: relative; color: #fff; overflow: hidden; background: #1a1a1a; }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-home { height: min(100vh, 860px); min-height: 600px; }
.hero-home .hero-text { position: relative; z-index: 2; padding-top: 360px; }
.hero-home h1 { font-size: 48px; line-height: 1.1; }
.hero-home h1 span { display: block; }
.hero-home h1 .gap { margin-top: 0.9em; }
.hero-video { z-index: 1; background: transparent; }

.hero-page { height: 630px; display: flex; align-items: center; justify-content: center; text-align: center; }
.hero-page .hero-text { position: relative; z-index: 2; padding-top: 140px; }
.hero-page h1, .hero-page .hero-title { font-family: var(--serif); font-size: 48px; line-height: 1.1; margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,.35); }
.hero-page h1 span { display: block; }
.hero-page .sub { font-family: var(--sans); font-size: 20px; margin-top: 16px; text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.hero-short { height: 460px; }

@media (prefers-reduced-motion: reduce) {
  .hero-video { display: none; }
}

/* ---------- Home ---------- */
.intro { background: var(--beige); padding: 150px 0; }
.intro .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 100px; align-items: start; }
.intro h2 { font-size: 35px; line-height: 1.5; padding-bottom: 24px; border-bottom: 2px solid var(--navy); }
.intro h2 .brand { color: var(--green); }
.intro p { font-size: 24px; line-height: 1.5; }
.intro a { font-weight: 600; }

.quote { position: relative; color: #fff; padding: 170px 0 200px; overflow: hidden; background: #0c1116; }
.quote .wrap { position: relative; z-index: 2; }
.quote blockquote { margin: 0; max-width: 720px; }
.quote blockquote p { font-family: var(--serif); font-style: italic; font-size: 32px; line-height: 1.3; margin-bottom: 40px; }
.quote footer { font-family: var(--sans); font-style: italic; font-weight: 300; font-size: 22px; line-height: 1.35; }
.quote footer span { display: block; }

/* ---------- About ---------- */
.about-main { background: var(--green-deep); padding: 80px 0 0; }
.about-main .wrap { max-width: 1240px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }
.about-main .tree { align-self: end; justify-self: center; width: 300px; }
.card { background: #fff; border-top: 6px solid var(--green-card); padding: 28px 26px 40px; margin-bottom: 80px; }
.card h2 { font-weight: 400; font-size: 35px; margin-bottom: 24px; letter-spacing: .5px; }
.card p { font-size: 18px; line-height: 1.3; margin-bottom: 1.25em; }
.about-more { padding: 40px 0 80px; }
.about-more .wrap { max-width: 1240px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-more .sketch-swap { position: relative; width: 460px; max-width: 100%; justify-self: center; }
.about-more .sketch { display: block; width: 100%; height: auto; }
.about-more .sketch-hover { position: absolute; inset: 0; height: 100%; opacity: 0; transition: opacity .6s ease; }
.about-more .sketch-swap:hover .sketch-hover { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .about-more .sketch-hover { transition: none; } }
.button { display: inline-block; justify-self: center; background: var(--green-button); color: #fff; font-family: var(--serif); font-size: 17px; letter-spacing: .5px; text-decoration: none; padding: 14px 40px; border: 1px solid #1d3f2d; }
.button:hover, .button:focus-visible { background: #234b37; }

/* ---------- Founder ---------- */
.founder { background: #000; color: #fff; padding: 100px 0 90px; }
.founder .wrap { display: grid; grid-template-columns: 370px 1fr; gap: 90px; align-items: start; }
.portrait { width: 370px; height: 370px; border-radius: 50%; object-fit: cover; background: #fff; }
.founder .icons { margin: 18px 0 10px; }
.founder h2 { font-weight: 400; font-size: 32px; line-height: 1.2; margin-top: 18px; text-shadow: 0 0 .5px #fff; }
.founder .role { font-family: var(--serif); font-size: 22px; margin: 2px 0 28px; }
.founder ul { font-family: var(--nav); font-size: 18px; line-height: 1.3; padding-left: 30px; margin: 0; }
.founder ul ul { padding-left: 30px; margin-top: 4px; list-style: circle; }
.founder li { margin-bottom: 26px; }
.founder li.tight { margin-bottom: 4px; }
.founder ul ul li { margin-bottom: 4px; }
.founder strong { font-weight: 600; }
.founder .bio p { font-family: var(--nav); font-size: 24px; line-height: 1.3; margin-bottom: 1.3em; }

/* ---------- Contact ---------- */
.contact { padding: 70px 0 110px; }
.contact .wrap { max-width: 1240px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 80px; align-items: start; }
.contact .art { display: grid; gap: 30px; justify-items: center; }
.contact .art img { width: 320px; }
.contact .art .arrow { width: 24px; height: 90px; }
.contact .note p { font-size: 20px; line-height: 1.5; }
.contact-card { margin-top: 32px; border: 2px solid #002a00; border-radius: 4px; padding: 28px; }
.contact-card h2 { font-size: 26px; margin-bottom: 12px; }
.contact-card p { font-size: 18px; }
.contact-card .button-wide { display: block; text-align: center; background: var(--green-submit); color: #fff; text-decoration: none; padding: 12px 20px; font-size: 18px; margin-top: 18px; }
.contact-card .button-wide:hover, .contact-card .button-wide:focus-visible { background: #1f572c; }

/* ---------- Blog ---------- */
.ledger-sub { font-family: var(--sans); }
.cats { border-bottom: 1px solid var(--line); }
.cats ul { list-style: none; margin: 0; padding: 18px 0; display: flex; flex-wrap: wrap; gap: 6px 26px; font-size: 15px; }
.cats a { text-decoration: none; color: #333; }
.cats a:hover, .cats a:focus-visible { color: var(--green-ink); }
.cats a[aria-current="page"] { color: var(--green-ink); font-weight: 600; }
.archive { padding: 50px 0 90px; }
.archive h2.archive-title { font-size: 30px; margin-bottom: 30px; }
.post-card { display: grid; grid-template-columns: 380px 1fr; gap: 0; border: 1px solid var(--line); margin-bottom: 36px; background: #fff; }
.post-card .thumb { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #eee; }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 34px 38px; display: flex; flex-direction: column; }
.post-card .card-title { font-size: 26px; line-height: 1.3; margin-bottom: 14px; }
.post-card .card-title a { text-decoration: none; }
.post-card .card-title a:hover, .post-card .card-title a:focus-visible { color: var(--green-ink); }
.post-card .excerpt { font-size: 16px; line-height: 1.6; color: #333; flex: 1; }
.meta { font-size: 14px; color: var(--muted); }
.meta span + span::before { content: "·"; margin: 0 8px; }

/* ---------- Article ---------- */
.article-wrap { padding: 60px 0 40px; }
.article { max-width: 760px; margin: 0 auto; }
.article h1 { font-size: 40px; line-height: 1.2; margin: 10px 0 18px; }
.article .meta { margin-bottom: 40px; }
.prose { font-size: 19px; line-height: 1.7; }
.prose p { margin: 0 0 1.25em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--sans); font-weight: 600; margin: 1.6em 0 .6em; line-height: 1.3; }
.prose h2 { font-size: 24px; }
.prose h3 { font-size: 21px; }
.prose a { color: var(--green-ink); text-underline-offset: 2px; }
.prose figure { margin: 2em 0; }
.prose figure img { margin: 0 auto; }
.prose figcaption { font-size: 15px; color: var(--muted); text-align: center; margin-top: 10px; }
.prose blockquote { border-left: 3px solid var(--green); margin: 1.5em 0; padding: 0 0 0 20px; font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.25em; }
.prose li { margin-bottom: .4em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 16px; margin: 1.5em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose sup a { text-decoration: none; }
.footnotes { font-size: 15px; line-height: 1.6; color: #333; font-style: italic; }
.footnotes li { margin-bottom: .8em; }
.footnotes li:target { background: #f1f5ee; }
.tags { list-style: none; padding: 0; margin: 40px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.tags a { display: inline-block; border: 1px solid var(--line); padding: 6px 14px; font-size: 14px; text-decoration: none; }
.tags a:hover, .tags a:focus-visible { border-color: var(--green-ink); color: var(--green-ink); }
.recent { border-top: 1px solid var(--line); margin-top: 60px; padding: 40px 0 80px; }
.recent-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 24px; }
.recent-head h2 { font-size: 26px; }
.recent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.recent-grid a { text-decoration: none; display: block; border: 1px solid var(--line); }
.recent-grid img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.recent-grid span { display: block; padding: 14px 16px 18px; font-family: var(--serif); font-size: 18px; line-height: 1.35; }
.recent-grid a:hover span, .recent-grid a:focus-visible span { color: var(--green-ink); }

/* ---------- Legal ---------- */
.legal { padding: 70px 0 100px; }
.legal .wrap { max-width: 860px; }
.legal h1 { font-size: 38px; line-height: 1.2; margin-bottom: 30px; }
.legal h2 { font-family: var(--sans); font-weight: 600; font-size: 20px; margin: 2em 0 .6em; }
.legal p, .legal li { font-size: 17px; line-height: 1.65; }
.legal .updated { color: var(--muted); font-size: 15px; margin-top: 2.5em; }

/* ---------- Footer ---------- */
.site-footer { padding: 42px 0 70px; background: #fff; }
.site-footer .wrap { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; }
.site-footer .logo img { width: 112px; }
.footer-right { text-align: right; font-size: 12px; line-height: 1.4; }
.icons { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 30px; }
.icons a { display: block; width: 38px; height: 38px; }
.icons svg { width: 38px; height: 38px; display: block; }
.footer-right p { margin: 0; }
.particulars { max-width: 460px; margin-left: auto !important; margin-top: 14px !important; color: #333; }
.legal-links { margin-top: 26px !important; }
.legal-links a { text-decoration: none; }
.legal-links a:hover, .legal-links a:focus-visible { text-decoration: underline; }
.legal-links span { margin: 0 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .site-header { padding-top: 32px; }
  .site-header .wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .logo img { width: 92px; }
  .nav ul { flex-wrap: wrap; gap: 0; }
  .nav a { font-size: 14px; letter-spacing: 1.2px; padding: 8px 14px 10px 0; margin-right: 14px; }
  .hero-home { height: auto; min-height: 640px; }
  .hero-home .hero-text { padding-top: 300px; padding-bottom: 60px; }
  .hero-home h1, .hero-page h1, .hero-page .hero-title { font-size: 34px; }
  .hero-page { height: 520px; }
  .hero-page .hero-text { padding-top: 180px; }
  .hero-short { height: 440px; }
  .intro { padding: 80px 0; }
  .intro .wrap, .about-main .wrap, .about-more .wrap, .founder .wrap, .contact .wrap { grid-template-columns: 1fr; gap: 40px; }
  .intro h2 { font-size: 28px; }
  .intro p { font-size: 19px; }
  .quote { padding: 100px 0 120px; }
  .quote blockquote p { font-size: 25px; }
  .quote footer { font-size: 18px; }
  .about-main .tree { order: 2; width: 220px; }
  .portrait, .founder .wrap > div:first-child { max-width: 100%; }
  .portrait { width: 280px; height: 280px; }
  .founder .bio p { font-size: 19px; }
  .post-card { grid-template-columns: 1fr; }
  .post-card .body { padding: 24px; }
  .recent-grid { grid-template-columns: 1fr; }
  .article h1 { font-size: 30px; }
  .prose { font-size: 17.5px; }
  .site-footer .wrap { flex-direction: column; }
  .footer-right { text-align: left; }
  .icons { justify-content: flex-start; }
  .particulars { margin-left: 0 !important; }
}

/* Post body extras */
.prose .dek { font-size: 1.1em; }
.prose a.fnref { text-decoration: none; font-size: .85em; vertical-align: super; line-height: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0 1.5em; }
.footnotes-block, .post-notes { font-size: 15px; line-height: 1.6; color: #333; }
.footnotes-block p.fn { margin-bottom: .8em; }
.footnotes-block :target, .footnotes :target, .prose :target { background: #f1f5ee; }
.fnback { text-decoration: none; margin-left: .3em; }
.prose figure a { display: block; }
.prose li > figure { margin: 1em 0; }

/* About page: the circuit tree grows upward as the section scrolls into view (CSS only, no script).
   Browsers without scroll-driven animations, and visitors who prefer reduced motion, see the full tree. */
@keyframes tree-grow { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .about-main .tree {
      animation: tree-grow ease-in-out both;
      animation-timeline: view();
      animation-range: entry 0% cover 50%;
    }
  }
}

/* ---------- UX refinements (Nov 2026) ---------- */
/* Post pages: slimmer banner so the article starts higher */
.hero-post { height: 380px; }
.hero-post .hero-text { padding-top: 150px; }
.hero-post .sub { font-size: 18px; margin-top: 10px; }

/* End of post: previous / next and back to top */
.post-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 48px 0 0; padding-top: 28px; border-top: 1px solid var(--line); }
.post-pager a { display: block; text-decoration: none; padding: 14px 16px; border: 1px solid var(--line); }
.post-pager a:hover, .post-pager a:focus-visible { border-color: var(--green-ink); }
.post-pager .next { text-align: right; grid-column: 2; }
.post-pager .dir { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.post-pager .t { display: block; font-family: var(--serif); font-size: 18px; line-height: 1.35; }
.post-pager a:hover .t, .post-pager a:focus-visible .t { color: var(--green-ink); }
.to-top { margin: 24px 0 0; font-size: 15px; }
.to-top a { color: var(--muted); }

/* Charts open full size on click or tap */
.prose a.zoom { display: block; cursor: zoom-in; }
.prose a.zoom:focus-visible { outline: 2px solid var(--green-ink); outline-offset: 4px; }

/* Table header row */
.prose th { font-weight: 600; background: #f4f4f0; }

@media (max-width: 900px) {
  /* Main menu fits on one row on phones */
  .nav ul { flex-wrap: nowrap; gap: 0; justify-content: space-between; width: 100%; }
  .site-header .wrap > .nav { width: 100%; }
  .nav a { font-size: clamp(11px, 3.4vw, 14px); letter-spacing: .06em; padding: 8px 0 10px; margin-right: 0; white-space: nowrap; }
  /* Blog categories: one row that scrolls sideways instead of wrapping onto several lines */
  .cats .wrap { padding: 0; }
  .cats ul { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 22px; padding: 14px 24px; scrollbar-width: none;
             -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .cats ul::-webkit-scrollbar { display: none; }
  .cats li { flex: none; }
  .cats li:last-child { padding-right: 32px; }
  .hero-post { height: 340px; }
  .hero-post .hero-text { padding-top: 184px; }
  .article-wrap { padding-top: 36px; }
  .hero-post .sub { font-size: 15px; }
  .post-pager { grid-template-columns: 1fr; }
  .post-pager .next { grid-column: 1; }
}

/* ---------- Blog archive refinements ---------- */
/* Thumbnail fills the full height of its card (no white strip under it) */
.post-card .thumb { aspect-ratio: auto; min-height: 285px; height: 100%; position: relative; }
.post-card .thumb img { position: absolute; inset: 0; }
/* Chart covers are shown whole on white rather than cropped */
.post-card .thumb.fit { background: #fff; border-right: 1px solid var(--line); }
.post-card .thumb.fit img, .recent-grid a.fit img { object-fit: contain; padding: 12px; background: #fff; }
.recent-grid a.fit img { border-bottom: 1px solid var(--line); }
/* Recent posts line up with the article column */
.recent { max-width: 760px; margin-left: auto; margin-right: auto; }
.recent-grid { gap: 16px; }
.recent-grid span { font-size: 16px; }

/* Category row: one centred line on wide screens, a sideways-scrolling line below that */
@media (min-width: 1240px) {
  .cats .wrap { max-width: 1248px; }
  .cats ul { flex-wrap: nowrap; justify-content: center; gap: 24px; }
}
@media (min-width: 901px) and (max-width: 1239px) {
  .cats .wrap { padding: 0; }
  .cats ul { flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 24px; padding: 18px 24px; scrollbar-width: none;
             -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .cats ul::-webkit-scrollbar { display: none; }
  .cats li { flex: none; }
  .cats li:last-child { padding-right: 32px; }
}

@media (max-width: 900px) {
  .post-card .thumb { aspect-ratio: 16 / 9; min-height: 0; height: auto; }
  .post-card .thumb.fit { border-right: 0; border-bottom: 1px solid var(--line); }
  /* Shorter cards on phones: summary limited to four lines (full text is in the post) */
  .post-card .excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
  .recent { max-width: none; }
}
