/* Look: "organic" (rounded, soft, shapes borrowed from leaves), chosen by Seb 2026-09-18.
   Colours come from Mandy's portrait: hedge green, linen off-white, one warm clay accent (decoration only).
   Every text colour is tested at 7:1 or better against --bg and --panel in both themes (tests/test_build.py).
   Fonts are self-hosted (site/fonts, SIL Open Font Licence): Lora for headings, Nunito Sans for text. */

@font-face { font-family: "Lora"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/lora.woff2") format("woff2"); }
@font-face { font-family: "Lora"; font-style: italic; font-weight: 400; font-display: swap; src: url("/fonts/lora-italic.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("/fonts/nunito-sans.woff2") format("woff2"); }
/* Fallbacks sized to match, so the page does not jump when the real fonts arrive */
@font-face { font-family: "Lora Fallback"; src: local("Georgia"); size-adjust: 104%; ascent-override: 96%; descent-override: 26%; }
@font-face { font-family: "Nunito Sans Fallback"; src: local("Segoe UI"), local("Helvetica Neue"), local("Arial"); size-adjust: 102%; }

:root {
  color-scheme: light dark;
  --bg: #faf7f2; --text: #1d2a22; --muted: #3f4f45; --accent: #28523c; --rule: #d9d3c7; --panel: #f0ebe1;
  --warm: #c98b6b; --error: #8f2415; --tint: #c6dccd;
  --measure: 58rem; --prose: 40rem; --step: 1.5rem; --radius: 22px;
  --shadow: 0 10px 30px rgb(29 42 34 / 0.10);
  --sans: "Nunito Sans", "Nunito Sans Fallback", system-ui, sans-serif;
  --serif: "Lora", "Lora Fallback", Georgia, serif;
}
/* Dark follows the device unless the visitor picked light; a visitor's pick (theme.js sets data-theme) beats the
   device. The two dark blocks must match: tests/test_build.py pins them equal. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) { color-scheme: dark;
    --bg: #141a16; --text: #ece8df; --muted: #c4cbc3; --accent: #9fd0b0; --rule: #2c3a31; --panel: #1b241e; --warm: #a8745a; --error: #ffab9b; --tint: #2f4d3b;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.45); }
}
:root[data-theme=dark] { color-scheme: dark;
    --bg: #141a16; --text: #ece8df; --muted: #c4cbc3; --accent: #9fd0b0; --rule: #2c3a31; --panel: #1b241e; --warm: #a8745a; --error: #ffab9b; --tint: #2f4d3b;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.45); }
:root[data-theme=light] { color-scheme: light; }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; padding-inline: 1.25rem; background: var(--bg); color: var(--text);
  font-family: var(--sans); line-height: 1.65; overflow-wrap: break-word; }
header, main, footer { max-width: var(--measure); margin-inline: auto; }
main > h2, main > h3, main > p, main > ul, main > ol, main > blockquote { max-width: var(--prose); }

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 5vw, 3rem); line-height: 1.12; margin-block: calc(var(--step) * 1.5) var(--step); }
h2 { font-size: 1.5rem; margin-block: calc(var(--step) * 1.75) calc(var(--step) / 2); }
h3 { font-size: 1.15rem; margin-block: var(--step) calc(var(--step) / 3); }
p, ul, ol, blockquote, picture { margin-block: 0 var(--step); }
main ul, main ol { padding-inline-start: 1.25rem; }
main li { margin-block-end: 0.4rem; }
.lead { font-size: 1.15rem; }
.eyebrow { margin: 0; color: var(--muted); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999rem; padding: 0.5rem 1rem; background: var(--panel); border-radius: 99px; z-index: 1; }
.skip:focus { left: 1.25rem; top: 0.5rem; }

/* Header: name and language picker on one line, the menu beneath */
header { padding-block: 1.25rem 0.5rem; display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 0 1rem; }
.theme-toggle { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; padding: 0; border: 2px solid var(--accent);
  border-radius: 50%; background: none; color: var(--accent); cursor: pointer; }
.theme-toggle[hidden] { display: none; }
.theme-toggle svg { width: 1.3rem; height: 1.3rem; }
.site-name { font-family: var(--serif); font-size: 1.35rem; margin: 0; }
.site-name a { color: inherit; text-decoration: none; }
.site-name a:hover { text-decoration: underline; }
.site-name a { display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap; }
.logo { width: 1.4em; height: 1.4em; flex: none; color: var(--accent); fill: currentColor; }   /* placeholder sprout until a real logo exists */
@media (forced-colors: active) { .logo { color: CanvasText; } }
nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.15rem 0.35rem; }
nav a { display: inline-block; padding: 0.3rem 0.75rem; min-height: 24px; border-radius: 99px; text-decoration: none; }
nav a:hover { background: var(--panel); text-decoration: none; }
nav a[aria-current] { background: var(--accent); color: var(--bg); border: 2px solid transparent; padding: calc(0.3rem - 2px) calc(0.75rem - 2px); }   /* transparent edge shows in High Contrast mode */
.langs { margin: 0; font-size: 0.9rem; }
.langs a { padding-inline: 0.6rem; }
.langs a[aria-current] { background: none; color: var(--text); font-weight: 700; }
header .header-cta { padding: 0.45rem 1.1rem; font-size: 0.95rem; box-shadow: none; }

/* Phones: the page links fold into a native "Menu" (no script), so the page starts on the first screen */
.menu { display: none; }
.menu summary { display: inline-flex; align-items: center; gap: 0.55rem; min-height: 44px; padding: 0.35rem 1.1rem;
  border: 2px solid var(--accent); border-radius: 99px; color: var(--accent); font-weight: 700; cursor: pointer; list-style: none; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: ""; width: 0.45em; height: 0.45em; border-right: 2px solid; border-bottom: 2px solid;
  transform: translateY(-0.15em) rotate(45deg); }
.menu[open] summary::after { transform: translateY(0.1em) rotate(-135deg); }
.menu nav ul { flex-direction: column; }
.menu nav a { display: block; min-height: 44px; padding: 0.55rem 1rem; }
@media (max-width: 40rem) {
  /* Name on its own line; then Menu on the left and the other language on the right */
  header { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 0.5rem; }   /* Menu, language and theme fit one line at 320px */
  .site-name { flex-basis: 100%; }
  .nav-wide { display: none; }
  .menu { display: block; order: 1; }
  .menu[open] { flex-basis: 100%; }   /* open: the list takes the full width and the language link follows it */
  header .header-cta { order: 2; }
  .langs { order: 3; margin-inline-start: auto; margin-block-start: 0.35rem; }
  .theme-toggle { order: 4; width: 2.45rem; height: 2.45rem; }   /* 44px, like the Menu button */
  .langs a { padding-inline: 0.45rem; }
  .langs li:has(a[aria-current]) { display: none; }   /* phones show only the other language */
  header:has(.menu[open]) .langs { margin-inline-start: 0.4rem; }   /* open: sits under the list, lined up with it */
}

/* Phones of ordinary height: a slim waitlist bar replaces the header link. Hidden at high zoom (short viewports),
   and scroll padding keeps keyboard focus clear of it (WCAG 2.2 AA, focus not obscured). */
.sticky-cta { display: none; }
@media (max-width: 40rem) and (min-height: 500px) {
  header .header-cta { display: none; }
  .sticky-cta { display: block; position: fixed; inset: auto 0 0 0; z-index: 10; margin: 0;
    padding: 0.6rem 1.25rem calc(0.6rem + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--rule); }
  .sticky-cta .cta { display: block; text-align: center; box-shadow: none; }
  .sticky-cta[hidden] { display: none; }
  html { scroll-padding-bottom: 6rem; }
  body { padding-bottom: 5.5rem; }
}
header nav:not(.langs) { grid-column: 1 / -1; margin-block-start: 0.75rem; }

/* Home page hero: text beside the portrait on wide screens */
.hero { display: grid; gap: 2rem; align-items: center; margin-block: 1.5rem 3rem; }
@media (min-width: 52rem) { .hero { grid-template-columns: 1.2fr 1fr; gap: 3rem; } }
.hero h1 { margin-block: 0.4rem 1.2rem; }
.hero picture { max-width: 24rem; justify-self: center; }   /* keeps the blob behind the portrait inside the screen at mid widths */
blockquote { margin-inline: 0; padding: 0; border: 0; color: var(--accent); font-family: var(--serif); font-size: 1.35rem; font-style: italic; }
blockquote p { margin: 0; }
blockquote cite { display: block; margin-block-start: 0.3rem; font-family: var(--sans); font-style: normal; font-size: 0.85rem; color: var(--muted); }
blockquote cite::before { content: "\2014\00a0"; }

/* Photo placements. Two patterns, alternated and set at different depths per page,
   so the eye is not trained to one spot. Both work for a real <picture> and for the
   panel placeholder that stands in until the shot exists. */
.photo-placeholder { display: grid; place-items: center; padding: 1.5rem; background: var(--panel);
  color: var(--muted); font-size: 0.9rem; text-align: center; }
.photo-band img, .photo-side img { display: block; width: 100%; height: auto; object-fit: cover; box-shadow: var(--shadow); }

/* Band: the full width of the page, landscape, breaking the column of text */
.photo-band { max-width: none; margin-block: calc(var(--step) * 2); }
.photo-band, .photo-band img { aspect-ratio: 5 / 2; border-radius: var(--radius); }
@media (max-width: 40rem) { .photo-band, .photo-band img { aspect-ratio: 3 / 2; } }

/* Side: a section and a portrait photo side by side, image left or right, stacking on a phone */
.with-photo { display: grid; gap: 1.5rem 2.5rem; max-width: none; margin-block: calc(var(--step) * 1.5); }
.with-photo > div > :first-child { margin-block-start: 0; }
.with-photo > div > :last-child { margin-block-end: 0; }
.photo-side, .photo-side img { aspect-ratio: 4 / 5; border-radius: 58% 42% 55% 45% / 46% 54% 46% 54%; }
@media (min-width: 46rem) {
  .with-photo { grid-template-columns: 1fr 17rem; align-items: center; }
  .with-photo-start { grid-template-columns: 17rem 1fr; }
  .with-photo-start > .photo-side { order: -1; }
}
@media (max-width: 46rem) { .photo-side { max-width: 15rem; margin-inline: auto; } }

/* Portrait: leaf-shaped, on a soft blob */
picture { display: block; position: relative; margin-inline: 1rem; }
picture::before { content: ""; position: absolute; inset: -6% -8% -4% -6%; background: var(--panel); z-index: -1;
  border-radius: 45% 55% 40% 60% / 55% 40% 60% 45%; }
picture img { display: block; width: 100%; height: auto; border-radius: 58% 42% 55% 45% / 46% 54% 46% 54%; box-shadow: var(--shadow); }
main > picture { max-width: 18rem; }
@media (min-width: 46rem) { main > picture { float: inline-end; margin: 0.4rem 1rem var(--step) 2rem; } }

.cta { display: inline-block; padding: 0.8rem 1.5rem; background: var(--accent); color: var(--bg); border-radius: 99px; border: 2px solid transparent;
  box-shadow: var(--shadow); text-decoration: none; font-weight: 700; }
.cta:hover { text-decoration: underline; }
button.cta { font: inherit; font-weight: 700; cursor: pointer; }

/* Waitlist signup: one field, laid out like milkroad.com (Seb, 2026-09-29). Grid, so the error and the typo hint
   sit straight under the field. Phones: field and button stacked, both full width. Wider: side by side, level.
   Works without script. The label stays visible (their placeholder-only field would fail WCAG). */
.signup { display: grid; gap: 0.75rem 1rem; align-items: center; margin-block: var(--step); max-width: var(--prose); }
.signup[hidden] { display: none; }
.signup label { font-size: 0.85rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.signup .form-error { color: var(--text); font-weight: 700; }
.signup .cta { justify-self: stretch; min-height: 3rem; padding-block: 0.6rem; }
@media (min-width: 30rem) {
  .signup { grid-template-columns: 1fr auto; }
  .signup > :not(input, button) { grid-column: 1 / -1; }
  .signup > button { grid-area: 2 / 2; }
  .signup > input, .signup > button { align-self: stretch; }
}
/* the offset tint is decoration; the 2px edge carries the 3:1 contrast a field outline needs */
.signup input { min-height: 3rem; padding: 0.6rem 1.25rem; font: inherit; color: var(--text);
  background: var(--bg); border: 2px solid var(--accent); border-radius: 20px; box-shadow: 3px 3px 0 var(--tint); }
.signup p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.signup [role=status]:empty { display: none; }
.signup .field-error { color: var(--error); font-weight: 700; }
/* :user-invalid only matches once someone has typed and moved on, so nobody is told off while starting */
.signup input:user-invalid, .signup input[aria-invalid=true] { border-color: var(--error); }
.signup [role=status] { color: var(--text); }
.signup [role=status] button, .signup-done [data-again] { font: inherit; font-weight: 700; color: var(--accent); background: none; border: 0; padding: 0.2rem 0.3rem;
  min-height: 24px; text-decoration: underline; cursor: pointer; }

/* Link cards, two by two */
.cards { list-style: none; padding: 0; display: grid; gap: 1rem; max-width: none; }
@media (min-width: 40rem) { .cards { grid-template-columns: 1fr 1fr; } }
.cards li { margin: 0; }
.cards a { display: block; height: 100%; padding: 1.4rem 1.5rem; border-radius: var(--radius); background: var(--panel);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.cards a:hover { background: var(--bg); }
.cards a:hover strong { text-decoration: underline; }
.cards strong { display: block; font-family: var(--serif); font-size: 1.3rem; color: var(--accent); margin-block-end: 0.3rem; }
.cards span { display: block; font-size: 0.95rem; }

/* Footer: one rounded panel */
footer { clear: both; margin-block-start: 3rem; padding: 2rem 1.5rem 2.5rem; background: var(--panel);
  border-radius: var(--radius) var(--radius) 0 0; color: var(--muted); }
.start { font-size: 1.1rem; color: var(--text); }
.crisis { background: var(--bg); padding: 1rem 1.1rem; border-radius: var(--radius); color: var(--text); }
.footer-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.1rem 1.1rem; }
.footer-links a { display: inline-block; padding-block: 0.35rem; min-height: 24px; }
.footer-links:empty { display: none; }
.reviewed { font-size: 0.85rem; margin: 0; }

@media (prefers-reduced-motion: no-preference) { a { transition: text-decoration-thickness 0.15s ease-out, background-color 0.15s ease-out; } }
@media print {
  nav, .skip, .start, .cta, .menu, .sticky-cta { display: none; }
  body { background: #fff; color: #000; }
  a { color: #000; }
  footer, .cards a { box-shadow: none; background: none; }
}

/* After joining: the form gives way to a short celebration (waitlist.js), same as the thank-you pages without script */
.signup-done { margin-block: var(--step); max-width: var(--prose); }
.signup-done-title { font-family: var(--serif); font-size: 1.5rem; margin: 0 0 0.4rem; }
.signup-done p { margin-block: 0 0.6rem; }

/* Celebration: a tick that draws itself and eight leaves floating up, about 1.5s. Still under reduced motion. */
.celebrate { position: relative; width: 4rem; height: 4rem; margin-block: 0.5rem 1rem; }
.celebrate svg { display: block; width: 100%; height: 100%; }
.celebrate circle { fill: var(--accent); }
.celebrate path { fill: none; stroke: var(--bg); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 36; stroke-dashoffset: 36; animation: celebrate-draw 0.5s 0.2s ease-out forwards; }
.celebrate i { position: absolute; inset-block-start: 50%; inset-inline-start: 50%; width: 0.8rem; height: 0.5rem;
  margin: -0.25rem 0 0 -0.4rem; border-radius: 0 100%; background: var(--accent); opacity: 0;
  animation: celebrate-leaf 1.5s 0.15s ease-out forwards; }
.celebrate i:nth-of-type(even) { background: var(--warm); animation-delay: 0.3s; }
.celebrate i:nth-of-type(1) { --a: -80deg; } .celebrate i:nth-of-type(2) { --a: -58deg; }
.celebrate i:nth-of-type(3) { --a: -36deg; } .celebrate i:nth-of-type(4) { --a: -12deg; }
.celebrate i:nth-of-type(5) { --a: 12deg; } .celebrate i:nth-of-type(6) { --a: 36deg; }
.celebrate i:nth-of-type(7) { --a: 58deg; } .celebrate i:nth-of-type(8) { --a: 80deg; }
@keyframes celebrate-draw { to { stroke-dashoffset: 0; } }
@keyframes celebrate-leaf {
  0% { opacity: 0; transform: rotate(var(--a)) translateY(0) rotate(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(-5rem) rotate(160deg); }
}
@media (prefers-reduced-motion: reduce) {
  .celebrate i { display: none; }
  .celebrate path { animation: none; stroke-dashoffset: 0; }
}
