/* Solid Garden — layout only. The masthead, nav, package card and footer come from
   `embed-demo-shell.css`, which every demo in this library shares. */

.callout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1rem 1.25rem;
  margin: 0 0 1.25rem;
  border: 1px solid var(--demo-border, #2a3140);
  border-radius: 12px;
  background: var(--demo-panel, #151a23);
  line-height: 1.55;
}

.callout > div {
  flex: 1 1 32rem;
}

.callout a {
  color: var(--demo-accent, #6fd3c7);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.callout a:hover,
.callout a:focus-visible {
  text-decoration: underline;
}

.garden-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(17rem, 0.9fr) minmax(15rem, 0.8fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 1180px) {
  .garden-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .garden-stage {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .garden-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.garden-panel {
  padding: 1.1rem 1.25rem 1.35rem;
  border: 1px solid var(--demo-border, #2a3140);
  border-radius: 12px;
  background: var(--demo-panel, #151a23);
}

.garden-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--demo-muted, #8b96a8);
}

.garden-panel h2:not(:first-child) {
  margin-top: 1.5rem;
}

.garden-hint,
.garden-note {
  margin: 0 0 0.9rem;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--demo-muted, #8b96a8);
}

.garden-note {
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}

.garden-stage-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.garden-viewswitch {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
}

.garden-viewswitch button {
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--demo-border, #2a3140);
  border-radius: 999px;
  background: #0e131b;
  color: var(--demo-muted, #8b96a8);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.garden-viewswitch button[aria-pressed='true'] {
  border-color: var(--demo-accent, #6fd3c7);
  color: var(--demo-accent, #6fd3c7);
}

.garden-viewswitch button:hover,
.garden-viewswitch button:focus-visible {
  border-color: var(--demo-accent, #6fd3c7);
}

.garden-canvas-frame {
  position: relative;
  aspect-ratio: 8 / 7;
  border-radius: 10px;
  overflow: hidden;
  background: #0b0e14;
}

/* Both canvases occupy the frame; the view switch decides which one is on top of the other. They
   are stacked rather than mounted and unmounted because a canvas that leaves the document loses
   its drawing buffer, and rebuilding the volume texture on every toggle would defeat the point. */
.garden-canvas-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.garden-canvas-frame > canvas + canvas {
  position: absolute;
  inset: 0;
}

.garden-canvas-frame[data-view='solid'] #stage,
.garden-canvas-frame[data-view='flat'] #stage-3d {
  visibility: hidden;
}

/* Drag-to-orbit must own the gesture on a touchscreen, or the page scrolls instead of turning. */
.garden-canvas-frame[data-view='solid'] #stage-3d {
  cursor: grab;
  touch-action: none;
}

.garden-canvas-frame[data-view='solid'] #stage-3d:active {
  cursor: grabbing;
}

.garden-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  background: rgba(11, 14, 20, 0.86);
  color: var(--demo-muted, #8b96a8);
  font-size: 0.9rem;
  line-height: 1.5;
}

/* `hidden` alone does NOT hide this.
   The attribute works through a *user-agent* `display: none`, which loses to any author `display`
   on the same element — and the rule above sets `display: grid`. Without this line the overlay
   stays fully opaque over the canvas forever, so a page that has finished building looks
   permanently stuck on "Growing…". Restate the hiding as an author rule that outranks the layout. */
.garden-overlay[hidden] {
  display: none;
}

.garden-scrub {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

/* The `display: flex` above outranks the user-agent `display: none` that the `hidden` attribute
   works through — the same trap `.garden-overlay[hidden]` documents. Without this line the "See
   inside" row stays on screen in the flat view, where it controls nothing. */
.garden-scrub[hidden] {
  display: none;
}

.garden-scrub input[type='range'] {
  flex: 1;
}

.garden-scrub label,
.garden-scrub output {
  color: var(--demo-muted, #8b96a8);
  font-variant-numeric: tabular-nums;
}

.garden-field {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

/* The `.garden-overlay[hidden]` trap again, one class down: the rule above sets `display: flex`,
   which outranks the user-agent `display: none` the `hidden` attribute works through. Without this
   the density slider stays on screen in single-seed mode, where it controls nothing. */
.garden-field[hidden] {
  display: none;
}

.garden-field > label {
  flex: 0 0 6.2rem;
  color: var(--demo-muted, #8b96a8);
}

.garden-field > select,
.garden-field > input[type='text'],
.garden-field > input[type='number'] {
  flex: 1;
  min-width: 0;
  padding: 0.38rem 0.5rem;
  border: 1px solid var(--demo-border, #2a3140);
  border-radius: 7px;
  background: #0e131b;
  color: inherit;
  font: inherit;
  font-size: 0.86rem;
}

.garden-field > input[type='text'] {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.garden-field > input[type='text'][aria-invalid='true'] {
  border-color: #d8695f;
}

.garden-field > input[type='range'] {
  flex: 1;
  min-width: 0;
}

.garden-field > output {
  flex: 0 0 3rem;
  text-align: right;
  color: var(--demo-muted, #8b96a8);
  font-variant-numeric: tabular-nums;
}

.garden-draw-tools {
  margin: -0.2rem 0 0.8rem;
}

.garden-draw-tools[hidden] {
  display: none;
}

.garden-button-row {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.garden-button-row button {
  flex: 1;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--demo-border, #2a3140);
  border-radius: 7px;
  background: #0e131b;
  color: inherit;
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.garden-button-row button:hover,
.garden-button-row button:focus-visible {
  border-color: var(--demo-accent, #6fd3c7);
}

/* Painting needs the pointer over the canvas, not a text caret or a drag-select. */
.garden-canvas-frame[data-painting='true'] canvas {
  cursor: crosshair;
  touch-action: none;
}

.garden-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.9rem;
}

.garden-grid-2 .garden-field > label {
  flex: 0 0 auto;
}

.garden-readout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.9rem;
  margin: 0 0 1rem;
}

.garden-readout > div {
  min-width: 0;
}

.garden-readout dt {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--demo-muted, #8b96a8);
}

.garden-readout dd {
  margin: 0.15rem 0 0;
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.garden-verdict {
  margin: 0 0 1rem;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.45;
  background: rgba(111, 211, 199, 0.1);
  border: 1px solid rgba(111, 211, 199, 0.32);
}

.garden-verdict[data-tone='warn'] {
  background: rgba(216, 155, 95, 0.1);
  border-color: rgba(216, 155, 95, 0.34);
}

.garden-verdict[data-tone='bad'] {
  background: rgba(216, 105, 95, 0.1);
  border-color: rgba(216, 105, 95, 0.34);
}

.garden-download {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 8px;
  background: var(--demo-accent, #6fd3c7);
  color: #06121a;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.garden-download:disabled {
  opacity: 0.45;
  cursor: default;
}

.garden-download:not(:disabled):hover,
.garden-download:not(:disabled):focus-visible {
  filter: brightness(1.08);
}
