/*
 * MyGarden website: the app's look (src/constants/theme.ts) – leafy grounds, leaf green, sunshine
 * and petals, Young Serif headings and Figtree text. Fonts are served from this site (nothing is
 * loaded from anywhere else); they're under the SIL Open Font License (fonts/LICENSE.txt).
 */
@font-face {
  font-family: "Young Serif";
  src: url("/fonts/YoungSerif-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Figtree";
  src: url("/fonts/Figtree-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #f5f9ee;
  --surface: #ffffff;
  --element: #e8f2dc;
  --element-strong: #d3e6bf;
  --text: #1c2a19;
  --muted: #4f6148;
  --leaf: #2e7d32;
  --leaf-deep: #1f5e25;
  --sprout: #cfeeb0;
  --mark: #fff2bf;
  --display: "Young Serif", Georgia, "Times New Roman", serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1810;
    --surface: #16241a;
    --element: #1e3121;
    --element-strong: #2a4429;
    --text: #eef6e6;
    --muted: #adc2a3;
    --leaf: #7ccf72;
    --leaf-deep: #a5e19a;
    --sprout: #2f5a2a;
    --mark: #3b3315;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--body);
}
main { max-width: 760px; margin: 0 auto; padding: 24px 16px 64px; }
header { margin-bottom: 28px; }
a { color: var(--leaf); text-underline-offset: 2px; }

/* The app's name with its icon, top left of every page. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--leaf-deep);
  font: 1.35rem/1 var(--display);
  text-decoration: none;
}
.brand img { width: 36px; height: 36px; border-radius: 9px; flex: none; }

h1, h2 { font-family: var(--display); font-weight: 400; color: var(--leaf-deep); }
h1 { font-size: 2.1rem; line-height: 1.2; margin: 16px 0 6px; }
h2 { font-size: 1.4rem; line-height: 1.3; margin: 40px 0 10px; padding-top: 12px; border-top: 1px solid var(--element-strong); }
h3 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 6px; }
.updated { color: var(--muted); margin: 0; }
p, ul { margin: 0 0 14px; }
ul { padding-left: 1.3em; }
li { margin-bottom: 6px; }

.summary {
  background: var(--element);
  border-radius: 16px;
  padding: 18px 20px;
  margin: 0 0 8px;
}
.summary h2 { border: 0; margin-top: 0; padding-top: 0; }
.summary ul { margin-bottom: 0; }
.card {
  background: var(--surface);
  border: 1px solid var(--element-strong);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 14px 0;
}
.card h3 { margin-top: 0; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.label { display: block; color: var(--muted); font-size: .9rem; font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 0 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 520px; }
th, td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--element-strong); }
th { color: var(--muted); font-weight: 600; }
mark { background: var(--mark); color: inherit; padding: 0 3px; border-radius: 3px; }
footer { margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--element-strong); color: var(--muted); font-size: .9rem; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 8px; font-weight: 600; }

/* Home page: the splash screen's name and three plants. */
.hero { text-align: center; padding: 16px 0 8px; }
.hero h1 { font-size: 2.9rem; margin: 8px 0 0; }
.hero .tagline { font: 1.5rem/1.3 var(--display); color: var(--text); margin: 6px 0 12px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 32em; margin: 0 auto 16px; }
.status {
  display: inline-block;
  background: var(--sprout);
  color: var(--leaf-deep);
  font-weight: 700;
  font-size: .9rem;
  border-radius: 999px;
  padding: 5px 14px;
  margin: 4px 0 0;
}
.plants { display: block; width: min(320px, 100%); height: auto; margin: 18px auto 20px; }
.plants .soil { fill: var(--element-strong); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 32px 0 0; }
.features .card { margin: 0; background: var(--element); border: 0; }
.features h3 { font: 1.2rem/1.3 var(--display); color: var(--leaf-deep); margin-bottom: 6px; }

/* The plants grow as on the app's splash screen: stem, then leaves, then the flower opens. */
.plants .stem, .plants .leaf, .plants .head {
  transform-box: fill-box;
  animation-duration: .45s;
  animation-timing-function: cubic-bezier(.2, .7, .3, 1);
  animation-fill-mode: both;
}
.plants .stem { transform-origin: bottom; animation-name: grow-up; }
.plants .leaf { transform-origin: left center; animation-name: unfurl; }
.plants .head { transform-origin: center; animation-name: open; animation-duration: .55s; }
.plants .tulip .head { transform-origin: bottom center; animation-name: bloom; }
.plants .p1 .stem { animation-delay: .15s; }
.plants .p1 .leaf { animation-delay: .35s; }
.plants .p1 .head { animation-delay: .6s; }
.plants .p2 .stem { animation-delay: .33s; }
.plants .p2 .leaf { animation-delay: .53s; }
.plants .p2 .head { animation-delay: .78s; }
.plants .p3 .stem { animation-delay: .51s; }
.plants .p3 .leaf { animation-delay: .71s; }
.plants .p3 .head { animation-delay: .96s; }
@keyframes grow-up { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes unfurl { from { transform: rotate(40deg) scale(0); opacity: 0; } 20% { opacity: 1; } to { transform: none; } }
@keyframes open { from { transform: rotate(-120deg) scale(0); opacity: 0; } 20% { opacity: 1; } to { transform: none; } }
@keyframes bloom { from { transform: scale(0); opacity: 0; } 20% { opacity: 1; } to { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .plants .stem, .plants .leaf, .plants .head { animation: none; }
}
