:root {
  color-scheme: light;
  --bg: #ff00ff;
  --bg-2: #00ffff;
  --ink: #ff0080;
  --ink-soft: #00ff80;
  --card: #ffff00;
  --card-2: #ff80ff;
  --accent: #00ff00;
  --accent-2: #ff00ff;
  --accent-3: #00ffff;
  --muted: #ff8000;
  --shadow: 0 24px 60px rgba(255, 0, 255, 0.8), 0 0 100px rgba(0, 255, 255, 0.5);
  --radius: 50px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: repeating-linear-gradient(
    45deg,
    #ff00ff 0%,
    #00ffff 10%,
    #ffff00 20%,
    #00ff00 30%,
    #ff00ff 40%
  );
  background-size: 400% 400%;
  position: relative;
  overflow-x: hidden;
  animation: gradient-shift 8s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  z-index: -1;
  filter: blur(80px);
  opacity: 0.9;
  animation: crazy-drift 3s ease-in-out infinite;
}

body::before {
  top: -10vw;
  right: -12vw;
  background: radial-gradient(circle, rgba(0, 255, 0, 0.9), rgba(255, 0, 255, 0.8));
  animation: crazy-spin 5s linear infinite;
}

body::after {
  bottom: -12vw;
  left: -10vw;
  background: radial-gradient(circle, rgba(255, 255, 0, 0.9), rgba(0, 255, 255, 0.8));
  animation-delay: -2s;
  animation: crazy-spin-reverse 4s linear infinite;
}

@keyframes crazy-drift {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(100px, -50px) scale(1.2);
  }
  50% {
    transform: translate(-80px, 80px) scale(0.8);
  }
  75% {
    transform: translate(60px, 120px) scale(1.1);
  }
}

@keyframes crazy-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes crazy-spin-reverse {
  from {
    transform: rotate(360deg);
  }
  to {
    transform: rotate(0deg);
  }
}

.app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 24px 96px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  animation: wobble-in 1.5s ease-out both;
}

@keyframes wobble-in {
  0% {
    opacity: 0;
    transform: translateY(-100px) rotate(-15deg) scale(0.5);
  }
  50% {
    transform: translateY(20px) rotate(5deg) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

.hero {
  display: grid;
  gap: 16px;
}

.theme-selector {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.theme-selector label {
  font-weight: 600;
  font-size: 0.95rem;
}

.theme-dropdown {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--muted);
  background: var(--card);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-dropdown:hover {
  border-color: var(--accent-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-dropdown:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(242, 106, 46, 0.2);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 0.75rem;
  color: var(--accent-2);
  font-weight: 700;
}

.hero h1 {
  font-family: "Fraunces", "Georgia", serif;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.05;
  max-width: 18ch;
  text-shadow:
    3px 3px 0 #00ffff,
    -3px -3px 0 #ff00ff,
    6px 6px 20px rgba(255, 255, 0, 0.8);
  animation: text-dance 2s ease-in-out infinite;
}

@keyframes text-dance {
  0%, 100% {
    transform: rotate(-2deg);
  }
  50% {
    transform: rotate(2deg);
  }
}

.hero p {
  font-size: 1.1rem;
  max-width: 58ch;
  color: var(--ink-soft);
}

.studio {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.deck {
  background: linear-gradient(135deg, #ff00ff 0%, #00ffff 50%, #ffff00 100%);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow:
    var(--shadow),
    0 0 50px rgba(0, 255, 0, 0.6),
    inset 0 0 30px rgba(255, 255, 255, 0.3);
  border: 5px dashed #ff0080;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
  overflow: hidden;
  animation: float-crazy 3s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes float-crazy {
  0%, 100% {
    transform: translateY(0px) rotateX(0deg);
  }
  25% {
    transform: translateY(-15px) rotateX(5deg);
  }
  50% {
    transform: translateY(0px) rotateX(0deg);
  }
  75% {
    transform: translateY(15px) rotateX(-5deg);
  }
}

.deck:nth-child(2) {
  animation-delay: 1s;
  background: linear-gradient(135deg, #00ff00 0%, #ff00ff 50%, #00ffff 100%);
  border-color: #00ff00;
  animation: spin-deck 6s linear infinite;
}

@keyframes spin-deck {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.05);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

.deck--reverse {
  background: linear-gradient(160deg, #fff4e6 0%, #ffe7d1 60%, #ffe0cf 100%);
  border-color: rgba(242, 106, 46, 0.3);
}

.deck-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.deck h2 {
  font-size: 1.5rem;
}

.sub {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(42, 157, 143, 0.14);
  color: #1a5c54;
}

.badge--muted {
  background: rgba(203, 184, 162, 0.4);
  color: #6b5c4d;
}

.badge--warn {
  background: rgba(209, 73, 91, 0.16);
  color: #8c2e3b;
}

.badge--ready {
  background: rgba(242, 106, 46, 0.16);
  color: #8a3912;
}

.record-stage {
  display: flex;
  align-items: center;
  gap: 20px;
}

.record-lamp {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 0, 0, 0.8);
  box-shadow:
    inset 0 0 10px rgba(255, 255, 0, 0.8),
    0 0 30px rgba(255, 0, 0, 0.9);
  transition: 0.3s ease;
  animation: rainbow-lamp 2s linear infinite;
}

@keyframes rainbow-lamp {
  0% { background: #ff0000; }
  14% { background: #ff8800; }
  28% { background: #ffff00; }
  42% { background: #00ff00; }
  57% { background: #00ffff; }
  71% { background: #0088ff; }
  85% { background: #ff00ff; }
  100% { background: #ff0000; }
}

.record-lamp.is-on {
  background: var(--accent-3);
  box-shadow:
    0 0 50px rgba(255, 0, 255, 0.9),
    0 0 100px rgba(0, 255, 255, 0.8),
    0 0 150px rgba(255, 255, 0, 0.7);
  animation: mega-pulse 0.5s ease-in-out infinite;
}

@keyframes mega-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(2);
  }
}

.meter {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  align-items: end;
  width: 100%;
}

.meter span {
  display: block;
  height: 16px;
  background: linear-gradient(180deg, #ff00ff, #00ffff, #ffff00, #00ff00);
  background-size: 100% 400%;
  border-radius: 999px;
  opacity: 0.9;
  transform-origin: bottom;
  animation: color-shift 2s linear infinite;
  box-shadow: 0 0 10px rgba(255, 0, 255, 0.8);
}

@keyframes color-shift {
  0% { background-position: 0% 0%; }
  100% { background-position: 0% 100%; }
}

.meter.is-recording span {
  animation: bounce-rainbow 0.9s ease-in-out infinite, color-shift 2s linear infinite;
  animation-delay: calc(var(--i) * -0.12s);
  opacity: 1;
}

@keyframes bounce-rainbow {
  0%, 100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(2.5);
  }
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(45deg, #ff00ff, #00ffff, #ffff00, #00ff00);
  background-size: 400% 400%;
  color: #000;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  animation: button-pulse 3s ease-in-out infinite;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  border: 3px solid #ff0080;
}

@keyframes button-pulse {
  0%, 100% {
    background-position: 0% 50%;
    transform: scale(1);
  }
  50% {
    background-position: 100% 50%;
    transform: scale(1.05);
  }
}

.btn:hover {
  transform: translateY(-5px) rotate(5deg) scale(1.15);
  box-shadow: 0 15px 40px rgba(255, 0, 255, 0.8), 0 0 50px rgba(0, 255, 255, 0.6);
  animation: button-crazy 0.5s ease-in-out infinite;
}

@keyframes button-crazy {
  0%, 100% {
    transform: translateY(-5px) rotate(-5deg) scale(1.15);
  }
  50% {
    transform: translateY(-8px) rotate(5deg) scale(1.2);
  }
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn--primary {
  background: var(--accent-2);
  color: #fff;
}

.btn--accent {
  background: var(--accent);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  border: 1px dashed rgba(26, 26, 26, 0.18);
}

.audio-wrap {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 241, 220, 0.6);
  border-radius: 16px;
  border: 1px solid rgba(203, 184, 162, 0.4);
  opacity: 0;
  transform: translateY(6px);
  transition: 0.3s ease;
}

.audio-wrap.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.label {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

audio {
  width: 100%;
}

.error {
  min-height: 1.2em;
  color: #a13a2f;
  font-size: 0.9rem;
}

.reverse-pad {
  background: #fffaf1;
  border-radius: 20px;
  padding: 24px;
  position: relative;
  min-height: 160px;
  display: grid;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(242, 106, 46, 0.2);
}

.swirl {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px dashed rgba(242, 106, 46, 0.5);
  top: -40px;
  right: -20px;
  animation: spin 12s linear infinite;
}

.swirl--small {
  width: 90px;
  height: 90px;
  top: auto;
  bottom: -24px;
  left: -18px;
  border-color: rgba(42, 157, 143, 0.5);
  animation-duration: 9s;
}

.reverse-copy {
  position: relative;
  z-index: 1;
  font-weight: 600;
  color: var(--ink-soft);
  max-width: 30ch;
}

.hint {
  font-size: 0.9rem;
  color: var(--ink-soft);
  background: rgba(42, 157, 143, 0.12);
  padding: 10px 14px;
  border-radius: 12px;
}

.notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.note-card {
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(203, 184, 162, 0.4);
  box-shadow: 0 10px 24px rgba(40, 30, 20, 0.08);
  animation: float-in 800ms ease-out both;
}

.note-card:nth-child(2) {
  animation-delay: 160ms;
}

.note-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.note-card p {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

@keyframes bounce {
  0%,
  100% {
    transform: scaleY(0.35);
  }
  50% {
    transform: scaleY(1.1);
  }
}

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

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-30px, 20px);
  }
}

@keyframes float-in {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes lift {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .app {
    padding-top: 56px;
  }

  .hero h1 {
    font-size: clamp(2rem, 6vw, 2.8rem);
  }

  .deck {
    padding: 22px;
  }
}

/* New Features Styling */
.trim-controls {
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  display: grid;
  gap: 12px;
}

.trim-sliders {
  display: grid;
  gap: 12px;
}

.trim-input {
  display: grid;
  gap: 6px;
}

.trim-input label {
  font-size: 0.9rem;
  font-weight: 600;
}

.trim-input input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--muted);
  outline: none;
  -webkit-appearance: none;
}

.trim-input input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.trim-input input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  border: none;
}

.btn--small {
  padding: 8px 16px;
  font-size: 0.9rem;
}

.btn--mini {
  padding: 6px 12px;
  font-size: 0.85rem;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.effect-control {
  display: grid;
  gap: 8px;
}

.effect-control input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: var(--muted);
  outline: none;
  -webkit-appearance: none;
}

.effect-control input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  cursor: pointer;
}

.effect-control input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-2);
  cursor: pointer;
  border: none;
}

.effect-value {
  text-align: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
}

.speed-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.waveform-canvas {
  width: 100%;
  height: 80px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.1);
  position: absolute;
  bottom: 10px;
  left: 0;
  z-index: 1;
}

.deck--chain {
  background: linear-gradient(135deg, var(--card) 0%, var(--card-2) 100%);
}

.chain-list {
  min-height: 120px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 16px;
  display: grid;
  gap: 10px;
}

.chain-empty {
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
  padding: 20px;
}

.chain-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  gap: 12px;
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.chain-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chain-item-number {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
  min-width: 30px;
}

.chain-item-details {
  display: grid;
  gap: 2px;
}

.chain-item-type {
  font-weight: 600;
  font-size: 0.9rem;
}

.chain-item-duration {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.chain-item-actions {
  display: flex;
  gap: 6px;
}

.chain-item-btn {
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.chain-item-btn:hover {
  transform: scale(1.1);
}

.chain-item-btn--danger {
  background: var(--accent-3);
}

/* History Section */
.deck--history {
  background: linear-gradient(135deg, var(--card-2) 0%, var(--card) 100%);
}

.history-list {
  min-height: 120px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  margin-bottom: 16px;
  display: grid;
  gap: 10px;
}

.history-empty {
  color: var(--ink-soft);
  text-align: center;
  font-style: italic;
  padding: 20px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  gap: 12px;
  animation: slide-in 0.3s ease-out;
}

.history-item-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-item-icon {
  font-size: 1.5rem;
}

.history-item-details {
  display: grid;
  gap: 2px;
}

.history-item-time {
  font-weight: 600;
  font-size: 0.9rem;
}

.history-item-date {
  font-size: 0.75rem;
  color: var(--ink-soft);
}

.history-item-duration {
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.history-item-actions {
  display: flex;
  gap: 6px;
}

.history-item-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent-2);
  color: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.history-item-btn:hover {
  transform: scale(1.1);
}

.history-item-btn--danger {
  background: var(--accent-3);
}

/* Features Section */
.features-section {
  margin: 40px 0;
  padding: 40px 0;
}

.features-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 40px;
  font-family: "Fraunces", "Georgia", serif;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: float-in 0.6s ease-out both;
}

.feature-card:nth-child(2) { animation-delay: 0.1s; }
.feature-card:nth-child(3) { animation-delay: 0.2s; }
.feature-card:nth-child(4) { animation-delay: 0.3s; }
.feature-card:nth-child(5) { animation-delay: 0.4s; }
.feature-card:nth-child(6) { animation-delay: 0.5s; }
.feature-card:nth-child(7) { animation-delay: 0.6s; }
.feature-card:nth-child(8) { animation-delay: 0.7s; }

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  text-align: center;
}

.feature-card h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  text-align: center;
}

.feature-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-card li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  font-size: 0.95rem;
  line-height: 1.4;
}

.feature-card li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
  font-size: 1.1rem;
}
