/* Tweaks panel */
.tweak-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 260px;
  z-index: 1000;
  background: rgba(20, 13, 28, 0.92);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 18px;
  font-family: var(--font-body);
  color: var(--text);
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.6);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
.tweak-panel.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.tweak-panel .tp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.tweak-panel .tp-close {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
}
.tweak-panel .tp-close:hover { background: var(--surface-2); color: var(--text); }
.tweak-panel .tp-section { margin-bottom: 16px; }
.tweak-panel .tp-section:last-child { margin-bottom: 0; }
.tweak-panel label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 8px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.tweak-panel .tp-val { color: var(--accent); text-transform: none; letter-spacing: 0; }
.tweak-panel .tp-swatches { display: flex; gap: 8px; }
.tweak-panel .tp-sw {
  flex: 1;
  height: 32px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s;
}
.tweak-panel .tp-sw:hover { transform: translateY(-2px); }
.tweak-panel .tp-sw.active { border-color: white; }
.tweak-panel input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--surface-2);
  border-radius: 999px;
  outline: none;
}
.tweak-panel input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tweak-panel input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.tweak-panel .tp-segmented {
  display: flex;
  background: var(--surface-2);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.tweak-panel .tp-segmented button {
  flex: 1;
  padding: 6px 8px;
  font-size: 11px;
  color: var(--text-dim);
  border-radius: 6px;
  font-family: var(--font-mono);
  text-transform: lowercase;
}
.tweak-panel .tp-segmented button.active {
  background: var(--accent);
  color: #1a0f33;
}

/* Animation intensity scale */
body.low-motion * {
  animation-duration: 0.001s !important;
  animation-iteration-count: 1 !important;
}
body.low-motion .marquee-track { animation-duration: 80s !important; }
body.hi-motion .bg-mesh::before,
body.hi-motion .bg-mesh::after { animation-duration: 12s !important; }

/* Accessibility: respect prefers-reduced-motion (WCAG 2.2 - 2.3.3) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile tap highlight: keep subtle, not jarring */
html { -webkit-tap-highlight-color: transparent; }
a, button, [role="button"] { -webkit-tap-highlight-color: rgba(255, 255, 255, 0.08); }

/* Mobile burger: minimum 44x44 tap target (WCAG 2.5.8) */
.mobile-burger {
  min-width: 44px;
  min-height: 44px;
}

/* Hero h1 cascade entrance — CSS-only replacement for the v4.js decrypt effect.
   Each line fades + rises 18px, staggered. GPU-composited, no JS, no DOM mutation. */
.hero h1 .line {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.85s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.85s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.hero.is-ready h1 .line { opacity: 1; transform: translateY(0); }
.hero.is-ready h1 .line:nth-child(1) { transition-delay: 0.20s; }
.hero.is-ready h1 .line:nth-child(2) { transition-delay: 0.35s; }
.hero.is-ready h1 .line:nth-child(3) { transition-delay: 0.50s; }

/* Respect reduced motion — skip the rise, keep just the fade */
@media (prefers-reduced-motion: reduce) {
  .hero h1 .line { transform: none; transition: opacity 0.3s linear; }
}
