/* ============================================================
   SYNTH-ELEMENTS.CSS — Interactive Synth GUI Components
   Resistor Technology · resistor.technology
   ============================================================ */

/* --- Hero (Simplified) --- */
.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.hero__scroll-hint {
  margin-top: var(--space-xl);
  animation: hero-chevron 2s ease-in-out infinite;
}

.hero__chevron {
  color: var(--color-text-muted);
  opacity: 0.5;
}

@keyframes hero-chevron {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(6px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .hero__scroll-hint { animation: none; }
  .hero__chevron { opacity: 0.5; }
}

/* --- 7-Segment LED Display --- */
.led-display {
  background: #001a00;
  border: 2px solid #003300;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  display: inline-flex;
  align-items: center;
  box-shadow:
    inset 0 0 30px rgba(0, 255, 0, 0.08),
    0 0 20px rgba(0, 255, 0, 0.03);
}

.led-display--amber {
  background: #1a1200;
  border-color: #332200;
  box-shadow:
    inset 0 0 30px rgba(255, 170, 0, 0.08),
    0 0 20px rgba(255, 170, 0, 0.03);
}

.led-display__text {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #00ff00;
  text-shadow:
    0 0 10px rgba(0, 255, 0, 0.8),
    0 0 20px rgba(0, 255, 0, 0.4),
    0 0 40px rgba(0, 255, 0, 0.15);
}

.led-display--amber .led-display__text {
  color: #ffaa00;
  text-shadow:
    0 0 10px rgba(255, 170, 0, 0.8),
    0 0 20px rgba(255, 170, 0, 0.4),
    0 0 40px rgba(255, 170, 0, 0.15);
}

/* --- Panel Labels --- */
.panel-label {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wider);
  color: var(--color-text-muted);
  text-align: center;
  user-select: none;
}

.panel-subtitle {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-secondary);
  text-align: center;
}

/* --- Rotary Knob --- */
.knob-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.knob-wrap:active {
  cursor: grabbing;
}

.knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(from 200deg, #1a1a1a, #3a3a3a 90deg, #2a2a2a 180deg, #3a3a3a 270deg, #1a1a1a);
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.06),
    0 0 0 2px #111;
  transition: box-shadow var(--duration-fast);
}

.knob:hover {
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.06),
    0 0 0 2px #111,
    0 0 12px rgba(196, 166, 122, calc(0.2 * var(--glow-intensity)));
}

/* Knob hub */
.knob::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #444, #222);
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Knob pointer indicator */
.knob::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 12px;
  background: #e8e0d0;
  border-radius: 1px;
}

/* --- Scale Marks Around Knob --- */
.knob-scale {
  position: absolute;
  width: 72px;
  height: 72px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.knob-scale__mark {
  position: absolute;
  width: 1px;
  height: 6px;
  background: var(--color-text-muted);
  top: 0;
  left: 50%;
  transform-origin: 0.5px 36px;
}

/* --- Synth Dock (Persistent Bottom Bar) --- */
.synth-dock {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xl);
  padding: 0 var(--space-lg);
  background: linear-gradient(180deg, rgba(20, 20, 26, 0.75), rgba(14, 14, 18, 0.9));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
}

/* Dock-sized knob wrapper */
.synth-dock__knob-wrap {
  flex-direction: column;
  gap: 4px;
}

.synth-dock__knob-wrap .panel-label {
  font-size: 7px;
  order: -1;
}

/* Dock-sized knob (36px) */
.synth-dock__knob {
  width: 36px;
  height: 36px;
}

.synth-dock__knob::after {
  top: 3px;
  height: 9px;
}

.synth-dock__knob::before {
  width: 10px;
  height: 10px;
}

/* --- Product Switch Buttons --- */
.synth-dock__switches {
  display: flex;
  gap: var(--space-sm);
}

.dock-switch {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background var(--duration-fast), border-color var(--duration-fast), box-shadow var(--duration-fast);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
  color: var(--color-text-muted);
}

.dock-switch:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.dock-switch__led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #222;
  transition: background var(--duration-fast), box-shadow var(--duration-fast);
}

.dock-switch__label {
  pointer-events: none;
}

/* Active states per product */
.dock-switch--amethyst.is-active {
  border-color: rgba(106, 74, 138, 0.4);
  color: var(--color-amethyst-light);
}

.dock-switch--amethyst.is-active .dock-switch__led {
  background: var(--color-amethyst-light);
  box-shadow:
    0 0 6px rgba(106, 74, 138, calc(0.8 * var(--glow-intensity, 0.5))),
    0 0 12px rgba(106, 74, 138, calc(0.4 * var(--glow-intensity, 0.5)));
}

.dock-switch--brass.is-active {
  border-color: rgba(196, 166, 122, 0.4);
  color: var(--color-brass);
}

.dock-switch--brass.is-active .dock-switch__led {
  background: var(--color-brass);
  box-shadow:
    0 0 6px rgba(196, 166, 122, calc(0.8 * var(--glow-intensity, 0.5))),
    0 0 12px rgba(196, 166, 122, calc(0.4 * var(--glow-intensity, 0.5)));
}

/* --- VU Meter (Compact Dock Version) --- */
.vu-meter {
  width: 100px;
  height: 56px;
  background: linear-gradient(to bottom, #2a2018, #1a1408);
  border: 1px solid #5a4a20;
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.5),
    inset 0 0 20px rgba(200, 160, 60, 0.08);
}

.vu-meter__face {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 6px;
  color: rgba(200, 160, 60, 0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vu-meter__scale {
  position: absolute;
  bottom: 12px;
  left: 10px;
  right: 10px;
  height: 26px;
  border-top: 1px solid rgba(200, 160, 60, 0.25);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}

.vu-meter__marks {
  position: absolute;
  bottom: 10px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 5px;
  color: rgba(200, 160, 60, 0.4);
}

.vu-meter__needle {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 1px;
  height: 34px;
  background: linear-gradient(to top, rgba(200, 160, 60, 0.9), rgba(200, 160, 60, 0.3));
  transform-origin: bottom center;
  transform: rotate(var(--vu-angle, -30deg));
  transition: transform 0.15s var(--ease-out);
  box-shadow: 0 0 3px rgba(200, 160, 60, 0.3);
}

.vu-meter__needle::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: #8a7a40;
  border-radius: 50%;
}

/* --- Knob ARIA enhancements --- */
.knob-wrap[role="slider"] {
  outline: none;
}

.knob-wrap[role="slider"]:focus-visible .knob {
  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.6),
    inset 0 -2px 4px rgba(0, 0, 0, 0.4),
    inset 0 2px 3px rgba(255, 255, 255, 0.06),
    0 0 0 3px var(--color-brass);
}

/* --- Dock Switch Focus --- */
.dock-switch:focus-visible {
  outline: 2px solid var(--color-brass);
  outline-offset: 2px;
}
