/* 
 * ECHO / FIELD Stylesheet
 * Premium Space Slate Design System
 * Inspired by Apple, Linear, Tesla, and Stripe.
 */

/* ==========================================================================
   1. DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
  /* Space Slate Theme (Cosmic Obsidian & Slate Slate) */
  --bg-app: #0A0A0F;
  --bg-dark: #0A0A0F;
  --bg-obsidian: #1A1A2E;
  --bg-panel: rgba(26, 26, 46, 0.78);
  --bg-frosted: rgba(26, 26, 46, 0.72);
  
  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-active: rgba(255, 255, 255, 0.12);
  --border-focus: rgba(255, 255, 255, 0.25);
  
  /* Ink (Text Hierarchy) */
  --ink-primary: #E8E8F0;
  --ink-secondary: rgba(232, 232, 240, .82);
  --ink-muted: rgba(232, 232, 240, .5);
  --ink-dark: hsl(240, 6%, 15%);
  
  /* High-Tech Neon Accents */
  --violet: #FF2D55;
  --cyan: #00E5FF;
  --lime: #FF9500;
  --orange: #FF9500;
  --danger: hsl(354, 100%, 65%);
  
  /* Glow Projections */
  --glow-violet: rgba(255, 45, 85, 0.28);
  --glow-cyan: rgba(0, 229, 255, 0.26);
  --glow-lime: rgba(255, 149, 0, 0.28);
  --glow-orange: rgba(255, 149, 0, 0.28);
  --glow-danger: rgba(255, 82, 82, 0.25);
  --glow-white: rgba(255, 255, 255, 0.06);
  
  /* Typography */
  --font-mono: 'DM Mono', monospace;
  --font-sans: 'Space Grotesk', sans-serif;
  
  /* Apple/Linear Spring-Like Easing & Transitions */
  --spring-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   2. GLOBAL RESET & SCROLLBARS
   ========================================================================== */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-app);
  color: var(--ink-secondary);
  font-family: var(--font-mono);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   3. APP WORKSPACE LAYOUT (SHELL & ENTRANCE ANIMATION)
   ========================================================================== */
.app-shell {
  width: calc(100vw - 48px);
  height: calc(100vh - 48px);
  margin: 24px;
  display: flex;
  flex-direction: column;
  min-height: 560px;
  animation: appEntrance 1.2s var(--spring-ease) both;
}

@keyframes appEntrance {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   4. TOPBAR (HEADER & ACTIONS)
   ========================================================================== */
.topbar {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 8px;
}

.topbar h1 {
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.28em;
  font-weight: 500;
  margin: 0;
  background: linear-gradient(90deg, #ffffff 0%, #a1a1aa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--font-sans);
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.text-button {
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.01);
  color: var(--ink-muted);
  font: 10px var(--font-mono);
  letter-spacing: 0.12em;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 6px;
  transition: var(--transition);
}

.text-button:hover, .text-button.active {
  color: var(--ink-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-active);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.04);
}

.live-state {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 8px var(--glow-lime);
  position: relative;
}

.live-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--lime);
  animation: pulse 2.2s infinite;
  opacity: 0;
}

@keyframes pulse {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ==========================================================================
   5. INSTRUMENT LAYOUT
   ========================================================================== */
.instrument {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 0;
  flex: 1;
  border: 1px solid var(--border-subtle);
  background: var(--bg-dark);
  border-radius: 8px;
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.02);
  transition: grid-template-columns 0.5s var(--spring-ease);
  overflow: hidden;
}

.instrument.inspector-open {
  grid-template-columns: 200px 1fr 320px;
}

/* ==========================================================================
   6. INPUT RAIL (SIDE NAVIGATION)
   ========================================================================== */
.input-rail {
  display: grid;
  grid-template-columns: 32px 1fr;
  grid-template-rows: 28px 1fr 28px 1fr 28px 1fr 28px 1fr;
  border-right: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.15);
}

.rail-marker {
  font-size: 9px;
  color: var(--ink-muted);
  padding: 16px 0 0 10px;
  border-right: 1px solid var(--border-subtle);
  font-weight: 500;
}

.input-module {
  border: 0;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--ink-muted);
  padding: 24px 16px;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

/* Subtle edge highlight for module hover/active */
.input-module::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 2.5px;
  height: 0%;
  background: currentColor;
  transform: translateY(-50%);
  transition: var(--transition);
  border-radius: 0 4px 4px 0;
}

.input-module:hover {
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-secondary);
}

.input-module:hover::before {
  height: 40%;
}

.input-module.active {
  background: rgba(255, 255, 255, 0.035);
  color: var(--ink-primary);
  border-bottom-color: var(--border-active);
}

.input-module.active::before {
  height: 70%;
  box-shadow: 0 0 8px currentColor;
}

/* Dynamic Accent Colors on Rail Modes */
.input-module[data-mode="voice"].active { color: var(--violet); }
.input-module[data-mode="motion"].active { color: var(--cyan); }
.input-module[data-mode="memory"].active { color: var(--lime); }
.input-module[data-mode="vision"].active { color: var(--orange); }

.module-title {
  font-size: 11px;
  letter-spacing: 0.22em;
  font-weight: 500;
  font-family: var(--font-sans);
  transition: var(--transition);
}

.input-module.active .module-title {
  text-shadow: 0 0 16px currentColor;
}

.module-code {
  color: rgba(255, 255, 255, 0.2);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.input-module.active .module-code {
  color: rgba(255, 255, 255, 0.5);
}

/* Module Glyphs */
.voice-bars {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.voice-bars i {
  display: block;
  width: 2px;
  background: var(--ink-muted);
  height: 10px;
  border-radius: 1px;
  transition: var(--transition);
}

.input-module:hover .voice-bars i {
  background: var(--ink-secondary);
}

.input-module.active[data-mode="voice"] .voice-bars i {
  background: var(--violet);
  box-shadow: 0 0 8px var(--glow-violet);
}

.voice-bars i:nth-child(2) { height: 18px; }
.voice-bars i:nth-child(3) { height: 28px; }
.voice-bars i:nth-child(4) { height: 16px; }
.voice-bars i:nth-child(5) { height: 34px; }
.voice-bars i:nth-child(6) { height: 24px; }
.voice-bars i:nth-child(7) { height: 14px; }
.voice-bars i:nth-child(8) { height: 22px; }
.voice-bars i:nth-child(9) { height: 10px; }

.motion-glyph {
  font-family: var(--font-sans);
  font-size: 40px;
  line-height: 0.7;
  font-weight: 300;
  color: var(--ink-muted);
  transform: rotate(-10deg);
  transition: var(--transition);
}

.input-module:hover .motion-glyph {
  color: var(--ink-secondary);
}

.input-module.active[data-mode="motion"] .motion-glyph {
  color: var(--cyan);
  text-shadow: 0 0 16px var(--glow-cyan);
  transform: rotate(0deg) scale(1.08);
}

.memory-grid {
  height: 32px;
  width: 48px;
  background-image: radial-gradient(circle, var(--ink-muted) 1px, transparent 1.5px);
  background-size: 8px 8px;
  opacity: 0.4;
  transition: var(--transition);
}

.input-module:hover .memory-grid {
  opacity: 0.7;
}

.input-module.active[data-mode="memory"] .memory-grid {
  background-image: radial-gradient(circle, var(--lime) 1px, transparent 1.5px);
  opacity: 1;
  filter: drop-shadow(0 0 4px var(--glow-lime));
}

.vision-glyph {
  font-family: var(--font-sans);
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
  color: var(--ink-muted);
  transition: var(--transition);
}

.input-module:hover .vision-glyph {
  color: var(--ink-secondary);
}

.input-module.active[data-mode="vision"] .vision-glyph {
  color: var(--orange);
  text-shadow: 0 0 16px var(--glow-orange);
  transform: scale(1.1);
}

/* ==========================================================================
   7. CANVAS CONTAINER & CURSOR
   ========================================================================== */
.canvas-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #020204;
}

.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* Highly Polished Cursor Glow Orb */
.canvas-cursor {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ink-primary);
  box-shadow: 
    0 0 0 1px rgba(255, 255, 255, 0.6),
    0 0 0 4px rgba(255, 255, 255, 0.1),
    0 0 24px 8px var(--glow-violet);
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.12s var(--spring-ease), top 0.12s var(--spring-ease);
}

.field-label {
  position: absolute;
  right: 20px;
  top: 16px;
  color: var(--ink-muted);
  font-size: 9px;
  letter-spacing: 0.22em;
  pointer-events: none;
  user-select: none;
}

.canvas-hint {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--ink-secondary);
  letter-spacing: 0.14em;
  opacity: 0.85;
  transition: opacity 0.4s var(--spring-ease);
  pointer-events: none;
  user-select: none;
  background: var(--bg-frosted);
  padding: 8px 16px;
  border-radius: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   8. PREMIUM HUD OVERLAY (DEVELOPER PANEL)
   ========================================================================== */
.hud-overlay {
  position: absolute;
  top: 16px;
  left: 20px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-radius: 8px;
  background: var(--bg-frosted);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-subtle);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  transition: var(--transition);
}

/* HUD elements visibility toggled by checkbox in settings */
.instrument:has(#toggleHud:not(:checked)) #hudOverlay {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.96);
}

.hud-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hud-label {
  color: var(--ink-muted);
  font-size: 8px;
  letter-spacing: 0.12em;
  font-weight: 500;
  text-transform: uppercase;
}

.hud-value {
  color: var(--ink-primary);
  font-size: 11px;
  font-weight: 500;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
}

/* Tracker status glowing accents */
.hud-value.status-searching { color: var(--cyan); text-shadow: 0 0 8px var(--glow-cyan); }
.hud-value.status-locked { color: var(--lime); text-shadow: 0 0 8px var(--glow-lime); }
.hud-value.status-tracking { color: var(--violet); text-shadow: 0 0 8px var(--glow-violet); }
.hud-value.status-active { color: var(--lime); text-shadow: 0 0 8px var(--glow-lime); }
.hud-value.status-listening { color: var(--cyan); text-shadow: 0 0 8px var(--glow-cyan); }
.hud-value.status-idle { color: var(--ink-muted); }
.hud-value.status-stable { color: var(--lime); text-shadow: 0 0 8px var(--glow-lime); }

/* Confidence bar outer & inner styling */
.confidence-wrap {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  border-left: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  padding: 0 16px;
}

.confidence-wrap .hud-label {
  margin-bottom: 0;
}

.confidence-bar-outer {
  width: 70px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.confidence-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--lime));
  border-radius: 2px;
  transition: width 0.35s var(--spring-ease);
  box-shadow: 0 0 6px var(--violet);
}

.confidence-wrap .hud-value {
  width: 32px;
  justify-content: flex-end;
  text-align: right;
}

.fps-wrap {
  padding-left: 4px;
}

/* Tracking preview */
.tracking-preview {
  position: relative;
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-subtle);
  z-index: 7;
  opacity: 0.92;
  transition: var(--transition);
}

.tracking-preview.active {
  opacity: 1;
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(167, 255, 214, 0.15);
}

.tracking-preview-stage {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  background: #000;
}

.tracking-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.14em;
  color: var(--ink-muted);
}

#trackingPreviewLabel {
  color: var(--lime);
}

#webcamVideo {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  transform: scaleX(-1);
  filter: saturate(1.15) contrast(1.05);
  background: #000;
}

#handOverlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.tracking-preview::after {
  content: '';
  position: absolute;
  inset: 34px 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 255, 197, 0.14);
  pointer-events: none;
}

/* ==========================================================================
   9. TARGET LOCK RETICLE (SVG ACCENT)
   ========================================================================== */
.target-lock-reticle {
  position: absolute;
  width: 72px;
  height: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.4);
  transition: opacity 0.5s var(--spring-ease), transform 0.5s var(--spring-ease);
  z-index: 8;
}

.target-lock-reticle.active {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.target-lock-reticle svg {
  width: 54px;
  height: 54px;
  stroke: var(--lime);
  stroke-width: 1.5px;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--glow-lime));
  animation: reticleRotate 12s linear infinite, reticlePulse 2s var(--spring-ease) infinite;
}

.target-lock-reticle .reticle-circle {
  stroke-dasharray: 8 4;
}

.target-lock-reticle .reticle-center {
  fill: var(--lime);
  stroke: none;
  animation: reticleCenterPulse 0.8s ease-in-out infinite alternate;
}

.target-lock-reticle .lock-label {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--lime);
  text-shadow: 0 0 6px var(--glow-lime);
  opacity: 0.8;
  animation: labelFlicker 3s infinite;
}

@keyframes reticleRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes reticlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes reticleCenterPulse {
  from { opacity: 0.45; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.2); }
}

@keyframes labelFlicker {
  0%, 94%, 100% { opacity: 0.8; }
  95% { opacity: 0.3; }
  97% { opacity: 0.8; }
}

/* ==========================================================================
   10. CUSTOM SWITCHES & PREMIUM TOGGLES
   ========================================================================== */
.custom-toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
  transition: var(--transition);
}

.custom-toggle:hover {
  color: var(--ink-primary);
}

.custom-toggle input[type="checkbox"] {
  display: none;
}

.custom-toggle .toggle-slider {
  position: relative;
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  transition: var(--transition);
  border: 1px solid var(--border-subtle);
}

.custom-toggle .toggle-slider::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-muted);
  top: 2px;
  left: 2px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.custom-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 10px rgba(163, 130, 255, 0.2);
}

.custom-toggle input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(14px);
  background: var(--ink-primary);
}

.custom-toggle input[type="checkbox"]:checked ~ span:not(.toggle-slider) {
  color: var(--ink-primary);
}

/* ==========================================================================
   11. INSPECTOR PANEL (SIDEBAR SETTINGS)
   ========================================================================== */
.inspector {
  display: none;
  border-left: 1px solid var(--border-subtle);
  background: var(--bg-panel);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow-y: auto;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.4);
  animation: slideLeft 0.5s var(--spring-ease);
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.inspector-open .inspector {
  display: block;
}

.inspector-head {
  height: 54px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--ink-primary);
  font-weight: 500;
  font-family: var(--font-sans);
}

.close-inspector, .close-how {
  background: none;
  border: 0;
  color: var(--ink-muted);
  font: 24px var(--font-sans);
  font-weight: 300;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px 8px;
  line-height: 1;
}

.close-inspector:hover, .close-how:hover {
  color: var(--ink-primary);
  transform: scale(1.18);
}

.inspector-section {
  border-bottom: 1px solid var(--border-subtle);
  padding: 24px 20px;
}

.section-label {
  display: block;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.16em;
  margin-bottom: 14px;
  text-transform: uppercase;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row > span {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-muted);
}

.checkbox-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
}

/* ==========================================================================
   12. CUSTOM PALETTES & COLOR SWATCHES
   ========================================================================== */
.palette-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.palette-choice {
  border: 0;
  background: none;
  color: var(--ink-muted);
  font: 9px var(--font-mono);
  letter-spacing: 0.08em;
  text-align: center;
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
}

.palette-choice.selected {
  color: var(--ink-primary);
}

.swatch {
  display: block;
  height: 44px;
  margin-bottom: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  transition: var(--transition);
}

.palette-choice:hover .swatch {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.palette-choice.selected .swatch {
  border-color: var(--ink-primary);
  box-shadow: 0 0 12px currentColor;
}

.swatch.prism {
  background: linear-gradient(135deg, var(--violet), var(--cyan) 50%, var(--lime));
  color: var(--violet);
}
.swatch.violet {
  background: linear-gradient(135deg, #4d339e, var(--violet));
  color: var(--violet);
}
.swatch.lime {
  background: linear-gradient(135deg, #7c9e1e, var(--lime));
  color: var(--lime);
}
.swatch.custom {
  background: linear-gradient(135deg, var(--custom-1, #a382ff), var(--custom-2, #4ce1ff) 50%, var(--custom-3, #c2f93c));
  color: var(--custom-1, #a382ff);
}

/* ==========================================================================
   13. CUSTOM INPUT CONTROLS (RANGE SLIDERS, COLOR PICKERS)
   ========================================================================== */

/* Range Sliders */
.sliders label {
  display: block;
  position: relative;
  color: var(--ink-muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  margin-bottom: 24px;
}

.sliders label:last-child {
  margin-bottom: 0;
}

.sliders output {
  float: right;
  color: var(--ink-primary);
  font-weight: 500;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

/* WebKit Track & Thumb */
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: transparent;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-primary);
  border: 1px solid var(--bg-dark);
  margin-top: -4px;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

input[type="range"]:hover::-webkit-slider-thumb {
  transform: scale(1.22);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

/* Firefox Track & Thumb */
input[type="range"]::-moz-range-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink-primary);
  border: 1px solid var(--bg-dark);
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

input[type="range"]:hover::-moz-range-thumb {
  transform: scale(1.22);
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

input[type="range"]:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* Color Inputs (Overriding Inline Styles) */
.custom-colors-row input[type="color"] {
  flex: 1 !important;
  height: 32px !important;
  border: 1px solid var(--border-subtle) !important;
  background: rgba(255, 255, 255, 0.02) !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  padding: 0 !important;
  outline: none;
  transition: var(--transition);
}

.custom-colors-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 3px !important;
}

.custom-colors-row input[type="color"]::-webkit-color-swatch {
  border: none !important;
  border-radius: 4px !important;
}

.custom-colors-row input[type="color"]::-moz-color-swatch {
  border: none !important;
  border-radius: 4px !important;
}

.custom-colors-row input[type="color"]:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
  transform: translateY(-1.5px);
}

/* Seed & buttons */
.seed-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seed-row strong {
  display: block;
  font-weight: 500;
  color: var(--ink-primary);
  font-size: 13px;
  margin-top: 8px;
  letter-spacing: 0.05em;
}

.outline-button {
  height: 32px;
  border: 1.5px solid var(--border-active);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  color: var(--ink-secondary);
  font: 10px var(--font-mono);
  letter-spacing: 0.1em;
  padding: 0 14px;
  cursor: pointer;
  transition: var(--transition);
}

.outline-button:hover {
  background: var(--ink-primary);
  color: var(--bg-app);
  border-color: var(--ink-primary);
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.outline-button:active {
  transform: translateY(0);
}

/* Saved Fields Section */
.saved-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.saved-head > span:last-child {
  font-size: 9px;
  color: var(--ink-muted);
}

.saved-fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.saved-thumb {
  height: 48px;
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  cursor: pointer;
  object-fit: cover;
  background: #000000;
  transition: var(--transition);
}

.saved-thumb:hover {
  border-color: var(--ink-primary);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.inspector-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.inspector-actions .outline-button {
  width: 100%;
  height: 34px;
}

/* ==========================================================================
   14. CONTROL BAR (FOOTER READOUTS)
   ========================================================================== */
.control-bar {
  height: 84px;
  border: 1px solid var(--border-subtle);
  border-top: 0;
  display: grid;
  grid-template-columns: 200px 1fr 280px 380px;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
}

.field-readout, .phrase, .waveform {
  height: 100%;
  display: flex;
  align-items: center;
  border-right: 1px solid var(--border-subtle);
}

.field-readout {
  padding: 0 20px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.readout-label {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.readout-label b {
  font-weight: 500;
  color: var(--ink-primary);
}

.mini-spark {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.08) 15%, 
    transparent 20%, 
    rgba(255, 255, 255, 0.45) 45%, 
    transparent 55%, 
    var(--ink-muted) 70%, 
    transparent 100%
  );
  opacity: 0.4;
}

.phrase {
  padding: 0 24px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}

.phrase #phraseText {
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.02em;
  color: var(--ink-secondary);
  font-weight: 500;
}

.bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 20px;
  gap: 12px;
}

/* Premium recording controls */
.record-button {
  height: 40px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--ink-muted);
  font: 11px var(--font-mono);
  letter-spacing: 0.1em;
  cursor: pointer;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.record-button:hover {
  color: var(--ink-primary);
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.04);
}

.record-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
  transition: var(--transition);
}

.record-button.recording {
  color: var(--danger);
  border-color: rgba(255, 82, 82, 0.3);
  background: rgba(255, 82, 82, 0.06);
  box-shadow: 0 0 15px rgba(255, 82, 82, 0.15);
}

.record-button.recording .record-dot {
  background: var(--danger);
  box-shadow: 0 0 10px var(--danger);
  animation: pulseRed 1s infinite alternate;
}

@keyframes pulseRed {
  from { opacity: 0.4; }
  to { opacity: 1; transform: scale(1.2); }
}

/* Begin new field button */
.new-field {
  height: 40px;
  background: var(--ink-primary);
  border: 1px solid var(--ink-primary);
  border-radius: 6px;
  color: var(--bg-app);
  font: 500 11px var(--font-mono);
  letter-spacing: 0.1em;
  padding: 0 20px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.new-field:hover {
  background: transparent;
  color: var(--ink-primary);
  border-color: var(--ink-primary);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.new-field span {
  font-size: 14px;
  transition: transform 0.3s var(--spring-ease);
}

.new-field:hover span {
  transform: translateX(4px);
}

/* ==========================================================================
   15. WAVEFORM SPECTRUM
   ========================================================================== */
.waveform {
  padding: 0 20px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.waveform span {
  width: 3px;
  background: var(--border-active);
  display: block;
  opacity: 0.85;
  border-radius: 1.5px;
  transition: height 0.15s ease, background-color 0.3s ease;
}

/* ==========================================================================
   16. MODALS & WELCOME OVERLAYS
   ========================================================================== */
.welcome-overlay, .how-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 5, 0.6);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: grid;
  place-items: center;
  z-index: 100;
  animation: fadeIn 0.6s var(--spring-ease) both;
}

.welcome-card, .how-card {
  width: min(480px, calc(100vw - 32px));
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  background: rgba(10, 10, 16, 0.8);
  padding: 48px;
  box-shadow: 
    0 30px 100px rgba(0, 0, 0, 0.7),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  animation: cardEntrance 0.8s var(--spring-ease) both;
}

@keyframes cardEntrance {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.welcome-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--violet);
  font-weight: 500;
  text-shadow: 0 0 10px var(--glow-violet);
}

.welcome-card h2, .how-card h2 {
  font: 500 38px/1.1 var(--font-sans);
  letter-spacing: -0.04em;
  margin: 28px 0 20px;
  color: var(--ink-primary);
}

.welcome-card h2 em {
  color: var(--violet);
  font-style: normal;
  text-shadow: 0 0 15px var(--glow-violet);
}

.welcome-card p {
  font: 15px/1.6 var(--font-sans);
  color: var(--ink-secondary);
  opacity: 0.75;
  margin-bottom: 36px;
}

.begin-button {
  border: 1px solid var(--ink-primary);
  background: var(--ink-primary);
  color: var(--bg-app);
  border-radius: 6px;
  height: 48px;
  padding: 0 24px;
  font: 500 11px var(--font-mono);
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.1);
}

.begin-button:hover {
  background: transparent;
  color: var(--ink-primary);
  border-color: var(--ink-primary);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.begin-button span {
  font-size: 16px;
  transition: transform 0.3s var(--spring-ease);
}

.begin-button:hover span {
  transform: translateX(4px);
}

.welcome-note {
  display: block;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin-top: 24px;
  text-align: center;
}

.how-overlay[hidden] {
  display: none;
}

.close-how {
  position: absolute;
  right: 18px;
  top: 18px;
}

.how-card h2 {
  margin: 16px 0 28px;
}

.how-steps {
  display: grid;
  gap: 24px;
  margin-bottom: 36px;
}

.how-steps div {
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 16px;
}

.how-steps b {
  color: var(--lime);
  font-family: var(--font-mono);
  font-size: 11px;
  text-shadow: 0 0 8px var(--glow-lime);
}

.how-steps span {
  font-size: 13px;
  letter-spacing: 0.1em;
  font-weight: 500;
  color: var(--ink-primary);
  font-family: var(--font-mono);
}

.how-steps p {
  grid-column: 2;
  margin: 6px 0 0;
  color: var(--ink-secondary);
  opacity: 0.7;
  font: 13px/1.5 var(--font-sans);
}

.how-card .outline-button {
  width: 100%;
  height: 40px;
}

.sr-only {
  position: absolute;
  clip: rect(0,0,0,0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ==========================================================================
   17. RESPONSIVE MEDIA QUERIES (TABLETS & MOBILE OVERRIDES)
   ========================================================================== */
@media (max-width: 1080px) {
  .control-bar {
    grid-template-columns: 180px 1fr 220px 320px;
  }
}

@media (max-width: 980px) {
  .app-shell {
    width: calc(100vw - 32px);
    height: calc(100vh - 32px);
    margin: 16px;
  }
  .instrument.inspector-open {
    grid-template-columns: 170px 1fr 260px;
  }
  .input-module {
    padding: 20px 10px;
  }
  .control-bar {
    grid-template-columns: 160px 1fr 180px 290px;
  }
  .new-field {
    padding: 0 12px;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-y: auto;
    overflow-x: hidden;
  }
  .app-shell {
    width: calc(100vw - 24px);
    height: auto;
    min-height: calc(100vh - 24px);
    margin: 12px;
    gap: 12px;
  }
  .topbar {
    height: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding-bottom: 8px;
  }
  .topbar h1 {
    font-size: 18px;
  }
  .top-actions {
    width: 100%;
    justify-content: space-between;
    gap: 10px;
  }
  .text-button {
    padding: 6px 0;
  }
  .instrument, .instrument.inspector-open {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(360px, 60vh);
    border-bottom: 1px solid var(--border-subtle);
  }
  
  .input-rail {
    grid-row: 1;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }
  .rail-marker {
    display: none;
  }
  .input-module {
    border-right: 1px solid var(--border-subtle);
    border-bottom: 0;
    padding: 14px 4px;
    gap: 8px;
  }
  .input-module::before {
    left: 50%;
    top: auto;
    bottom: 0;
    width: 0%;
    height: 2.5px;
    transform: translateX(-50%);
  }
  .input-module:hover::before {
    width: 40%;
    height: 2.5px;
  }
  .input-module.active::before {
    width: 70%;
    height: 2.5px;
  }
  .input-module:last-child {
    border-right: 0;
  }
  .module-title {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .module-code {
    font-size: 7px;
  }
  .voice-bars {
    height: 20px;
  }
  .motion-glyph {
    font-size: 32px;
  }
  .vision-glyph {
    font-size: 26px;
  }
  .memory-grid {
    height: 24px;
    width: 44px;
    background-size: 8px 8px;
  }
  
  /* Canvas wraps the inspector on mobile when open */
  .instrument.inspector-open {
    grid-template-rows: auto minmax(320px, 50vh) auto;
  }
  .inspector {
    grid-row: 3;
    max-height: 400px;
    border-left: 0;
    border-top: 1px solid var(--border-subtle);
    animation: slideUp 0.5s var(--spring-ease);
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  
  .control-bar {
    height: auto;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border-subtle);
  }
  .field-readout, .waveform {
    height: 52px;
    border-bottom: 1px solid var(--border-subtle);
  }
  .waveform {
    border-right: 0;
  }
  .phrase {
    grid-column: 1 / -1;
    height: 56px;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 16px;
  }
  .bar-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    padding: 12px 16px;
  }
  .record-button, .new-field {
    flex: 1;
    justify-content: center;
    height: 40px;
  }

  /* Responsive HUD overlay layout */
  .hud-overlay {
    left: 12px;
    right: 12px;
    top: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 12px;
  }
  .confidence-wrap {
    grid-column: 1 / -1;
    border-left: 0;
    border-right: 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    padding: 8px 0;
    justify-content: space-between;
  }
  .fps-wrap {
    padding-left: 0;
    justify-content: flex-end;
    align-items: flex-end;
  }
}


/* Responsive precision layer and field-form controls */
.field-form-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.form-choice {
  min-width: 0;
  min-height: 74px;
  display: grid;
  place-items: center;
  gap: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.015);
  color: var(--ink-muted);
  font: 9px var(--font-mono);
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-fast);
}

.form-choice:hover,
.form-choice.selected {
  color: var(--ink-primary);
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 0 18px rgba(163, 130, 255, 0.12);
}

.form-choice.selected .form-icon { border-color: currentColor; }
.form-icon { width: 30px; height: 24px; display: block; position: relative; opacity: 0.8; }
.form-icon-flow::before, .form-icon-flow::after { content: ''; position: absolute; inset: 4px 0; border-top: 1px solid currentColor; border-radius: 50%; transform: skewY(-12deg); }
.form-icon-flow::after { inset: 11px 0 0; transform: skewY(12deg); }
.form-icon-orbit { border: 1px solid currentColor; border-radius: 50%; transform: scaleY(0.62) rotate(-18deg); }
.form-icon-orbit::after { content: ''; position: absolute; width: 5px; height: 5px; left: 12px; top: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.form-icon-stars { background: radial-gradient(circle at 15% 30%, currentColor 0 1px, transparent 2px), radial-gradient(circle at 70% 20%, currentColor 0 1px, transparent 2px), radial-gradient(circle at 45% 78%, currentColor 0 1px, transparent 2px), linear-gradient(32deg, transparent 48%, currentColor 49% 51%, transparent 52%); }
.form-icon-topo { border: 1px solid currentColor; border-radius: 50%; transform: scaleX(1.2); box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 5px currentColor; }

.style-sliders label { display: block; position: relative; color: var(--ink-muted); font-size: 10px; letter-spacing: 0.12em; margin-bottom: 20px; }
.style-sliders label:last-child { margin-bottom: 0; }
.style-sliders output { float: right; color: var(--ink-primary); font-weight: 500; }

html { min-height: 100%; }
body { min-height: 100dvh; }
.app-shell {
  width: min(calc(100vw - 32px), 1920px);
  height: min(calc(100dvh - 32px), 1100px);
  margin: 16px auto;
  min-height: 0;
}
.instrument { grid-template-columns: clamp(150px, 12vw, 210px) minmax(0, 1fr); }
.instrument.inspector-open { grid-template-columns: clamp(150px, 12vw, 210px) minmax(0, 1fr) clamp(280px, 22vw, 360px); }
.control-bar { grid-template-columns: minmax(150px, 0.7fr) minmax(140px, 1fr) minmax(190px, 1.1fr) minmax(250px, 1.35fr); }
.inspector { min-width: 0; }

@media (max-width: 1240px) and (min-width: 769px) {
  .top-actions { gap: 8px; }
  .text-button { padding-inline: 10px; }
  .instrument.inspector-open { grid-template-columns: 164px minmax(0, 1fr) 286px; }
  .control-bar { grid-template-columns: 150px minmax(110px, 1fr) 190px 270px; }
  .tracking-preview { right: 12px; bottom: 12px; width: 152px; }
}

@media (max-height: 780px) and (min-width: 769px) {
  .app-shell { height: calc(100dvh - 20px); margin-block: 10px; }
  .topbar { height: 48px; }
  .instrument { min-height: 0; }
  .input-module { padding-block: 12px; gap: 8px; }
  .inspector-section { padding-block: 16px; }
  .control-bar { height: 66px; }
  .tracking-preview { width: 142px; }
  .hud-overlay { top: 12px; left: 12px; }
}

@media (max-width: 768px) {
  .app-shell { width: calc(100vw - 20px); height: auto; min-height: calc(100dvh - 20px); margin: 10px; }
  .instrument, .instrument.inspector-open { grid-template-columns: 1fr; grid-template-rows: auto minmax(300px, 52dvh) auto; }
  .control-bar { grid-template-columns: 1fr 1fr; }
  .field-form-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .form-choice { min-height: 58px; font-size: 8px; }
  .form-icon { transform: scale(0.82); }
  .tracking-preview { display: block; }
}

@media (max-width: 430px) {
  .control-bar { grid-template-columns: 80px 1fr 140px; padding: 0 10px; gap: 10px; }
  .field-readout { border-right: none; }
  .phrase { padding-left: 10px; }
  .bar-actions { gap: 10px; }
  .new-field { display: none; }
  .tracking-preview { display: block; }
  .top-actions { flex-wrap: wrap; justify-content: flex-start; }
  .live-state { margin-left: auto; }
  .input-module { padding-inline: 2px; }
  .module-code { letter-spacing: 0; font-size: 6px; }
  .tracking-preview { width: 128px; }
  .field-form-options { gap: 4px; }
}
/* Inspector fit fix: keep every control reachable on short desktop viewports. */
.inspector {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}
.inspector-head {
  position: sticky;
  top: 0;
  z-index: 4;
  background: rgba(8, 8, 12, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.field-form-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-choice { min-height: 62px; padding: 8px 4px; }
.form-icon { transform: scale(0.82); }

@media (min-width: 769px) and (max-height: 920px) {
  .inspector-section { padding: 14px 16px; }
  .inspector-head { height: 48px; padding-inline: 16px; }
  .section-label { margin-bottom: 9px; }
  .settings-grid { gap: 10px; }
  .palette-options { gap: 7px; margin-top: 8px; }
  .swatch { height: 34px; margin-bottom: 5px; }
  .sliders label, .style-sliders label { margin-bottom: 12px; }
  .style-sliders label { margin-bottom: 10px; }
  .form-choice { min-height: 58px; font-size: 8px; }
  .form-section .section-label { margin-bottom: 8px; }
  .seed-row strong { margin-top: 4px; }
  .saved-fields { margin: 9px 0; }
}

/* Final layout pass: each workspace region owns its space and overlays only
   appear when their input mode is active. */
.app-shell {
  width: min(calc(100vw - 32px), 1920px);
  height: calc(100dvh - 32px);
  margin: 16px auto;
}

.instrument {
  grid-template-columns: clamp(132px, 11vw, 184px) minmax(0, 1fr);
}

.instrument.inspector-open {
  grid-template-columns: clamp(132px, 11vw, 184px) minmax(0, 1fr) clamp(272px, 20vw, 340px);
}

.canvas-wrap { isolation: isolate; }
.canvas-wrap > #webcamCanvas { display: none !important; }
.tracking-preview { display: none; }
.instrument:has(.input-module[data-mode="vision"].active) .tracking-preview { display: block; }

.hud-overlay { max-width: min(560px, calc(100% - 32px)); flex-wrap: wrap; row-gap: 8px; }
.input-wrap { min-width: 74px; }
.gesture-guide { color: var(--cyan); font-size: 8px; letter-spacing: .09em; opacity: .8; }
.phrase { gap: 5px; }

.control-bar {
  grid-template-columns: minmax(130px, .7fr) minmax(130px, 1fr) minmax(190px, 1.2fr) minmax(240px, 1.2fr);
}

@media (max-width: 1240px) and (min-width: 769px) {
  .instrument.inspector-open { grid-template-columns: 132px minmax(0, 1fr) 272px; }
  .input-module { padding-inline: 8px; }
  .module-code { font-size: 7px; letter-spacing: .02em; }
  .hud-overlay { gap: 10px; padding: 8px 10px; }
  .input-wrap { display: none; }
}

@media (max-width: 900px) and (min-width: 769px) {
  .instrument.inspector-open { grid-template-columns: 110px minmax(0, 1fr) 250px; }
  .input-module { gap: 8px; padding-block: 12px; }
  .module-code { display: none; }
  .control-bar { grid-template-columns: 120px 1fr 180px 230px; }
  .bar-actions { padding-inline: 10px; gap: 8px; }
  .new-field { font-size: 8px; }
}

/* ========================================================================== 
   20. EDITORIAL SITE SHELL
   ========================================================================== */
html { scroll-behavior: smooth; background: #050509; height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
body {
  width: 100%;
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: #050509;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: .22;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.08) 0 1px, transparent 1.5px),
    radial-gradient(circle at 70% 80%, rgba(255,255,255,.06) 0 1px, transparent 1.5px);
  background-size: 73px 67px, 91px 83px;
}
.welcome-overlay { display: none !important; }
.site-main { overflow: clip; }
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 76px;
  padding: 0 clamp(22px, 4vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
  color: #f6f5f2;
  background: linear-gradient(180deg, rgba(5,5,9,.88), rgba(5,5,9,0));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.site-brand {
  color: inherit;
  text-decoration: none;
  font: 500 15px var(--font-sans);
  letter-spacing: .3em;
}
.site-links { display: flex; align-items: center; gap: clamp(18px, 3vw, 48px); }
.site-links a {
  color: rgba(255,255,255,.62);
  text-decoration: none;
  font-size: 9px;
  letter-spacing: .17em;
  transition: color .25s ease;
}
.site-links a:hover { color: #fff; }
.site-links .nav-enter {
  color: #050509;
  background: #f4f3ef;
  padding: 12px 16px;
  border-radius: 999px;
}
.nav-enter span { margin-left: 9px; }

.landing-hero {
  position: relative;
  min-height: 100svh;
  padding: clamp(120px, 17vh, 190px) clamp(22px, 6vw, 104px) 58px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 74% 42%, rgba(94, 64, 255, .14), transparent 31%),
    radial-gradient(circle at 48% 100%, rgba(57, 226, 255, .08), transparent 35%),
    #050509;
}
.landing-hero::after {
  content: '';
  position: absolute;
  inset: auto 5vw 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.18), transparent);
}
.hero-particles, .section-particles { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-copy { position: relative; z-index: 3; max-width: 820px; }
.eyebrow, .section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.55);
  font-size: 9px;
  letter-spacing: .22em;
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 14px var(--lime); }
.hero-copy h1, .makers-heading h2, .story-hero h2, .experience-intro h2 {
  margin: 26px 0 24px;
  color: #f5f4f0;
  font-family: var(--font-sans);
  font-size: clamp(55px, 7.2vw, 128px);
  font-weight: 400;
  line-height: .88;
  letter-spacing: -.055em;
}
.hero-copy h1 em, .makers-heading h2 em, .story-hero h2 em, .experience-intro h2 em { color: var(--violet); font-weight: 400; }
.hero-copy > p {
  max-width: 610px;
  margin: 0;
  color: rgba(255,255,255,.58);
  font-family: var(--font-sans);
  font-size: clamp(15px, 1.25vw, 19px);
  line-height: 1.65;
}
.hero-actions { display: flex; align-items: center; gap: 28px; margin-top: 42px; }
.primary-link, .quiet-link { text-decoration: none; font-size: 10px; letter-spacing: .17em; }
.primary-link { display: inline-flex; gap: 34px; color: #07070a; background: var(--lime); padding: 17px 20px; border-radius: 999px; box-shadow: 0 0 50px rgba(194,249,60,.12); }
.quiet-link { color: rgba(255,255,255,.52); border-bottom: 1px solid rgba(255,255,255,.2); padding: 10px 0; }

.sound-sculpture {
  --rx: -12deg;
  --ry: -14deg;
  --rz: var(--scroll-rotate, 0deg);
  position: relative;
  z-index: 2;
  width: min(42vw, 650px);
  aspect-ratio: 1;
  justify-self: center;
  transform-style: preserve-3d;
  transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)) rotateZ(var(--rz));
  transition: transform .16s ease-out;
}
.sculpture-halo, .sculpture-core { position: absolute; inset: 50%; transform-style: preserve-3d; }
.sculpture-halo {
  width: 72%;
  height: 72%;
  margin: -36%;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 55px rgba(115,91,255,.1), inset 0 0 45px rgba(76,225,255,.05);
}
.halo-a { animation: sculptureSpin 15s linear infinite; border-color: rgba(163,130,255,.52); }
.halo-b { width: 58%; height: 58%; margin: -29%; transform: rotateX(68deg); animation: sculptureSpinB 12s linear infinite reverse; border-color: rgba(76,225,255,.45); }
.halo-c { width: 86%; height: 42%; margin: -21% -43%; transform: rotateY(68deg); animation: sculptureSpinC 18s linear infinite; border-color: rgba(194,249,60,.26); }
.sculpture-halo::before, .sculpture-halo::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 22px currentColor;
}
.sculpture-halo::before { left: 6%; top: 25%; }
.sculpture-halo::after { right: 10%; bottom: 20%; }
.sculpture-core {
  width: 27%;
  height: 27%;
  margin: -13.5%;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, rgba(255,255,255,.8), rgba(106,74,255,.38) 8%, rgba(11,9,28,.95) 50%);
  border: 1px solid rgba(255,255,255,.25);
  box-shadow: 0 0 80px rgba(122,87,255,.34), 0 0 180px rgba(76,225,255,.11);
}
.sculpture-core span { font-size: 10px; letter-spacing: .22em; }
.orbit-note { position: absolute; padding: 7px 10px; border: 1px solid rgba(255,255,255,.1); border-radius: 999px; color: rgba(255,255,255,.48); background: rgba(5,5,9,.65); font-size: 7px; letter-spacing: .16em; backdrop-filter: blur(8px); }
.note-a { top: 12%; left: 18%; }.note-b { right: 2%; top: 48%; }.note-c { bottom: 13%; left: 24%; }
@keyframes sculptureSpin { to { transform: rotate(360deg) rotateX(55deg); } }
@keyframes sculptureSpinB { to { transform: rotateX(68deg) rotateZ(360deg); } }
@keyframes sculptureSpinC { to { transform: rotateY(68deg) rotateZ(360deg); } }
.hero-index { position: absolute; z-index: 3; left: clamp(22px,6vw,104px); right: clamp(22px,6vw,104px); bottom: 28px; display: flex; justify-content: space-between; color: rgba(255,255,255,.35); font-size: 8px; letter-spacing: .2em; }

.makers-section, .story-section { position: relative; padding: 130px clamp(22px, 6vw, 104px); }
.makers-section { min-height: 110svh; background: #f0eee8; color: #121116; overflow: hidden; }
.makers-section .section-kicker { color: rgba(18,17,22,.52); }
.makers-heading { position: relative; z-index: 2; display: grid; grid-template-columns: 1.35fr .65fr; align-items: end; gap: 60px; margin: 58px 0 85px; }
.makers-heading h2 { margin: 0; color: #111016; font-size: clamp(52px, 6.4vw, 104px); }
.makers-heading h2 em { color: #6752d8; }
.makers-heading p { margin: 0; font-family: var(--font-sans); font-size: clamp(16px,1.5vw,21px); line-height: 1.6; color: rgba(18,17,22,.62); }
.maker-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(18,17,22,.16); border: 1px solid rgba(18,17,22,.16); }
.maker-card { position: relative; min-height: 430px; padding: clamp(28px,4vw,64px); background: rgba(240,238,232,.9); overflow: hidden; }
.maker-card::after { content: ''; position: absolute; width: 240px; height: 240px; border: 1px solid currentColor; border-radius: 50%; right: -100px; top: -100px; opacity: .08; transition: transform .7s var(--spring-ease); }
.maker-card:hover::after { transform: scale(1.4); }
.maker-number { color: rgba(18,17,22,.4); font-size: 8px; letter-spacing: .2em; }
.maker-monogram { margin: 54px 0 30px; width: 84px; height: 84px; display: grid; place-items: center; color: #f0eee8; font: 500 22px var(--font-sans); border-radius: 50%; background: #17151c; box-shadow: 14px 14px 0 #c7ff3e; }
.maker-card:nth-child(2) .maker-monogram { background: #6d55e9; box-shadow: 14px 14px 0 #50dfff; }
.maker-card h3 { margin: 0 0 15px; color: #111016; font: 500 clamp(30px,3vw,48px) var(--font-sans); letter-spacing: -.035em; }
.maker-card p { max-width: 570px; margin: 0 0 44px; color: rgba(18,17,22,.64); font: 16px/1.7 var(--font-sans); }
.maker-role { position: absolute; left: clamp(28px,4vw,64px); bottom: 35px; font-size: 8px; letter-spacing: .16em; color: rgba(18,17,22,.45); }

.story-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 170px;
  background: #08070d;
  overflow: hidden;
}

/* Story Hero — full-width centered intro */
.story-hero {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
  padding-bottom: 80px;
}
.story-hero h2 {
  font-size: clamp(56px,6.3vw,104px);
  margin: 50px 0 24px;
}
.story-hero__sub {
  max-width: 520px;
  margin: 0 auto 48px;
  color: rgba(255,255,255,.45);
  font: 17px/1.6 var(--font-sans);
  letter-spacing: .01em;
}
.story-meter {
  width: 100%;
  max-width: 420px;
  height: 1px;
  margin: 0 auto;
  background: rgba(255,255,255,.12);
}
.story-meter i {
  display: block;
  height: 100%;
  width: var(--story-progress, 0%);
  background: linear-gradient(90deg,var(--violet),var(--cyan),var(--lime));
  box-shadow: 0 0 16px var(--cyan);
  transition: width .15s linear;
}

/* Story Timeline — vertical line with gradient fill */
.story-timeline {
  position: relative;
  width: 100%;
  max-width: 1200px;
  padding: 0 clamp(22px,6vw,104px);
}
.story-timeline__line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255,255,255,.08);
  transform: translateX(-50%);
}
.story-timeline__fill {
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--pressure-cyan), var(--pressure-orange), var(--pressure-red));
  box-shadow: 0 0 18px var(--pressure-cyan);
  transition: height .12s linear;
}

/* Story Card — glassmorphism card with large number */
.story-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-bottom: 80px;
  align-items: center;
}
.story-card:last-child { margin-bottom: 0; }

/* Left-aligned cards — content on the left half */
.story-card .story-card__content {
  grid-column: 1;
  grid-row: 1;
  padding: clamp(36px,4vw,60px);
  padding-right: clamp(48px,6vw,100px);
  text-align: right;
}
.story-card .story-card__number {
  grid-column: 2;
  grid-row: 1;
  justify-self: start;
  padding-left: clamp(32px,5vw,80px);
}

/* Right-aligned cards — content on the right half */
.story-card--right .story-card__content {
  grid-column: 2;
  text-align: left;
  padding-right: clamp(36px,4vw,60px);
  padding-left: clamp(48px,6vw,100px);
}
.story-card--right .story-card__number {
  grid-column: 1;
  justify-self: end;
  padding-left: 0;
  padding-right: clamp(32px,5vw,80px);
}

/* Large decorative parallax number */
.story-card__number {
  font: 500 clamp(96px,12vw,180px) var(--font-sans);
  letter-spacing: -.06em;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(255,255,255,.1);
  will-change: transform;
  transition: transform .1s linear, -webkit-text-stroke-color .5s ease;
  user-select: none;
}
.story-card.is-active .story-card__number {
  -webkit-text-stroke-color: rgba(0,229,255,.3);
}

/* Card content area */
.story-card__badge {
  display: inline-block;
  color: var(--pressure-cyan);
  font: 500 9px/1 var(--font-mono);
  letter-spacing: .22em;
  padding: 7px 14px;
  border: 1px solid rgba(0,229,255,.2);
  border-radius: 999px;
  margin-bottom: 22px;
  transition: all .5s var(--spring-ease);
}
.story-card.is-active .story-card__badge {
  border-color: rgba(0,229,255,.5);
  box-shadow: 0 0 20px rgba(0,229,255,.15);
}
.story-card h3 {
  max-width: 520px;
  margin: 0 0 16px;
  color: rgba(243,242,238,.7);
  font: 400 clamp(26px,2.8vw,44px)/1.08 var(--font-sans);
  letter-spacing: -.035em;
  transition: color .5s ease;
}
.story-card.is-active h3 { color: #f3f2ee; }

/* Right-aligned cards need left-margin auto for max-width h3 */
.story-card--right h3 { margin-left: 0; }
.story-card:not(.story-card--right) h3 { margin-left: auto; }

.story-card p {
  max-width: 520px;
  margin: 0;
  color: rgba(255,255,255,.4);
  font: 15px/1.75 var(--font-sans);
  transition: color .5s ease;
}
.story-card.is-active p { color: rgba(255,255,255,.6); }
.story-card--right p { margin-left: 0; }
.story-card:not(.story-card--right) p { margin-left: auto; }

/* Subtle glow behind active card */
.story-card::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 24px;
  background: radial-gradient(ellipse at center, rgba(0,229,255,.04), transparent 70%);
  opacity: 0;
  transition: opacity .6s ease;
  pointer-events: none;
  z-index: -1;
}
.story-card.is-active::after { opacity: 1; }


.experience-intro { padding: 135px clamp(22px,6vw,104px) 60px; background: #050509; }
.experience-intro h2 { max-width: 1000px; font-size: clamp(58px,7vw,112px); }
.experience-intro > p { max-width: 640px; color: rgba(255,255,255,.52); font: 17px/1.65 var(--font-sans); }
.app-shell {
  width: min(calc(100vw - 40px), 1840px);
  height: min(900px, calc(100svh - 38px));
  min-height: 640px;
  margin: 0 auto 140px;
  animation: none;
}
.app-shell .topbar { flex: 0 0 58px; }
.input-rail {
  grid-template-columns: 32px minmax(0,1fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
}
.rail-marker { padding-top: 18px; }
.input-module { min-height: 0; padding: 14px 10px; gap: 10px; }
.module-code { white-space: nowrap; }

.site-footer { min-height: 360px; padding: 90px clamp(22px,6vw,104px) 38px; display: grid; grid-template-columns: 1.2fr .9fr .5fr; align-items: start; gap: 40px; border-top: 1px solid rgba(255,255,255,.1); background: #c7ff3e; color: #0b0a0e; }
.footer-mark { font: 500 clamp(44px,6vw,96px)/.9 var(--font-sans); letter-spacing: -.05em; }
.site-footer p { max-width: 360px; margin: 0; font: 18px/1.5 var(--font-sans); }
.site-footer a { justify-self: end; color: inherit; text-decoration: none; font-size: 9px; letter-spacing: .18em; border-bottom: 1px solid rgba(0,0,0,.35); padding-bottom: 7px; }
.site-footer > span { grid-column: 1 / -1; align-self: end; font-size: 8px; letter-spacing: .2em; opacity: .58; }

/* ── Reveal animations ─────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(60px); filter: blur(8px); transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal.is-visible { opacity: 1; transform: translateY(0); filter: blur(0); }

/* Directional slide variants */
.reveal-left { opacity: 0; transform: translateX(-60px); filter: blur(8px); transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-left.is-visible { opacity: 1; transform: translateX(0); filter: blur(0); }

.reveal-right { opacity: 0; transform: translateX(60px); filter: blur(8px); transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-right.is-visible { opacity: 1; transform: translateX(0); filter: blur(0); }

/* Scale-zoom reveal for headings */
.reveal-scale { opacity: 0; transform: scale(0.92); filter: blur(8px); transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), filter 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.reveal-scale.is-visible { opacity: 1; transform: scale(1); filter: blur(0); }

/* Staggered reveal — delay based on data-delay attribute */
.reveal[data-delay="0"] { transition-delay: 0s; }
.reveal[data-delay="1"] { transition-delay: .12s; }
.reveal[data-delay="2"] { transition-delay: .24s; }
.reveal[data-delay="3"] { transition-delay: .36s; }
.reveal[data-delay="4"] { transition-delay: .48s; }

@media (max-width: 900px) {
  .site-nav { height: 64px; }
  .site-links > a:not(.nav-enter) { display: none; }
  .landing-hero { grid-template-columns: 1fr; padding-top: 126px; padding-bottom: 70px; }
  .hero-copy { z-index: 4; }
  .hero-copy h1 { font-size: clamp(52px,14vw,86px); }
  .sound-sculpture { position: absolute; right: -18vw; bottom: 0; width: 75vw; opacity: .65; }
  .makers-heading { grid-template-columns: 1fr; gap: 32px; margin-bottom: 55px; }
  .maker-grid { grid-template-columns: 1fr; }
  .story-card { grid-template-columns: 1fr; }
  .story-card .story-card__content,
  .story-card--right .story-card__content { grid-column: 1; text-align: left; padding: 32px 0; }
  .story-card .story-card__number,
  .story-card--right .story-card__number { grid-column: 1; grid-row: 1; justify-self: start; padding: 0; }
  .story-card--right .story-card__content { grid-row: 2; }
  .story-timeline__line { display: none; }
  .reveal-left, .reveal-right { transform: translateY(60px); }
  .reveal-left.is-visible, .reveal-right.is-visible { transform: translateY(0); }
  .app-shell { height: auto; min-height: 780px; margin-bottom: 80px; }
  .site-footer { grid-template-columns: 1fr; min-height: 420px; }
  .site-footer a { justify-self: start; }
}

@media (max-width: 560px) {
  .site-brand { font-size: 12px; }
  .site-links .nav-enter { padding: 10px 12px; font-size: 7px; }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .makers-section, .story-section { padding-block: 95px; }
  .maker-card { min-height: 460px; }
  .story-card { margin-bottom: 50px; }
  .story-card__number { font-size: 72px !important; }
  .experience-intro { padding-top: 90px; }
  .app-shell { width: calc(100vw - 20px); }
}

@media (max-width: 768px) {
  .input-rail { grid-template-rows: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale { opacity: 1; transform: none; transition: none; }
  .sculpture-halo { animation-play-state: paused; }
}

/* Repair legacy mojibake glyphs without depending on file encoding. */
.motion-glyph, .vision-glyph { font-size: 0; }

/* ==========================================================================
   18. MOBILE WARNING OVERLAY
   ========================================================================== */
.mobile-warning-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.mobile-warning-card {
  background: var(--bg-obsidian);
  border: 1px solid var(--border-active);
  padding: 40px 30px;
  border-radius: 16px;
  text-align: center;
  max-width: 340px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  animation: modalEnter 1.2s var(--spring-ease) forwards;
}

.mobile-warning-card h2 {
  font-family: var(--font-sans);
  font-size: 24px;
  color: var(--ink-primary);
  margin: 0 0 16px;
}

.mobile-warning-card p {
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.mobile-warning-card .begin-button {
  width: 100%;
}

.motion-glyph::after { content: '∞'; font-size: 42px; }
.vision-glyph::after { content: '⊙'; font-size: 34px; }
.close-inspector, .close-how { font-size: 0; }
.close-inspector::after, .close-how::after { content: '×'; font-size: 24px; }
.new-field > span[aria-hidden="true"] { font-size: 0; }
.new-field > span[aria-hidden="true"]::after { content: '→'; font-size: 13px; }

/* ========================================================================== 
   21. PRESSURE DROP COLOR + SCROLL SYSTEM
   ========================================================================== */
:root {
  --pressure-black: #0A0A0F;
  --pressure-panel: #1A1A2E;
  --pressure-red: #FF2D55;
  --pressure-orange: #FF9500;
  --pressure-cyan: #00E5FF;
  --pressure-text: #E8E8F0;
  --energy-accent: var(--pressure-cyan);
  --nav-progress: 0%;
}

.site-nav {
  isolation: isolate;
  overflow: hidden;
  border-bottom: 1px solid rgba(232,232,240,.1);
  background: rgba(10,10,15,.7);
  box-shadow: 0 8px 40px rgba(0,0,0,.16);
}
.site-nav::before {
  content: '';
  position: absolute;
  z-index: -2;
  inset: 0 auto 0 0;
  width: var(--nav-progress);
  background: linear-gradient(90deg, var(--pressure-cyan) 0%, var(--pressure-orange) 52%, var(--pressure-red) 100%);
  opacity: .78;
  box-shadow: 12px 0 38px color-mix(in srgb, var(--energy-accent) 40%, transparent);
}
.site-nav::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: rgba(10,10,15,.46);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.site-nav > * { position: relative; z-index: 1; }
.site-brand { font-size: 17px; }
.site-links a { color: rgba(232,232,240,.78); font-size: 11px; font-weight: 500; text-shadow: 0 1px 10px rgba(0,0,0,.72); }
.site-links .nav-enter { color: var(--pressure-black); background: var(--pressure-text); text-shadow: none; }
.site-links .nav-enter { min-width: 176px; display: inline-flex; justify-content: center; white-space: nowrap; }

.ambient-light {
  position: fixed;
  z-index: 8;
  left: 0;
  top: 0;
  width: clamp(220px, 30vw, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(76px);
  mix-blend-mode: screen;
  opacity: .12;
  will-change: transform, background, opacity;
  transition: background .6s ease, opacity .6s ease;
}
.ambient-light-a { background: radial-gradient(circle, var(--pressure-cyan), transparent 68%); }
.ambient-light-b { background: radial-gradient(circle, var(--pressure-red), transparent 68%); }

.landing-hero,
.story-section,
.experience-intro { background-color: var(--pressure-black); }
.landing-hero {
  background:
    radial-gradient(circle at 74% 42%, rgba(255,45,85,.11), transparent 31%),
    radial-gradient(circle at 48% 100%, rgba(0,229,255,.08), transparent 35%),
    var(--pressure-black);
}
.hero-copy h1,
.story-hero h2,
.experience-intro h2 { color: var(--pressure-text); }
.hero-copy h1 em,
.story-hero h2 em,
.experience-intro h2 em { color: var(--pressure-red); }
.primary-link { color: var(--pressure-black); background: var(--pressure-cyan); box-shadow: 0 0 50px rgba(0,229,255,.15); }
.eyebrow i { background: var(--energy-accent); box-shadow: 0 0 18px var(--energy-accent); }

.halo-a { border-color: rgba(0,229,255,.58); color: var(--pressure-cyan); }
.halo-b { border-color: rgba(255,149,0,.52); color: var(--pressure-orange); }
.halo-c { border-color: rgba(255,45,85,.45); color: var(--pressure-red); }
.sculpture-core {
  background: radial-gradient(circle at 36% 30%, rgba(232,232,240,.86), color-mix(in srgb, var(--energy-accent) 60%, transparent) 9%, rgba(10,10,15,.98) 52%);
  box-shadow: 0 0 80px color-mix(in srgb, var(--energy-accent) 34%, transparent), 0 0 180px rgba(0,229,255,.08);
}

.makers-section { background: var(--pressure-panel); color: var(--pressure-text); }
.makers-section .section-kicker { color: rgba(232,232,240,.55); }
.makers-heading h2 { color: var(--pressure-text); }
.makers-heading h2 em { color: var(--pressure-orange); }
.makers-heading p { color: rgba(232,232,240,.62); }
.maker-grid { background: rgba(232,232,240,.12); border-color: rgba(232,232,240,.12); }
.maker-card { background: rgba(10,10,15,.7); }
.maker-card h3 { color: var(--pressure-text); }
.maker-card p { color: rgba(232,232,240,.62); }
.maker-number, .maker-role { color: rgba(232,232,240,.46); }
.maker-monogram { color: var(--pressure-black); background: var(--pressure-cyan); box-shadow: 14px 14px 0 var(--pressure-orange); }
.maker-card:nth-child(2) .maker-monogram { background: var(--pressure-orange); box-shadow: 14px 14px 0 var(--pressure-red); }
.maker-card::after { border-color: var(--energy-accent); opacity: .16; }

.story-section { background: #0A0A0F; }
.story-meter i { background: linear-gradient(90deg,var(--pressure-cyan),var(--pressure-orange),var(--pressure-red)); }
.story-timeline__fill { background: linear-gradient(180deg,var(--pressure-cyan),var(--pressure-orange),var(--pressure-red)); box-shadow: 0 0 18px var(--pressure-cyan); }
.story-card__badge { color: var(--pressure-cyan); border-color: rgba(0,229,255,.2); }
.story-card.is-active .story-card__badge { border-color: rgba(0,229,255,.5); box-shadow: 0 0 20px rgba(0,229,255,.15); }
.story-card.is-active .story-card__number { -webkit-text-stroke-color: color-mix(in srgb, var(--pressure-cyan) 30%, transparent); }
.story-card.is-active::after { background: radial-gradient(ellipse at center, color-mix(in srgb, var(--pressure-cyan) 4%, transparent), transparent 70%); }

.instrument,
.control-bar { background: var(--pressure-black); border-color: rgba(232,232,240,.1); }
.input-rail { background: rgba(26,26,46,.55); }
.inspector { background: rgba(26,26,46,.9); }
.canvas-wrap { background: var(--pressure-black); }
.canvas-cursor { box-shadow: 0 0 0 1px rgba(232,232,240,.7), 0 0 0 4px rgba(232,232,240,.1), 0 0 28px 10px color-mix(in srgb, var(--energy-accent) 42%, transparent); }
.live-dot { background: var(--energy-accent); box-shadow: 0 0 12px var(--energy-accent); }
.live-dot::after { border-color: var(--energy-accent); }
.confidence-bar-inner { background: linear-gradient(90deg,var(--pressure-cyan),var(--pressure-orange),var(--pressure-red)); box-shadow: 0 0 8px var(--energy-accent); }
.swatch.prism { background: linear-gradient(135deg,var(--pressure-cyan),var(--pressure-orange) 50%,var(--pressure-red)); }
.swatch.violet { background: linear-gradient(135deg,var(--pressure-orange),var(--pressure-red)); }
.swatch.lime { background: linear-gradient(135deg,#007f91,var(--pressure-cyan)); }
.swatch.custom { background: linear-gradient(135deg,var(--custom-1, #00e5ff),var(--custom-2, #ff9500) 50%,var(--custom-3, #ff2d55)); color: var(--custom-1, #00e5ff); }
.custom-toggle input[type="checkbox"]:checked + .toggle-slider { background: linear-gradient(135deg,var(--pressure-cyan),var(--pressure-red)); }

.site-footer { background: var(--pressure-red); color: var(--pressure-text); }
.site-footer a { color: inherit; border-color: rgba(232,232,240,.5); }

@media (max-width: 560px) {
  .site-brand { font-size: 13px; }
  .site-links .nav-enter { min-width: 132px; font-size: 8px; }
  .ambient-light { width: 58vw; filter: blur(54px); opacity: .1; }
}
