/* farmraiders.com: shared styles for every page. Everything is served from this site (fonts included), so the
   pages make no requests to anyone else. Colours come from the app icon: the cabbage field (#33984b, #356837,
   #5ac54f), the cow's cream and the near-black outline. Mobile first; wider screens only get more room. */

@font-face {
  font-family: "Lilita One";
  src: url("/fonts/LilitaOne-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Fredoka";
  src: url("/fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fbf4e8;
  --surface: #fffaf1;
  --surface-2: #f4e6cf;
  --ink: #1d1a26;
  --muted: #5b5248;
  --line: #e2cfb1;
  --outline: #1d1a26;
  --chip: #fffaf1;
  --chip-hover: #f4e6cf;
  --chip-ink: #1d1a26;
  --link: #2f6233;
  --link-hover: #1d4421;
  --tile: #33984b;
  --field-shade: transparent;
  --on-tile: #fff6e6;
  --pill: #ffe08a;
  --mark-bg: #ffe08a;
  --mark-ink: #1d1a26;
  --focus: #1d1a26;
  --display: "Lilita One", "Fredoka", ui-rounded, system-ui, sans-serif;
  --body: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111b15;
    --surface: #17251d;
    --surface-2: #1f3328;
    --ink: #f6ecdc;
    --muted: #c9bba6;
    --line: #2f4738;
    --outline: #070c09;
    --chip: #f6ecdc;
    --chip-hover: #e8dcc6;
    --chip-ink: #1d1a26;
    --link: #a3e872;
    --link-hover: #c8f5a4;
    --tile: #1e5a3a;
    /* The header's field dimmed to sit with the dark page (its grass comes out near --tile). */
    --field-shade: rgb(17 27 21 / 0.45);
    --on-tile: #fff6e6;
    --pill: #f1d36f;
    --mark-bg: #f1d36f;
    --mark-ink: #1d1a26;
    --focus: #f6ecdc;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--link);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--link-hover);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: 0.01em;
}

h1 {
  font-size: clamp(2rem, 1.5rem + 2.6vw, 2.9rem);
  margin: 0 0 0.3em;
}

h2 {
  font-size: clamp(1.45rem, 1.25rem + 1.2vw, 1.85rem);
  margin: 2.2em 0 0.6em;
}

h3 {
  font-family: var(--body);
  font-weight: 600;
  font-size: 1.15rem;
  line-height: 1.3;
  margin: 1.7em 0 0.4em;
}

h1,
h2,
h3,
[id] {
  scroll-margin-top: 1rem;
}

p,
ul,
ol,
dl,
table {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: 0.35rem;
}

strong {
  font-weight: 600;
}

/* Words in [brackets] are still to be filled in (see site/README.md). */
mark.todo {
  background: var(--mark-bg);
  color: var(--mark-ink);
  padding: 0 0.2em;
  border-radius: 4px;
}

/* The cabbage field from the app icon, behind the page header: one of its tiles (cabbage-tile.png, 19 art pixels
   square, from Tools/Art/build_site_tile.py) repeated at two CSS pixels an art pixel and never smoothed, so it stays as
   sharp as the icon. Dark mode lays --field-shade over it. Images inside keep their usual smoothing. */
.field {
  background-color: var(--tile);
  background-image: linear-gradient(var(--field-shade), var(--field-shade)), url("/cabbage-tile.png");
  background-size: 100% 100%, 38px 38px;
  image-rendering: pixelated;
}

.field img {
  image-rendering: auto;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.5rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--outline);
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

/* Inner pages: header, document, footer. */
.site-header {
  border-bottom: 4px solid var(--outline);
}

.site-header .bar {
  max-width: 46rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--on-tile);
  text-decoration: none;
}

.brand:hover {
  color: var(--on-tile);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  border: 3px solid var(--outline);
  box-shadow: 0 3px 0 var(--outline);
  background: var(--tile);
}

.brand-name {
  font-family: var(--display);
  font-size: 1.65rem;
  line-height: 1;
  text-shadow:
    0 3px 0 var(--outline),
    2px 0 0 var(--outline),
    -2px 0 0 var(--outline),
    0 -2px 0 var(--outline),
    2px 3px 0 var(--outline),
    -2px 3px 0 var(--outline);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.95rem;
  border-radius: 999px;
  background: var(--chip);
  color: var(--chip-ink);
  border: 2px solid var(--outline);
  box-shadow: 0 3px 0 var(--outline);
  font-weight: 600;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--chip-ink);
  background: var(--chip-hover);
}

.site-nav a[aria-current="page"] {
  background: var(--pill);
  color: #1d1a26;
}

.doc {
  max-width: 46rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
}

.doc > h1 + .meta {
  margin-top: -0.2rem;
}

.meta {
  color: var(--muted);
  font-size: 0.97rem;
}

.lead {
  font-size: 1.12rem;
}

.card {
  background: var(--surface);
  border: 3px solid var(--outline);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--outline);
  padding: 1rem 1.15rem 0.25rem;
  margin: 1.5rem 0;
}

.card > h2:first-child {
  margin-top: 0.2em;
}

.toc {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem 1.15rem 0.6rem;
  margin: 1.5rem 0 2rem;
}

.toc h2 {
  font-size: 1.3rem;
  margin: 0 0 0.5rem;
}

.toc ol {
  margin: 0 0 0.5rem;
  padding-left: 1.6rem;
}

.toc li + li {
  margin-top: 0.15rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.97rem;
}

caption {
  text-align: left;
  font-weight: 600;
  padding-bottom: 0.4rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}

thead th {
  background: var(--surface-2);
  font-weight: 600;
}

td > ul {
  margin: 0;
  padding-left: 1.1rem;
}

.contact-list {
  list-style: none;
  padding: 0;
}

.contact-list li + li {
  margin-top: 0.6rem;
}

address {
  font-style: normal;
  margin: 0 0 1rem;
}

.site-footer {
  border-top: 2px solid var(--line);
  padding: 1.25rem 1rem 2.25rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer p {
  margin: 0 0 0.5rem;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.site-footer li + li {
  margin-top: 0;
}

/* Home and Not found: the page's message in the middle, under the header like every other page. */
.doc.hero {
  text-align: center;
  padding-top: 3rem;
}

.app-icon {
  display: block;
  width: 168px;
  height: 168px;
  margin: 0 auto 1.1rem;
  border-radius: 22%;
  border: 4px solid var(--outline);
  box-shadow: 0 5px 0 var(--outline);
  background: var(--tile);
}

.hero h1 {
  font-size: clamp(2.5rem, 1.9rem + 3.4vw, 3.4rem);
  margin-bottom: 0.25em;
}

.tagline {
  font-size: 1.15rem;
  max-width: 26rem;
  margin: 0 auto 1.25rem;
}

.soon {
  display: inline-block;
  margin: 0 0 0.25rem;
  padding: 0.45rem 1.1rem;
  background: var(--pill);
  color: #1d1a26;
  border: 2px solid var(--outline);
  border-radius: 999px;
  box-shadow: 0 3px 0 var(--outline);
  font-weight: 600;
  line-height: 1.4;
}

@media (min-width: 40em) {
  body {
    font-size: 1.125rem;
  }

  .doc {
    padding: 2.5rem 1.5rem 4rem;
  }

  .site-header .bar {
    padding: 0.9rem 1.5rem;
  }

  .toc ol {
    columns: 2;
    column-gap: 2.5rem;
  }

  .doc.hero {
    padding-top: 4rem;
  }
}

@media print {
  .skip-link,
  .site-nav,
  .toc {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }

  .site-header,
  .card {
    background: none;
    border: 0;
    box-shadow: none;
  }

  .brand,
  .brand-name {
    color: #000;
    text-shadow: none;
  }

  a {
    color: #000;
  }

  a[href^="http"]::after,
  a[href^="mailto:"]::after {
    content: " (" attr(href) ")";
  }
}
