/* Sprig — website stylesheet.
 *
 * The tokens are the app's "Seed Packet" design system
 * (calorie_calculator/docs/redesign/tokens.json, lib/theme/): the same
 * colours, type, radii and motion, so site and app read as one product.
 * Flat colour, hairline borders, no shadows, no gradients.
 */

/* ---------- Fonts (self-hosted, SIL OFL; licences in /assets/fonts/) ---------- */

@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-latin-italic-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans-latin-var.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens ---------- */

:root {
  color-scheme: light;

  /* Paper (light) */
  --paper: #f2ede1;
  --card: #fbf8f1;
  --soil: #e8e1d0;
  --line: #d9d0bb;
  --soil-line: #a99f86;
  --seed: #8c8672;
  --ink: #1f2a20;
  --ink-2: #5c6152;
  --forest: #2d6a35;
  --on-forest: #fbf8f1;
  --leaf: #7cb342;
  --sage: #dde8c9;
  --sage-ink: #24502b;
  --protein: #c4562f;
  --carbs: #d9a12b;
  --fats: #6e4a86;
  --water: #3d7fa6;
  --danger: #a3431f;
  --scrim: rgba(31, 42, 32, 0.45);

  /* The assistant's own colours do not change with the theme. */
  --pip-body: #b9d88c;
  --pip-ink: #1f2a20;
  --pip-leaf-dark: #2d6a35;
  --pip-leaf-light: #7cb342;
  --pip-cheek: #c4562f;

  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-card: 26px;
  --r-card-s: 22px;
  --r-tile: 16px;
  --r-pill: 999px;

  --pad-x: 22px;
  --wrap: 1120px;

  /* Motion: the app's SprigMotion. */
  --t-fast: 120ms;
  --t-base: 220ms;
  --t-slow: 380ms;
  --t-grow: 700ms;
  --stagger: 45ms;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --ease-pop: cubic-bezier(0.34, 1.4, 0.64, 1);
  --rise: 14px;
}

/* Night (dark): when the system asks for it, unless Paper was chosen… */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #12160f;
    --card: #1a1f17;
    --soil: #262c21;
    --line: #2e3529;
    --soil-line: #4a4f3f;
    --seed: #7d7a68;
    --ink: #ede8da;
    --ink-2: #a9a994;
    --forest: #9bc46a;
    --on-forest: #12160f;
    --leaf: #b9d88c;
    --sage: #243020;
    --sage-ink: #bfdc98;
    --protein: #e07a52;
    --carbs: #e8b84a;
    --fats: #a27bc0;
    --water: #6fa8cb;
    --danger: #e07a52;
    --scrim: rgba(0, 0, 0, 0.55);
  }
}
/* …and whenever Night was chosen. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #12160f;
  --card: #1a1f17;
  --soil: #262c21;
  --line: #2e3529;
  --soil-line: #4a4f3f;
  --seed: #7d7a68;
  --ink: #ede8da;
  --ink-2: #a9a994;
  --forest: #9bc46a;
  --on-forest: #12160f;
  --leaf: #b9d88c;
  --sage: #243020;
  --sage-ink: #bfdc98;
  --protein: #e07a52;
  --carbs: #e8b84a;
  --fats: #a27bc0;
  --water: #6fa8cb;
  --danger: #e07a52;
  --scrim: rgba(0, 0, 0, 0.55);
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration-color: var(--soil-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.18em;
  transition: text-decoration-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
a:hover {
  text-decoration-color: var(--forest);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

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

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

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--r-pill);
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--t-base) var(--ease);
}
.skip-link:focus {
  top: 12px;
}

/* ---------- Type ---------- */

.display,
h1,
h2,
h3,
.h1,
.h2,
.h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}

h1,
.h1 {
  font-size: clamp(2.6rem, 1.6rem + 4.6vw, 4.75rem);
  letter-spacing: -0.03em;
  line-height: 0.98;
}
h2,
.h2 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.25rem);
}
h3,
.h3 {
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.7rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

/* The accent word of a headline: Fraunces italic 400, as in the app. */
h1 em,
h2 em,
h3 em,
.display em {
  font-style: italic;
  font-weight: 400;
}

.lead {
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.3rem);
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 34em;
  text-wrap: pretty;
}

.kicker,
.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.label--strong {
  font-weight: 600;
  color: var(--sage-ink);
}

.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.35;
}

.muted {
  color: var(--ink-2);
}

.stack > * + * {
  margin-top: var(--gap, 16px);
}

.stack-top {
  margin-top: 22px;
}
.stack-top-s {
  margin-top: 10px;
}

/* ---------- Layout ---------- */

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--pad-x));
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.wrap--narrow {
  max-width: calc(760px + 2 * var(--pad-x));
}

.section {
  padding-block: clamp(64px, 9vw, 128px);
}
.section--tight {
  padding-block: clamp(40px, 6vw, 80px);
}
.section--sage {
  background: var(--sage);
  color: var(--ink);
}
.section--card {
  background: var(--card);
  border-block: 1px solid var(--line);
}

.section-head {
  max-width: 44rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}
.section-head > * + * {
  margin-top: 16px;
}

/* A wavy soil line: the app's divider between things that grow. */
.soil-rule {
  width: 100%;
  height: 10px;
  color: var(--soil-line);
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-base) var(--ease);
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
}
.site-header__in {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 68px;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}
.wordmark__mark {
  width: 30px;
  height: 30px;
  flex: none;
}
.mark-stem {
  fill: none;
  stroke: var(--forest);
  stroke-width: 4.5;
  stroke-linecap: round;
}
.mark-leaf-a {
  fill: var(--leaf);
}
.mark-leaf-b {
  fill: var(--forest);
}
/* The leaf that replaces the dot of the i. */
.wordmark__i {
  position: relative;
  display: inline-block;
}
.wordmark__i svg {
  position: absolute;
  left: 50%;
  top: -0.06em;
  width: 0.3em;
  height: 0.3em;
  transform: translateX(-40%);
  fill: var(--leaf);
}

.nav {
  display: none;
}
.nav__list {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav__link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-size: 0.97rem;
  font-weight: 500;
  color: var(--ink-2);
  text-decoration: none;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.nav__link:hover {
  color: var(--ink);
  background: var(--soil);
}
.nav__link[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--sage);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover {
  border-color: var(--ink);
}
.icon-btn:active {
  transform: scale(0.97);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The theme button needs JavaScript; without it the site follows the system. */
.theme-toggle {
  display: none;
}
.js .theme-toggle {
  display: inline-flex;
}
.theme-toggle .icon-moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon {
    display: block;
  }
}

/* Small screens: the menu is a <details>, so it opens without JavaScript. */
.menu {
  position: relative;
}
.menu > summary {
  list-style: none;
}
.menu > summary::-webkit-details-marker {
  display: none;
}
.menu__panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(300px, calc(100vw - 2 * var(--pad-x)));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-s);
  background: var(--card);
}
.menu[open] .menu__panel {
  animation: rise-in var(--t-slow) var(--ease);
}
.menu__panel a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 14px;
  border-radius: var(--r-tile);
  font-weight: 500;
  text-decoration: none;
}
.menu__panel a:hover {
  background: var(--soil);
}
.menu__panel a[aria-current="page"] {
  background: var(--sage);
  font-weight: 600;
}
.menu .icon-close {
  display: none;
}
.menu[open] .icon-close {
  display: block;
}
.menu[open] .icon-open {
  display: none;
}

@media (min-width: 860px) {
  .nav {
    display: block;
  }
  .menu {
    display: none;
  }
}

/* ---------- Buttons, chips ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 1.5px solid var(--forest);
  border-radius: var(--r-pill);
  background: var(--forest);
  color: var(--on-forest);
  font-family: var(--font-text);
  font-size: 1.03rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease), background-color var(--t-base) var(--ease),
    border-color var(--t-base) var(--ease), color var(--t-base) var(--ease), opacity var(--t-base) var(--ease);
}
.btn:hover {
  background: var(--sage-ink);
  border-color: var(--sage-ink);
}
:root[data-theme="dark"] .btn:hover {
  background: var(--leaf);
  border-color: var(--leaf);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn:hover {
    background: var(--leaf);
    border-color: var(--leaf);
  }
}
.btn:active {
  transform: scale(0.97);
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}
.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.btn--outline,
.btn--outline:hover {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}
.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn--danger,
.btn--danger:hover {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}
.btn--danger:hover {
  background: var(--danger);
  color: var(--card);
}
.btn--danger-solid,
.btn--danger-solid:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--card);
}
.btn--small {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.95rem;
}
.btn--block {
  display: flex;
  width: 100%;
}

/* A mono text link: "ASK PIP →". */
.link-mono {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-ink);
  text-decoration: none;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.link-mono:hover {
  text-decoration: underline;
  text-decoration-color: currentColor;
}
.link-mono .arrow {
  transition: transform var(--t-base) var(--ease);
}
.link-mono:hover .arrow {
  transform: translateX(4px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--sage);
  color: var(--sage-ink);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}
.chip svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.chip--outline {
  background: transparent;
  border: 1.5px dashed var(--soil-line);
  color: var(--ink-2);
}
.chip--pro {
  background: var(--forest);
  color: var(--on-forest);
}
.chip--free {
  background: transparent;
  border: 1.5px solid var(--ink);
  color: var(--ink);
}

/* Store buttons. Until the app is in the stores they are not links. */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.store {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 8px 22px 8px 18px;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  color: var(--ink);
  text-decoration: none;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease),
    transform var(--t-fast) var(--ease);
}
.store svg {
  width: 26px;
  height: 26px;
  flex: none;
  fill: currentColor;
}
.store__text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.store__small {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.store__big {
  font-weight: 600;
  font-size: 1.05rem;
}
.store--soon {
  border-style: dashed;
  border-color: var(--soil-line);
}
a.store:hover {
  background: var(--ink);
  color: var(--paper);
}
a.store:hover .store__small {
  color: inherit;
}
a.store:active {
  transform: scale(0.97);
}

/* ---------- Cards ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: clamp(20px, 3vw, 30px);
}
.card--sage {
  background: var(--sage);
  border-color: transparent;
}
.card--forest {
  background: var(--forest);
  border-color: transparent;
  color: var(--on-forest);
}
.card--dashed {
  background: transparent;
  border: 1.5px dashed var(--soil-line);
}

/* ---------- Hero ---------- */

.hero {
  padding-block: clamp(36px, 6vw, 84px) clamp(56px, 8vw, 110px);
  overflow: hidden;
}
.hero__grid {
  display: grid;
  gap: clamp(40px, 6vw, 72px);
  align-items: center;
}
.hero__copy > * + * {
  margin-top: 22px;
}
.hero__copy .stores {
  margin-top: 30px;
}
.hero__note {
  font-size: 0.92rem;
  color: var(--ink-2);
}
.hero__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.caption {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: center;
}

@media (min-width: 920px) {
  .hero__grid {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
}

/* ---------- The phone: an illustration of the app, drawn in HTML ---------- */

.phone {
  --pw: min(350px, 86vw);
  --u: calc(var(--pw) / 390);
  position: relative;
  width: var(--pw);
  aspect-ratio: 390 / 800;
  padding: calc(46 * var(--u)) calc(20 * var(--u)) 0;
  border: 1.5px solid var(--ink);
  border-radius: calc(54 * var(--u));
  background: var(--paper);
  overflow: hidden;
  font-size: calc(15 * var(--u));
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
}
.phone::before {
  /* the speaker slot */
  content: "";
  position: absolute;
  top: calc(16 * var(--u));
  left: 50%;
  width: calc(96 * var(--u));
  height: calc(10 * var(--u));
  border-radius: var(--r-pill);
  background: var(--soil);
  transform: translateX(-50%);
}
.phone__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.phone .p-mono {
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.phone .p-chip {
  display: inline-flex;
  align-items: center;
  gap: calc(6 * var(--u));
  height: calc(28 * var(--u));
  padding: 0 calc(12 * var(--u));
  border-radius: var(--r-pill);
  background: var(--sage);
  color: var(--sage-ink);
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u));
  font-weight: 600;
  letter-spacing: 0.04em;
}
.phone .p-chip svg {
  width: calc(12 * var(--u));
  height: calc(12 * var(--u));
  fill: currentColor;
}
.phone .p-title {
  font-family: var(--font-display);
  font-size: calc(34 * var(--u));
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.phone .p-title em {
  font-style: italic;
  font-weight: 400;
}

/* Today's plant card (also used, larger, in the story section). */
.plant-card {
  --u: 1px;
  display: grid;
  grid-template-columns: calc(112 * var(--u)) minmax(0, 1fr);
  gap: calc(14 * var(--u));
  padding: calc(18 * var(--u)) calc(18 * var(--u)) calc(16 * var(--u)) calc(10 * var(--u));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(28 * var(--u));
}
.phone .plant-card {
  --u: inherit;
}
.plant-card__plant {
  width: 100%;
  height: auto;
  overflow: visible;
}
.plant-card__side {
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--u));
  min-width: 0;
}
.plant-card__label {
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.plant-card__num {
  font-family: var(--font-display);
  font-size: calc(60 * var(--u));
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}
.plant-card__unit {
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(17 * var(--u));
  color: var(--ink-2);
}
.macros {
  display: flex;
  flex-direction: column;
  gap: calc(9 * var(--u));
  margin-top: calc(4 * var(--u));
}
.macro__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u));
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.macro__head span:last-child {
  color: var(--ink-2);
  letter-spacing: 0;
  text-transform: none;
}
.macro__track {
  height: calc(5 * var(--u));
  margin-top: calc(4 * var(--u));
  border-radius: var(--r-pill);
  background: var(--soil);
  overflow: hidden;
}
.macro__bar {
  width: var(--pct, 0%);
  height: 100%;
  border-radius: var(--r-pill);
  transition: width var(--t-grow) var(--ease);
}
.macro--protein .macro__bar {
  background: var(--protein);
}
.macro--carbs .macro__bar {
  background: var(--carbs);
}
.macro--fats .macro__bar {
  background: var(--fats);
}
.plant-card__foot {
  margin-top: auto;
  padding-top: calc(8 * var(--u));
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u));
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Parts of the plant drawing. */
.plant-goal {
  stroke: var(--ink-2);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
  fill: none;
}
.plant-mound {
  fill: var(--soil);
}
.plant-soil {
  fill: none;
  stroke: var(--soil-line);
  stroke-width: 2;
  stroke-linecap: round;
}
.plant-stem {
  fill: none;
  stroke: var(--forest);
  stroke-width: 4;
  stroke-linecap: round;
}
.plant-leaf {
  fill: var(--forest);
  transform-box: fill-box;
}
.plant-leaf--left {
  transform-origin: 100% 100%;
}
.plant-leaf--right {
  transform-origin: 0% 100%;
}
.plant-leaf--new {
  fill: var(--leaf);
}
.plant-bud {
  fill: var(--leaf);
  transform-box: fill-box;
  transform-origin: center;
}
.plant-bud--goal {
  fill: var(--carbs);
}
.plant-seed {
  fill: var(--seed);
}

/* The hero plant grows once when the page opens. */
.js .hero .plant-stem {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: stem-draw 900ms var(--ease) 250ms forwards;
}
.js .hero .plant-leaf,
.js .hero .plant-bud {
  transform: scale(0);
  animation: leaf-pop 520ms var(--ease-pop) forwards;
  animation-delay: calc(650ms + var(--i, 0) * 140ms);
}

.plant-leaves > :nth-child(2) {
  --i: 1;
}
.plant-leaves > :nth-child(3) {
  --i: 2;
}
.plant-leaves > :nth-child(4) {
  --i: 3;
}
.hero .plant-bud {
  --i: 4;
}
/* Sample numbers of the illustrations. */
.hero .macro--protein {
  --pct: 73%;
}
.hero .macro--carbs {
  --pct: 63%;
}
.hero .macro--fats {
  --pct: 57%;
}
.story .macro--protein {
  --pct: 95%;
}
.story .macro--carbs {
  --pct: 93%;
}
.story .macro--fats {
  --pct: 100%;
}

/* The assistant card. */
.pip-card {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u, 1px));
  padding: calc(12 * var(--u, 1px)) calc(16 * var(--u, 1px)) calc(12 * var(--u, 1px)) calc(10 * var(--u, 1px));
  border-radius: calc(24 * var(--u, 1px));
  background: var(--sage);
  color: var(--ink);
}
.pip-card .pip {
  width: calc(58 * var(--u, 1px));
  height: calc(58 * var(--u, 1px));
  flex: none;
}
.pip-card__quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: calc(15.5 * var(--u, 1px));
  line-height: 1.3;
}
.pip-card__ask {
  margin-top: calc(4 * var(--u, 1px));
  font-family: var(--font-mono);
  font-size: calc(11 * var(--u, 1px));
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage-ink);
}

.phone__duo {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(12 * var(--u));
}
.mini-card {
  display: flex;
  flex-direction: column;
  gap: calc(8 * var(--u));
  padding: calc(14 * var(--u));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(22 * var(--u));
}
.mini-card__num {
  font-family: var(--font-display);
  font-size: calc(22 * var(--u));
  font-weight: 500;
  line-height: 1.1;
}
.mini-card__num small {
  font-size: calc(14 * var(--u));
  color: var(--ink-2);
}
.drops {
  display: flex;
  gap: calc(3 * var(--u));
}
.drops svg {
  width: calc(15 * var(--u));
  height: calc(19 * var(--u));
  fill: transparent;
  stroke: var(--water);
  stroke-width: 1.4;
}
.drops svg.is-full {
  fill: var(--water);
}
.spark {
  width: 100%;
  height: calc(34 * var(--u));
}
.spark path:first-child {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
}
.spark path:last-child {
  fill: var(--leaf);
}

/* The app's floating nav capsule. */
.phone__nav {
  position: absolute;
  left: calc(16 * var(--u));
  right: calc(16 * var(--u));
  bottom: calc(18 * var(--u));
  height: calc(64 * var(--u));
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--card);
}
.phone__tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(2 * var(--u));
  font-size: calc(11 * var(--u));
  font-weight: 500;
  color: var(--ink-2);
}
.phone__tab svg {
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.phone__tab.is-active {
  color: var(--ink);
  font-weight: 600;
}
.phone__tab.is-active svg {
  stroke: var(--forest);
}
.phone__tab.is-active svg .fill {
  fill: var(--forest);
}
.phone__plus {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(48 * var(--u));
  height: calc(48 * var(--u));
  border-radius: var(--r-pill);
  background: var(--forest);
  color: var(--on-forest);
}
.phone__plus svg {
  width: calc(22 * var(--u));
  height: calc(22 * var(--u));
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

/* ---------- Pip, the assistant's default face ---------- */

.pip {
  overflow: visible;
}
.pip__shadow {
  fill: var(--pip-ink);
  fill-opacity: 0.12;
}
.pip__body {
  fill: var(--pip-body);
  stroke: var(--pip-ink);
  stroke-width: 3;
  stroke-linejoin: round;
}
.pip__seam {
  fill: none;
  stroke: var(--pip-ink);
  stroke-opacity: 0.22;
  stroke-width: 2.5;
  stroke-linecap: round;
}
.pip__cheek {
  fill: var(--pip-cheek);
  fill-opacity: 0.3;
}
.pip__stem {
  fill: none;
  stroke: var(--pip-ink);
  stroke-width: 3;
  stroke-linecap: round;
}
.pip__leaf-a {
  fill: var(--pip-leaf-dark);
  stroke: var(--pip-ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.pip__leaf-b {
  fill: var(--pip-leaf-light);
  stroke: var(--pip-ink);
  stroke-width: 2.5;
  stroke-linejoin: round;
}
.pip__eye {
  fill: var(--pip-ink);
}
.pip__glint {
  fill: #fbf8f1;
}
.pip__mouth,
.pip__lids {
  fill: none;
  stroke: var(--pip-ink);
  stroke-width: 2.6;
  stroke-linecap: round;
}
.pip__zz {
  fill: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}
/* Idle: breathe, sway, blink (README §7). */
.pip__all {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: pip-breathe 3.2s ease-in-out infinite;
}
.pip__sprout {
  transform-box: view-box;
  transform-origin: 60px 36px;
  animation: pip-sway 3.2s ease-in-out infinite;
}
.pip__eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: pip-blink 4s infinite;
}
.pip--sleepy .pip__all {
  animation: pip-breathe-slow 4.5s ease-in-out infinite;
}
.pip--sleepy .pip__sprout {
  animation: pip-droop 4.5s ease-in-out infinite;
}
.pip--sleepy .pip__zz {
  animation: pip-zz 3s ease-in-out infinite;
}
.pip--sleepy .pip__zz + .pip__zz {
  animation-delay: 1.5s;
}

/* ---------- Story: a day, as it grows ---------- */

.story__grid {
  display: grid;
  gap: 28px;
}
.story__stage {
  position: sticky;
  top: 76px;
  z-index: 2;
  padding-block: 8px 12px;
  background: var(--paper);
}
.story .plant-card {
  /* Compact while it rides along at the top of a phone screen. */
  --u: 0.8px;
  max-width: calc(380 * var(--u));
  margin-inline: auto;
}
.story__steps {
  display: grid;
  gap: 18px;
}
.step {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
  transition: border-color var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease);
}
.step > * + * {
  margin-top: 12px;
}
.step__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.js .story.is-live .step {
  opacity: 0.55;
}
.js .story.is-live .step.is-current {
  opacity: 1;
  border-color: var(--ink);
}

/* What the person does at each step, drawn like the app's own controls. */
.demo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-tile);
  background: var(--paper);
}
.demo__text {
  flex: 1;
  min-width: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.3;
}
.demo__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--forest);
  color: var(--on-forest);
}
.demo__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.demo--dashed {
  border-style: dashed;
  border-color: var(--soil-line);
}
.result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.result__name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
}
.result__macros {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.result__kcal {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Stages of the story plant. Without JavaScript the plant is fully grown.
   The numbers are where the stem is after breakfast and after lunch. */
.story {
  --stem-1: 76.4;
  --stem-2: 42.3;
}
.story .plant-stem {
  stroke-dasharray: 100;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset var(--t-grow) var(--ease);
}
.story .plant-leaf,
.story .plant-bud,
.story .plant-seed {
  transition: transform 520ms var(--ease-pop), opacity var(--t-base) var(--ease), fill var(--t-slow) var(--ease);
}
.story .plant-seed {
  opacity: 0;
}
.js .story[data-stage="0"] .plant-stem {
  stroke-dashoffset: 100;
}
.js .story[data-stage="1"] .plant-stem {
  stroke-dashoffset: var(--stem-1);
}
.js .story[data-stage="2"] .plant-stem {
  stroke-dashoffset: var(--stem-2);
}
.js .story[data-stage="0"] .plant-seed {
  opacity: 1;
}
.js .story[data-stage="0"] .plant-leaf,
.js .story[data-stage="0"] .plant-bud,
.js .story[data-stage="1"] .plant-leaf:not([data-at="1"]),
.js .story[data-stage="2"] .plant-leaf[data-at="3"] {
  transform: scale(0);
}
.js .story[data-stage="1"] .plant-bud {
  transform: translate(-1.6px, 160.9px);
}
.js .story[data-stage="2"] .plant-bud {
  transform: translate(1px, 89.2px);
}
/* The newest leaf is the light one. */
.js .story[data-stage="1"] .plant-leaf[data-at="1"],
.js .story[data-stage="2"] .plant-leaf[data-at="2"],
.story .plant-leaf[data-at="3"] {
  fill: var(--leaf);
}
.js .story[data-stage="1"] .plant-leaf[data-at="3"],
.js .story[data-stage="2"] .plant-leaf[data-at="3"] {
  fill: var(--forest);
}
.story .plant-bud {
  fill: var(--carbs);
}
.js .story:not([data-stage="3"]) .plant-bud {
  fill: var(--leaf);
}

@media (min-width: 920px) {
  .story__grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: clamp(40px, 6vw, 88px);
    align-items: start;
  }
  .story__stage {
    top: 110px;
    padding: 0;
    background: none;
  }
  .story .plant-card {
    --u: 1.16px;
  }
  .story__steps {
    gap: 22px;
    padding-bottom: 6vh;
  }
  .js .story.is-live .step {
    min-height: min(46vh, 400px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* ---------- Garden ---------- */

.garden {
  display: grid;
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.garden__cal {
  padding: clamp(16px, 2.6vw, 26px);
}
.garden__week,
.garden__days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}
.garden__week {
  margin-top: 14px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 4px;
  border-radius: 16px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--ink-2);
}
.day svg {
  width: clamp(28px, 7vw, 44px);
  height: auto;
  overflow: visible;
}
.day--today {
  background: var(--sage);
  color: var(--sage-ink);
  font-weight: 600;
}
.day--future {
  opacity: 0.5;
}
.day--other {
  opacity: 0.3;
}
.sprig-soil {
  stroke: var(--soil-line);
  stroke-width: 1.5;
  stroke-linecap: round;
  fill: none;
}
.sprig-seed {
  fill: var(--seed);
}
.sprig-stem {
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}
.sprig-leaf {
  fill: var(--forest);
}
.sprig-bud {
  fill: var(--carbs);
}
.sprig-grow {
  transform-box: view-box;
  transform-origin: 15px 33px;
}
.js .garden__cal:not(.is-in) .sprig-grow {
  transform: scaleY(0);
}
.js .garden__cal.is-in .sprig-grow {
  animation: sprig-grow var(--t-grow) var(--ease) backwards;
  animation-delay: calc(var(--d, 0) * 28ms);
}
.garden__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin-top: 22px;
}
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.93rem;
  color: var(--ink-2);
}
.legend svg {
  width: 30px;
  height: 36px;
  flex: none;
}
.garden__handle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  color: var(--soil-line);
}
.garden__handle svg {
  width: 64px;
  height: 8px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
}

@media (min-width: 920px) {
  .garden {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* ---------- Feature grid ---------- */

.grid {
  display: grid;
  gap: 16px;
}
@media (min-width: 640px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 980px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color var(--t-base) var(--ease), transform var(--t-slow) var(--ease);
}
.feature:hover {
  border-color: var(--ink);
}
.feature__art {
  display: flex;
  align-items: flex-end;
  min-height: 74px;
  margin-bottom: 4px;
}
.feature__art > svg {
  height: 64px;
  width: auto;
  overflow: visible;
}
.feature p {
  color: var(--ink-2);
}
.art-stroke {
  fill: none;
  stroke: var(--forest);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art-ink {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.art-soil {
  fill: none;
  stroke: var(--soil-line);
  stroke-width: 2;
  stroke-linecap: round;
}
.art-leaf {
  fill: var(--leaf);
}
.art-forest {
  fill: var(--forest);
}
.art-sage {
  fill: var(--sage);
}
.art-water {
  fill: var(--water);
}
.art-water-stroke {
  fill: none;
  stroke: var(--water);
  stroke-width: 1.5;
}
.art-protein {
  fill: var(--protein);
}
.art-carbs {
  fill: var(--carbs);
}
.art-fats {
  fill: var(--fats);
}
.art-track {
  fill: var(--soil);
}
.art-card {
  fill: var(--card);
  stroke: var(--line);
}
.art-paper {
  fill: var(--paper);
}
.art-ink-fill {
  fill: var(--ink);
}

/* The two looks side by side: these keep their own colours in both themes. */
.art-fixed-paper {
  fill: #f2ede1;
  stroke: #d9d0bb;
}
.art-fixed-night {
  fill: #12160f;
  stroke: #2e3529;
}
.art-fixed-stem-l,
.art-fixed-stem-d {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
}
.art-fixed-stem-l {
  stroke: #2d6a35;
}
.art-fixed-stem-d {
  stroke: #9bc46a;
}
.art-fixed-leaf-l {
  fill: #7cb342;
}
.art-fixed-leaf-l2 {
  fill: #2d6a35;
}
.art-fixed-leaf-d {
  fill: #b9d88c;
}
.art-fixed-leaf-d2 {
  fill: #9bc46a;
}
.barcode {
  flex: none;
  height: 34px;
  width: auto;
}

/* The seed packet: the app's summary card, here used for lists of facts. */
.packet {
  overflow: hidden;
  padding: 0;
}
.packet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px clamp(18px, 3vw, 26px);
  background: var(--forest);
  color: var(--on-forest);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.packet__body {
  padding: clamp(18px, 3vw, 26px);
}
.packet__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.packet__cell {
  padding: 16px clamp(18px, 3vw, 26px);
  border-top: 1px solid var(--line);
}
.packet__cell:nth-child(odd) {
  border-right: 1px solid var(--line);
}
.packet__cell:nth-child(-n + 2) {
  border-top: 0;
}
.packet__cell dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.packet__cell dd {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.2;
}

.packet .packet__head h2,
.label-reset {
  margin: 0;
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}
.link-mono--on-forest {
  color: var(--on-forest);
}
.packet__head :focus-visible {
  outline-color: var(--on-forest);
}

/* Hairline rows: label left, value right. */
.rows > * {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-block: 14px;
  border-top: 1px solid var(--line);
}
.rows > *:first-child {
  border-top: 0;
}
.rows dt {
  flex: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.rows dd {
  min-width: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Check lists. */
.ticks {
  display: grid;
  gap: 12px;
}
.ticks li {
  position: relative;
  padding-left: 30px;
}
.ticks li::before {
  /* a small leaf */
  content: "";
  position: absolute;
  left: 0;
  top: 0.28em;
  width: 16px;
  height: 16px;
  background: var(--forest);
  border-radius: 1px 12px 1px 12px;
}
.ticks--plain li::before {
  background: var(--soil-line);
}

/* ---------- Assistant section ---------- */

.assistant {
  display: grid;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
@media (min-width: 920px) {
  .assistant {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.chat {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: clamp(18px, 3vw, 28px);
  border-radius: var(--r-card);
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
}
.chat__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.chat__face {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: var(--r-pill);
  background: var(--sage);
}
.chat__face .pip {
  width: 44px;
  height: 44px;
}
.chat__name {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.chat__me {
  align-self: flex-end;
  max-width: 85%;
  padding: 11px 16px;
  border-radius: 20px 20px 6px 20px;
  background: var(--sage);
  color: var(--ink);
}
.chat__them {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.15rem;
  line-height: 1.35;
}
.chat__them::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-top: 0.3em;
  background: var(--forest);
  border-radius: 1px 11px 1px 11px;
}
.suggestion {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-s);
  background: var(--paper);
}
.suggestion > * + * {
  margin-top: 6px;
}
.suggestion__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1.2;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.namer {
  margin-top: 26px;
  padding: 18px 20px 20px;
  border: 1.5px dashed var(--soil-line);
  border-radius: var(--r-card-s);
}
.namer__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.namer input {
  flex: 1 1 180px;
  min-width: 0;
}

/* ---------- Forms ---------- */

.field {
  display: grid;
  gap: 8px;
}
.field + .field,
.field + .field-row,
.field-row + .field {
  margin-top: 18px;
}
.field-row {
  display: grid;
  gap: 18px;
}
.field-row .field + .field {
  margin-top: 0;
}
@media (min-width: 640px) {
  .field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.field label,
.field .field__label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field__hint {
  font-size: 0.88rem;
  color: var(--ink-2);
}
.input,
.field input:not([type="checkbox"]),
.field select,
.field textarea {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-tile);
  background: var(--card);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.35;
  transition: border-color var(--t-base) var(--ease), background-color var(--t-base) var(--ease);
}
.field textarea {
  min-height: 170px;
  resize: vertical;
}
.field select {
  appearance: none;
  padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 23px) 50%, calc(100% - 17px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-2);
  opacity: 0.75;
  font-family: var(--font-display);
  font-style: italic;
}
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.input:focus-visible {
  outline-offset: 2px;
  border-radius: var(--r-tile);
}
.field input:not([type="checkbox"])[aria-invalid="true"],
.field textarea[aria-invalid="true"],
.field select[aria-invalid="true"] {
  border-color: var(--danger);
}
.field__hint + .field {
  margin-top: 18px;
}
.field__error {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--danger);
}
/* The field only bots fill in. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
}
.check input {
  width: 22px;
  height: 22px;
  flex: none;
  margin: 2px 0 0;
  accent-color: var(--forest);
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--forest);
  border-radius: var(--r-tile);
  background: var(--card);
  font-size: 0.98rem;
}
.notice:empty {
  display: none;
}
.notice--ok {
  border-left-color: var(--forest);
  background: var(--sage);
  border-color: transparent;
  color: var(--ink);
}
.notice--warn {
  border-left-color: var(--carbs);
}
.notice--error {
  border-left-color: var(--danger);
}
.notice a {
  font-weight: 600;
}
.notice > div > * + * {
  margin-top: 8px;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: none;
  border: 2.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

/* ---------- Pro ---------- */

.compare {
  display: grid;
  gap: 16px;
}
@media (min-width: 820px) {
  .compare {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.plan-head h2,
.plan-head h3 {
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem);
}
.pro-feature {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.pro-feature + .pro-feature {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.pro-feature__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-tile);
  background: var(--card);
  color: var(--sage-ink);
}
.pro-feature__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pro-feature p {
  margin-top: 6px;
  color: var(--ink-2);
}
.pro-feature .chip {
  margin-top: 10px;
}

.periods {
  display: grid;
  gap: 12px;
}
@media (min-width: 720px) {
  .periods {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.period {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-card-s);
  background: var(--card);
}
.period__name {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.1;
}
.period__price {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-2);
}

/* FAQ: <details>, so it works without JavaScript. */
.faq {
  border-top: 1px solid var(--line);
}
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding-block: 14px;
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.35rem);
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  font-family: var(--font-text);
  font-size: 1.2rem;
  font-weight: 500;
  line-height: 1;
  transition: transform var(--t-slow) var(--ease), background-color var(--t-base) var(--ease),
    color var(--t-base) var(--ease);
}
.faq details[open] summary::after {
  transform: rotate(45deg);
  background: var(--ink);
  color: var(--paper);
}
.faq__body {
  padding: 0 48px 22px 0;
  color: var(--ink-2);
}
.faq__body > * + * {
  margin-top: 12px;
}
.faq details[open] .faq__body {
  animation: rise-in var(--t-slow) var(--ease);
}

/* ---------- Page heads (inner pages) ---------- */

.page-head {
  padding-block: clamp(40px, 6vw, 84px) clamp(28px, 4vw, 48px);
}
.page-head > .wrap > * + * {
  margin-top: 18px;
}
.page-head h1 {
  font-size: clamp(2.4rem, 1.6rem + 3.6vw, 4rem);
}

/* ---------- Legal ---------- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tab {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.tab:hover {
  background: var(--soil);
}
.tab[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* One document at a time once the script has read ?doc=. Without it, both
   are on the page, one after the other. */
:root[data-doc="privacy"] #terms,
:root[data-doc="terms"] #privacy {
  display: none;
}

.draft-banner {
  margin-bottom: 28px;
  border-left-color: var(--carbs);
}

.doc {
  padding-bottom: clamp(48px, 7vw, 96px);
}
.doc + .doc {
  padding-top: clamp(32px, 5vw, 64px);
  border-top: 1px solid var(--line);
}
:root[data-doc] .doc + .doc {
  padding-top: 0;
  border-top: 0;
}
:root #licences {
  margin-top: 0;
  padding-top: clamp(28px, 4vw, 44px);
  border-top: 1px solid var(--line);
}
.doc__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.doc__meta .chip {
  min-height: 28px;
  padding-block: 5px;
  border-radius: 14px;
  line-height: 1.4;
  white-space: normal;
}
.doc h2 {
  font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem);
}
.doc h3 {
  margin-top: 44px;
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.65rem);
}
.doc h4 {
  margin-top: 26px;
  font-family: var(--font-text);
  font-size: 1.05rem;
  font-weight: 600;
}
.doc p,
.doc ul,
.doc ol,
.doc table,
.doc .summary {
  margin-top: 14px;
}
.doc ul,
.doc ol {
  padding-left: 1.3em;
}
.doc li + li {
  margin-top: 8px;
}
.doc li::marker {
  color: var(--forest);
}
.doc .summary {
  padding: 18px 20px;
  border-radius: var(--r-card-s);
  background: var(--sage);
  color: var(--ink);
}
.doc .summary > * + * {
  margin-top: 10px;
}
.doc .summary p:first-child {
  margin-top: 0;
}
/* Something only the owner can fill in: shown plainly, not hidden. */
.todo {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--carbs);
  color: #1f2a20;
  font-family: var(--font-mono);
  font-size: 0.82em;
  font-weight: 600;
}
.table-scroll {
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-tile);
}
.doc table {
  width: 100%;
  min-width: 620px;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.doc th,
.doc td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc tr:last-child td {
  border-bottom: 0;
}
.doc th {
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-2);
}
/* On a phone a wide table is hard to read: each row becomes a small card,
   with the column names written in front of the values. */
@media (max-width: 700px) {
  .table-scroll {
    overflow: visible;
    border: 0;
  }
  .doc table,
  .doc tbody,
  .doc tr,
  .doc td {
    display: block;
    min-width: 0;
  }
  .doc thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .doc tr {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--r-tile);
    background: var(--card);
  }
  .doc td {
    padding: 0;
    border: 0;
  }
  .doc td + td {
    margin-top: 10px;
    color: var(--ink-2);
  }
  .doc td + td::before {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .table-data td:nth-child(2)::before {
    content: "Where it is kept";
  }
  .table-data td:nth-child(3)::before {
    content: "What it is for";
  }
  .table-partners td:nth-child(2)::before {
    content: "What it does for Sprig";
  }
}

.doc__toc {
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-card-s);
  background: var(--card);
}
.doc__toc ol {
  margin-top: 10px;
  columns: 2 220px;
  column-gap: 28px;
  padding-left: 1.4em;
}
.doc__toc li {
  break-inside: avoid;
}

/* ---------- Account ---------- */

.account {
  display: grid;
  gap: 18px;
  padding-bottom: clamp(56px, 8vw, 110px);
}
/* One panel at a time, chosen by the page's state. */
.account [data-panel] {
  display: none;
}
.account[data-state="loading"] [data-panel="loading"],
.account[data-state="signed-out"] [data-panel="signed-out"],
.account[data-state="signed-in"] [data-panel="signed-in"],
.account[data-state="deleted"] [data-panel="deleted"] {
  display: block;
}
.no-js .account [data-panel="loading"] {
  display: none;
}
.account__loading {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-2);
}
.account h2 {
  font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
}
.or {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.or::before,
.or::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}
.provider-buttons {
  display: grid;
  gap: 10px;
}
.danger-zone {
  border-color: var(--danger);
}
.danger-zone h2 {
  color: var(--danger);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

dialog.sheet {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: clamp(22px, 4vw, 32px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--paper);
  color: var(--ink);
  overflow-y: auto;
}
dialog.sheet::backdrop {
  background: var(--scrim);
}
dialog.sheet[open] {
  animation: rise-in var(--t-slow) var(--ease);
}
dialog.sheet h2 {
  font-size: clamp(1.7rem, 1.4rem + 1.4vw, 2.2rem);
}

/* ---------- Contact ---------- */

.contact {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  padding-bottom: clamp(56px, 8vw, 110px);
}
@media (min-width: 920px) {
  .contact {
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: start;
  }
}
.counter {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-2);
  text-align: right;
}

/* ---------- 404 ---------- */

.lost {
  display: grid;
  place-items: center;
  min-height: 62vh;
  padding-block: 48px 80px;
  text-align: center;
}
.lost > .wrap > * + * {
  margin-top: 20px;
}
.lost .pip {
  width: 150px;
  height: 150px;
  margin-inline: auto;
}
.lost .lead {
  margin-inline: auto;
}
.lost .actions {
  justify-content: center;
}

/* ---------- Call to action, footer ---------- */

.cta {
  display: grid;
  gap: 26px;
  justify-items: start;
  padding: clamp(28px, 5vw, 64px);
  border-radius: clamp(26px, 4vw, 40px);
  background: var(--forest);
  color: var(--on-forest);
}
.cta .lead {
  color: inherit;
  opacity: 0.86;
}
.cta .store {
  border-color: currentColor;
  color: inherit;
}
.cta .store__small {
  color: inherit;
  opacity: 0.8;
}
.cta a.store:hover {
  background: var(--on-forest);
  color: var(--forest);
}
.cta .btn--outline {
  border-color: currentColor;
  color: inherit;
}
.cta .btn--outline:hover {
  background: var(--on-forest);
  border-color: var(--on-forest);
  color: var(--forest);
}
.cta .kicker {
  color: inherit;
  opacity: 0.8;
}
.cta :focus-visible {
  outline-color: var(--on-forest);
}

.site-footer {
  margin-top: clamp(40px, 6vw, 80px);
  padding-block: 44px 36px;
  border-top: 1px solid var(--line);
  background: var(--card);
  font-size: 0.97rem;
}
.site-footer__grid {
  display: grid;
  gap: 32px;
}
@media (min-width: 760px) {
  .site-footer__grid {
    grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  }
}
.site-footer h2 {
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.site-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  text-decoration: none;
}
.site-footer li a:hover {
  text-decoration: underline;
}
.site-footer__about > * + * {
  margin-top: 12px;
}
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-2);
}

/* LOOK: Paper / Night / System, as on the app's You tab. */
.look {
  display: none;
  align-items: center;
  gap: 10px;
}
.js .look {
  display: flex;
}
.look__options {
  display: flex;
  gap: 6px;
}
.look button {
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color var(--t-base) var(--ease), color var(--t-base) var(--ease);
}
.look button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- Motion ---------- */

/* Things rise into place as they scroll into view; only with JavaScript. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(var(--rise));
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
  transition-delay: calc(var(--i, 0) * var(--stagger));
}
.js [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(var(--rise));
  }
}
@keyframes stem-draw {
  to {
    stroke-dashoffset: var(--stem-end, 0);
  }
}
@keyframes leaf-pop {
  to {
    transform: scale(1);
  }
}
@keyframes sprig-grow {
  from {
    transform: scaleY(0);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes pip-breathe {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(0.985, 1.03);
  }
}
@keyframes pip-breathe-slow {
  0%,
  100% {
    transform: scale(1, 1);
  }
  50% {
    transform: scale(1.03, 0.97);
  }
}
@keyframes pip-sway {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(7deg);
  }
}
@keyframes pip-droop {
  0%,
  100% {
    transform: rotate(-26deg);
  }
  50% {
    transform: rotate(-30deg);
  }
}
@keyframes pip-blink {
  0%,
  90%,
  100% {
    transform: scaleY(1);
  }
  94% {
    transform: scaleY(0.1);
  }
}
@keyframes pip-zz {
  0% {
    opacity: 0;
    transform: translate(0, 0);
  }
  30% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(8px, -16px);
  }
}

/* Reduced motion: everything is simply in its final place. */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }
  .pip__all,
  .pip__sprout,
  .pip__eyes,
  .pip__zz,
  .spinner {
    animation: none !important;
  }
  .js [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Print (the legal texts are worth printing) ---------- */

@media print {
  .site-header,
  .site-footer,
  .tabs,
  .skip-link,
  .cta {
    display: none !important;
  }
  :root[data-doc] #terms,
  :root[data-doc] #privacy {
    display: block !important;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
  }
  .doc h3 {
    break-after: avoid;
  }
}
