/* the cameron williams project - session view console */

:root {
  --bg: #0b0d10;
  --panel: #14161b;
  --surface: #1d2026;
  --border: #2a2f36;
  --violet: #8d7bd8;
  --pink: #ff6fae;
  --ice-blue: #8fb8ff;
  --indigo: #4c51bf;
  --plum: #a855f7;
  --magenta: #e11d48;
  --master-red: #d92b2b;
  --steel: #6f7f9e;
  --text-main: #d6dae0;
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

body {
  margin: 0;
  padding: 0;
  font-family: 'IBM Plex Sans', sans-serif;
  background-color: var(--bg);
  color: var(--text-main);
}

.mono { font-family: 'IBM Plex Mono', monospace; }

/* header hardware */

.led-display {
  background: #050505;
  border: 1px solid #1a1a1a;
  box-shadow: var(--shadow-inset);
  font-family: 'IBM Plex Mono', monospace;
}

.led-text {
  text-shadow: 0 0 10px var(--ice-blue);
  color: var(--ice-blue);
}

.transport-well {
  background: #08090b;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-inset);
}

.transport-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 2px solid #000;
  transition: all 0.1s;
  color: var(--text-main);
  cursor: pointer;
}

.transport-btn:active {
  border-bottom-width: 0;
  transform: translateY(2px);
}

.transport-btn.engaged {
  background: #2a2f3a;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* tracks panel, the pt style list on the far left */

.tracks-panel {
  width: 176px;
  background: var(--panel);
  border-right: 1px solid #000;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.tracks-panel-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.4;
}

.track-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 12px;
  background: none;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.track-item:hover { background: rgba(255, 255, 255, 0.05); }
.track-item.selected { background: rgba(143, 184, 255, 0.12); }

.track-chip {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.track-item .track-sub {
  margin-left: auto;
  font-size: 8px;
  opacity: 0.3;
  text-transform: uppercase;
}

/* arrangement */

/* each row wears a muted wash of its clip's color, like a tinted console */
.track-lane {
  height: 100px;
  border-bottom: 1px solid var(--border);
  position: relative;
  background: color-mix(in srgb, var(--lane-color, transparent) 8%, transparent);
}

.track-header {
  width: 280px;
  background: color-mix(in srgb, var(--lane-color, var(--panel)) 16%, var(--panel));
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  position: sticky;
  left: 0;
  z-index: 20;
}

.ruler-label {
  position: sticky;
  left: 0;
  z-index: 20;
}

.track-lane-master { height: 44px; }

/* clips nudge left and right inside their lane, the one time a region
   may truly float above the desk */
.clip { touch-action: pan-y; }

.clip-dragging {
  cursor: grabbing;
  z-index: 25;
  filter: brightness(1.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55);
}

.master-sum-bar {
  position: absolute;
  left: 0;
  right: 12px;
  top: 50%;
  margin-top: -4px;
  height: 8px;
  border-radius: 2px;
  background: rgba(217, 43, 43, 0.25);
  border: 1px solid rgba(217, 43, 43, 0.4);
}

/* clips are square, fill their whole lane, and draw the song's real
   waveform on a canvas behind the name tag */
.clip {
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  position: absolute;
  top: 0;
  bottom: 0;
  border: 1px solid rgba(0, 0, 0, 0.5);
  overflow: hidden;
  text-align: left;
}

/* clickable things glow a little so nobody has to guess, and the glow
   leans in on hover */
.clip {
  box-shadow: 0 0 9px rgba(143, 184, 255, 0.22);
  transition: box-shadow 0.2s ease, filter 0.2s ease;
}

.clip:hover {
  filter: brightness(1.12);
  box-shadow: 0 0 18px rgba(143, 184, 255, 0.55);
}

#nav-about, #nav-contact {
  text-shadow: 0 0 8px rgba(255, 111, 174, 0.4);
  transition: text-shadow 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

#nav-about:hover, #nav-contact:hover {
  text-shadow: 0 0 14px rgba(255, 111, 174, 0.85);
}

.dev-plate {
  box-shadow: 0 0 10px rgba(143, 184, 255, 0.25);
  transition: box-shadow 0.2s ease;
}

.mixer-strip-clickable:hover .dev-plate {
  box-shadow: 0 0 18px rgba(143, 184, 255, 0.6);
}

.clip.active {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.clip .clip-name {
  position: absolute;
  top: 3px;
  left: 5px;
  font-size: 10px;
  font-weight: 700;
  font-family: 'IBM Plex Mono', monospace;
  z-index: 2;
  white-space: nowrap;
}

.clip canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* the cursor is grabbable, the ::after pad widens the hit area */
.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ice-blue);
  z-index: 30;
  left: 300px;
  box-shadow: 0 0 12px var(--ice-blue);
  cursor: ew-resize;
  touch-action: none;
}

.playhead::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -7px;
  right: -7px;
}

.grid-lines {
  background-image: linear-gradient(to right, var(--border) 1px, transparent 1px);
  background-size: 120px 100%;
}

.ruler-row {
  height: 28px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.ruler-label {
  width: 80px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ruler-tick {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 9px;
  opacity: 0.4;
  padding-left: 5px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1;
  height: 12px;
  display: flex;
  align-items: center;
}

.tempo-strip {
  height: 10px;
  border-radius: 2px;
  background: rgba(76, 81, 191, 0.35);
  border: 1px solid rgba(143, 184, 255, 0.3);
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.scroll-area::-webkit-scrollbar { width: 8px; height: 8px; }
.scroll-area::-webkit-scrollbar-track { background: var(--bg); }
.scroll-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.small-toggle {
  width: 16px;
  height: 16px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 8px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.small-toggle.on-solo { background: #eab308; color: #000; }
.small-toggle.on-mute { background: #f97316; color: #000; }

/* inspector: pops open with every clip, and the x sends it away */

.inspector {
  width: 300px;
  background: var(--panel);
  border-left: 1px solid #000;
  display: none;
  flex-direction: column;
  flex-shrink: 0;
}

body.inspector-open .inspector { display: flex; }

.inspector-close {
  display: block;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: var(--text-main);
  font-size: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}

.inspector-close:hover { background: var(--master-red); border-color: var(--master-red); color: #fff; }

/* mixer */

.mixer-strip {
  position: relative;
  width: 140px;
  border-right: 1px solid rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

/* uniform 4 slot insert rack so every fader lines up */
.insert-rack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.insert-slot {
  height: 22px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  font-size: 8px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
}

.insert-slot .slot-letter {
  color: rgba(255, 255, 255, 0.25);
  font-weight: 600;
  flex-shrink: 0;
}

.insert-slot .slot-plugin { opacity: 0.65; letter-spacing: 0.02em; }

.fader-track {
  height: 300px;
  background: rgba(0, 0, 0, 0.3);
  width: 4px;
  border-radius: 2px;
  position: relative;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
}

/* the cap looks like an actual fader now: brushed face, center groove,
   and it rides a css variable so both the intro spring and live dragging
   move it without fighting each other */
.fader-cap {
  width: 34px;
  height: 52px;
  background: linear-gradient(180deg, #3d4048 0%, #26282e 46%, #191b20 54%, #2e3138 100%);
  border: 1px solid #08090b;
  border-radius: 3px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  z-index: 10;
  cursor: grab;
  bottom: 0;
  touch-action: none;
  transition: bottom 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--stagger, 0s);
}

.fader-cap::after {
  content: '';
  position: absolute;
  left: 3px;
  right: 3px;
  top: 50%;
  margin-top: -2px;
  height: 3px;
  background: #0b0c0e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1px;
}

.fader-cap:active { cursor: grabbing; }

.fader-level {
  position: absolute;
  bottom: 0;
  width: 100%;
  background: var(--ice-blue);
  filter: blur(1px);
  opacity: 0.4;
  height: 0;
  transition: height 0.9s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition-delay: var(--stagger, 0s);
}

/* travel is scaled so the 52px cap tops out inside the 300px track
   instead of riding up over the solo and mute buttons */
.mixer-visible .fader-cap { bottom: calc(var(--target-level) * 0.82); }
.mixer-visible .fader-level { height: calc(var(--target-level) * 0.82); }
.mixer-visible .knob { transform: rotate(var(--pan-angle, 0deg)); }

/* while a hand is on a control, transitions get out of the way */
.dragging .fader-cap,
.dragging .fader-level,
.dragging .knob { transition: none; }

.knob {
  width: 32px;
  height: 32px;
  background: radial-gradient(circle at 40% 32%, #33363d 0%, #1d1f24 70%, #15161a 100%);
  border: 2px solid #444;
  border-radius: 50%;
  position: relative;
  transform: rotate(0deg);
  cursor: grab;
  touch-action: none;
  transition: transform 1s ease-out;
  transition-delay: var(--stagger, 0s);
}

.knob:active { cursor: grabbing; }

.knob-marker {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 7px;
  background: #ccc;
}

/* stereo meters standing next to the fader, running its full length,
   the way an actual channel strip meters. idle shows a faint segmented
   skeleton, playback lights them from the bottom up. */
.vmeters {
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  display: flex;
  gap: 3px;
}

/* real led ladders: a column of discrete squares that switch on and
   off, green through the body, orange near the top, red for clipping.
   no eased animation, segments just light. */
.vmeter {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  width: 6px;
  height: 100%;
  padding: 1px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.vmeter-seg {
  flex: 1 1 0;
  border-radius: 1px;
  min-height: 2px;
}

.vmeter-seg.zone-green { background: rgba(47, 191, 95, 0.14); }
.vmeter-seg.zone-orange { background: rgba(255, 176, 32, 0.14); }
.vmeter-seg.zone-red { background: rgba(255, 59, 48, 0.14); }

.vmeter-seg.zone-green.lit { background: #2fbf5f; }
.vmeter-seg.zone-orange.lit { background: #ffb020; }
.vmeter-seg.zone-red.lit { background: #ff3b30; }

.strip-btn {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.strip-btn.on-solo { background: #eab308; color: #000; }
.strip-btn.on-mute { background: #f97316; color: #000; }

.mixer-strip-clickable { cursor: pointer; }
.mixer-strip-clickable:hover { filter: brightness(1.15); }

.fx-window-wide { width: min(760px, calc(100vw - 32px)); }

.aidaw-img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 4px;
  display: block;
}

/* the vegas chip idles with a faint glow so the curious find it */
.vegas-chip {
  cursor: pointer;
  color: var(--text-main);
  box-shadow: 0 0 8px rgba(255, 111, 174, 0.3);
  animation: vegas-idle 2.6s ease-in-out infinite alternate;
  transition: box-shadow 0.2s ease;
}

.vegas-chip:hover { box-shadow: 0 0 16px rgba(255, 111, 174, 0.6); }

.vegas-chip.on {
  animation: none;
  background: rgba(255, 111, 174, 0.2);
  border-color: var(--pink);
  box-shadow: 0 0 20px rgba(255, 111, 174, 0.8);
}

@keyframes vegas-idle {
  from { box-shadow: 0 0 5px rgba(255, 111, 174, 0.15); }
  to { box-shadow: 0 0 12px rgba(255, 111, 174, 0.45); }
}

/* vegas mode drives the faders directly, transitions get out of the way */
.vegas .fader-cap, .vegas .fader-level { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .vegas-chip { animation: none; }
}

/* floating windows for about and contact, styled like plugin windows */

.fx-window {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 32px));
  max-height: 80vh;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fx-window[hidden] { display: none; }

.fx-titlebar {
  height: 30px;
  background: #08090b;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  opacity: 0.9;
}

.fx-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  color: var(--text-main);
  font-size: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  line-height: 1;
}

.fx-close:hover { background: var(--master-red); border-color: var(--master-red); color: #fff; }

.fx-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.fx-body a { color: var(--pink); }

/* links in windows and the inspector are first class tap targets,
   no double-tap zoom delay, comfortable thumb size */
.fx-body a, .inspector a {
  touch-action: manipulation;
  min-height: 44px;
}

/* accessibility floor */

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--ice-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .fader-cap, .fader-level, .knob { transition: none; }
}

/* mobile: the inspector becomes a dismissible overlay instead of a wall */

@media (max-width: 1023px) {
  .tracks-panel { display: none; }

  .inspector {
    display: none;
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    max-height: 70vh;
    z-index: 90;
    border-top: 2px solid var(--border);
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.6);
  }

  body.inspector-open .inspector { display: flex; }

  .inspector-close {
    display: block;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: var(--text-main);
    font-size: 11px;
    padding: 4px 10px;
    cursor: pointer;
  }

  .track-header { width: 170px; }
  .mixer-strip { width: 116px; }
}
