:root {
  color-scheme: light;
  --ink: #1f2720;
  --muted: #667067;
  --line: #d9ded6;
  --paper: #fbfaf4;
  --soft: #eef3ed;
  --leaf: #315f43;
  --moss: #6e8f58;
  --rose: #b45d60;
  --sun: #c8943f;
  --water: #567f9f;
  --shadow: 0 16px 40px rgba(32, 39, 32, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

button,
input {
  font: inherit;
}

.hero {
  position: relative;
  min-height: 82vh;
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
  background: #253529;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(90deg, rgba(18, 28, 20, 0.88), rgba(18, 28, 20, 0.54) 52%, rgba(18, 28, 20, 0.18));
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 20px clamp(18px, 4vw, 56px);
}

.topbar a {
  color: #fffaf0;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(31, 39, 32, 0.28);
}

.hero__content {
  width: min(960px, 100%);
  padding: 110px clamp(20px, 6vw, 72px) 44px;
  color: #fffaf0;
}

.eyebrow,
.section-kicker {
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 800;
  color: #f0c96f;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 12vw, 7.5rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.hero__copy {
  max-width: 660px;
  margin: 22px 0 0;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.7;
  color: rgba(255, 250, 240, 0.88);
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero__stats span {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 250, 240, 0.12);
  padding: 10px 14px;
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

main {
  padding-bottom: 48px;
}

.toolbar,
.care-strip,
footer {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(280px, 1.2fr);
  gap: 20px;
  align-items: end;
  padding: 42px 0 18px;
}

.toolbar h2,
.care-strip h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  letter-spacing: 0;
}

.controls {
  display: grid;
  gap: 12px;
}

.search {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fffefa;
  color: var(--ink);
  outline-color: var(--leaf);
}

.status-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-filter button {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: #fffefa;
  padding: 8px 12px;
  cursor: pointer;
}

.status-filter button.is-active {
  background: var(--leaf);
  border-color: var(--leaf);
  color: #fffaf0;
}

.gallery {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 16px;
}

.plant-card {
  display: grid;
  background: #fffefa;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(31, 39, 32, 0.06);
}

.plant-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  padding: 0;
  background: var(--soft);
  cursor: zoom-in;
  overflow: hidden;
}

.plant-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}

.plant-card:hover .plant-card__image img {
  transform: scale(1.035);
}

.plant-card__body {
  padding: 15px;
}

.plant-card__header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.plant-card__id,
.plant-card__status {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--muted);
}

.plant-card__status {
  color: var(--rose);
}

.plant-card h3 {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.25;
}

.plant-card__science {
  min-height: 2.6em;
  margin: 8px 0 12px;
  color: var(--leaf);
  line-height: 1.3;
}

dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

dl div {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 10px;
}

dt {
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 0;
}

.plant-card__last-watered,
.plant-card__next-water,
.dialog-care dd {
  font-weight: 800;
}

.plant-card__next-water,
#dialogNextWater {
  color: var(--muted);
}

.plant-card__next-water.is-ok,
#dialogNextWater.is-ok {
  color: var(--leaf);
}

.plant-card__next-water.is-overdue,
#dialogNextWater.is-overdue {
  color: #b3261e;
}

.plant-card__notes {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.care-strip {
  display: grid;
  grid-template-columns: minmax(180px, 0.55fr) 1fr;
  gap: 22px;
  align-items: start;
  margin-top: 56px;
  padding: 34px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.care-strip__items {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.care-strip article {
  border-left: 4px solid var(--sun);
  padding-left: 14px;
}

.care-strip article:nth-child(2) {
  border-color: var(--water);
}

.care-strip article:nth-child(3) {
  border-color: var(--moss);
}

.care-strip span {
  font-weight: 900;
}

.care-strip p {
  color: var(--muted);
  line-height: 1.65;
  margin: 8px 0 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 34px;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty {
  grid-column: 1 / -1;
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  color: var(--muted);
}

.plant-dialog {
  width: min(960px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.plant-dialog::backdrop {
  background: rgba(17, 25, 20, 0.62);
}

.dialog-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 1.35rem;
}

.plant-dialog__layout {
  display: grid;
  grid-template-columns: minmax(280px, 1.15fr) minmax(260px, 0.85fr);
}

.plant-dialog img {
  width: 100%;
  height: 100%;
  min-height: 520px;
  object-fit: cover;
  background: var(--soft);
}

.plant-dialog__layout > div {
  padding: clamp(22px, 4vw, 44px);
  overflow: auto;
}

.plant-dialog h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.05;
}

#dialogScience {
  color: var(--leaf);
  font-style: italic;
  font-size: 1.1rem;
}

#dialogMeta {
  color: var(--rose);
  font-weight: 800;
}

.dialog-care {
  margin: 18px 0;
}

.dialog-care div {
  grid-template-columns: 96px 1fr;
}

.dialog-plants {
  display: grid;
  gap: 10px;
  margin: 20px 0;
}

.dialog-plants h3 {
  margin: 0;
  font-size: 1rem;
}

.dialog-plant {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fffefa;
}

.dialog-plant h4 {
  margin: 0;
  font-size: 1rem;
}

.dialog-plant p {
  margin: 6px 0 0;
  line-height: 1.55;
}

.dialog-plant__meta {
  color: var(--rose);
  font-size: 0.82rem;
  font-weight: 800;
}

.dialog-plant__science {
  color: var(--leaf);
  font-style: italic;
}

.dialog-plant__notes {
  color: var(--muted);
  font-size: 0.92rem;
}

#dialogNotes {
  color: var(--muted);
  line-height: 1.75;
}

@media (max-width: 760px) {
  .hero {
    min-height: 76vh;
  }

  .hero::after {
    background: linear-gradient(0deg, rgba(18, 28, 20, 0.9), rgba(18, 28, 20, 0.28));
  }

  .topbar {
    justify-content: flex-start;
    padding: 14px 18px;
  }

  .hero__content {
    padding: 92px 18px 30px;
  }

  .toolbar,
  .care-strip,
  footer {
    width: calc(100% - 28px);
  }

  .toolbar,
  .care-strip {
    grid-template-columns: 1fr;
  }

  .care-strip__items,
  .plant-dialog__layout {
    grid-template-columns: 1fr;
  }

  .plant-dialog img {
    min-height: 320px;
    max-height: 54vh;
  }

  footer {
    flex-direction: column;
  }
}
