:root {
  --paper: #fffaf1;
  --paper-2: #f5ecdb;
  --panel: #fef1d5; /* warm butter — that cozy old-video-game feel */
  --panel-2: #f5e2b8;
  --ink: #2e3529;
  --ink-soft: #5d6656;
  --moss: #4f7a43;
  --leaf: #7dbb6a;
  --honey: #e2a530;
  --wood: #8b6440;
  --line: rgba(46, 53, 41, 0.12);
  --shadow: 0 10px 30px rgba(60, 50, 30, 0.18);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #cfdfbe;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#scene:active { cursor: grabbing; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 22px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 250, 241, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 10px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.brand-name { font-family: var(--serif); font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }
.brand-role { font-size: 12.5px; color: var(--ink-soft); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.chip {
  border: 1px solid var(--line);
  background: rgba(255, 250, 241, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(60, 50, 30, 0.12);
  transition: translate 0.15s, background 0.15s;
}
.chip:hover { translate: 0 -1px; background: #fff; }
.chip.primary { background: var(--moss); color: #fff; border-color: transparent; }
.chip.primary:hover { background: #456d3a; }
.chip .short { display: none; }

/* ---------- garden signs ---------- */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
.sign {
  position: absolute;
  left: 0; top: 0;
  pointer-events: auto;
  padding: 7px 13px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid rgba(139, 100, 64, 0.35);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(60, 50, 30, 0.18);
  transition: translate 0.2s, background 0.2s, border-color 0.2s, opacity 0.3s;
}
.sign::after {
  content: '';
  position: absolute;
  left: 50%; top: 100%;
  width: 3px; height: 14px;
  margin-left: -1.5px;
  background: var(--wood);
  border-radius: 0 0 2px 2px;
}
.sign:hover, .sign.hover { translate: 0 -3px; background: #fff; }
.sign.active { background: #fff1cf; border-color: var(--honey); }
.sign.hidden { opacity: 0; pointer-events: none; }

.toast.heart { color: #f07a9e; font-style: normal; font-size: 22px; text-shadow: 0 1px 4px rgba(120, 30, 60, 0.35); }
.toast {
  position: absolute;
  left: 0; top: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 17px;
  color: #fff;
  text-shadow: 0 1px 6px rgba(40, 30, 10, 0.55);
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- Sprout's speech bubble ---------- */
.bubble {
  position: fixed;
  left: 0; top: 0;
  z-index: 6;
  max-width: 260px;
  padding: 10px 14px 11px;
  background: #fff;
  border: 1px solid rgba(125, 187, 106, 0.55);
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
}
.bubble.show { opacity: 1; }
.bubble::before {
  content: 'Sprout · garden AI';
  display: block;
  margin-bottom: 3px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--moss);
}

.hint {
  position: fixed;
  left: 50%; bottom: 18px;
  translate: -50% 0;
  z-index: 4;
  margin: 0;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.85);
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: opacity 0.6s;
}
.hint.gone { opacity: 0; pointer-events: none; }

/* phone-only intro card that fills the empty grass at the bottom */
.intro { display: none; }

/* ---------- side panel ---------- */
.panel {
  position: fixed;
  top: 92px; right: 16px; bottom: 16px;
  z-index: 20;
  width: min(440px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(60, 50, 30, 0.28);
  padding-top: 56px; /* a fixed strip for the close button, so text and cards scroll below it */
  transform: translateX(calc(100% + 40px));
  visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.55s;
}
.panel.open { transform: none; visibility: visible; transition-delay: 0s; }
.panel-body { flex: 1; overflow-y: auto; padding: 0 28px 16px; }
.close {
  position: absolute;
  top: 14px; right: 14px;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--panel-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 2; /* stay above the cards as the section scrolls underneath */
  box-shadow: 0 2px 8px rgba(120, 90, 30, 0.18);
}
.close:hover { background: #eed49e; }
.panel-nav { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
.panel-nav .chip { box-shadow: none; font-size: 12.5px; }

.kicker {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--moss);
}
.panel h2, .list-view h2 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lede { margin: 0 0 22px; font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }

.card {
  position: relative;
  margin-bottom: 14px;
  padding: 18px 18px 16px;
  background: #fffcf5; /* soft warm white: reads white, but gentler on the butter panel */
  border: 1px solid rgba(139, 100, 64, 0.16);
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(120, 90, 30, 0.07);
}
.card h3 { margin: 0 0 6px; padding-right: 60px; font-family: var(--serif); font-size: 19px; font-weight: 600; }
.card p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.55; }
.card ul { margin: 8px 0; padding-left: 18px; font-size: 14px; line-height: 1.55; color: var(--ink-soft); }
.tags span {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--paper-2);
  font-size: 11.5px;
  color: var(--ink-soft);
}
.card-link { display: inline-block; margin-top: 6px; color: var(--moss); font-size: 14px; font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }
/* QR code for phone-only apps: shown on computers, hidden on phones and tablets */
.qr-box { display: none; align-items: center; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.qr-box .qr { width: 96px; height: 96px; flex: none; padding: 6px; background: #fff; border-radius: 10px; }
.qr-box .qr svg { width: 100%; height: 100%; display: block; }
.qr-box p { margin: 0; font-size: 13px; color: var(--ink-soft); }
@media (hover: hover) and (pointer: fine) and (min-width: 760px) { .qr-box { display: flex; } }
.card.draft { border: 1.5px dashed var(--honey); background: #fffcf5; }
.card.draft::after {
  content: 'draft';
  position: absolute;
  top: 14px; right: 14px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fdf0d2;
  color: #a06f10;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }
.contact-form { display: grid; gap: 12px; margin: 0 0 20px; }
.contact-form label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.contact-form input, .contact-form textarea {
  font: inherit; font-size: 15px; font-weight: 400; color: var(--ink);
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid rgba(139, 100, 64, 0.25); background: #fffcf5;
}
.contact-form textarea { resize: vertical; min-height: 96px; }
.contact-form input:focus, .contact-form textarea:focus { outline: 3px solid var(--honey); outline-offset: 1px; }
.contact-form .botcheck { position: absolute; left: -9999px; }
.form-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2px; }
.form-row button { cursor: pointer; border: none; }
.form-row button:disabled { opacity: 0.6; cursor: default; }
.form-status { margin: 0; font-size: 14px; min-height: 1em; }
.form-status.ok { color: var(--moss); font-weight: 600; }
.form-status.error { color: #a5452c; }
.btn {
  display: inline-flex;
  align-items: center;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}
.btn.primary { background: var(--moss); border-color: transparent; color: #fff; }

/* ---------- plain list view ---------- */
.list-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow-y: auto;
  padding: 110px 20px 80px;
  background: var(--paper);
}
.list-inner { max-width: 720px; margin: 0 auto; }
.list-hero h1 { margin: 0 0 10px; font-family: var(--serif); font-size: clamp(38px, 6vw, 58px); font-weight: 600; letter-spacing: -0.02em; }
.list-view section { margin-top: 60px; scroll-margin-top: 100px; }

/* ---------- loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  background: #cfdfbe; /* matches the garden's misty green horizon */
  font-family: var(--serif);
  font-size: 18px;
  transition: opacity 0.9s;
}
.loader span { font-size: 42px; animation: bob 1.6s ease-in-out infinite; }
.loader.gone { opacity: 0; pointer-events: none; }
@keyframes bob { 50% { translate: 0 -6px; } }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); font-family: var(--serif); font-size: 20px; margin: 0; z-index: 60; }

/* ---------- phones ---------- */
@media (max-width: 759px) {
  .topbar { padding: 12px; align-items: center; }
  .brand { padding: 8px 12px; border-radius: 14px; }
  .brand-name { font-size: 17px; white-space: nowrap; }
  .brand-role { display: none; }
  .actions { flex-wrap: nowrap; gap: 6px; }
  .chip { padding: 8px 11px; font-size: 12.5px; white-space: nowrap; }
  .chip .long { display: none; }
  .chip .short { display: inline; }
  .hint { display: none; }
  .intro {
    display: block;
    position: fixed;
    left: 16px; right: 16px; bottom: 16px;
    z-index: 4;
    padding: 12px 16px;
    background: rgba(255, 250, 241, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 18px;
    box-shadow: var(--shadow);
  }
  .intro-text { margin: 0; font-family: var(--serif); font-size: 17px; line-height: 1.35; }
  .intro-hint { margin: 6px 0 0; font-size: 12px; color: var(--ink-soft); }
  .intro.touched .intro-hint { display: none; } /* once they've touched the garden, they know how it works */
  .sign { padding: 5px 10px; font-size: 12.5px; }
  .bubble { max-width: 180px; padding: 8px 11px 9px; font-size: 12.5px; }
  .bubble::before { font-size: 9.5px; margin-bottom: 1px; }
  .hint { font-size: 11.5px; }
  .panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 58vh;
    border-radius: 22px 22px 0 0;
    transform: translateY(105%);
  }
  .panel-body { padding: 0 20px 12px; }
  .panel h2, .list-view h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .loader span { animation: none; }
  .panel { transition-duration: 0.01s; }
}
