/* Houseplant Tracker's look. The tokens at the top — a natural green palette,
   a warm paper background, soft rounded cards — set the product's voice; the
   rules underneath spend them consistently. Change tokens first; add rules
   second. */
:root {
  color-scheme: light dark;

  /* Palette. Natural greens on warm earth tones. */
  --ink: #1f2a23;
  --muted: #6b7d6f;
  --line: #dce6dc;
  --bg: #f4f1e8;
  --surface: #ffffff;
  --accent: #2f6f4f;
  --accent-soft: #e4f0e2;
  --accent-ink: #ffffff;
  --soil: #7a5a3f;
  --overdue: #b9412b;
  --overdue-soft: #f6e4dd;

  /* Type scale. */
  --step-0: 0.9375rem; /* small print */
  --step-1: 1.0625rem; /* body */
  --step-2: 1.375rem; /* section headings */
  --step-3: clamp(2.25rem, 6vw, 3rem); /* the masthead */

  /* Shape. */
  --radius: 14px;
  --shadow: 0 1px 2px rgb(31 42 35 / 0.06), 0 8px 24px rgb(31 42 35 / 0.07);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e8eee5;
    --muted: #9aa89c;
    --line: #2c3a30;
    --bg: #141a16;
    --surface: #1e2620;
    --accent: #74c39a;
    --accent-soft: #1f2f25;
    --accent-ink: #10251b;
    --soil: #a87f56;
    --overdue: #e0806a;
    --overdue-soft: #2e211c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    var(--step-1) / 1.6 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.masthead,
main {
  max-width: 38rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* The product's name and its one sentence: the first thing a visitor reads,
   so it is the largest thing on the page, marked with the product's own
   colour rather than fenced off by a rule line. */
.masthead {
  padding-top: 4rem;
  padding-bottom: 2rem;
}

.masthead::before {
  content: "";
  display: block;
  width: 2.25rem;
  height: 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  margin-bottom: 1.25rem;
}

.masthead h1 {
  margin: 0 0 0.5rem;
  font-size: var(--step-3);
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-weight: 750;
  text-wrap: balance;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: var(--step-1);
  max-width: 34rem;
  text-wrap: pretty;
}

main {
  padding-bottom: 3rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

/* The shelf: a list of cards laid out for a phone width. */
.plants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.875rem;
}

.plant-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem 1.1rem;
  margin: 0;
}

/* A card's own header: the plant's name above where it lives. */
.plant-card__head {
  margin-bottom: 0.6rem;
}

.plant-card__name {
  margin: 0;
  font-size: var(--step-2);
  letter-spacing: -0.015em;
  font-weight: 650;
  line-height: 1.2;
}

.plant-card__location {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: var(--step-0);
}

/* The facts: how often it wants water, and when it was last watered. */
.plant-card__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.75rem;
  margin: 0;
}

.plant-card__facts dt {
  color: var(--muted);
  font-size: var(--step-0);
}

.plant-card__facts dd {
  margin: 0;
  font-size: var(--step-0);
}

/* Overdue plants stand out — a warm soil-red edge and a tinted surface — so a
   glance down the page finds the thirsty ones first. */
.plant-card--overdue {
  border-color: var(--overdue);
  background: var(--overdue-soft);
  box-shadow:
    0 0 0 1px var(--overdue),
    0 8px 24px rgb(185 65 43 / 0.12);
}

.plant-card--overdue .plant-card__name {
  color: var(--overdue);
}

/* The "overdue" class is the urgency layer's signal that a plant's watering
   day has passed. A warm left bar makes the thirsty ones catch the eye the
   moment the page opens, before the rest is read. */
.plant-card.overdue {
  border-left: 0.4rem solid var(--overdue);
}

/* The "Water today" button: a clear, thumb-sized call to action on the cards
   that need attention. */
.water-today {
  margin-top: 0.7rem;
  border: 1px solid var(--overdue);
  background: var(--overdue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  width: 100%;
}

.water-today:hover {
  filter: brightness(1.05);
}

/* A plant due today gets a quiet green edge — a nudge, not an alarm. */
.plant-card--due {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* An empty state is a designed state, not an absence. */
.empty {
  color: var(--muted);
  text-align: center;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
