/* Plotfern website. "Graph paper & seed packet" (docs/design_system.md):
   squared-paper background, fiddlehead green for action, beet for Pro and
   highlights, borage blue for tasks. Alegreya (headings) + Alegreya Sans (UI).
   Square-cornered plan shapes, seed-packet cards with a coloured left edge.
   Self-hosted fonts, no third-party requests (CSP default-src 'none').
   Logical properties for RTL. */

@font-face { font-family: "Alegreya"; src: url("/assets/fonts/alegreya-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-400i.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Alegreya Sans"; src: url("/assets/fonts/alegreya-sans-700.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --bg: #F5F3EA;
  --surface: #FCFBF6;
  --tray: #EFECDF;
  --ink: #1E2318;
  --ink-2: #565C4B;
  --outline: #7A8070;
  --outline-2: #C9C6B5;
  --grid-1: #E6E2D2;
  --grid-2: #D6D1BC;
  --primary: #3F6B12;
  --on-primary: #FFFFFF;
  --primary-c: #D9EBB8;
  --on-primary-c: #1A2E05;
  --beet: #8A2A5B;
  --beet-c: #F6D9E7;
  --on-beet-c: #3A0F25;
  --borage: #2F5597;
  --soil: #E6DCC6;
  --bed-edge: #6E5A3A;
  --path: #D3CFC4;
  --fam-night: #C0392B;
  --fam-roots: #B5651D;
  --fam-other: #6B7A5A;
  --link: #3F6B12;
  --no: #7A8070;
  --dark-band: #1A1F16;
  --dark-band-ink: #E7EADF;
  --dark-band-ink-2: #B4BAA8;
  --dark-band-rule: #3A4232;

  --f-head: "Alegreya", Georgia, "Noto Serif", "Noto Naskh Arabic", "Noto Serif Hebrew", "Noto Serif Thai", "Noto Serif Devanagari", "Noto Serif Bengali", "Noto Serif Tamil", "Noto Serif Telugu", serif;
  --f-ui: "Alegreya Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Hebrew", "Noto Sans Thai", "Noto Sans Devanagari", "Noto Sans Bengali", "Noto Sans Tamil", "Noto Sans Telugu", sans-serif;

  --r-s: 6px;
  --r-m: 12px;
  --r-l: 20px;
  --wrap: 1120px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11150E;
    --surface: #1A1F16;
    --tray: #22281D;
    --ink: #E7EADF;
    --ink-2: #B4BAA8;
    --outline: #8C9380;
    --outline-2: #3A4232;
    --grid-1: #1A2016;
    --grid-2: #232A1E;
    --primary: #A6D26A;
    --on-primary: #1A2E05;
    --primary-c: #2F4F0C;
    --on-primary-c: #D9EBB8;
    --beet: #EE9CC6;
    --beet-c: #4E1835;
    --on-beet-c: #F6D9E7;
    --borage: #A9C1F2;
    --soil: #3B3226;
    --bed-edge: #A58B63;
    --path: #2E342A;
    --link: #A6D26A;
    --no: #8C9380;
    --dark-band: #0B0E09;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; color: var(--ink); font: 400 18px/1.6 var(--f-ui);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-2) 1px, transparent 1px),
    linear-gradient(var(--grid-1) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-1) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--borage); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.small { font-size: .9rem; color: var(--ink-2); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.wrap.narrow { max-width: 820px; }
.center { text-align: center; }
.mt { margin-top: 32px; }

.skip { position: absolute; inset-inline-start: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 10; }
.skip:focus { inset-inline-start: 8px; }

/* Top bar: a plain ruler strip. */
.topbar { background: var(--surface); border-bottom: 1px solid var(--outline-2); position: sticky; top: 0; z-index: 5; }
.topbar .wrap { display: flex; align-items: center; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 1.45rem/1 var(--f-head); color: var(--ink); text-decoration: none; }
.brand img { border-radius: 8px; }
.topnav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-inline-start: auto; }
.topnav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .98rem; padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:hover, .topnav a[aria-current] { border-bottom-color: var(--primary); }
@media (max-width: 720px) { .topnav a.opt { display: none; } .topbar .wrap { gap: 10px; } }

/* Hero */
.hero { padding: 56px 0 48px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow { font-weight: 700; font-size: .92rem; letter-spacing: .04em; color: var(--beet); margin-bottom: 14px; }
.lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36em; }
.lead strong { color: var(--ink); }
.cta-row { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 22px; }
.badge img { width: 200px; height: auto; display: block; }
.text-link { font-weight: 700; }
.badge-note { font-size: .88rem; color: var(--ink-2); margin-top: 6px; }

.hero-art { width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 22px rgba(30, 35, 24, .14)); }
.hero-art .paper { fill: var(--surface); stroke: var(--outline-2); stroke-width: 2; }
.hero-art .g1 { fill: none; stroke: var(--grid-1); stroke-width: 1; }
.hero-art .g2 { fill: none; stroke: var(--grid-2); stroke-width: 1.2; }
.hero-art .path-obj { fill: var(--path); }
.hero-art .obj-t { font: 700 13px var(--f-ui); fill: var(--ink-2); text-anchor: middle; letter-spacing: .08em; }
.hero-art .bed { fill: var(--soil); }
.hero-art .bed-edge { fill: none; stroke: var(--bed-edge); stroke-width: 4; }
.hero-art .cell { fill: none; stroke: var(--outline-2); stroke-width: 1.5; }
.hero-art .tok { fill: var(--surface); stroke: var(--outline-2); stroke-width: 1.2; }
.hero-art .tok-edge.fam-night { fill: var(--fam-night); }
.hero-art .tok-edge.fam-roots { fill: var(--fam-roots); }
.hero-art .tok-edge.fam-other { fill: var(--fam-other); }
.hero-art .tok-t { font: 700 14px var(--f-ui); fill: var(--ink); text-anchor: middle; }
.hero-art .bed-t { font: 600 18px var(--f-head); fill: var(--ink); }
.hero-art .bed-t.mid { text-anchor: middle; font-size: 16px; }
.hero-art .dim { fill: var(--surface); stroke: var(--outline); stroke-width: 1.2; }
.hero-art .dim-t { font: 700 13px var(--f-ui); fill: var(--ink); text-anchor: middle; font-variant-numeric: tabular-nums; }
.hero-art .sprig { fill: none; stroke: var(--primary); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .seed { fill: var(--beet); }
.hero-art .card { fill: var(--surface); stroke: var(--outline-2); stroke-width: 1.5; }
.hero-art .card-h { font: 600 19px var(--f-head); fill: var(--ink); }
.hero-art .chk { fill: none; stroke: var(--borage); stroke-width: 2.2; }
.hero-art .chk.done { fill: var(--borage); }
.hero-art .tick { fill: none; stroke: var(--surface); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .task { font: 400 14px var(--f-ui); fill: var(--ink); }

/* Bands */
.band { padding: 64px 0; }
.band.tint { background: color-mix(in srgb, var(--tray) 88%, transparent); border-block: 1px solid var(--outline-2); }
.band.soil { background: var(--dark-band); color: var(--dark-band-ink); }
.band.soil h2, .band.soil h3 { color: var(--dark-band-ink); }
.band.soil .sec-lead, .band.soil p { color: var(--dark-band-ink-2); }
.band.soil .plot { color: #A6D26A; border-color: #A6D26A; }
.band.soil .icon svg { stroke: #A6D26A; }
.sec-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.sec-head h2 { margin: 0; }
.plot { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 2px solid var(--bed-edge); background: var(--soil); color: var(--ink); font: 700 1rem var(--f-ui); border-radius: 3px; }
.sec-lead { font-size: 1.12rem; color: var(--ink-2); max-width: 44em; margin-bottom: 28px; }

.icon { display: inline-grid; place-items: center; flex: none; width: 44px; height: 44px; }
.icon svg { width: 26px; height: 26px; fill: none; stroke: var(--primary); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon.big { width: 56px; height: 56px; border: 2px solid currentColor; border-radius: 3px; color: #A6D26A; margin-bottom: 14px; }
.icon.big svg { width: 30px; height: 30px; }

/* Promises: seed-packet cards */
.promises { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.promises li { display: flex; gap: 12px; background: var(--surface); border: 1px solid var(--outline-2); border-inline-start: 6px solid var(--primary); border-radius: var(--r-m); padding: 18px 18px 14px; }
.promises li:nth-child(2n) { border-inline-start-color: var(--beet); }
.promises li:nth-child(3n) { border-inline-start-color: var(--borage); }
.promises h3 { font-size: 1.15rem; margin-bottom: .3em; }
.promises p { margin: 0; color: var(--ink-2); }

/* Steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: s; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { border-top: 2px dashed var(--dark-band-rule); padding-top: 20px; }
.step h3 { font-size: 1.35rem; }

/* Features */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(310px, 100%), 1fr)); gap: 18px; }
.feat { background: var(--surface); border: 1px solid var(--outline-2); border-radius: var(--r-m); padding: 18px 20px 8px; }
.feat h3 { display: flex; align-items: center; gap: 6px; margin-inline-start: -8px; }
.ticks { list-style: none; margin: 0 0 12px; padding: 0; }
.ticks li { position: relative; padding-inline-start: 24px; margin: 6px 0; }
.ticks li::before { content: ""; position: absolute; inset-inline-start: 2px; top: .55em; width: 9px; height: 9px; border: 2px solid var(--primary); border-radius: 2px; }

/* Pro */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; background: var(--surface); border: 1px solid var(--outline-2); border-radius: var(--r-m); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--outline-2); text-align: start; vertical-align: top; }
thead th { font-weight: 700; background: var(--tray); }
.compare td { text-align: center; white-space: nowrap; }
.compare thead th:not(:first-child) { text-align: center; }
.compare th[scope=row] { font-weight: 400; }
.cell-t { font-weight: 700; font-size: .95rem; }
.mark { display: inline-block; width: 22px; height: 22px; border-radius: 3px; vertical-align: middle; }
.mark.yes { background: var(--primary); position: relative; }
.mark.yes::after { content: ""; position: absolute; left: 7px; top: 3px; width: 6px; height: 11px; border: solid var(--on-primary); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.mark.no { border: 2px solid var(--no); position: relative; }
.mark.no::after { content: ""; position: absolute; left: 4px; right: 4px; top: 8px; height: 2px; background: var(--no); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.plans { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.plans li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: baseline; background: var(--surface); border: 1px solid var(--outline-2); border-radius: var(--r-m); padding: 12px 16px; }
.plans li > span:last-child { grid-column: 1 / -1; color: var(--ink-2); }
.plan-tag { font-size: .82rem; font-weight: 700; color: var(--on-beet-c); background: var(--beet-c); border-radius: 999px; padding: 2px 10px; }
.note { font-size: .95rem; color: var(--ink-2); }
.stack { display: grid; gap: 14px; align-content: start; }
.callout { background: var(--surface); border: 1px solid var(--outline-2); border-inline-start: 6px solid var(--beet); border-radius: var(--r-m); padding: 16px 18px 4px; }
.callout.free { display: flex; gap: 10px; border-inline-start-color: var(--primary); background: color-mix(in srgb, var(--primary-c) 55%, var(--surface)); }
.callout.free .icon { margin-top: -6px; }
.callout h3 { font-size: 1.15rem; margin-bottom: .3em; }

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq { background: var(--surface); border: 1px solid var(--outline-2); border-radius: var(--r-m); padding: 0 18px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: outside; }
.faq p { margin: 0 0 16px; color: var(--ink-2); }

.band.final { padding: 72px 0 80px; }
.band.final .badge { display: inline-block; }
.band.final .sec-lead { margin-inline: auto; }

/* Pages and legal documents */
.page { padding: 40px 0 64px; }
.doc { max-width: 820px; margin: 0 auto; background: var(--surface); border: 1px solid var(--outline-2); border-radius: var(--r-l); padding: clamp(22px, 4vw, 48px); }
.doc h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); }
.doc h2 { font-size: 1.55rem; margin-top: 1.6em; padding-top: .4em; border-top: 1px dashed var(--outline-2); scroll-margin-top: 80px; }
.doc h3 { margin-top: 1.3em; scroll-margin-top: 80px; }
.doc ul, .doc ol { padding-inline-start: 1.3em; }
.doc li { margin: .35em 0; }
.doc table { font-size: .95rem; margin: 0 0 1.2em; }
.doc code { font-size: .9em; background: var(--tray); padding: 1px 5px; border-radius: 4px; }
.meta { color: var(--ink-2); font-size: .95rem; }
.fallback { max-width: 820px; margin: 0 auto 16px; background: var(--beet-c); color: var(--on-beet-c); padding: 10px 16px; border-radius: var(--r-m); }
.toc { background: var(--tray); border-radius: var(--r-m); padding: 6px 18px; margin: 0 0 1.4em; }
.toc summary { cursor: pointer; font-weight: 700; padding: 8px 0; }
.toc ol { margin: 0 0 10px; columns: 2 240px; column-gap: 28px; }
.toc li { break-inside: avoid; }
.button { display: inline-block; background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none; padding: 12px 24px; border-radius: 999px; }
.button:hover { filter: brightness(1.08); }

/* Footer */
.foot { background: var(--surface); border-top: 1px solid var(--outline-2); padding: 40px 0 48px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 32px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-brand { font: 600 1.4rem var(--f-head); margin-bottom: .3em; }
.foot-links { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.langs summary { cursor: pointer; font-weight: 700; }
.langs ul { list-style: none; padding: 0; margin: 10px 0 0; columns: 2 150px; font-size: .95rem; }
.langs a[aria-current] { font-weight: 700; color: var(--ink); }
