/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #24242409;
  --panel-bg: rgba(22, 22, 34, 0.85);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent: #7c5cfc;
  --accent-glow: rgba(124, 92, 252, 0.35);
  --text: #e4e4ed;
  --text-dim: #8888a4;
  --radius: 14px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  /* Enable vertical scrolling */
  background: var(--bg);
  font-family: var(--font);
  color: var(--text);
  /* cursor: crosshair;  Moved to hero */
}

/* ===== Hero Section ===== */
#hero {
  width: 100%;
  height: 100vh;
  position: relative;
  overflow: hidden;
  cursor: default;
}

/* ===== Canvas ===== */
#canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  /* Changed from fixed */
  inset: 0;
}

/* ===== Content Section ===== */
#content {
  position: relative;
  z-index: 2;
  background: #16161f;
  /* Dark background to cover canvas if needed, or blend */
  padding: 80px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
  box-shadow: 0 -25px 50px rgba(0, 0, 0, 0.7);
}

.text-block {
  max-width: 700px;
  width: 100%;
  line-height: 1.6;
}

.text-block h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
}

.text-block p {
  font-size: 1.1rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* ===== Floating Controls ===== */
#controls {
  position: absolute;
  /* Changed from fixed to scroll with hero? Or keep fixed? */
  /* If we want controls ONLY on hero, use absolute inside relative hero. */
  /* User said "constrain... to just the initial screen", so controls likely belong there. */
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  /* Hidden as requested */
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  z-index: 10;
  user-select: none;
  transition: opacity 0.3s ease;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.info-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-dim);
  min-width: 110px;
}

/* ===== Buttons ===== */
button {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

button:hover {
  background: var(--accent);
  transform: scale(1.08);
  box-shadow: 0 0 18px var(--accent-glow);
}

button:active {
  transform: scale(0.96);
}

button .icon {
  display: inline-block;
  transition: transform 0.2s;
}

/* ===== Slider ===== */
label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: transform 0.15s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== Hint ===== */

#hint {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: var(--panel-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-dim);
  z-index: 10;
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

#hint strong {
  color: var(--accent);
  font-weight: 600;
}

#hint.hidden {
  opacity: 0;
  transform: translateX(-50%) translateY(-12px);
}

/* ===== Settings Panel ===== */
#settings {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  padding: 18px 22px;
  background: var(--panel-bg);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  z-index: 10;
  user-select: none;
  min-width: 240px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#settings.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(12px);
}

#settings h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.setting-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.setting-row label {
  min-width: 80px;
  font-size: 12px;
}

.setting-row input[type="number"] {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}

.setting-row input[type="number"]:focus {
  border-color: var(--accent);
}

.sm-btn {
  width: 32px !important;
  height: 32px !important;
  font-size: 14px !important;
  border-radius: 8px !important;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
}

.toggle-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 18px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.12);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle-label input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: transform 0.2s, background 0.2s;
}

.toggle-label input[type="checkbox"]:checked {
  background: var(--accent);
}

.toggle-label input[type="checkbox"]:checked::after {
  transform: translateX(16px);
  background: #fff;
}

.toggle-text {
  color: var(--text-dim);
  font-weight: 500;
}

.setting-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0.7;
}

/* ===== Responsive ===== */
@media (max-width: 560px) {
  #controls {
    gap: 14px;
    padding: 10px 16px;
    bottom: 16px;
  }

  input[type="range"] {
    width: 70px;
  }

  .info-group {
    display: none;
  }
}