/* opensource.day - Garage Skeuomorphic Workshop Theme */
/* Colors: #c9a55a #2c2821 #8a7e6f #f4ede2 #5a5142 #b5573a #e8dfd1 #3d3730 */
/* Fonts: Space Mono, IBM Plex Mono, Inter */

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

:root {
  --walnut: #2c2821;
  --brass: #c9a55a;
  --parchment: #e8dfd1;
  --cream: #f4ede2;
  --oxide: #8a7e6f;
  --dark-wood: #3d3730;
  --shadow: #5a5142;
  --solder: #6b6355;
  --rust: #b5573a;
  --gap-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--walnut);
  color: var(--parchment);
  overflow-x: hidden;
  line-height: 1.6;
}

.svg-filters { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Noise overlay */
.noise-overlay {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Label tape styling */
.label-tape {
  display: inline-block;
  background: var(--cream);
  color: var(--walnut);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  padding: 4px 12px;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ========== HERO SECTION ========== */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(180deg, var(--walnut) 0%, var(--dark-wood) 100%);
  padding: 60px 40px;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 80px;
  max-width: 1100px;
  width: 100%;
}

.hero-gauge-container { flex-shrink: 0; }

.hero-gauge {
  width: 280px;
  height: 280px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
}

.gauge-needle {
  transform-origin: 150px 150px;
  transition: transform 2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gauge-led-row {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.led {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--shadow);
  border: 2px solid var(--dark-wood);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
  position: relative;
}

.led::after {
  content: attr(data-label);
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: var(--oxide);
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.led-red.active { background: #e04040; box-shadow: 0 0 8px #e04040, inset 0 1px 2px rgba(255,200,200,0.3); }
.led-amber.active { background: #d4a030; box-shadow: 0 0 8px #d4a030, inset 0 1px 2px rgba(255,220,150,0.3); }
.led-green.active { background: #40b040; box-shadow: 0 0 8px #40b040, inset 0 1px 2px rgba(200,255,200,0.3); }

.hero-text {
  position: relative;
  z-index: 2;
}

.hero-title {
  font-family: 'Space Mono', monospace;
  font-size: 80px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 0.95;
  color: var(--parchment);
  text-transform: uppercase;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--oxide);
  max-width: 400px;
  margin-bottom: 24px;
  line-height: 1.6;
}

.hero-terminal {
  background: var(--dark-wood);
  border: 1px solid var(--shadow);
  border-radius: 4px;
  padding: 12px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: var(--brass);
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.terminal-prompt { color: var(--rust); }
.terminal-cursor {
  animation: blink 1s step-end infinite;
  color: var(--brass);
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--oxide);
  border-bottom: 2px solid var(--oxide);
  transform: rotate(45deg);
  animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce { 0%,100%{transform:rotate(45deg) translateY(0)} 50%{transform:rotate(45deg) translateY(6px)} }

.scroll-label {
  color: #6b6355;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: var(--oxide);
}

/* ========== WORKBENCH SECTION ========== */
.workbench-section {
  position: relative;
  padding: 80px 40px;
  background: var(--dark-wood);
}

.section-header {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-bottom: 50px;
}

.section-title {
  font-family: 'Space Mono', monospace;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--parchment);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.section-description {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: var(--oxide);
  max-width: 600px;
  margin: 0 auto;
}

.module-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 3px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--walnut);
  box-shadow: var(--gap-shadow);
  border-radius: 4px;
  padding: 3px;
}

.module-card {
  background: linear-gradient(180deg, #4a4338 0%, var(--dark-wood) 100%);
  border: 1px solid var(--shadow);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.module-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}

.module-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--walnut);
  border-bottom: 1px solid var(--shadow);
}

.module-id {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--oxide);
  letter-spacing: 0.1em;
}

.module-leds { display: flex; gap: 6px; }

.led-mini {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--shadow);
}

.led-mini.active.green { background: #40b040; box-shadow: 0 0 4px #40b040; }
.led-mini.active.amber { background: #d4a030; box-shadow: 0 0 4px #d4a030; }

.led-mini.blink { animation: ledBlink 1.5s ease-in-out infinite; }
@keyframes ledBlink { 0%,100%{opacity:1} 50%{opacity:0.3} }

.module-label {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brass);
  padding: 12px 16px 4px;
  text-transform: uppercase;
}

.module-body { padding: 8px 16px 16px; }

.module-icon {
  width: 60px;
  height: 60px;
  margin-bottom: 12px;
}
.module-icon svg { width: 100%; height: 100%; }

.module-description {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--oxide);
  line-height: 1.6;
}

.module-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--shadow);
  background: rgba(0,0,0,0.1);
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.toggle-track {
  width: 36px;
  height: 18px;
  background: var(--walnut);
  border-radius: 9px;
  border: 1px solid var(--shadow);
  padding: 2px;
  transition: background 0.3s ease;
  position: relative;
}

.toggle-thumb {
  width: 12px;
  height: 12px;
  background: var(--oxide);
  border-radius: 50%;
  transition: transform 0.3s ease, background 0.3s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.toggle-switch.active .toggle-track { background: var(--brass); border-color: var(--brass); }
.toggle-switch.active .toggle-thumb { transform: translateX(18px); background: var(--cream); }

.toggle-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--oxide);
  text-transform: uppercase;
}

.module-drawer-indicator {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: var(--oxide);
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: color 0.2s;
}
.module-drawer-indicator:hover { color: var(--brass); }

.module-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--walnut);
}

.module-drawer.open { max-height: 200px; }

.drawer-content {
  padding: 16px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.drawer-stat { flex: 1; min-width: 80px; }

.stat-label {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--oxide);
  margin-bottom: 4px;
  text-transform: uppercase;
}

.stat-value {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--brass);
}

/* ========== TIMELINE / OSCILLOSCOPE SECTION ========== */
.timeline-section {
  position: relative;
  padding: 80px 40px;
  background: var(--walnut);
}

.oscilloscope-frame {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto 50px;
  background: var(--dark-wood);
  border: 3px solid var(--shadow);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.05);
}

.oscilloscope-screen {
  position: relative;
  background: #0a1a0a;
  border: 2px solid var(--shadow);
  border-radius: 4px;
  height: 300px;
  overflow: hidden;
}

#oscilloscopeCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.oscilloscope-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0,255,0,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,255,0,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}

.oscilloscope-readout {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.readout-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(0,255,0,0.5);
}

.readout-value {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: rgba(0,255,0,0.8);
}

.oscilloscope-controls {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 16px;
}

.knob-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.rotary-knob { cursor: pointer; }

.knob-body {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5a5142 0%, #3d3730 100%);
  border: 2px solid var(--shadow);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knob-indicator {
  width: 3px;
  height: 16px;
  background: var(--brass);
  border-radius: 1px;
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: center 19px;
}

.knob-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--oxide);
}

.timeline-events {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
  padding-left: 30px;
  border-left: 2px solid var(--shadow);
}

.timeline-event {
  position: relative;
  padding: 0 0 40px 30px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-event.visible {
  opacity: 1;
  transform: translateY(0);
}

.event-year {
  font-family: 'Space Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--brass);
  margin-bottom: 4px;
}

.event-dot {
  position: absolute;
  left: -37px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--rust);
  border: 2px solid var(--dark-wood);
  box-shadow: 0 0 6px var(--rust);
}

.event-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--oxide);
  line-height: 1.6;
  max-width: 500px;
}

/* ========== PATCH BAY SECTION ========== */
.patchbay-section {
  position: relative;
  padding: 80px 40px;
  background: linear-gradient(180deg, var(--dark-wood) 0%, var(--walnut) 100%);
}

.patchbay-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}

.patch-port {
  background: var(--walnut);
  border: 1px solid var(--shadow);
  border-radius: 4px;
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.patch-port:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.port-jack {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--dark-wood) 30%, var(--shadow) 70%);
  border: 3px solid var(--oxide);
  margin: 0 auto 16px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.patch-port:hover .port-jack {
  border-color: var(--brass);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 8px var(--brass);
}

.port-label {
  display: block;
  font-family: 'Space Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--brass);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.port-description {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: var(--oxide);
  line-height: 1.6;
}

/* ========== FOOTER ========== */
.footer-section {
  position: relative;
  padding: 40px;
  background: var(--walnut);
  border-top: 2px solid var(--shadow);
}

.footer-content {
  position: relative;
  z-index: 2;
  max-width: 1000px;
  margin: 0 auto;
}

.footer-rack {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--shadow);
  flex-wrap: wrap;
  gap: 20px;
}

.power-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
}

.power-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--oxide);
}

.footer-info { text-align: center; flex: 1; min-width: 200px; }

.footer-text {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--parchment);
}

.footer-text-small {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--oxide);
  margin-top: 4px;
}

.footer-voltmeter { text-align: right; }

.voltmeter-display {
  background: #0a1a0a;
  border: 1px solid var(--shadow);
  border-radius: 3px;
  padding: 6px 12px;
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.voltmeter-value {
  font-family: 'Space Mono', monospace;
  font-size: 20px;
  color: #40b040;
}

.voltmeter-unit {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(0,255,0,0.5);
}

.voltmeter-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--oxide);
  text-align: center;
  margin-top: 4px;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
}

.footer-copyright {
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--oxide);
}

.footer-year {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--oxide);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .hero-content { flex-direction: column; gap: 40px; text-align: center; }
  .hero-title { font-size: 48px; }
  .hero-subtitle { margin: 0 auto 24px; }
  .section-title { font-size: 32px; }
  .module-grid { grid-template-columns: 1fr; }
  .footer-rack { flex-direction: column; text-align: center; }
  .footer-voltmeter { text-align: center; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .oscilloscope-screen { height: 200px; }
}
