/* =========================================================================
 * MYCELIUM — style.css
 * Dark, full-bleed canvas with a glassy floating control panel. The whole UI
 * is kept deliberately quiet so the organism is the only bright thing on
 * screen.
 * ========================================================================= */

:root {
  --ink: #e8f0ee;
  --dim: #8a9a96;
  --faint: #5a6a66;
  --glass: rgba(14, 20, 19, 0.62);
  --glass-line: rgba(150, 220, 200, 0.14);
  --accent: #56e0b8;
  --accent-soft: rgba(86, 224, 184, 0.16);
  --mono: "SFMono-Regular", ui-monospace, "Cascadia Code", "Consolas", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #05080a;
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: crosshair;
}

#gl {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
  touch-action: none;
}

/* ---- wordmark ---------------------------------------------------------- */
#brand {
  position: fixed;
  top: 22px;
  left: 26px;
  pointer-events: none;
  user-select: none;
  mix-blend-mode: screen;
  z-index: 5;
}
#brand .logo {
  display: block;
  font-weight: 700;
  letter-spacing: 0.42em;
  font-size: 15px;
  color: var(--ink);
  text-shadow: 0 0 18px rgba(86, 224, 184, 0.35);
}
#brand .sub {
  display: block;
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---- HUD readout ------------------------------------------------------- */
#hud {
  position: fixed;
  left: 26px;
  bottom: 18px;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  color: var(--dim);
  pointer-events: none;
  user-select: none;
  white-space: pre;
  text-shadow: 0 1px 8px #000;
  z-index: 5;
}
#hud b { color: var(--accent); font-weight: 600; }

/* ---- control panel ----------------------------------------------------- */
#panel {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 286px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  background: var(--glass);
  backdrop-filter: blur(16px) saturate(1.1);
  -webkit-backdrop-filter: blur(16px) saturate(1.1);
  border: 1px solid var(--glass-line);
  border-radius: 14px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  z-index: 10;
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.32s;
}
#panel.hidden {
  transform: translateX(calc(100% + 26px));
  opacity: 0;
  pointer-events: none;
}
#panel::-webkit-scrollbar { width: 8px; }
#panel::-webkit-scrollbar-thumb {
  background: rgba(120, 180, 160, 0.2);
  border-radius: 8px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h1 {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--dim);
}
#collapse {
  width: 24px; height: 24px;
  border-radius: 7px;
  border: 1px solid var(--glass-line);
  background: transparent;
  color: var(--dim);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: 0.18s;
}
#collapse:hover { color: var(--ink); border-color: var(--accent-soft); }

section { margin-bottom: 14px; }
.row-label {
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 8px;
}

/* ---- presets ----------------------------------------------------------- */
.presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.presets button,
.actions button {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  padding: 7px 4px;
  cursor: pointer;
  transition: 0.16s;
}
.presets button:hover,
.actions button:hover {
  color: var(--ink);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.presets button.active {
  color: #04110d;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---- sliders ----------------------------------------------------------- */
.slider {
  margin-bottom: 11px;
}
.slider .lab {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 5px;
  color: var(--dim);
}
.slider .lab .val {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
}
.slider input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: rgba(150, 200, 185, 0.16);
  outline: none;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(86, 224, 184, 0.6);
  transition: transform 0.12s;
}
.slider input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
.slider input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border: none; border-radius: 50%;
  background: var(--accent); cursor: pointer;
}

/* ---- palettes ---------------------------------------------------------- */
.swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.swatch {
  height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: 0.16s;
}
.swatch:hover { transform: translateY(-1px); }
.swatch.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

/* ---- actions ----------------------------------------------------------- */
.actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.actions button.on {
  color: #04110d;
  background: var(--accent);
  border-color: var(--accent);
}

.hint {
  font-size: 10px;
  line-height: 1.6;
  color: var(--faint);
  margin: 4px 0 0;
}
.hint b { color: var(--dim); font-weight: 600; }

/* ---- splash ------------------------------------------------------------ */
#splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #0a1412 0%, #05080a 70%);
  z-index: 50;
  transition: opacity 0.8s ease;
}
#splash.gone { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; }
.splash-logo {
  font-weight: 700;
  letter-spacing: 0.5em;
  font-size: 26px;
  color: var(--ink);
  text-shadow: 0 0 40px rgba(86, 224, 184, 0.4);
  animation: pulse 2.4s ease-in-out infinite;
}
.splash-msg {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--dim);
}
.splash-msg.error { color: #ff8a7a; max-width: 460px; line-height: 1.6; }
@keyframes pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

@media (max-width: 640px) {
  #panel { width: calc(100vw - 24px); right: 12px; top: 12px; }
  #brand { top: 14px; left: 16px; }
}
