:root {
  --ink: #18231d;
  --muted: #66756d;
  --paper: #f6f2e8;
  --panel: #fffdf7;
  --line: #d9dfd2;
  --moss: #284f37;
  --leaf: #62845c;
  --clay: #ad6042;
  --gold: #c39a45;
  --shadow: 0 18px 55px rgba(28, 42, 31, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 26px;
  background: rgba(246, 242, 232, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--moss);
  color: white;
  font-size: 0.82rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a,
.menu-button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  padding: 10px 12px;
  font-weight: 800;
}

.top-nav a:hover,
.menu-button:hover {
  background: #e9eadf;
}

.menu-group {
  position: relative;
}

.dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  width: 290px;
  max-height: min(70vh, 620px);
  overflow: auto;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.menu-group:hover .dropdown,
.menu-group:focus-within .dropdown {
  display: grid;
  gap: 3px;
}

.dropdown a {
  display: block;
  padding: 9px 10px;
  border-radius: 7px;
  color: var(--muted);
}

.dropdown a:hover {
  color: var(--ink);
  background: #f0f4eb;
}

.hero {
  min-height: calc(100vh - 68px);
  display: grid;
  align-items: end;
  background-image: linear-gradient(180deg, rgba(15, 26, 19, 0.1), rgba(15, 26, 19, 0.78)), url("assets/specs/maple-garden.jpg");
  background-size: cover;
  background-position: center;
  color: white;
}

.hero-content {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0 86px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(3rem, 7vw, 6.8rem);
  line-height: 0.94;
  letter-spacing: 0;
}

.hero p {
  max-width: 640px;
  margin: 18px 0 28px;
  color: #eef4e9;
  font-size: 1.08rem;
  line-height: 1.6;
}

.hero-actions,
.actions,
.toolbar,
.garden-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.primary,
.secondary,
.chip {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  background: #fff;
  color: var(--ink);
  font-weight: 850;
}

.primary,
.button.primary {
  border-color: var(--moss);
  background: var(--moss);
  color: white;
}

.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: white;
  border-color: rgba(255, 255, 255, 0.42);
}

.page {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.page-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin-bottom: 22px;
}

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

.page h1 {
  margin-bottom: 7px;
  font-size: clamp(2rem, 4vw, 3.7rem);
  line-height: 1;
}

.page-intro {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.species-grid,
.tree-grid,
.care-grid,
.garden-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.species-card,
.tree-card,
.care-card,
.media-card,
.detail-card,
.editor-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 28px rgba(31, 48, 35, 0.08);
}

.species-card {
  padding: 16px;
}

.species-card strong,
.species-card span {
  display: block;
}

.species-card span,
.tree-card p,
.care-card p,
.detail-list span,
.meta {
  color: var(--muted);
  line-height: 1.45;
}

.tree-card,
.media-card {
  overflow: hidden;
}

.tree-card img,
.media-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #dfe6da;
}

.tree-card-body,
.care-card,
.detail-card,
.editor-panel,
.media-card-body {
  padding: 15px;
}

.tree-card h3,
.media-card h3 {
  margin-bottom: 5px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.photo-timeline {
  margin-top: 24px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.detail-card img {
  width: 100%;
  border-radius: 8px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

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

.detail-list div {
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.detail-list strong,
.detail-list span {
  display: block;
}

.repot-list {
  display: grid;
  gap: 7px;
  margin: 10px 0;
}

.repot-list span {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: #eef4ea;
  padding: 6px 9px;
  color: var(--moss);
  font-weight: 800;
}

.care-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
}

.care-list {
  display: grid;
  gap: 7px;
  align-content: start;
}

.care-list button,
.garden-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  text-align: left;
}

.care-list button.active,
.garden-tabs button.active {
  border-color: var(--moss);
  background: #e8f0e3;
}

.care-note {
  min-height: 320px;
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
  color: var(--ink);
  line-height: 1.55;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: var(--ink);
}

.dialog-card {
  width: min(760px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 0;
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

dialog {
  border: 0;
  background: transparent;
  padding: 0;
}

dialog::backdrop {
  background: rgba(17, 26, 20, 0.58);
}

.dialog-close {
  float: right;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  width: 36px;
  aspect-ratio: 1;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 820px) {
  .site-header,
  .page-header,
  .section-heading,
  .detail-layout,
  .care-layout {
    display: block;
  }

  .top-nav {
    margin-top: 12px;
    overflow-x: auto;
  }

  .site-header {
    position: static;
  }

  .dropdown {
    left: 0;
    right: auto;
  }

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