/*
  farmers.guide website.

  The page is drawn as a cross-section: pale sky above a ground line, dark
  soil below. Type is Barlow (road-sign plain, easy to read in bright
  light) in three widths. Colors match the app (app/src/theme.ts).
*/

@font-face { font-family: "Barlow"; src: url("fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("fonts/barlow-semi-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Barlow Condensed"; src: url("fonts/barlow-condensed-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --page: #e8ecea;
  --paper: #ffffff;
  --ink: #1d1a16;
  --muted: #555b56;
  --rule: #cbd3ce;
  --leaf: #2f5d34;
  --sky: #d6e6ef;
  --soil: #4a3524;
  --frost: #1f5fa8;
  --water: #17707f;
  --wheat: #8a5606;
  --alarm: #b3261e;

  /* Used only for marks, never for text on a light ground. */
  --rime: #f3f7f9;
  --grass: #5e9a45;
  --sprout: #a8d68a;
  --straw: #e7c873;
  --soil-ink: #f4eee7;

  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --label: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --display: "Barlow Condensed", "Barlow Semi Condensed", "Arial Narrow", sans-serif;

  --w: 1120px;
  --pad: clamp(20px, 5vw, 48px);
  --gutter: 0px; /* room left of the year chart for crop names, on wide screens */
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
img, svg { max-width: 100%; }
a { color: var(--leaf); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--frost); outline-offset: 3px; border-radius: 4px; }
.on-soil :focus-visible, .year-soil :focus-visible { outline-color: #ffffff; }

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 var(--pad); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 10px 14px; border-radius: 8px; z-index: 10; }
.skip:focus { left: 8px; }

h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font: 600 clamp(2rem, 5vw, 2.75rem)/1.05 var(--display); letter-spacing: 0.002em; }
h3 { font: 600 1.25rem/1.25 var(--label); }
p { margin: 0 0 1em; }
.lede { font-size: 1.1875rem; max-width: 34em; }
.small { font-size: 0.9375rem; color: var(--muted); }

/* ---------- top bar and hero: the sky ---------- */

.sky { background: var(--sky); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 6px; }
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 1.625rem/1 var(--display); }
.mark svg { width: 34px; height: 34px; border-radius: 8px; flex: none; }
.top nav { display: flex; align-items: center; gap: 6px; }
.top nav a { font: 600 1.0625rem/1 var(--label); color: var(--ink); text-decoration: none; padding: 12px 14px; border-radius: 10px; }
.top nav a:hover { background: rgba(255, 255, 255, 0.55); }
.top nav a.open { background: var(--paper); border: 2px solid var(--ink); }
@media (max-width: 520px) { .top nav a.hide-narrow { display: none; } }

.hero { padding-top: clamp(28px, 6vw, 64px); padding-bottom: clamp(24px, 3vw, 34px); }
.hero h1 {
  font: 700 clamp(2.875rem, 9.4vw, 5.5rem)/0.94 var(--display);
  letter-spacing: -0.006em;
  max-width: 11.5em;
  text-wrap: balance;
}
.hero .lede { margin-top: clamp(16px, 2.4vw, 26px); }

.lookup { margin-top: clamp(20px, 3vw, 30px); max-width: 30rem; }
.lookup label { display: block; font: 600 1.0625rem/1.2 var(--label); margin-bottom: 8px; }
.lookup .line { display: flex; gap: 10px; }
.lookup input {
  flex: 0 1 7.5rem; min-width: 0; height: 60px; padding: 0 16px;
  font: 600 1.625rem/1 var(--label); font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
  color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 12px;
}
.lookup input::placeholder { color: #8b918c; font-weight: 600; letter-spacing: 0; font-size: 1.125rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 22px; border: 0; border-radius: 12px; cursor: pointer;
  font: 600 1.1875rem/1.1 var(--label); text-decoration: none;
  background: var(--leaf); color: #ffffff;
}
.btn:hover { background: #244a29; color: #ffffff; }
.btn[disabled] { opacity: 0.75; cursor: progress; }
.btn.paper { background: var(--paper); color: var(--ink); }
.btn.paper:hover { background: #ece6de; color: var(--ink); }
.btn.line { background: transparent; color: var(--ink); border: 2px solid var(--ink); }
.btn.line:hover { background: rgba(255, 255, 255, 0.6); color: var(--ink); }
.lookup .line .btn { flex: 1 1 auto; padding: 0 14px; white-space: nowrap; }
.lookup .hint { margin: 10px 0 0; font-size: 0.9375rem; color: var(--muted); min-height: 1.5em; }
.lookup .hint.bad { color: var(--alarm); font-weight: 600; }

/* ---------- the year: frost above the line, planting below ---------- */

.year { color: var(--soil-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.axis { position: relative; margin-left: var(--gutter); }

.year-sky { background: var(--sky); color: var(--ink); }
.year-sky .wrap { position: relative; }
.place { padding-bottom: 16px; }
.place h2 { font: 700 1.75rem/1.05 var(--display); }
.place h2:focus { outline: none; }
.place p { margin: 4px 0 0; font-size: 0.9375rem; line-height: 1.4; color: var(--muted); max-width: 36em; }
#sky-axis { height: 104px; }

.months { position: absolute; left: 0; right: 0; bottom: 0; height: 22px; display: grid;
  grid-template-columns: 31fr 28fr 31fr 30fr 31fr 30fr 31fr 31fr 30fr 31fr 30fr 31fr; }
.months span { border-left: 1px solid rgba(29, 26, 22, 0.28); padding-left: 4px; font: 600 0.8125rem/22px var(--label); color: var(--muted); white-space: nowrap; overflow: hidden; }
.months i { font-style: normal; }
@media (max-width: 640px) { .months i { display: none; } }

.flag { position: absolute; bottom: 22px; height: 82px; border-left: 2px solid var(--frost); padding-left: 6px; color: var(--frost); white-space: nowrap; }
.flag span { display: block; font: 600 0.8125rem/1.1 var(--label); }
.flag b { display: block; font: 700 1.375rem/1.05 var(--display); }
.flag.flip { border-left: 0; border-right: 2px solid var(--frost); padding: 0 6px 0 0; transform: translateX(-100%); text-align: right; }
.season { position: absolute; bottom: 27px; height: 22px; border-top: 2px solid var(--leaf); text-align: center; overflow: hidden;
  font: 600 0.875rem/20px var(--label); color: var(--leaf); white-space: nowrap; }
.season.all { border-top: 0; text-align: left; height: auto; bottom: 34px; font-size: 1rem; line-height: 1.3; white-space: normal; }

.year-line { background: var(--rime); }
.year-line .axis { height: 12px; }
.grass { position: absolute; top: 0; bottom: 0; background: var(--grass); transform-origin: left center; }

/* Today: a notch on the ground line and a dashed line down into the soil. */
.notch { position: absolute; top: -4px; bottom: -4px; width: 4px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.now { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dashed rgba(244, 238, 231, 0.42); pointer-events: none; }
.soil-axis { position: absolute; top: 0; bottom: 0; left: calc(var(--pad) + var(--gutter)); right: var(--pad); pointer-events: none; }
.now span { position: absolute; top: 10px; left: 7px; font: 600 0.8125rem/1 var(--label); color: var(--soil-ink); white-space: nowrap; }
.now.flip span { left: auto; right: 7px; }
@media (max-width: 899px) { .now { bottom: auto; height: 28px; } }

.year-soil { background: var(--soil); }
.year-soil .wrap { position: relative; padding-top: 36px; padding-bottom: 38px; }
.band { margin: 0; padding: 0; list-style: none; position: relative; }
.band-title { font: 600 1.25rem/1.2 var(--label); margin: 0 0 2px; position: relative; }
.band-note { margin: 0 0 10px; font-size: 0.9375rem; line-height: 1.45; color: rgba(244, 238, 231, 0.86); position: relative; max-width: 34em; }
.band + .band-title { margin-top: 26px; }
.crop { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; row-gap: 4px; padding: 6px 0; }
.crop .name { font: 600 1.0625rem/1.25 var(--body); }
.crop .when { font: 400 0.9375rem/1.4 var(--body); font-variant-numeric: tabular-nums; color: rgba(244, 238, 231, 0.86); white-space: nowrap; }
.crop .when b { font-weight: 600; color: var(--straw); }
.crop .track { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.11); }
.crop .track i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--sprout); transform-origin: left center; }
.crop.next .track i { background: var(--straw); }
@media (max-width: 640px) {
  .band.open .crop:nth-child(n + 9), .band.next .crop:nth-child(n + 6) { display: none; }
}
.year-soil .after { position: relative; margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.year-soil .after p { margin: 0; font-size: 0.9375rem; color: rgba(244, 238, 231, 0.86); max-width: 26em; }

@media (min-width: 900px) {
  :root { --gutter: 330px; }
  .year-sky .wrap { min-height: 150px; display: flex; flex-direction: column; justify-content: flex-end; }
  .place { position: absolute; left: var(--pad); bottom: 14px; width: calc(var(--gutter) - 30px); padding: 0; }
  .place h2 { font-size: 2rem; }
  .crop { grid-template-columns: calc(var(--gutter) - 150px) 138px 1fr; align-items: center; column-gap: 6px; padding: 5px 0; }
  .crop .track { grid-column: 3; }
  .band-title, .band-note { max-width: calc(var(--gutter) - 24px); }
  .band-note { background: var(--soil); }
}

@media (prefers-reduced-motion: no-preference) {
  .year.fresh .grass { animation: grow 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .year.fresh .crop .track i { animation: grow 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(0.2s + var(--i, 0) * 25ms); }
  @keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
}

/* ---------- sections on the galvanized ground ---------- */

.part { padding: clamp(48px, 8vw, 96px) 0; }
.part + .part { border-top: 1px solid var(--rule); }
.part > .wrap > h2 { max-width: 16em; }
.part > .wrap > .lede { margin-top: 14px; }
.cols { display: grid; gap: clamp(28px, 5vw, 64px); margin-top: clamp(24px, 4vw, 40px); }
@media (min-width: 900px) {
  .cols { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .cols.flip { grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
}

.facts { margin: 0; display: grid; gap: 22px; }
.facts dt { font: 600 1.25rem/1.25 var(--label); }
.facts dd { margin: 4px 0 0; max-width: 32em; }

.fig-note { margin: 10px 2px 0; font-size: 0.875rem; color: var(--muted); }

/* A stack of alerts, as they sit in the app's inbox. */
.alerts { margin: 0; padding: 0; list-style: none; background: var(--paper); border-radius: 16px; overflow: hidden; }
.alerts li { padding: 16px 18px 16px 20px; border-left: 6px solid var(--kind); }
.alerts li + li { border-top: 1px solid var(--rule); }
.alerts .kind { display: flex; justify-content: space-between; gap: 12px; font: 600 0.875rem/1.2 var(--label); color: var(--kind); }
.alerts .kind em { font-style: normal; color: var(--muted); font-weight: 600; }
.alerts strong { display: block; margin-top: 4px; font: 600 1.125rem/1.25 var(--label); }
.alerts p { margin: 4px 0 0; font-size: 0.9688rem; line-height: 1.45; color: var(--muted); }
.k-frost { --kind: var(--frost); } .k-plant { --kind: var(--leaf); } .k-water { --kind: var(--water); }
.k-hay { --kind: var(--wheat); } .k-harvest { --kind: var(--wheat); } .k-weather { --kind: var(--alarm); } .k-ground { --kind: var(--soil); }

/* One photo check, as the app reports it. */
.check { background: var(--paper); border-radius: 16px; overflow: hidden; }
.check-top { display: grid; grid-template-columns: 132px 1fr; }
.check-top svg { display: block; width: 132px; height: 100%; min-height: 148px; }
.check-read { padding: 16px 18px; }
.score { display: inline-flex; align-items: baseline; gap: 8px; color: var(--wheat); }
.score b { font: 700 3rem/0.9 var(--display); }
.score span { font: 600 1.125rem/1 var(--label); }
.check-read p { margin: 8px 0 0; font-size: 0.9688rem; line-height: 1.45; }
.causes { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.causes li { padding: 13px 18px; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; }
.causes li + li { border-top: 1px solid var(--rule); }
.causes b { font: 600 1.0625rem/1.3 var(--label); }
.causes em { font-style: normal; font: 600 0.875rem/1.5 var(--label); color: var(--muted); }
.causes span { grid-column: 1 / -1; font-size: 0.9375rem; line-height: 1.45; color: var(--muted); }
.trend { border-top: 1px solid var(--rule); padding: 14px 18px 12px; }
.trend svg { display: block; width: 100%; height: auto; }
.trend p { margin: 6px 0 0; font-size: 0.875rem; color: var(--muted); }

/* What it covers: five kinds of crop, written out. */
.kinds { margin: clamp(24px, 4vw, 40px) 0 0; display: grid; gap: 0; }
.kinds > div { display: grid; gap: 4px 28px; padding: 18px 0; border-top: 1px solid var(--rule); }
.kinds dt { font: 600 1.25rem/1.25 var(--label); }
.kinds dt span { display: block; font: 400 0.9375rem/1.3 var(--body); color: var(--muted); }
.kinds dd { margin: 0; max-width: 46em; }
@media (min-width: 760px) { .kinds > div { grid-template-columns: 230px 1fr; } }

.sources { margin-top: clamp(24px, 4vw, 40px); display: grid; gap: 26px 44px; }
@media (min-width: 760px) { .sources { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sources h3 { margin-bottom: 6px; }
.sources p { margin: 0; }
.plain { margin-top: 30px; padding: 18px 20px; background: var(--paper); border-radius: 14px; border-left: 6px solid var(--soil); max-width: 52em; }
.plain p { margin: 0; }

/* Free and Pro. */
.plans { width: 100%; max-width: 760px; margin-top: clamp(22px, 4vw, 36px); border-collapse: collapse; background: var(--paper); border-radius: 16px; overflow: hidden; }
.plans th, .plans td { padding: 13px 16px; text-align: left; vertical-align: top; border-top: 1px solid var(--rule); }
.plans thead th { border-top: 0; font: 600 1.375rem/1.1 var(--display); padding-top: 18px; padding-bottom: 14px; }
.plans tbody th { font-weight: 400; }
.plans td, .plans thead th + th { width: 6.5em; font: 600 1.0625rem/1.4 var(--label); font-variant-numeric: tabular-nums; }
.plans thead th + th { font: 600 1.375rem/1.1 var(--display); }
.plans .no { color: var(--muted); font-weight: 400; }
.price { margin-top: 16px; max-width: 40em; }
.noscript { padding: 16px 0; margin: 0; }

details { border-top: 1px solid var(--rule); max-width: 46em; }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; padding: 16px 30px 16px 0; font: 600 1.1875rem/1.3 var(--label); list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font: 400 1.75rem/1 var(--body); color: var(--muted); }
details[open] summary::after { content: "\2212"; }
details p { margin: 0 0 18px; max-width: 40em; }
.asks { margin-top: clamp(20px, 3vw, 32px); }

.closing { background: var(--soil); color: var(--soil-ink); padding: clamp(44px, 7vw, 80px) 0; }
.closing h2 { max-width: 14em; }
.closing p { margin: 14px 0 0; max-width: 34em; color: rgba(244, 238, 231, 0.9); }
.closing .go { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }
.closing .btn.line { color: var(--soil-ink); border-color: rgba(244, 238, 231, 0.7); }
.closing .btn.line:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.closing a:not(.btn) { color: var(--soil-ink); }

footer { padding: 34px 0 44px; font-size: 0.9375rem; color: var(--muted); }
footer .rows { display: flex; flex-wrap: wrap; gap: 10px 26px; }
footer a { color: var(--ink); }
footer p { margin: 16px 0 0; max-width: 56em; }

/* ---------- the plain pages: privacy, terms, texts, support ---------- */

.doc-top { background: var(--sky); border-bottom: 12px solid var(--rime); }
.doc-top .title { padding-top: clamp(22px, 5vw, 44px); padding-bottom: clamp(22px, 4vw, 36px); }
.doc-top h1 { font: 700 clamp(2.375rem, 7vw, 3.75rem)/1 var(--display); max-width: 14em; }
.doc-top p { margin: 10px 0 0; color: var(--muted); }
.doc { padding: clamp(28px, 5vw, 52px) 0 clamp(40px, 7vw, 72px); }
.doc .wrap > * { max-width: 44rem; }
.doc h2 { font: 600 1.625rem/1.15 var(--display); margin: 2em 0 0.45em; }
.doc h2:first-child { margin-top: 0; }
.doc h3 { margin: 1.5em 0 0.35em; }
.doc ul, .doc ol { padding-left: 1.25em; margin: 0 0 1em; }
.doc li { margin: 0.35em 0; }
.doc table { border-collapse: collapse; width: 100%; margin: 0.4em 0 1.2em; background: var(--paper); border-radius: 12px; overflow: hidden; font-size: 0.9688rem; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 11px 14px; border-top: 1px solid var(--rule); }
.doc thead th { border-top: 0; font: 600 1rem/1.3 var(--label); }
.doc tbody th { font-weight: 600; width: 11.5em; }
@media (max-width: 640px) {
  .doc table, .doc tbody, .doc tr, .doc tbody th, .doc td { display: block; }
  .doc thead { display: none; }
  .doc tr { padding: 13px 14px; border-top: 1px solid var(--rule); }
  .doc tbody tr:first-child { border-top: 0; }
  .doc tbody th, .doc td { border: 0; padding: 0; }
  .doc tbody th { font: 600 1.0625rem/1.3 var(--label); margin-bottom: 4px; }
  .doc td + td { margin-top: 8px; }
  .doc td[data-label]::before { content: attr(data-label) ": "; font-weight: 600; }
}
.doc .box { background: var(--paper); border-radius: 14px; padding: 18px 20px; border-left: 6px solid var(--leaf); }
.doc .box > :last-child { margin-bottom: 0; }
.doc .steps { counter-reset: step; list-style: none; padding: 0; }
.doc .steps li { counter-increment: step; position: relative; padding: 2px 0 2px 44px; margin: 12px 0; }
.doc .steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--leaf); color: #fff; font: 600 1rem/30px var(--label); text-align: center; }

@media print {
  .top nav, .lookup, .closing .go, .skip { display: none; }
  body { background: #fff; }
}
