/* Musical Toys Hub - CRT/VHS Aesthetic */

:root {
  --bg-dark: #0c0c10;
  --bg-card: #141418;
  --text-primary: #c8d8c8;
  --text-secondary: #606868;
  --accent-purple: #cc66ff;
  --accent-cyan: #00ffcc;
  --accent-pink: #ff66aa;
  --accent-red: #ff3333;
  --accent-orange: #ff9933;
  --border-color: rgba(255, 255, 255, 0.12);
}

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

body {
  font-family: 'IBM Plex Mono', monospace;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
}

/* Layout */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
  position: relative;
  z-index: 1;
}

/* Header - Left aligned, structured */
.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 60px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  gap: 40px;
  flex-wrap: wrap;
}

.header-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-label {
  font-size: 11px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.title {
  font-family: 'VT323', monospace;
  font-size: 4rem;
  font-weight: 400;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  line-height: 1;
}

.header-meta {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.disclaimer {
  font-size: 11px;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* Toys List */
.toys-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 80px;
}

.toy-item {
  --toy-color: var(--accent-cyan);
  --toy-color-bg: rgba(0, 255, 204, 0.03);
  display: grid;
  grid-template-columns: 48px 72px 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s, background 0.1s;
}

.toy-item:first-child {
  border-radius: 2px 2px 0 0;
}

.toy-item:last-child {
  border-radius: 0 0 2px 2px;
}

.toy-item:hover {
  border-color: var(--toy-color);
  background: var(--toy-color-bg);
}

.toy-item:hover .toy-title {
  color: var(--toy-color);
}

.toy-item:hover .toy-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.toy-num {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: var(--text-secondary);
  opacity: 0.4;
}

.toy-icon {
  width: 72px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.toy-info {
  min-width: 0;
}

.toy-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 4px;
  transition: color 0.1s;
}

.toy-description {
  font-size: 12px;
  color: var(--text-secondary);
}

.toy-about {
  display: inline-block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
  cursor: pointer;
  transition: color 0.1s;
  position: relative;
  z-index: 2;
}

.toy-about::before {
  content: '// ';
}

.toy-about:hover {
  color: var(--toy-color);
}

.toy-arrow {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: var(--toy-color);
  opacity: 0;
  transition: opacity 0.1s, transform 0.1s;
}

/* Icon styles */
.binary-icon {
  background: rgba(0, 20, 20, 0.6);
}

.binary-text {
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  color: var(--accent-cyan);
  letter-spacing: 2px;
  text-shadow: 0 0 6px rgba(0, 255, 204, 0.4);
  animation: binary-flicker 4s ease-in-out infinite;
}

@keyframes binary-flicker {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.6; }
  75% { opacity: 1; }
}

.stranger-icon {
  background: rgba(20, 0, 0, 0.6);
}

.arp-text {
  font-family: 'VT323', monospace;
  font-size: 24px;
  color: var(--accent-red);
  letter-spacing: 4px;
  text-shadow: 0 0 8px rgba(255, 51, 51, 0.5);
  animation: arp-pulse 2s ease-in-out infinite;
}

@keyframes arp-pulse {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 51, 51, 0.5); }
  50% { text-shadow: 0 0 14px rgba(255, 51, 51, 0.8), 0 0 4px rgba(255, 51, 51, 0.3); }
}

.drum-icon {
  background: rgba(20, 15, 10, 0.6);
}

.drum-dots {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.drum-dots span {
  width: 14px;
  height: 14px;
  background: var(--accent-orange);
  border-radius: 2px;
  animation: drum-tap 1.6s ease-in-out infinite;
}

.drum-dots span:nth-child(2) { animation-delay: 0.2s; }
.drum-dots span:nth-child(3) { animation-delay: 0.4s; }
.drum-dots span:nth-child(4) { animation-delay: 0.6s; }

@keyframes drum-tap {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.metronome-icon {
  background: rgba(0, 20, 20, 0.6);
}

.metro-bpm {
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  color: var(--accent-cyan);
  font-weight: 700;
  animation: metro-tick 1s ease-in-out infinite;
  transform-origin: center top;
}

@keyframes metro-tick {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

.circle-icon {
  background: rgba(0, 15, 20, 0.6);
}

.circle-note {
  font-family: 'VT323', monospace;
  font-size: 28px;
  color: var(--accent-cyan);
  text-shadow: 0 0 8px rgba(0, 255, 204, 0.4);
  animation: note-breathe 3s ease-in-out infinite;
}

@keyframes note-breathe {
  0%, 100% { transform: scale(1); text-shadow: 0 0 8px rgba(0, 255, 204, 0.4); }
  50% { transform: scale(1.1); text-shadow: 0 0 14px rgba(0, 255, 204, 0.6); }
}

.gravity-icon {
  background: rgba(15, 5, 20, 0.6);
  flex-direction: column;
  gap: 8px;
}

.gravity-ball {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  animation: bounce 1s ease-in-out infinite;
}

.gravity-bar {
  width: 36px;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-orange));
  border-radius: 2px;
  transform: rotate(-15deg);
}

@keyframes bounce {
  0%, 100% { transform: translateY(-6px); }
  50% { transform: translateY(2px); }
}

.spiro-icon {
  background: rgba(15, 5, 20, 0.6);
}

.spiro-circle {
  width: 36px;
  height: 36px;
  border: 2px solid transparent;
  border-radius: 50%;
  background:
    conic-gradient(from 0deg, var(--accent-red), var(--accent-orange), #eab308, #22c55e, var(--accent-cyan), #3b82f6, var(--accent-purple), var(--accent-pink), var(--accent-red));
  -webkit-mask:
    radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
  mask:
    radial-gradient(farthest-side, transparent calc(100% - 2px), #fff calc(100% - 2px));
  animation: spin 4s linear infinite;
}

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

/* Tone Matrix icon */
.matrix-icon {
  background: rgba(0, 20, 20, 0.6);
}

.matrix-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  width: 28px;
  height: 28px;
}

.matrix-grid::before,
.matrix-grid::after {
  content: '';
  grid-column: 1 / -1;
  height: 0;
}

/* Use box-shadow trick for grid cells */
.matrix-grid {
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 1px;
  /* Offset to visually center the box-shadow pattern within the icon */
  transform: translate(-12px, -12px);
  box-shadow:
    8px 0 0 var(--accent-cyan),
    16px 0 0 rgba(0, 255, 204, 0.3),
    24px 0 0 var(--accent-cyan),
    0 8px 0 rgba(0, 255, 204, 0.3),
    8px 8px 0 var(--accent-cyan),
    16px 8px 0 var(--accent-cyan),
    24px 8px 0 rgba(0, 255, 204, 0.3),
    0 16px 0 var(--accent-cyan),
    8px 16px 0 rgba(0, 255, 204, 0.3),
    16px 16px 0 rgba(0, 255, 204, 0.3),
    24px 16px 0 var(--accent-cyan),
    0 24px 0 rgba(0, 255, 204, 0.3),
    8px 24px 0 var(--accent-cyan),
    16px 24px 0 var(--accent-cyan),
    24px 24px 0 rgba(0, 255, 204, 0.3);
}

/* String Garden icon */
.string-icon {
  background: rgba(20, 15, 0, 0.6);
}

.string-lines {
  display: flex;
  gap: 4px;
  height: 32px;
  align-items: stretch;
}

.string-lines {
  width: 2px;
  height: 32px;
  background: #f59e0b;
  box-shadow:
    6px 0 0 #ef4444,
    12px 0 0 #eab308,
    18px 0 0 #22c55e,
    24px 0 0 #3b82f6;
  opacity: 0.8;
  animation: string-sway 3s ease-in-out infinite;
}

@keyframes string-sway {
  0%, 100% { transform: translateX(-12px) scaleY(1) rotate(-1deg); }
  50% { transform: translateX(-12px) scaleY(0.95) rotate(1deg); }
}

/* Cell Auto icon */
.cellauto-icon {
  background: rgba(0, 15, 5, 0.6);
}

.cellauto-grid {
  width: 5px;
  height: 5px;
  background: transparent;
  border-radius: 1px;
  /* Offset to visually center the box-shadow pattern within the icon */
  transform: translate(-17px, -10px);
  /* Generation 1: glider + scattered */
  box-shadow:
    7px 0 0 #22c55e,
    14px 7px 0 #22c55e,
    0 14px 0 #22c55e,
    7px 14px 0 #22c55e,
    14px 14px 0 #22c55e,
    28px 0 0 rgba(34, 197, 94, 0.4),
    35px 7px 0 #22c55e,
    21px 14px 0 rgba(34, 197, 94, 0.3),
    28px 21px 0 #22c55e,
    35px 21px 0 rgba(34, 197, 94, 0.4),
    7px 21px 0 rgba(34, 197, 94, 0.3),
    21px 7px 0 rgba(34, 197, 94, 0.25);
  animation: cellauto-gen 4s step-end infinite;
}

@keyframes cellauto-gen {
  /* Gen 1 */
  0% {
    box-shadow:
      7px 0 0 #22c55e,
      14px 7px 0 #22c55e,
      0 14px 0 #22c55e,
      7px 14px 0 #22c55e,
      14px 14px 0 #22c55e,
      28px 0 0 rgba(34, 197, 94, 0.4),
      35px 7px 0 #22c55e,
      21px 14px 0 rgba(34, 197, 94, 0.3),
      28px 21px 0 #22c55e,
      35px 21px 0 rgba(34, 197, 94, 0.4),
      7px 21px 0 rgba(34, 197, 94, 0.3),
      21px 7px 0 rgba(34, 197, 94, 0.25);
  }
  /* Gen 2: glider steps, cells shift */
  25% {
    box-shadow:
      0 7px 0 #22c55e,
      14px 7px 0 rgba(34, 197, 94, 0.3),
      7px 14px 0 #22c55e,
      14px 14px 0 #22c55e,
      7px 21px 0 #22c55e,
      28px 7px 0 #22c55e,
      35px 0 0 rgba(34, 197, 94, 0.4),
      21px 14px 0 #22c55e,
      28px 21px 0 rgba(34, 197, 94, 0.3),
      35px 14px 0 rgba(34, 197, 94, 0.25),
      21px 0 0 rgba(34, 197, 94, 0.4),
      35px 21px 0 #22c55e;
  }
  /* Gen 3: more evolution */
  50% {
    box-shadow:
      14px 7px 0 #22c55e,
      0 14px 0 rgba(34, 197, 94, 0.3),
      7px 21px 0 #22c55e,
      14px 21px 0 #22c55e,
      14px 14px 0 #22c55e,
      28px 0 0 #22c55e,
      35px 7px 0 rgba(34, 197, 94, 0.4),
      21px 7px 0 #22c55e,
      28px 14px 0 #22c55e,
      35px 21px 0 rgba(34, 197, 94, 0.3),
      21px 21px 0 rgba(34, 197, 94, 0.25),
      7px 7px 0 rgba(34, 197, 94, 0.4);
  }
  /* Gen 4: cycle back */
  75% {
    box-shadow:
      7px 14px 0 #22c55e,
      14px 14px 0 rgba(34, 197, 94, 0.3),
      7px 21px 0 #22c55e,
      14px 21px 0 #22c55e,
      0 21px 0 #22c55e,
      35px 0 0 rgba(34, 197, 94, 0.4),
      28px 7px 0 #22c55e,
      21px 14px 0 rgba(34, 197, 94, 0.4),
      35px 14px 0 #22c55e,
      28px 21px 0 rgba(34, 197, 94, 0.25),
      21px 0 0 #22c55e,
      35px 7px 0 rgba(34, 197, 94, 0.3);
  }
}

/* Sound Bath icon */
.bath-icon {
  background: rgba(10, 15, 25, 0.6);
}

.bath-wave {
  width: 40px;
  height: 20px;
  background: transparent;
  border: 2px solid var(--accent-cyan);
  border-radius: 50% 50% 0 0;
  border-bottom: none;
  opacity: 0.7;
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% {
    transform: translateY(2px) scaleY(1);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-2px) scaleY(0.9);
    opacity: 0.5;
  }
}

/* Pendulum Waves icon */
.pendulum-icon {
  background: rgba(20, 15, 0, 0.6);
  overflow: hidden;
}

.pendulum-set {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  height: 36px;
  padding-top: 2px;
}

.pendulum-set span {
  display: block;
  width: 2px;
  height: 28px;
  background: linear-gradient(to bottom, rgba(245, 158, 11, 0.3), rgba(245, 158, 11, 0.6));
  transform-origin: center top;
  position: relative;
  animation: pendulum-home-swing 2s ease-in-out infinite;
}

.pendulum-set span::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.5);
}

.pendulum-set span:nth-child(1) { animation-delay: 0s; }
.pendulum-set span:nth-child(2) { animation-delay: 0.15s; }
.pendulum-set span:nth-child(3) { animation-delay: 0.3s; }
.pendulum-set span:nth-child(4) { animation-delay: 0.45s; }
.pendulum-set span:nth-child(5) { animation-delay: 0.6s; }

@keyframes pendulum-home-swing {
  0%, 100% { transform: rotate(25deg); }
  50% { transform: rotate(-25deg); }
}

/* Color variants for toy items */
.toy-item--red {
  --toy-color: var(--accent-red);
  --toy-color-bg: rgba(255, 51, 51, 0.03);
}

.toy-item--orange {
  --toy-color: var(--accent-orange);
  --toy-color-bg: rgba(255, 153, 51, 0.03);
}

.toy-item--amber {
  --toy-color: #f59e0b;
  --toy-color-bg: rgba(245, 158, 11, 0.03);
}

.toy-item--green {
  --toy-color: #22c55e;
  --toy-color-bg: rgba(34, 197, 94, 0.03);
}

.toy-item--blue {
  --toy-color: #3b82f6;
  --toy-color-bg: rgba(59, 130, 246, 0.03);
}

.toy-item--purple {
  --toy-color: var(--accent-purple);
  --toy-color-bg: rgba(204, 102, 255, 0.03);
}

.toy-item--pink {
  --toy-color: var(--accent-pink);
  --toy-color-bg: rgba(255, 102, 170, 0.03);
}

.toy-item--cyan {
  --toy-color: var(--accent-cyan);
  --toy-color-bg: rgba(6, 182, 212, 0.03);
}

/* Sound Wave Drawing icon */
.sound-wave-drawing-icon {
  background: rgba(0, 15, 20, 0.6);
}

.sound-wave-drawing-icon .swd-wave {
  display: block;
  width: 40px;
  height: 24px;
  background: linear-gradient(90deg,
    #06b6d4 0%, #06b6d4 100%
  );
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 14'%3E%3Cpath d='M0 7 Q6 0 12 7 Q18 14 24 7 Q30 0 36 7 Q42 14 48 7' fill='none' stroke='white' stroke-width='3'/%3E%3C/svg%3E");
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 14'%3E%3Cpath d='M0 7 Q6 0 12 7 Q18 14 24 7 Q30 0 36 7 Q42 14 48 7' fill='none' stroke='white' stroke-width='3'/%3E%3C/svg%3E");
  -webkit-mask-size: cover;
  mask-size: cover;
  clip-path: inset(0 100% 0 0);
  animation: swd-draw 3s ease-in-out infinite;
}

@keyframes swd-draw {
  0% { clip-path: inset(0 100% 0 0); opacity: 0.5; }
  40% { clip-path: inset(0 0% 0 0); opacity: 1; }
  60% { clip-path: inset(0 0% 0 0); opacity: 1; }
  100% { clip-path: inset(0 0% 0 0); opacity: 0.5; }
}

/* Footer */
.footer {
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}

.footer-content {
  display: flex;
  gap: 60px;
}

.footer-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-label {
  font-size: 10px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.6;
}

.footer a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.1s;
}

.footer a:hover {
  color: var(--accent-cyan);
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 40px 16px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }

  .header-meta {
    text-align: left;
  }

  .title {
    font-size: 3rem;
  }

  .toy-item {
    grid-template-columns: 36px 56px 1fr auto;
    gap: 12px;
    padding: 16px;
  }

  .toy-num {
    font-size: 18px;
  }

  .toy-icon {
    width: 56px;
    height: 40px;
  }

  .toy-title {
    font-size: 14px;
  }

  .toy-description {
    font-size: 11px;
  }

  .toy-arrow {
    display: none;
  }

  .footer-content {
    flex-direction: column;
    gap: 24px;
  }
}
