/* ================= base: layout + reading comfort rules shared by every theme =================
   reading policy: body text >= 18px, line-height ~1.7, line length 60-70 characters,
   left-aligned (never justified), soft but strong contrast (>= 7:1 for body text),
   balanced headings, no orphans in paragraphs, generous paragraph spacing, motion only if allowed. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: var(--size-body); line-height: var(--lh-body); font-kerning: normal; font-synthesis: none; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--accent); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--accent); color: var(--on-accent); }
h1, h2, h3 { font-family: var(--font-head); text-wrap: balance; }
p, li { text-wrap: pretty; }
:lang(fr) .prose p { hyphens: auto; -webkit-hyphens: auto; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 20; background: var(--surface); color: var(--text); padding: 8px 12px; }

/* header / nav */
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.site-header nav { display: flex; gap: 20px; }
.site-header nav a { text-decoration: none; }

/* home */
.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 24px; }
.card { display: flex; flex-direction: column; }
.card h2 a { color: inherit; text-decoration: none; }
.card h2 a:hover { color: var(--accent); }
.card p { margin: 0 0 16px; }
.card .more { margin-top: auto; }
.kicker { margin: 0; }
.more { font-weight: 700; color: var(--accent-text); text-decoration: none; }
.more:hover { text-decoration: underline; }

/* article */
.crumbs { font-size: .875em; padding-top: 28px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.post-head { max-width: var(--measure); }
.lede { color: var(--muted); }
.meta { font-size: .875em; color: var(--muted); }
.disclosure { max-width: var(--measure); font-size: .85em; line-height: 1.6; color: var(--muted); padding: 12px 16px; background: var(--soft); }
.toc p { margin: 0 0 6px; font-weight: 700; }
.toc ol { margin: 0; padding-left: 1.3em; }
.toc li { margin: 5px 0; line-height: 1.4; }
.prose { max-width: var(--measure); }
.prose p, .prose ul, .prose ol { margin: 0 0 1.15em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .4em 0; }
.prose li::marker { color: var(--accent-text); }
.prose h2 { margin: 2.1em 0 .6em; scroll-margin-top: 24px; }
.prose h3 { margin: 1.7em 0 .4em; }
.prose strong { font-weight: 700; color: var(--strong, inherit); }
.prose code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .88em; padding: .1em .35em; background: var(--soft); border-radius: 4px; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; max-width: 100%; }
.prose table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .88em; line-height: 1.5; font-variant-numeric: tabular-nums; }
.prose th, .prose td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose thead th { border-bottom: 2px solid var(--text); }
.prose tbody th { font-weight: 700; }
.tip { margin: 1.8em 0; }
.page { max-width: var(--measure); }
.page h1 { margin-top: 1.2em; }
main.page { padding-bottom: 64px; }

/* author + related */
.author { display: flex; gap: 18px; align-items: flex-start; margin: 56px 0 40px; max-width: var(--measure); }
.avatar { flex: none; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 700 1.4rem/1 var(--font-head); }
.author p { margin: 0 0 6px; font-size: .92em; line-height: 1.6; }
.author .name { font-weight: 700; }
.author .role { color: var(--muted); }
.related { margin-bottom: 72px; max-width: var(--measure); }
.related ul { list-style: none; padding: 0; display: grid; gap: 16px; }
.related li a { font-weight: 700; }
.related li span { display: block; color: var(--muted); font-size: .9em; line-height: 1.55; }

/* footer */
.site-footer { color: var(--muted); font-size: .875rem; line-height: 1.6; padding: 32px 0; }
.site-footer p { margin: 4px 0; }
.site-footer a { color: inherit; }

/* reading progress bar (pure css, only in browsers that support scroll timelines) */
.progress { position: fixed; inset: 0 0 auto 0; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); z-index: 10; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .progress { animation: progress linear both; animation-timeline: scroll(root); }
    @keyframes progress { to { transform: scaleX(1); } }
  }
}
@supports not (animation-timeline: scroll()) { .progress { display: none; } }

@media (max-width: 560px) {
  body { font-size: calc(var(--size-body) - 1px); }
  .author { flex-direction: column; }
}
@media print {
  .site-header, .site-footer, .toc, .progress, .related, .disclosure { display: none; }
  body { background: #fff; color: #000; }
}

/* drop-cap paragraph keeps its float inside (avoids the letter spilling into a following list) */
.prose > h2:first-child + p { display: flow-root; }
/* kicker label inside cards keeps its small size */
.card p.kicker { font-size: .74rem; margin: 0; }

/* ================= theme 2 — "Field Notes" : oat paper, forest green, editorial magazine with a developer accent =================
   body: Newsreader (Production Type, designed for on-screen reading, optical sizes)
   headings: Instrument Serif (elegant condensed display serif)
   labels, meta and code: JetBrains Mono */
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("/fonts/newsreader-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 800; font-style: normal; font-display: swap; }
:root {
  --font-body: "Newsreader", Georgia, "Times New Roman", serif;
  --font-head: "Instrument Serif", "Newsreader", Georgia, serif;
  --font-ui: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --font-mono: var(--font-ui);
  --size-body: 1.25rem; --lh-body: 1.7; --measure: 64ch; --max: 1120px;
  --bg: #f7f4ec; --surface: #fffdf7; --soft: #e9eee2; --text: #24231e; --muted: #57564b; --line: #e2ddd0; --strong: #15150f;
  --accent: #2f6b3f; --accent-text: #285c36; --on-accent: #fff; --link: #285c36;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #131411; --surface: #1a1c17; --soft: #20261d; --text: #e6e4da; --muted: #aaa99a; --line: #2f322a; --strong: #f6f4ea;
          --accent: #6fc488; --accent-text: #8fd6a4; --on-accent: #07140d; --link: #8fd6a4; }
}
body { font-optical-sizing: auto; }

/* masthead: centered, italic title, mono navigation */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { flex-direction: column; justify-content: center; padding-block: 24px 14px; gap: 10px; }
.brand { font: italic 400 clamp(1.8rem, 5vw, 2.6rem)/1 var(--font-head); color: var(--strong); }
.mark { display: none; }
.site-header nav { gap: 26px; }
.site-header nav a { font: 500 .74rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.site-header nav a::before { content: "/"; color: var(--accent-text); margin-right: 2px; }
.site-header nav a:hover { color: var(--strong); }

h1, h2, h3 { color: var(--strong); font-weight: 400; line-height: 1.08; letter-spacing: -0.005em; }
.hero { padding: 72px 0 28px; max-width: 900px; margin-inline: auto; text-align: center; }
.hero h1 { font-size: clamp(2.8rem, 7.4vw, 5rem); margin: 0 0 22px; }
.hero p { font-size: 1.22rem; color: var(--muted); margin: 0 auto; max-width: 54ch; font-style: italic; }
.section-t { font: 500 .74rem/1 var(--font-ui); text-transform: uppercase; letter-spacing: .16em; color: var(--accent-text); margin: 56px 0 24px; display: flex; align-items: center; gap: 16px; }
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* cards: featured story in italic + two columns with a glowing accent rule */
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 48px; }
.card { padding-top: 20px; border-top: 1px solid var(--line); position: relative; }
.card::after { content: ""; position: absolute; top: -1px; left: 0; width: 56px; height: 2px; background: var(--accent); }
.card.featured { grid-column: 1 / -1; padding: 36px 0 12px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 52px; align-items: end; }
.card.featured::after { width: 100%; opacity: .55; }
.card.featured > * { grid-column: 1; }
.card.featured p:not(.kicker), .card.featured .more { grid-column: 2; }
.card.featured .kicker { grid-row: 1; }
.card.featured h2 { grid-row: 2 / span 2; font-size: clamp(2.3rem, 5vw, 3.6rem); font-style: italic; margin: 10px 0 0; }
.card.featured p:not(.kicker) { grid-row: 2; font-size: 1.1rem; }
.card.featured .more { grid-row: 3; }
.card h2 { font-size: 1.9rem; margin: 10px 0 12px; }
.card p { color: var(--muted); font-size: 1.05rem; line-height: 1.62; }
.kicker { font: 500 .72rem/1.4 var(--font-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.more { font: 600 .76rem/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .1em; }
@media (max-width: 760px) {
  .cards { grid-template-columns: 1fr; }
  .card.featured { display: flex; padding-top: 24px; }
}
.pitch { margin: 80px auto; padding: 40px 32px; max-width: 700px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
.pitch h2 { margin: 0 0 14px; font-size: 2.2rem; font-style: italic; }
.pitch p:last-child { margin-bottom: 0; }

/* article: centered header, single column */
.post { --max: var(--measure); }
.crumbs { font-family: var(--font-ui); font-size: .72rem; text-align: center; }
.post-head { text-align: center; margin-inline: auto; }
.post-head .kicker { margin-top: 28px; color: var(--accent-text); }
.post-head h1 { font-size: clamp(2.5rem, 6.4vw, 4rem); margin: 14px 0 18px; }
.lede { font-size: 1.32rem; line-height: 1.55; font-style: italic; margin: 0 auto 18px; max-width: 52ch; }
.meta { font-family: var(--font-ui); font-size: .72rem; margin: 0 0 32px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.disclosure { max-width: none; font-family: var(--font-ui); font-size: .74rem; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); }
.toc { margin: 32px 0; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; font-family: var(--font-ui); font-size: .8rem; }
.toc p { text-transform: uppercase; letter-spacing: .14em; font-size: .68rem; color: var(--accent-text); }
.toc ol { list-style: decimal-leading-zero; padding-left: 2.4em; }
.toc li::marker { color: var(--muted); }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--accent-text); }
/* italic drop cap */
.prose > h2:first-child + p::first-letter { float: left; font: italic 400 4.6em/.78 var(--font-head); color: var(--accent); margin: .04em .1em 0 0; }
.prose h2 { font-size: 2.3rem; }
.prose h3 { font: 600 .9rem/1.3 var(--font-ui); text-transform: uppercase; letter-spacing: .08em; color: var(--accent-text); }
.prose strong { color: var(--strong); }
.prose code { color: var(--accent-text); }
.prose a[rel~="sponsored"]::after { content: " ↗"; font-size: .75em; }
.prose table { font-family: var(--font-ui); font-size: .74em; }
.prose thead th { border-bottom: 1px solid var(--accent); color: var(--accent-text); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
/* tips: left-aligned pull quote */
.tip { margin: 2.2em 0; padding: 4px 0 4px 26px; border-left: 2px solid var(--accent); font: italic 400 1.5em/1.35 var(--font-head); color: var(--strong); }
.tip strong { font-style: normal; font: 600 .5em/1 var(--font-ui); text-transform: uppercase; letter-spacing: .12em; color: var(--accent-text); display: block; margin-bottom: 8px; }
.author { padding: 28px 0 0; border-top: 1px solid var(--line); }
.avatar { font: italic 400 1.8rem/1 var(--font-head); }
.author p { font-family: var(--font-ui); font-size: .78rem; }
.related h2 { font-size: 1.9rem; font-style: italic; }
.related li a { font-weight: 500; font-size: 1.1rem; }
.related li span { font-size: .95rem; }

.site-footer { border-top: 1px solid var(--line); text-align: center; font-family: var(--font-ui); font-size: .74rem; }
