/* ============================================================
   RESET & CSS VARIABLES
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg:          #080b10;
  --bg-2:        #0d1219;
  --bg-3:        #111827;
  --border:      rgba(0, 210, 255, 0.15);

  --blue:        #00d2ff;
  --blue-dim:    rgba(0, 210, 255, 0.55);
  --orange:      #ff6b35;
  --orange-dim:  rgba(255, 107, 53, 0.55);

  --text:        #c0d4e4;
  --text-dim:    #4e6070;

  --glow-blue:   0 0 12px rgba(0, 210, 255, 0.45);
  --glow-orange: 0 0 12px rgba(255, 107, 53, 0.45);

  --font-display: 'Orbitron', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;

  --pad-w: 280px;
  --pad-h: 460px;
  --handle: 36px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-mono);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.65;
}

/* ============================================================
   SCANLINES
   ============================================================ */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,0.035) 2px,
    rgba(0,0,0,0.035) 4px
  );
}

/* ============================================================
   PAGE WRAPPER
   ============================================================ */
.page-wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 0 26px;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.site-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: var(--glow-blue);
  line-height: 1;
}
.site-title span { color: var(--blue); }

.site-url {
  font-size: 0.68rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: 3px;
}

.status-badge {
  font-family: var(--font-display);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 6px 13px;
  border: 1px solid var(--orange);
  color: var(--orange);
  border-radius: 2px;
  text-shadow: var(--glow-orange);
  box-shadow: var(--glow-orange);
  animation: badge-pulse 3.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.55; }
}

/* ============================================================
   WELCOME
   ============================================================ */
.welcome-section {
  padding: 56px 0 44px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.welcome-line {
  font-size: 1rem;
  line-height: 2;
}
.welcome-line strong { color: var(--blue); font-style: normal; }
.welcome-line.muted  { color: var(--text-dim); }

.welcome-cta {
  margin-top: 22px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--blue);
  text-shadow: var(--glow-blue);
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  color: #fff;
  margin-bottom: 28px;
}
.heading-dim {
  color: var(--text-dim);
  font-weight: 400;
}

/* ============================================================
   DEMO SECTION
   ============================================================ */
.demo-section {
  padding: 52px 0;
  border-bottom: 1px solid var(--border);
}

.demo-layout {
  display: flex;
  gap: 40px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* ── PAD COLUMN ── */
.pad-column {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pad-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pan-label {
  font-family: var(--font-display);
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  writing-mode: vertical-rl;
}
.pan-left  { transform: rotate(180deg); }

/* ── XY PAD ── */
.xy-pad {
  position: relative;
  width: var(--pad-w);
  height: var(--pad-h);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: crosshair;
  overflow: hidden;
  box-shadow:
    0 0 24px rgba(0, 210, 255, 0.06),
    inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.xy-pad canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: block;
}

/* Distance axis labels overlaid inside the pad */
.pad-dist-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.5rem;
  letter-spacing: 0.16em;
  color: rgba(78, 96, 112, 0.7);
  pointer-events: none;
  z-index: 2;
}
.pad-dist-top    { top: 8px; }
.pad-dist-bottom { bottom: 8px; }

/* ── HANDLES ── */
.handle {
  position: absolute;
  width: var(--handle);
  height: var(--handle);
  transform: translate(-50%, -50%);
  cursor: grab;
  z-index: 10;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.handle:active { cursor: grabbing; }

.handle-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  transition: transform 0.12s, box-shadow 0.12s;
}
.handle:active .handle-ring { transform: scale(1.18); }

.handle-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  position: relative;
  z-index: 1;
}

.handle-label {
  position: absolute;
  top: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-size: 0.46rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  white-space: nowrap;
  pointer-events: none;
}

/* Gun = orange */
.gun-handle {
  color: var(--orange);
}
.gun-handle .handle-ring {
  box-shadow: 0 0 10px rgba(255, 107, 53, 0.7),
              inset 0 0 6px rgba(255, 107, 53, 0.15);
}

/* Target = blue */
.target-handle {
  color: var(--blue);
}
.target-handle .handle-ring {
  box-shadow: var(--glow-blue),
              inset 0 0 6px rgba(0, 210, 255, 0.15);
}

/* ── LEGEND ── */
.pad-legend {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 2px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.6rem;
  color: var(--text-dim);
  letter-spacing: 0.06em;
}

.legend-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
}
.gun-pip    { border-color: var(--orange); box-shadow: var(--glow-orange); }
.target-pip { border-color: var(--blue);   box-shadow: var(--glow-blue);   }

/* ── SOUND SELECTORS ── */
.sound-selectors {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.sound-sel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  gap: 12px;
}
.sound-sel-row + .sound-sel-row {
  border-top: 1px solid var(--border);
}

.sound-sel-label {
  font-family: var(--font-display);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  flex-shrink: 0;
  width: 52px;
}

.sound-sel-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.sel-name {
  font-size: 0.72rem;
  color: #fff;
  letter-spacing: 0.05em;
  text-align: center;
  min-width: 90px;
}

.sel-arrow {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.6rem;
  width: 22px;
  height: 22px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.sel-arrow:hover {
  color: var(--blue);
  border-color: var(--blue-dim);
}

/* ── CONTROLS COLUMN ── */
.controls-column {
  flex: 1 1 200px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Readout */
.readout-panel { display: flex; flex-direction: column; gap: 12px; }

.readout-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 14px 16px;
}

.readout-title {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 10px;
}
.gun-color    { color: var(--orange); }
.target-color { color: var(--blue);   }

.readout-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  padding: 2px 0;
}
.rk { color: var(--text-dim); letter-spacing: 0.08em; }
.rv { color: #fff; font-weight: 700; }

/* Fire button */
.fire-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 22px 0;
  background: transparent;
  border: 2px solid var(--orange);
  border-radius: 4px;
  color: var(--orange);
  font-family: var(--font-display);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  box-shadow: var(--glow-orange);
  text-shadow: var(--glow-orange);
}
.fire-btn:hover {
  background: rgba(255, 107, 53, 0.09);
  box-shadow: 0 0 28px rgba(255, 107, 53, 0.65);
}
.fire-btn:active,
.fire-btn.firing {
  background: rgba(255, 107, 53, 0.22);
  transform: scale(0.96);
}
.fire-icon { font-size: 1.5rem; line-height: 1; }
.fire-text {
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.22em;
}

/* Volume */
.vol-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vol-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}
.slider-track {
  display: flex;
  align-items: center;
  gap: 10px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: var(--glow-blue);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: var(--glow-blue);
  border: none;
  cursor: pointer;
}

.vol-num {
  font-size: 0.7rem;
  color: var(--text-dim);
  width: 28px;
  text-align: right;
}

/* ============================================================
   CONTACT SECTION
   ============================================================ */
.contact-section { padding: 52px 0 64px; }

.contact-card { max-width: 520px; }

.contact-desc {
  color: var(--text-dim);
  font-size: 0.8rem;
  line-height: 1.75;
  margin-bottom: 28px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-family: var(--font-display);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--text-dim);
}

.field-input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field-input:focus {
  border-color: var(--blue-dim);
  box-shadow: var(--glow-blue);
}
.field-input::placeholder { color: var(--text-dim); }

/* Custom checkbox */
.check-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.55;
}
.check-label input[type="checkbox"] { display: none; }

.check-box {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--bg-2);
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.check-label input:checked + .check-box {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: var(--glow-blue);
}
.check-label input:checked + .check-box::after {
  content: '✓';
  font-size: 0.62rem;
  color: #000;
  font-weight: bold;
  line-height: 1;
}

.submit-btn {
  align-self: flex-start;
  background: transparent;
  border: 1px solid var(--blue);
  border-radius: 3px;
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 14px 28px;
  cursor: pointer;
  box-shadow: var(--glow-blue);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
.submit-btn:hover {
  background: rgba(0, 210, 255, 0.1);
  box-shadow: 0 0 22px rgba(0, 210, 255, 0.55);
}
.submit-btn:active { transform: scale(0.97); }

.form-feedback {
  font-size: 0.76rem;
  color: var(--blue);
  letter-spacing: 0.06em;
  min-height: 20px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 0;
  text-align: center;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-credit { font-size: 0.58rem; }

.footer-link {
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.08em;
}
.footer-link:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 680px) {
  :root {
    --pad-w: 240px;
    --pad-h: 390px;
    --handle: 40px;
  }

  .demo-layout {
    flex-direction: column;
    align-items: center;
  }

  .controls-column {
    width: 100%;
    max-width: var(--pad-w);
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
