/* Digital Greenhouse — ambient.css
   Shared look for the ambient screens on /tools (fireplace and friends):
   the stage, its fading control bar, clock, notice and settings panel.
   Pairs with /assets/js/ambient-core.js. */

.amb-wrap { max-width: 1100px; margin-inline: auto; }
.amb-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  background: #0b0705; color: #fff; border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -24px rgba(5, 12, 9, 0.55);
  container-type: inline-size; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
@media (max-width: 640px) { .amb-stage { aspect-ratio: 4 / 5; } }
.amb-stage:focus { outline: none; }
.amb-stage:focus-visible { outline: 3px solid var(--color-sprout); outline-offset: 3px; }
.amb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.amb-stage:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100%; height: 100%; box-shadow: none; }
.amb-stage:-webkit-full-screen { border-radius: 0; width: 100%; height: 100%; }
.amb-stage.is-pseudo-fs {
  position: fixed; inset: 0; z-index: 9999; width: 100vw; height: 100vh; height: 100dvh;
  aspect-ratio: auto; border-radius: 0; box-shadow: none;
}
html.amb-lock, html.amb-lock body { overflow: hidden; }
.amb-stage.is-idle, .amb-stage.amb-bare { cursor: none; }
.amb-stage.amb-bare .amb-hud { display: none; }

.amb-clock {
  position: absolute; z-index: 2; left: clamp(16px, 4%, 64px); top: clamp(14px, 5%, 56px);
  font-family: var(--font-display); font-weight: 300; line-height: 1; letter-spacing: -0.02em;
  font-size: clamp(2rem, 8vw, 7rem); font-size: clamp(1.8rem, 9cqw, 9rem);
  color: rgba(255, 255, 255, 0.9); text-shadow: 0 2px 28px rgba(0, 0, 0, 0.45); pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.amb-clock small {
  display: block; margin-top: 0.55em; font-family: var(--font-sans); font-weight: 600;
  font-size: max(0.75rem, 0.19em); letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.75;
}

.amb-hud {
  position: absolute; z-index: 3; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; padding: 6px;
  max-width: calc(100% - 20px); width: max-content;
  background: rgba(10, 7, 5, 0.58); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 26px;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}
.amb-stage.is-idle .amb-hud { opacity: 0; transform: translate(-50%, 12px); pointer-events: none; }
.amb-hud button {
  display: inline-flex; align-items: center; gap: 7px; height: 40px; min-width: 40px; padding: 0 12px;
  border: 0; border-radius: 20px; background: transparent; color: #fff; cursor: pointer;
  font: 600 0.86rem/1 var(--font-sans); white-space: nowrap;
  transition: background var(--t-fast) var(--ease);
}
.amb-hud button:hover { background: rgba(255, 255, 255, 0.14); }
.amb-hud button:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.amb-hud button[aria-pressed="true"] { background: rgba(63, 179, 127, 0.42); }
.amb-hud button.amb-icon { padding: 0; justify-content: center; }
.amb-hud svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.amb-hud .amb-i-play { display: none; }
.amb-hud .is-paused .amb-i-play { display: block; }
.amb-hud .is-paused .amb-i-pause { display: none; }
.amb-hud .amb-i-shrink { display: none; }
.amb-hud .is-on .amb-i-shrink { display: block; }
.amb-hud .is-on .amb-i-grow { display: none; }
/* on/off isn't shown by colour alone: an "off" toggle gets a slash */
.amb-hud .amb-slash { display: none; }
.amb-hud button[aria-pressed="false"] .amb-slash { display: block; }
.amb-hud button[aria-pressed="false"] svg { opacity: 0.8; }
.amb-hud label { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; font: 600 0.82rem/1 var(--font-sans); color: rgba(255, 255, 255, 0.85); }
.amb-hud input[type="range"] { width: 110px; accent-color: var(--color-sprout); }
.amb-hud .amb-sep { width: 1px; height: 22px; background: rgba(255, 255, 255, 0.18); margin: 0 2px; }
@media (max-width: 640px) {
  .amb-hud .amb-hide-sm { display: none; }
  .amb-hud input[type="range"] { width: 84px; }
}
/* a narrow stage: keep the bar on one line */
@container (max-width: 420px) {
  .amb-hud { gap: 2px; padding: 4px; }
  .amb-hud button { padding: 0 9px; gap: 5px; }
  .amb-hud button:not(.amb-icon) > svg { display: none; }
}

.amb-notice {
  position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; text-align: center; padding: 24px;
  background: rgba(4, 3, 2, 0.45);
}
.amb-notice[hidden] { display: none; }
.amb-notice p { color: #fff; font-weight: 600; margin-bottom: var(--space-4); text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5); }

.amb-panel { margin-top: var(--space-5); }
.amb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5) var(--space-6); }
@media (max-width: 760px) { .amb-grid { grid-template-columns: 1fr; } }
.amb-out { float: right; font-weight: 600; color: var(--text-muted); font-size: var(--fs-sm); text-transform: none; letter-spacing: 0; }
.amb-scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }
.amb-toggles { display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-5); }
.amb-keys { margin-top: var(--space-5); font-size: var(--fs-sm); color: var(--text-muted); }
.amb-keys kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; margin: 0 1px; text-align: center;
  font: 600 0.8em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  border: 1px solid var(--color-line); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-card); color: var(--text);
}

/* a panel toggle button (e.g. "Play the jazz") shows its on state with a tick, not colour alone */
.btn[data-amb-toggle][aria-pressed="true"]::after { content: " \2713"; }
