:root {
  --site-bg: #f6f1e8;
  --ink: #2a2926;
  --muted-ink: #5f6f63;
  --line-ink: rgba(95,111,99,0.38);
  --line-active: rgba(95,111,99,0.82);
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--site-bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
}

.muted {
  color: var(--muted-ink);
}

.layout {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 20px;
  padding: 20px;
  margin-top: 0;
  padding-top: 10px;
}

.panel {
  background: rgba(0,0,0,0.025);
  border: 1px solid rgba(0,0,0,0.06);
  padding: 15px;
  border-radius: 18px;
}

/* Local Trophic — Chestnut Creek working system */
.system-panel {
  text-align: center;
  min-height: 620px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: visible;
}

.trophic-map {
  position: relative;
  width: min(720px, 100%);
  height: 620px;
  margin: 0 auto;
}

.trophic-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.trophic-line {
  fill: none;
  stroke: var(--line-ink);
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
  opacity: 0.26;
  transition: opacity 260ms ease, stroke 260ms ease, stroke-width 260ms ease;
}

.trophic-line.visible {
  opacity: 0.75;
}

.trophic-line.active {
  stroke: var(--line-active);
  stroke-width: 1.9;
  opacity: 1;
}

.trophic-node {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 250px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  opacity: 0.58;
  transition: opacity 220ms ease, transform 220ms ease;
}

.trophic-node:hover,
.trophic-node:focus-visible,
.trophic-node.revealed {
  opacity: 1;
}

.trophic-node.active {
  transform: translateY(-2px);
}

.trophic-node:focus-visible {
  outline: 1px solid rgba(95,111,99,0.6);
  outline-offset: 6px;
  border-radius: 999px;
}

.node-orb {
  width: 88px;
  height: 88px;
  flex: 0 0 88px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.55), rgba(255,255,255,0.05) 34%, rgba(95,111,99,0.16) 72%),
    rgba(0,0,0,0.025);
  border: 1px solid rgba(95,111,99,0.34);
  box-shadow: 0 10px 22px rgba(42,41,38,0.06);
  color: var(--muted-ink);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  position: relative;
  font-family: Georgia, "Times New Roman", Times, serif;
}

.node-copy strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.node-copy small {
  display: block;
  max-width: 180px;
  color: var(--muted-ink);
  font-size: 0.86rem;
  line-height: 1.35;
}

.node-stone {
  top: 8px;
  left: 300px;
  width: 310px;
}

.node-algae {
  top: 145px;
  left: 300px;
  width: 300px;
}

.node-insects {
  top: 300px;
  left: 300px;
  width: 310px;
}

.node-fish {
  top: 430px;
  left: 52px;
  flex-direction: row-reverse;
  text-align: right;
}

.node-fish .node-copy small {
  margin-left: auto;
}

.node-crayfish {
  top: 430px;
  left: 468px;
}

.node-kingfisher {
  top: 535px;
  left: 300px;
  width: 320px;
}

.trophic-map.has-selection .trophic-node {
  opacity: 0.34;
}

.trophic-map.has-selection .trophic-node.active {
  opacity: 1;
}

.trophic-map.has-selection .trophic-node:hover,
.trophic-map.has-selection .trophic-node:focus-visible {
  opacity: 1;
}

.trophic-map::before {
  content: "";
  position: absolute;
  inset: 44px 86px;
  border: 1px solid rgba(95,111,99,0.14);
  border-radius: 50%;
  pointer-events: none;
}

.trophic-map::after {
  content: "Click stone to begin, then follow the revealed path.";
  position: absolute;
  left: 28%;
  top: 50%;
  width: 180px;
  transform: translate(-50%, -50%);
  color: rgba(71,83,74,1);
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.trophic-map.has-selection::after {
  opacity: 0;
}

.trophic-node.active .node-orb {
  box-shadow: 0 12px 26px rgba(42,41,38,0.09);
  border-color: rgba(95,111,99,0.62);
}

.trophic-node.revealed .node-orb {
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.72), rgba(255,255,255,0.08) 34%, rgba(95,111,99,0.22) 72%),
    rgba(0,0,0,0.02);
}

.node-orb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter:
    contrast(1.04)
    brightness(1.01)
    saturate(0.92);
}

.node-orb::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(
    circle at center,
    rgba(0,0,0,0.01) 42%,
    rgba(0,0,0,0.10) 100%
  );
  pointer-events: none;
}

.node-algae .node-orb img {
  filter:
    saturate(0.86)
    contrast(0.96)
    brightness(0.98);
}

.node-crayfish .node-orb img,
.node-kingfisher .node-orb img {
  filter:
    saturate(0.84)
    contrast(0.96)
    brightness(0.98);
}

.place-tag {
  margin-top: 18px;
  color: var(--muted-ink);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quiet-list {
  padding-left: 1.1rem;
  color: var(--muted-ink);
}

.quiet-list li {
  margin: 0.45rem 0;
}

.right-panel h4,
.left-panel h3 {
  margin-top: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

/* Inline field-guide preview */
.inline-preview {
  margin: 28px 0 0;
  padding: 0;
}

.inline-preview img {
  display: block;
  width: min(260px, 100%);
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid rgba(95,111,99,0.32);
  box-shadow: 0 12px 28px rgba(42,41,38,0.10);
  filter:
    contrast(1.03)
    brightness(1.01)
    saturate(0.92);
}

.inline-preview figcaption {
  margin-top: 14px;
  max-width: 280px;
  line-height: 1.45;
}

.inline-preview strong {
  display: block;
  margin-bottom: 5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.inline-preview span {
  display: block;
  color: var(--muted-ink);
  font-size: 0.88rem;
}

.system-subtitle {
  max-width: 720px;
  margin: 12px auto 4px;
  padding: 0 20px;
  text-align: center;
  color: var(--muted-ink);
  font-size: 0.95rem;
  line-height: 1.45;
  opacity: 0.86;
}

.system-subtitle--bottom {
  margin: 4px auto 24px;
  padding: 0 20px;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .system-panel {
    min-height: auto;
  }

  .trophic-map {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 0;
  }

  .trophic-lines {
    display: none;
  }

  .trophic-node {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    flex-direction: row;
    text-align: left;
    opacity: 1;
  }

  .node-fish {
    flex-direction: row;
    text-align: left;
  }

  .node-fish .node-copy small {
    margin-left: 0;
  }

  .node-orb {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .node-copy small {
    max-width: none;
  }

  .trophic-map::before,
  .trophic-map::after {
    display: none;
  }

  .inline-preview {
    display: none;
  }
}

@media (max-width: 760px) {
  .system-subtitle {
    font-size: 0.9rem;
  }

  .system-subtitle--bottom {
    margin: 8px auto 20px;
  }
}
