:root {
  --bg: #e6ecde;
  --bg-deep: #d1ddc0;
  --ink: #132722;
  --ink-soft: #2d4a40;
  --card: #fefefb;
  --line: #bcccb2;
  --line-strong: #9ab28d;
  --accent: #217848;
  --accent-strong: #0f5a32;
  --accent-soft: #d8ecdb;
  --focus: #0f5a32;
  --warm: #fff7db;
  --warm-line: #e7d88f;
  --danger: #b31f1f;
  --shadow: 0 12px 34px rgba(25, 62, 39, 0.14);
  --shadow-strong: 0 18px 42px rgba(20, 57, 34, 0.2);
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Gill Sans", sans-serif;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(circle at 5% -10%, rgba(255, 255, 255, 0.75), transparent 42%),
    radial-gradient(circle at 95% 100%, rgba(176, 205, 151, 0.43), transparent 38%),
    linear-gradient(155deg, var(--bg), var(--bg-deep));
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  z-index: 10;
}

.skip-link:focus {
  top: 0.75rem;
}

h1,
h2,
h3 {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.85rem, 3.2vw, 2.35rem);
}

h2 {
  font-size: clamp(1.35rem, 2.3vw, 1.7rem);
}

h3 {
  font-size: clamp(1.08rem, 1.7vw, 1.2rem);
}

p {
  margin: 0;
}

a {
  color: var(--accent-strong);
}

a:hover {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(15, 90, 50, 0.38);
  outline-offset: 2px;
}

.wrap {
  width: min(1040px, 92vw);
  margin: 0 auto;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 0;
}

.brand {
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.015em;
  text-decoration: none;
  color: var(--ink);
}

nav {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  text-decoration: none;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid transparent;
  padding: 0.44rem 0.72rem;
  border-radius: 999px;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

nav a:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(15, 90, 50, 0.14);
}

main.wrap {
  padding: 0.5rem 0 2.8rem;
}

main.wrap > * + * {
  margin-top: 1.4rem;
}

section > * + * {
  margin-top: 0.75rem;
}

.hero {
  margin-bottom: 0.6rem;
  border-radius: 22px;
  padding: clamp(1rem, 1.8vw, 1.45rem);
  background:
    radial-gradient(circle at 80% 0, rgba(31, 121, 69, 0.2), transparent 35%),
    linear-gradient(132deg, rgba(31, 121, 69, 0.13), rgba(255, 255, 255, 0.96) 55%),
    var(--card);
}

.hero p + p {
  margin-top: 0.72rem;
}

.eyebrow {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--ink-soft);
}

.card {
  display: block;
  background: linear-gradient(180deg, #ffffff, #fdfef9);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(0.9rem, 1.35vw, 1.1rem);
  box-shadow: var(--shadow);
}

.card.compact {
  padding: 0.75rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.95rem;
}

.garden-grid {
  margin-bottom: 0.25rem;
}

.garden-card {
  text-decoration: none;
  color: inherit;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.garden-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.garden-card:focus-visible,
.harvest-card-title:focus-visible {
  border-radius: 10px;
}

.plant-frame {
  border-radius: 13px;
  border: 1px solid #d5e0c7;
  background:
    radial-gradient(circle at 60% 0%, rgba(255, 255, 255, 0.8), transparent 40%),
    linear-gradient(180deg, #f8fbf1, #ebf3df);
  padding: 0.42rem;
  margin-bottom: 0.6rem;
}

.plant-frame img {
  display: block;
  width: 100%;
  height: auto;
}

.garden-name {
  display: block;
  margin-bottom: 0.15rem;
  font-size: 1.03rem;
}

.garden-meta {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.profile-card {
  margin-bottom: 0;
}

.profile-photo {
  border-radius: 999px;
  object-fit: cover;
  border: 2px solid #d3dfc6;
  box-shadow: 0 6px 18px rgba(21, 56, 35, 0.16);
}

.main-plant {
  display: block;
  margin: 0.45rem 0 0.85rem;
}

.bio :first-child {
  margin-top: 0.2rem;
}

.bio p:last-child {
  margin-bottom: 0.3rem;
}

.subtle {
  color: var(--ink-soft);
}

.pick-box {
  border-top: 1px dashed #bcccb2;
  margin-top: 0.8rem;
  padding-top: 0.75rem;
}

.pick-count {
  margin-top: 0;
  margin-bottom: 0.55rem;
  font-weight: 600;
}

.btn,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.62rem 0.95rem;
  text-decoration: none;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 8px 18px rgba(14, 79, 44, 0.24);
}

.btn:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn:hover,
.btn:focus-visible {
  color: #fff;
}

.btn:active,
button:active {
  transform: translateY(0);
}

.auth-card {
  max-width: 560px;
  padding: 1.2rem;
}

label {
  display: block;
  font-weight: 700;
}

input[type="url"],
input[type="text"],
input[type="search"],
textarea {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.6rem 0.67rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0.26rem 0 0.8rem;
  background: #fbfef7;
  font-family: inherit;
  font-size: inherit;
  color: var(--ink);
}

input[type="url"]:focus,
input[type="text"]:focus,
input[type="search"]:focus,
textarea:focus {
  border-color: #8cae83;
  box-shadow: 0 0 0 3px rgba(33, 120, 72, 0.18);
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.checkbox-label input[type="checkbox"] {
  margin: 0;
}

.msg {
  background: var(--warm);
  border: 1px solid var(--warm-line);
  padding: 0.6rem 0.68rem;
  border-radius: 12px;
}

.roll-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.roll-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

pre {
  overflow-x: auto;
  white-space: pre-wrap;
  background: #f4f8ef;
  border: 1px solid #d7e1c8;
  padding: 0.72rem;
  border-radius: 10px;
  font-size: 0.89rem;
}

.bookmarklet-link {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  background: var(--accent-soft);
  border: 1px solid rgba(15, 90, 50, 0.18);
}

.harvest-search-wrap {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.harvest-search-input {
  flex: 1;
  min-width: 0;
  font-size: 0.95rem;
}

.harvest-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  margin-bottom: 0.75rem;
}

.harvest-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.harvest-card:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-strong);
}

.harvest-card-domain {
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.harvest-card-title {
  font-weight: 700;
  color: var(--accent-strong);
  text-decoration: none;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.harvest-card-title:hover {
  text-decoration: underline;
}

.harvest-card-note {
  font-size: 0.88rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.harvest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.14rem;
}

.harvest-tag {
  display: inline-block;
  background: rgba(47, 122, 74, 0.12);
  color: var(--accent-strong);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(47, 122, 74, 0.2);
}

.harvest-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.harvest-card-date {
  font-size: 0.8rem;
  flex: 1;
}

.harvest-posted {
  font-size: 0.75rem;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid #c8e6c9;
}

.harvest-card-footer form {
  margin: 0;
}

.btn-small {
  padding: 0.3rem 0.58rem;
  font-size: 0.8rem;
  border-radius: 8px;
  min-height: 2.2rem;
}

.btn-danger {
  background: linear-gradient(180deg, #ce2e2e, var(--danger));
  box-shadow: 0 8px 18px rgba(123, 21, 21, 0.24);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.danger-zone details summary {
  list-style: none;
}

.danger-zone details summary::-webkit-details-marker {
  display: none;
}

.btn-disabled {
  opacity: 0.42;
  cursor: default;
  pointer-events: none;
}

.embed {
  margin: 0;
  padding: 0.4rem;
  background: transparent;
}

/* ── Harvests page layout ─────────────────────────── */

.harvests-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.4rem;
  align-items: start;
}

.harvests-sidebar {
  position: sticky;
  top: 1rem;
}

.harvests-main {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ── Garden stats sidebar ─────────────────────────── */

.garden-stats-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.garden-plant-preview {
  display: flex;
  justify-content: center;
  padding: 0.5rem;
  background: linear-gradient(180deg, #f8fbf1, #ebf3df);
  border: 1px solid #d5e0c7;
  border-radius: 13px;
}

.garden-stats-heading {
  font-size: 1.05rem;
  margin: 0;
}

.garden-stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.garden-stat-icon {
  margin-right: 0.35rem;
}

.garden-nudge {
  display: block;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

/* ── Garden health meter ──────────────────────────── */

.garden-health {
  margin-top: 0.25rem;
}

.garden-health-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.garden-health-meter {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.garden-health-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 600ms ease;
  min-width: 2px;
}

/* ── Ripeness tints ───────────────────────────────── */

.harvest--ripe {
  background: linear-gradient(180deg, var(--warm), #fdf9ee);
}

.harvest--overdue {
  background: linear-gradient(180deg, var(--warm), #fdf9ee);
  border-color: var(--warm-line);
}

/* ── Harvest tag as button ────────────────────────── */

.harvest-tag {
  background: rgba(47, 122, 74, 0.12);
  box-shadow: none;
  cursor: pointer;
  padding: 0.15rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-strong);
  border: 1px solid rgba(47, 122, 74, 0.2);
  border-radius: 999px;
  min-height: unset;
  letter-spacing: 0;
  transition: background 140ms ease;
}

.harvest-tag:hover {
  background: rgba(47, 122, 74, 0.22);
  transform: none;
  filter: none;
}

/* ── Ghost button variant ─────────────────────────── */

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  transform: none;
  filter: none;
}

/* ── Edit dialog / modal ──────────────────────────── */

.harvest-edit-dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem;
  max-width: 480px;
  width: 90vw;
  box-shadow: var(--shadow-strong);
  background: var(--card);
}

.harvest-edit-dialog::backdrop {
  background: rgba(19, 39, 34, 0.45);
  backdrop-filter: blur(2px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h2 {
  margin: 0;
}

.modal-close {
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

/* ── Harvest results count ────────────────────────── */

.harvest-results-count {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
}

/* ── Empty state ──────────────────────────────────── */

.harvest-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--ink-soft);
}

.harvest-empty-sprout {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* ── Filter hint text ─────────────────────────────── */

.filter-hint {
  font-size: 0.85rem;
  margin-top: 0.3rem;
  color: var(--ink-soft);
}

@media (max-width: 920px) {
  .wrap {
    width: min(1040px, 94vw);
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  nav {
    flex-wrap: wrap;
    width: 100%;
  }

  .hero {
    padding: 1rem;
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .harvest-search-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .harvest-search-wrap .btn {
    width: 100%;
  }

  .pagination {
    justify-content: center;
  }

  .pagination .btn {
    min-width: 8rem;
  }

  .harvests-layout {
    grid-template-columns: 1fr;
  }

  .harvests-sidebar {
    position: static;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 16px;
  }

  nav a {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
