/* HOW GROUNDWORK LOOKS: the "Fieldstone" palette (chosen November 2026).
   Cool stone-white pages, one confident evergreen for things you press, harvest
   gold as a small spark, and a color for each app. Colors follow the device's
   light/dark setting, unless someone picks Light or Dark in their profile
   (js/theme.js sets data-theme="light" or "dark" on the page).

   Every color is a token here at the top. Pages use the tokens, never a color
   written straight into a rule, so light and dark always match.

   Type: Inter for everything you read, Plus Jakarta Sans for titles and big
   numbers. Both are files in fonts/ (SIL Open Font License, fonts/OFL.txt), the
   same ones Groundwork Farm uses, so nothing loads from another website. */

@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Plus Jakarta Sans"; src: url("fonts/jakarta.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

/* Light */
:root {
  color-scheme: light dark;
  --font: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Plus Jakarta Sans", "Inter", "Segoe UI", sans-serif;

  --bg: #f4f6f5;          /* the page: stone white */
  --surface: #ffffff;     /* cards */
  --ink: #14201a;         /* text */
  --muted: #5c6962;       /* quieter text */
  --line: #e2e7e4;        /* hairlines */
  --line-strong: #cfd6d2;
  --accent: #16774e;      /* evergreen: buttons and links */
  --accent-hover: #11603f;
  --on-accent: #ffffff;   /* text on evergreen */
  --accent-soft: #e0f0e7;
  --gold: #dba43a;        /* the sun in the mark; small highlights only */

  /* One color per app (the dots, icons and each app's own header) */
  --farm: #2f7d52;
  --books: #2f64b0;
  --home: #b65a33;
  --garage: #5a6878;
  --lists: #7552c2;
  --sensors: #13808a;
  --calendar: #a8436a;

  --danger: #b3261e;      /* errors, sign out */
  --danger-soft: #fbe9e7;
  --warn-ink: #7a5310;    /* "needs attention" pills */
  --warn-soft: #fbf0d9;

  --shadow: 0 1px 2px rgba(20, 32, 26, 0.04), 0 10px 30px -14px rgba(20, 32, 26, 0.18);
  --shadow-lg: 0 1px 2px rgba(20, 32, 26, 0.05), 0 16px 40px -18px rgba(20, 32, 26, 0.28);
  --radius: 16px;
}
:root[data-theme="light"] { color-scheme: light; }

/* Dark: deep green-tinted charcoal (never pure black), colors softened so nothing
   glares. The same values twice: once when the device is dark (and the person
   hasn't picked Light), once when the person picked Dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1110; --surface: #151a18; --ink: #e7ecea; --muted: #97a39d;
    --line: #232a27; --line-strong: #323b37;
    --accent: #5ccf96; --accent-hover: #7ddcac; --on-accent: #06150d; --accent-soft: #14291e;
    --gold: #e6b955;
    --farm: #7ccb9c; --books: #8db1ef; --home: #eb9d77; --garage: #a8b5c4; --lists: #b7a1ee; --sensors: #6fcdd4; --calendar: #ef9bbb;
    --danger: #f0938a; --danger-soft: #2e1714; --warn-ink: #eac77c; --warn-soft: #2e2512;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1110; --surface: #151a18; --ink: #e7ecea; --muted: #97a39d;
  --line: #232a27; --line-strong: #323b37;
  --accent: #5ccf96; --accent-hover: #7ddcac; --on-accent: #06150d; --accent-soft: #14291e;
  --gold: #e6b955;
  --farm: #7ccb9c; --books: #8db1ef; --home: #eb9d77; --garage: #a8b5c4; --lists: #b7a1ee; --sensors: #6fcdd4; --calendar: #ef9bbb;
  --danger: #f0938a; --danger-soft: #2e1714; --warn-ink: #eac77c; --warn-soft: #2e2512;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -18px rgba(0, 0, 0, 0.7);
}

/* Each app's color, by class (pages set no inline styles: the security rules forbid them). */
.app-farm { --c: var(--farm); }
.app-books { --c: var(--books); }
.app-home { --c: var(--home); }
.app-garage { --c: var(--garage); }
.app-lists { --c: var(--lists); }
.app-sensors { --c: var(--sensors); }
.app-calendar { --c: var(--calendar); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  font-feature-settings: "cv11", "ss03"; /* Inter: a single-storey a, rounder quotes */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; text-wrap: balance; margin: 0; }

/* The page column: at most 1080px wide, with at least 20px either side on a phone. */
.page {
  max-width: 1080px;
  margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ---------- Top bar: the mark and the name ---------- */
.topbar { display: flex; align-items: center; gap: 10px; padding-block: 22px; }
.topbar img { width: 32px; height: 32px; }
.brand { font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -0.015em; color: var(--ink); text-decoration: none; }
.signin-link { margin-left: auto; font-weight: 600; font-size: 15px; text-decoration: none; padding: 9px 18px; border-radius: 99px; background: var(--accent); color: var(--on-accent); }
.signin-link:hover { background: var(--accent-hover); color: var(--on-accent); }

/* ---------- The opening: what Groundwork is ---------- */
.hero { display: flex; flex-direction: column; gap: 18px; padding-block: 56px 64px; max-width: 760px; }
.hero h1 { font-size: clamp(38px, 6.4vw, 64px); line-height: 1.04; font-weight: 700; }
.hero h1 .sun { color: var(--gold); }
.hero p { margin: 0; font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 58ch; }

/* ---------- The apps ---------- */
.apps { display: flex; flex-direction: column; gap: 20px; padding-bottom: 72px; }
.apps-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; }
.apps-head h2 { font-size: 26px; }
.apps-head p { margin: 0; color: var(--muted); font-size: 15px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.app {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.app-top { display: flex; align-items: center; gap: 12px; }
/* The app's icon on a soft tile of its own color. */
.icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, var(--surface));
}
.icon svg { width: 24px; height: 24px; }
.app h3 { font-size: 19px; }
.app p { margin: 0; color: var(--muted); font-size: 15px; }
.status { margin-top: auto; padding-top: 6px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 7px; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); }
.status.ready { color: var(--accent); }
.status.ready::before { background: var(--accent); }
/* Farm, the app you can use today, gets a double-width card (seven apps fill two rows of four). */
.app.featured { grid-column: span 2; }

/* ---------- Bottom ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 26px 40px; color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; }

/* Tablets: two apps across. Phones: one. */
@media (max-width: 1000px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .app.featured { grid-column: auto; }
  .hero { padding-block: 28px 44px; }
}
