/* Grove — Clean minimal renderer
 *
 * Dark background, clean cards, subtle clusters.
 * Energy drives opacity. Lifecycle is a color dot.
 * No textures, no filters, no farm metaphor.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #09090b;
  --surface: #18181b;
  --surface-hover: #1f1f23;
  --border: #27272a;
  --border-hover: #3f3f46;

  --text: #fafafa;
  --text-secondary: #a1a1aa;
  --text-dim: #71717a;
  --text-muted: #52525b;

  /* Lifecycle */
  --seed: #a1a1aa;
  --sprouting: #4ade80;
  --harvestable: #f59e0b;
  --decaying: #78716c;
  --archived: #3f3f46;

  --radius: 10px;
  --radius-sm: 6px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  min-height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Garden canvas ── */
#garden {
  width: 100vw;
  height: 100vh;
  position: relative;
}

#garden svg {
  display: block;
  cursor: default;
}

/* ── Rail — garden switcher (top-left) ── */
#rail {
  position: fixed;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 1px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  z-index: 100;
}

.rail-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.rail-btn:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.rail-btn.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

/* ── Plot panel — detail sidebar ── */
#plot {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: 24px;
  z-index: 200;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.2s ease;
}

#plot.open {
  transform: translateX(0);
}

#plot::-webkit-scrollbar { width: 4px; }
#plot::-webkit-scrollbar-track { background: transparent; }
#plot::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.plot-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
}

.plot-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.plot-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-right: 32px;
  line-height: 1.3;
}

.plot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.plot-lifecycle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--bg);
}

.plot-energy-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--border);
  overflow: hidden;
}

.plot-energy-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.plot-energy-label {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.plot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 20px;
}

.plot-tag {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.plot-section {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 20px 0 8px;
}

.plot-links {
  list-style: none;
}

.plot-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  margin: 0 -8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.1s;
}

.plot-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.plot-link-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plot-link-type {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  flex-shrink: 0;
}

.plot-stat {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.plot-bed-count {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* ── SVG node styles ── */

.cluster-bg {
  fill: rgba(255, 255, 255, 0.02);
  stroke: var(--border);
  stroke-width: 1;
}

.cluster-bg.dimmed { opacity: 0.4; }

.cluster-label {
  fill: var(--text-muted);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cluster-label.dimmed { opacity: 0.3; }

.node { cursor: pointer; }

.node-bg {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1;
  transition: stroke 0.15s;
}

.node:hover .node-bg { stroke: var(--border-hover); }

.node.selected .node-bg {
  stroke: var(--text-dim);
  stroke-width: 1.5;
}

.node.dimmed {
  opacity: 0.25;
  pointer-events: none;
}

.node-title {
  fill: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 12px;
  font-weight: 500;
}

.node-title-line2 {
  fill: var(--text-secondary);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
}

.edge-line {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
  transition: stroke 0.2s, stroke-width 0.2s, opacity 0.2s;
}

.edge-line.warm {
  stroke: var(--text-dim);
  stroke-width: 1.5;
}

.edge-line.cold { opacity: 0.3; }

.inbox-label {
  fill: var(--text-muted);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inbox-line {
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
