:root {
  color-scheme: light;
  --ink: #24182b;
  --muted: #64566b;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --line: #ddd6e5;
  --violet: #6d3a9c;
  --leaf: #2f6b4f;
  --rose: #b94d75;
  --shadow: 0 18px 45px rgba(44, 28, 57, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.8rem, 6vw, 4.4rem);
  line-height: 0.95;
  margin-bottom: 0;
}

main {
  padding: 0 clamp(16px, 5vw, 56px) 48px;
}

.feature {
  align-items: end;
  display: grid;
  min-height: 320px;
  overflow: hidden;
  position: relative;
}

.feature img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.feature::after {
  background:
    linear-gradient(180deg, rgba(24, 13, 31, 0.18), rgba(24, 13, 31, 0.54)),
    rgba(58, 18, 77, 0.12);
  content: "";
  inset: 0;
  position: absolute;
}

.feature-copy {
  color: white;
  max-width: 760px;
  padding: clamp(22px, 6vw, 48px);
  position: relative;
  z-index: 1;
}

.feature-copy h1 {
  color: white;
  font-size: clamp(2rem, 6.5vw, 4.4rem);
  line-height: 0.95;
  margin: 0;
  text-shadow: 0 3px 18px rgba(20, 13, 25, 0.55);
}

.featured-violet {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: clamp(18px, 4vw, 34px);
  grid-template-columns: minmax(180px, 340px) minmax(0, 1fr);
  margin: 0 calc(clamp(16px, 5vw, 56px) * -1);
  padding: clamp(18px, 4vw, 36px) clamp(16px, 5vw, 56px);
}

.featured-violet img {
  aspect-ratio: 4 / 3;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(44, 28, 57, 0.12);
  object-fit: cover;
  width: 100%;
}

.featured-violet-copy {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.eyebrow {
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.featured-violet h2 {
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  line-height: 1.05;
  margin: 0;
}

.view-tabs {
  display: inline-flex;
  gap: 6px;
  margin: 18px 0;
}

.view-tab {
  background: #f0ebf5;
  color: var(--ink);
  min-width: 104px;
}

.view-tab[aria-selected="true"] {
  background: var(--violet);
  color: white;
}

.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  margin: 0 calc(clamp(16px, 5vw, 56px) * -1);
  padding: 16px clamp(16px, 5vw, 56px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.search-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 7px;
}

.search-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr auto;
}

#search {
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 46px;
  padding: 0 14px;
  width: 100%;
}

button {
  background: var(--violet);
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font-weight: 700;
  min-height: 42px;
  padding: 0 14px;
}

button:hover {
  background: #4f2676;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.filter {
  background: #f0ebf5;
  color: var(--ink);
  min-height: 36px;
}

.filter[aria-pressed="true"] {
  background: var(--leaf);
  color: white;
}

.results-heading {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin: 28px 0 14px;
}

.results-heading h2 {
  font-size: clamp(1.25rem, 3vw, 2rem);
  margin: 0;
}

.gallery {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(44, 28, 57, 0.06);
  color: inherit;
  display: grid;
  overflow: hidden;
  padding: 0;
  text-align: left;
}

.card:hover {
  background: var(--surface);
  border-color: #c7b6d7;
}

.card img {
  aspect-ratio: 1;
  background: #eee8f3;
  object-fit: cover;
  width: 100%;
}

.card-body {
  padding: 12px;
}

.card h3 {
  font-size: 1rem;
  line-height: 1.2;
  margin: 0 0 8px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag {
  background: #eee5f2;
  border-radius: 999px;
  color: #33233d;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
}

.plant-list {
  display: grid;
  gap: 12px;
}

.az-nav {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 0;
  position: sticky;
  top: 0;
  z-index: 4;
}

.az-nav a {
  align-items: center;
  background: #f0ebf5;
  border-radius: 6px;
  color: var(--ink);
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 800;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  text-decoration: none;
}

.letter-section {
  scroll-margin-top: 56px;
}

.letter-heading {
  background: var(--leaf);
  border-radius: 6px;
  color: white;
  display: inline-flex;
  font-size: 0.95rem;
  justify-content: center;
  margin: 0 0 5px;
  min-width: 38px;
  padding: 3px 9px;
}

.plant-rows {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.plant-row {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 42px;
  padding: 6px 11px;
  text-align: left;
  width: 100%;
}

.plant-row:last-child {
  border-bottom: 0;
}

.plant-row:hover {
  background: #f8f4fb;
}

.plant-row-text {
  display: block;
  min-width: 0;
}

.plant-row strong {
  font-size: 1rem;
  line-height: 1.2;
}

.empty-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0;
  padding: 18px;
}

.viewer {
  border: 0;
  box-shadow: var(--shadow);
  height: min(860px, calc(100dvh - 24px));
  max-width: min(980px, calc(100vw - 24px));
  padding: 0;
  width: 100%;
}

.viewer::backdrop {
  background: rgba(20, 13, 25, 0.78);
}

.viewer figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  margin: 0;
}

.viewer img {
  height: 100%;
  max-height: calc(100dvh - 130px);
  object-fit: contain;
  padding: 48px 16px 16px;
  width: 100%;
}

.viewer figcaption {
  align-items: center;
  background: white;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: center;
  padding: 16px 18px;
}

.viewer-title {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.viewer-title strong {
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1.15;
}

.viewer-photo-status {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.viewer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
}

.viewer-close,
.viewer-nav {
  position: absolute;
  z-index: 2;
}

.viewer-close {
  right: 12px;
  top: 12px;
}

.viewer-nav {
  top: 50%;
  transform: translateY(-50%);
}

.previous {
  left: 12px;
}

.next {
  right: 12px;
}

@media (max-width: 640px) {
  .feature {
    min-height: 190px;
  }

  .featured-violet {
    align-items: start;
    grid-template-columns: 128px minmax(0, 1fr);
  }

  .featured-violet-copy {
    gap: 9px;
  }

  .featured-violet h2 {
    font-size: 1.45rem;
  }

  .featured-violet .tag-list {
    display: flex;
  }

  .featured-violet .tag {
    font-size: 0.75rem;
    padding: 3px 7px;
  }

  .featured-violet button {
    min-height: 38px;
  }

  .toolbar {
    padding-bottom: 10px;
  }

  .filters {
    flex-wrap: nowrap;
    margin-left: calc(clamp(16px, 5vw, 56px) * -1);
    margin-right: calc(clamp(16px, 5vw, 56px) * -1);
    overflow-x: auto;
    padding: 0 clamp(16px, 5vw, 56px) 6px;
    scrollbar-width: none;
  }

  .filters::-webkit-scrollbar {
    display: none;
  }

  .filter {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
  }

  .gallery {
    gap: 12px;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }

  .view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin: 14px 0;
    width: 100%;
  }

  .view-tab {
    min-width: 0;
  }

  .az-nav {
    flex-wrap: nowrap;
    margin-left: calc(clamp(16px, 5vw, 56px) * -1);
    margin-right: calc(clamp(16px, 5vw, 56px) * -1);
    overflow-x: auto;
    padding-left: clamp(16px, 5vw, 56px);
    padding-right: clamp(16px, 5vw, 56px);
    scrollbar-width: none;
    top: 0;
  }

  .az-nav::-webkit-scrollbar {
    display: none;
  }

  .az-nav a {
    flex: 0 0 auto;
  }

  .letter-section {
    scroll-margin-top: 54px;
  }

  .plant-row {
    min-height: 44px;
    padding: 6px 10px;
  }

  .card-body {
    padding: 9px;
  }

  .card h3 {
    font-size: 0.9rem;
    margin-bottom: 0;
  }

  .tag-list {
    display: none;
  }

  .featured-violet .tag-list {
    display: flex;
  }

  .results-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .viewer figcaption {
    align-items: center;
    flex-direction: column;
    gap: 10px;
    padding: 14px 14px;
  }

  .viewer-title strong {
    font-size: 1.35rem;
    text-align: center;
  }

  .viewer-tags {
    max-height: 72px;
    overflow: hidden;
  }

  .viewer-tags .tag {
    font-size: 0.92rem;
    padding: 5px 9px;
  }
}
