:root {
  --ink: #17211d;
  --muted: #65716c;
  --paper: #fff;
  --soft: #f1f5f2;
  --line: #d4ded8;
  --green: #0a4935;
  --green-deep: #061f18;
  --gold: #b78516;
  --gold-soft: #f3da81;
  --blue: #246b85;
  --clay: #a54f3d;
  --success: #2f8451;
}

* { box-sizing: border-box; }
html { background: var(--soft); scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: system-ui, "Segoe UI", Tahoma, sans-serif;
}
a { color: inherit; }
button, select { font: inherit; }

.topbar {
  min-height: 70px;
  padding: 8px max(20px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  color: #fff;
  background: var(--green-deep);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand img {
  width: 43px;
  height: 43px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 6px;
}
.brand span { display: grid; }
.brand strong { color: var(--gold-soft); font-size: 20px; }
.brand small { color: #afc0b8; font-size: 10px; }
.topbar nav { display: flex; align-items: center; gap: 3px; }
.topbar nav a {
  padding: 9px 11px;
  color: #d9e5df;
  text-decoration: none;
  border-radius: 5px;
  font-size: 14px;
  font-weight: 750;
}
.topbar nav a:hover,
.topbar nav a.active { color: #fff; background: rgba(255, 255, 255, .1); }

main { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.garden-stage {
  height: min(66vh, 570px);
  min-height: 430px;
  margin-top: 18px;
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #13261e;
  border-radius: 7px;
}
.garden-stage > img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.stage-shade { position: absolute; inset: 0; background: rgba(2, 19, 14, .46); }
.stage-copy {
  width: min(700px, calc(100% - 44px));
  padding: 28px;
  position: absolute;
  inset: auto 0 0 auto;
  text-shadow: 0 2px 16px #000;
}
.eyebrow { margin: 0 0 8px; color: var(--gold); font-size: 12px; font-weight: 900; }
.stage-copy .eyebrow { color: var(--gold-soft); }
h1 { margin: 0; font-size: 66px; line-height: 1.1; letter-spacing: 0; }
.stage-copy > p:not(.eyebrow) { margin: 14px 0 20px; font-size: 19px; line-height: 1.8; }
.stage-copy > a,
.knowledge-bridge > a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 10px 16px;
  color: #142019;
  background: var(--gold-soft);
  border-radius: 5px;
  text-decoration: none;
  text-shadow: none;
  font-weight: 850;
}

.runtime-strip {
  min-height: 84px;
  margin: 16px 0 34px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.runtime-state { display: flex; align-items: center; gap: 9px; white-space: nowrap; }
.runtime-state span { width: 10px; height: 10px; background: #9c6f1b; border-radius: 50%; }
.runtime-state span.ready { background: var(--success); }
.runtime-strip dl {
  width: min(780px, 100%);
  margin: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(70px, 1fr));
  gap: 16px;
}
.runtime-strip dl div { display: grid; gap: 2px; }
.runtime-strip dt { color: var(--muted); font-size: 11px; }
.runtime-strip dd { margin: 0; color: var(--green); font-size: 19px; font-weight: 900; }

.garden-directory,
.product-bridge,
.garden-detail { padding: 34px 0 48px; border-top: 1px solid var(--line); }
.section-heading { max-width: 820px; }
.section-heading h2,
.detail-header h2,
.knowledge-bridge h2 { margin: 0; font-size: 38px; letter-spacing: 0; }
.section-heading p:last-child,
.detail-header p:last-child,
.knowledge-bridge p { margin: 10px 0 0; color: var(--muted); line-height: 1.75; }
.garden-directory > .section-heading,
.detail-header {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}
.garden-directory label { min-width: 230px; display: grid; gap: 6px; }
.garden-directory label span { color: var(--muted); font-size: 12px; font-weight: 800; }
select {
  min-height: 42px;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #bac7c0;
  border-radius: 5px;
}

.garden-grid { margin-top: 24px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.garden-card,
.tree-card {
  padding: 19px;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 7px;
}
.garden-card { min-height: 310px; }
.garden-card > span,
.tree-card > span { color: var(--blue); font-size: 11px; font-weight: 900; }
.garden-card h3,
.tree-card h4 { margin: 7px 0; font-size: 20px; }
.garden-card > p,
.tree-card > p { margin: 0 0 16px; color: var(--muted); line-height: 1.7; font-size: 13px; }
.garden-card dl { margin: auto 0 16px; display: grid; gap: 9px; }
.garden-card dl div { padding-top: 8px; border-top: 1px solid var(--line); }
.garden-card dt { color: var(--green); font-size: 11px; font-weight: 850; }
.garden-card dd { margin: 4px 0 0; color: #53615b; font-size: 12px; line-height: 1.6; }
.garden-card button,
#close-detail {
  min-height: 39px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
}
.garden-card button:hover { background: var(--green-deep); }
.loading { grid-column: 1 / -1; padding: 36px; color: var(--muted); text-align: center; }

.garden-detail[hidden] { display: none; }
.detail-header { align-items: flex-start; }
.detail-header > div { max-width: 850px; }
#close-detail {
  padding: 7px 13px;
  color: var(--green);
  background: transparent;
}
.land-profile {
  margin: 26px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border: 1px solid var(--line);
}
.land-profile div { min-height: 135px; padding: 17px; border-inline-start: 1px solid var(--line); }
.land-profile div:first-child { border-inline-start: 0; }
.land-profile dt { color: var(--clay); font-size: 12px; font-weight: 900; }
.land-profile dd { margin: 8px 0 0; color: #46514d; font-size: 13px; line-height: 1.75; }
.detail-band {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 25px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.detail-band h3,
.roadmap h3,
.tree-directory h3 { margin: 0 0 14px; font-size: 24px; }
.detail-band ul,
.tree-card ul { margin: 0; padding: 0 19px 0 0; color: var(--muted); line-height: 1.8; }
.roadmap { padding: 28px 0; }
.roadmap ol {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  counter-reset: phases;
  border: 1px solid var(--line);
}
.roadmap li {
  min-height: 130px;
  padding: 16px;
  counter-increment: phases;
  background: var(--paper);
  border-inline-start: 1px solid var(--line);
}
.roadmap li:nth-child(4n + 1) { border-inline-start: 0; }
.roadmap li:nth-child(n + 5) { border-top: 1px solid var(--line); }
.roadmap li::before {
  content: counter(phases, decimal-leading-zero);
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-weight: 900;
}
.roadmap strong { display: block; font-size: 14px; }
.roadmap span { display: block; margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.tree-directory { padding-top: 12px; }
.tree-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tree-card { min-height: 400px; }
.tree-card .plant-name { color: var(--clay); font-weight: 850; }
.tree-card dl { margin: 4px 0 14px; display: grid; gap: 8px; }
.tree-card dl div { padding-top: 8px; border-top: 1px solid var(--line); }
.tree-card dt { color: var(--green); font-size: 11px; font-weight: 900; }
.tree-card dd { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.tree-card ul { margin-top: auto; font-size: 12px; }

.knowledge-bridge {
  margin: 0 0 42px;
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: #fff;
  background: var(--blue);
}
.knowledge-bridge > div { max-width: 760px; }
.knowledge-bridge .eyebrow { color: #e9cf7a; }
.knowledge-bridge p { color: #dcecf2; }
.knowledge-bridge > a { min-width: 170px; }

.product-bridge ol {
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}
.product-bridge li {
  min-height: 108px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 5px;
  background: var(--paper);
  border-inline-start: 1px solid var(--line);
}
.product-bridge li:first-child { border-inline-start: 0; }
.product-bridge li span { color: var(--gold); font-size: 12px; font-weight: 900; }
.product-bridge li b { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.product-bridge li b.ready { color: var(--success); }

.boundary {
  margin: 0 0 48px;
  padding: 18px;
  color: #5d4b1c;
  background: #fff9e9;
  border: 1px solid #e7d6a4;
  border-radius: 7px;
}
.boundary p { margin: 7px 0 0; line-height: 1.75; }
footer {
  min-height: 94px;
  padding: 22px max(20px, calc((100vw - 1200px) / 2));
  display: flex;
  align-items: center;
  gap: 18px;
  color: #d8e3de;
  background: #172522;
}
footer strong { color: var(--gold-soft); font-size: 20px; }
footer span { color: #a6b5ae; font-size: 13px; }
footer a { margin-inline-start: auto; color: #fff; }

@media (max-width: 960px) {
  .runtime-strip { align-items: flex-start; flex-direction: column; }
  .runtime-strip dl { grid-template-columns: repeat(3, 1fr); }
  .garden-grid,
  .tree-grid { grid-template-columns: 1fr 1fr; }
  .land-profile { grid-template-columns: 1fr 1fr; }
  .land-profile div:nth-child(3) { border-inline-start: 0; border-top: 1px solid var(--line); }
  .land-profile div:nth-child(4) { border-top: 1px solid var(--line); }
  .roadmap ol { grid-template-columns: 1fr 1fr; }
  .roadmap li:nth-child(odd) { border-inline-start: 0; }
  .roadmap li:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 680px) {
  main { width: min(100% - 20px, 1200px); }
  .topbar { align-items: flex-start; flex-direction: column; padding: 8px 10px; }
  .brand { align-self: center; }
  .topbar nav { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); }
  .topbar nav a { padding: 7px 2px; text-align: center; font-size: 11px; overflow-wrap: anywhere; }
  .garden-stage { min-height: 480px; margin-top: 10px; }
  .garden-stage > img { object-position: 43% center; }
  .stage-copy { width: calc(100% - 20px); padding: 20px; }
  h1 { font-size: 43px; }
  .stage-copy > p:not(.eyebrow) { font-size: 16px; }
  .runtime-strip dl { grid-template-columns: 1fr 1fr; }
  .garden-directory > .section-heading,
  .detail-header,
  .knowledge-bridge { align-items: stretch; flex-direction: column; }
  .section-heading h2,
  .detail-header h2,
  .knowledge-bridge h2 { font-size: 30px; }
  .garden-directory label { min-width: 0; }
  .garden-grid,
  .tree-grid,
  .land-profile,
  .detail-band,
  .roadmap ol,
  .product-bridge ol { grid-template-columns: 1fr; }
  .land-profile div,
  .land-profile div:nth-child(3),
  .land-profile div:nth-child(4) { border-inline-start: 0; border-top: 1px solid var(--line); }
  .land-profile div:first-child { border-top: 0; }
  .roadmap li,
  .roadmap li:nth-child(odd) { border-inline-start: 0; border-top: 1px solid var(--line); }
  .roadmap li:first-child { border-top: 0; }
  .product-bridge li { border-inline-start: 0; border-top: 1px solid var(--line); }
  .product-bridge li:first-child { border-top: 0; }
  footer { align-items: flex-start; flex-direction: column; }
  footer a { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
