/* =================================================================
   style.css - Music Virgin | musicvirgin.com
   BPM Counter main stylesheet
================================================================= */

/* --- Variables --------------------------------------------------- */
:root {
  --bg:        #0a0a0c;
  --surface:   #111116;
  --panel:     #17171e;
  --border:    #2a2a38;
  --accent:    #e63946;
  --accent2:   #ff6b35;
  --gold:      #c9a84c;
  --text:      #cccccc;
  --muted:     #aaaaaa;
  --white:     #f4f4f8;
  --glow:      rgba(230, 57, 70, 0.35);
  --eq-idle:   #2a3a2a;
  --eq-active: #39ff14;
  --eq-glow:   rgba(57, 255, 20, 0.65);
}

/* --- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* --- Body --------------------------------------------------------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' 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: 0;
  opacity: 0.45;
}

/* --- Header ------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 64px;
  background: rgba(10,10,12,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--white);
  text-decoration: none;
}
.logo span { color: var(--accent); }

/* --- Hamburger ---------------------------------------------------- */
.menu-wrap { position: relative; }

.hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  background: none;
  border: none;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.28s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Dropdown nav ------------------------------------------------- */
.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 190px;
  background: #15151c;
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.75);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.nav-dropdown.open { opacity: 1; transform: translateY(0); pointer-events: all; }
.nav-dropdown a {
  display: block;
  padding: 0.85rem 1.2rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
}
.nav-dropdown a:last-child { border-bottom: none; }
.nav-dropdown a:hover { background: var(--panel); color: var(--accent); padding-left: 1.6rem; }
.nav-dropdown a.nav-active { color: var(--accent); background: var(--panel); padding-left: 1.6rem; border-left: 2px solid var(--accent); }

/* --- Main --------------------------------------------------------- */
main {
  flex: 1;
  position: relative;
  z-index: 1;
  padding: 3rem 2rem 4rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* --- Title row: heading left, 300x250 ad right ------------------- */
.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.8rem; /* tightened - was 3rem, causing gap above analyser */
}
.title-text { flex: 1; min-width: 0; }

.page-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(2.8rem, 8vw, 5rem);
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 0.4rem;
  color: var(--white);
}
.page-title span { color: var(--accent); }

.subtitle {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

/* --- Bookmark hint ------------------------------------------------ */
.bookmark-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.7;
  user-select: none;
}
.bookmark-hint svg { width: 11px; height: 11px; fill: var(--gold); flex-shrink: 0; }

/* --- 300x250 Medium Rectangle ad slot --------------------------- */
.ad-top-right {
  flex-shrink: 0;
  width: 300px;
  height: 250px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  overflow: hidden;
}
.ad-top-right .ad-size { font-size: 0.55rem; opacity: 0.5; }

/* --- File size badge ---------------------------------------------- */
.drop-limit {
  margin-top: 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.7rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.drop-limit-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

/* --- Two-column analyser wrap ------------------------------------- */
/*  GAP FIX: height:300px clamps the container before results show,  */
/*  preventing the hidden right-col's content inflating the row.     */
.analyser-wrap {
  display: grid;
  grid-template-columns: 1fr 0fr;
  gap: 0;
  height: 300px;
  transition: grid-template-columns 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.65s cubic-bezier(0.4, 0, 0.2, 1);
  align-items: stretch;
  overflow: hidden;
  border-radius: 4px;
}
.analyser-wrap.has-results {
  grid-template-columns: 1fr 1fr;
  height: auto;
  gap: 1px;
  background: var(--border);
}

/* --- Left column -------------------------------------------------- */
.left-col {
  position: relative;
  min-height: 300px;
  height: 300px;
  overflow: hidden;
  background: var(--surface);
  border-radius: 4px;
  transition: border-radius 0.65s ease, height 0.65s ease;
}
.analyser-wrap.has-results .left-col {
  height: auto;
  min-height: 300px;
  border-radius: 4px 0 0 4px;
}

/* --- Drop zone ---------------------------------------------------- */
.drop-zone {
  position: absolute;
  inset: 0;
  padding: 1.6rem 2rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: opacity 0.45s ease, transform 0.45s ease,
              border-color 0.25s, background 0.25s, box-shadow 0.25s;
  overflow: hidden;
}
.drop-zone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(230,57,70,0.06) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.drop-zone:hover,
.drop-zone.dragover { border-color: var(--accent); background: var(--panel); box-shadow: 0 0 40px var(--glow); }
.drop-zone:hover::before,
.drop-zone.dragover::before { opacity: 1; }
.drop-zone.hidden { opacity: 0; transform: scale(0.96); pointer-events: none; }

.drop-icon  { font-size: 2.8rem; margin-bottom: 0.9rem; display: block; line-height: 1; filter: drop-shadow(0 0 12px var(--glow)); pointer-events: none; }
.drop-title { font-family: 'Bebas Neue', sans-serif; font-size: 1.4rem; letter-spacing: 0.1em; color: var(--white); margin-bottom: 0.4rem; pointer-events: none; }
.drop-sub   { font-size: 0.82rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; pointer-events: none; }

.file-btn {
  display: inline-block;
  margin-top: 1.4rem;
  padding: 0.6rem 1.8rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  position: relative;
  z-index: 2;
}
.file-btn:hover { background: #c1121f; box-shadow: 0 0 20px var(--glow); }
#file-input { display: none; }

/* --- EQ display (replaces drop zone after analysis) -------------- */
.eq-display {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: var(--surface);
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease 0.3s;
}
.eq-display.visible { opacity: 1; }

.eq-track-name {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90%;
}

/* --- EQ bars ------------------------------------------------------ */
.eq-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 120px;
  width: 90%;
}
.eq-bar {
  flex: 1;
  max-width: 18px;
  border-radius: 2px 2px 0 0;
  background: var(--eq-idle);
  transition: background 0.5s ease, box-shadow 0.5s ease;
  animation: eqBounce var(--dur, 0.6s) ease-in-out infinite alternate;
  transform-origin: bottom;
}
.eq-bar:nth-child(1)  { --dur: 0.52s; height: 30%; }
.eq-bar:nth-child(2)  { --dur: 0.37s; height: 65%; }
.eq-bar:nth-child(3)  { --dur: 0.61s; height: 48%; }
.eq-bar:nth-child(4)  { --dur: 0.44s; height: 88%; }
.eq-bar:nth-child(5)  { --dur: 0.58s; height: 58%; }
.eq-bar:nth-child(6)  { --dur: 0.32s; height: 78%; }
.eq-bar:nth-child(7)  { --dur: 0.67s; height: 42%; }
.eq-bar:nth-child(8)  { --dur: 0.41s; height: 72%; }
.eq-bar:nth-child(9)  { --dur: 0.55s; height: 53%; }
.eq-bar:nth-child(10) { --dur: 0.48s; height: 82%; }
.eq-bar:nth-child(11) { --dur: 0.35s; height: 38%; }
.eq-bar:nth-child(12) { --dur: 0.63s; height: 62%; }
.eq-bar:nth-child(13) { --dur: 0.50s; height: 50%; }
.eq-bar:nth-child(14) { --dur: 0.40s; height: 70%; }
.eq-bar:nth-child(15) { --dur: 0.56s; height: 44%; }
.eq-bar:nth-child(16) { --dur: 0.46s; height: 76%; }

@keyframes eqBounce {
  from { transform: scaleY(0.1); }
  to   { transform: scaleY(1); }
}

.eq-wrap.analysing .eq-bar,
.eq-display.visible .eq-wrap .eq-bar {
  background: var(--eq-active);
  box-shadow: 0 0 6px var(--eq-glow), 0 0 22px var(--eq-glow);
}
.eq-display.idle .eq-wrap .eq-bar {
  background: var(--eq-idle);
  box-shadow: none;
}

/* --- Right column ------------------------------------------------- */
.right-col {
  background: var(--surface);
  border-radius: 0 4px 4px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.2rem 2rem;
  overflow: hidden;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.45s ease 0.3s, transform 0.45s ease 0.3s;
}
.analyser-wrap.has-results .right-col { opacity: 1; transform: translateX(0); }

/* --- BPM display -------------------------------------------------- */
.bpm-block { margin-bottom: 1.6rem; }
.bpm-label {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.bpm-row { display: flex; align-items: baseline; gap: 0.6rem; }
.bpm-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 9vw, 7rem);
  line-height: 1;
  color: var(--white);
  text-shadow: 0 0 50px var(--glow);
  transition: color 0.3s;
}
.bpm-number.pulsing { animation: bpmPulse 0.2s ease-out; }
@keyframes bpmPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); color: var(--accent); }
  100% { transform: scale(1); }
}
.bpm-unit {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
}
.tempo-tag {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.25rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
}

/* --- Stat rows ---------------------------------------------------- */
.stat-rows { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.stat-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  transition: background 0.15s;
}
.stat-row:last-child { border-bottom: none; }
.stat-row:hover { background: #1c1c26; }
.stat-icon { font-size: 1rem; width: 1.4rem; text-align: center; flex-shrink: 0; opacity: 0.8; }
.stat-body { flex: 1; min-width: 0; }
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.stat-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--white);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-note { font-size: 0.68rem; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; margin-top: 0.1rem; opacity: 0.7; }

/* Coloured left accents */
.stat-row:nth-child(1) { border-left: 3px solid var(--accent); }
.stat-row:nth-child(2) { border-left: 3px solid #7b61ff; }
.stat-row:nth-child(3) { border-left: 3px solid var(--gold); }
.stat-row:nth-child(4) { border-left: 3px solid var(--eq-active); }

/* --- Status strip ------------------------------------------------- */
/* GAP FIX: no min-height; hidden when empty so it takes zero space  */
.status-strip {
  display: none;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
}
.status-strip.active,
.status-strip.error { display: block; }
.status-strip.active { color: var(--gold); }
.status-strip.error  { color: var(--accent); }

/* --- Progress bar ------------------------------------------------- */
.progress-wrap { margin-top: 0.6rem; height: 3px; background: var(--panel); border-radius: 2px; overflow: hidden; display: none; }
.progress-wrap.visible { display: block; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent2)); border-radius: 2px; transition: width 0.2s linear; box-shadow: 0 0 8px var(--glow); }

/* --- Reset button ------------------------------------------------- */
.reset-wrap { text-align: center; margin-top: 1.2rem; display: none; }
.reset-wrap.visible { display: block; }
.reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 2rem;
  background: var(--panel);
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s;
}
.reset-btn:hover { background: rgba(230,57,70,0.08); border-color: var(--accent); color: var(--accent); box-shadow: 0 0 18px var(--glow); }

/* --- How it works ------------------------------------------------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 2.5rem;
}
.info-cell  { background: var(--surface); padding: 1.5rem; }
.info-num   { font-family: 'Bebas Neue', sans-serif; font-size: 2.2rem; color: var(--accent); line-height: 1; margin-bottom: 0.5rem; }
.info-title { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--white); margin-bottom: 0.4rem; }
.info-desc  { font-size: 0.95rem; color: var(--muted); line-height: 1.8; }

/* --- Ad slot (leaderboard) ---------------------------------------- */
.ad-slot {
  margin-top: 2.5rem;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 4px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* --- How to Use explainer section -------------------------------- */
.howto-section {
  margin-top: 2.5rem;
}
.howto-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.howto-heading span { color: var(--accent); }
.howto-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.8rem 2rem;
}
.howto-body p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.85;
  margin-bottom: 1.2rem;
}
.howto-body p:last-child { margin-bottom: 0; }
.howto-body strong { color: var(--white); }
.howto-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.2rem;
}
.howto-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.65;
}
.howto-list li::before {
  content: '\203a';
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
  font-weight: bold;
}
.howto-list li strong { color: var(--white); }
.howto-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
  margin-bottom: 1.2rem;
}
.howto-pill {
  padding: 0.3rem 0.8rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.howto-privacy {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.1rem;
  background: rgba(57, 255, 20, 0.04);
  border: 1px solid rgba(57, 255, 20, 0.18);
  border-radius: 4px;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.6;
}
.howto-privacy-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* --- Tap Tempo section -------------------------------------------- */
.tap-section {
  margin-top: 2.5rem;
}
.tap-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 0.3rem;
}
.tap-heading span { color: var(--accent); }
.tap-subheading {
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.6rem;
}
.tap-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.tap-steps {
  background: var(--surface);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.tap-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.tap-step-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
  width: 1.4rem;
  text-align: center;
}
.tap-step-text {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
  padding-top: 0.1rem;
}
.tap-step-text strong { color: var(--white); }
.tap-panel {
  background: var(--panel);
  padding: 1.8rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
}
.tap-bpm-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3.5rem, 8vw, 6rem);
  line-height: 1;
  color: var(--white);
  text-shadow: 0 0 40px var(--glow);
  letter-spacing: 0.04em;
  transition: transform 0.08s ease, color 0.1s ease;
}
.tap-bpm-display.flash {
  transform: scale(1.08);
  color: var(--accent);
}
.tap-bpm-unit {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -0.8rem;
}
.tap-btn {
  width: 100%;
  max-width: 280px;
  padding: 1rem 2rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.12em;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s, transform 0.08s, box-shadow 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tap-btn:hover  { background: #c1121f; box-shadow: 0 0 28px var(--glow); }
.tap-btn:active { transform: scale(0.97); }
.tap-hint {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
}
.tap-controls {
  display: flex;
  gap: 0.6rem;
}
.tap-reset {
  padding: 0.45rem 1.2rem;
  background: var(--surface);
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.tap-reset:hover { border-color: var(--accent); color: var(--accent); }

@media (max-width: 680px) {
  .tap-layout { grid-template-columns: 1fr; }
}

/* --- FAQ Section -------------------------------------------------- */
.faq-section { margin-top: 3rem; }
.faq-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 0.4rem;
}
.faq-heading span { color: var(--accent); }
.faq-subheading {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.8rem;
}
.faq-list { display: flex; flex-direction: column; gap: 2px; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--white);
  transition: background 0.15s, color 0.15s;
}
.faq-question:hover { background: var(--panel); color: var(--accent); }
.faq-question[aria-expanded="true"] { color: var(--accent); background: var(--panel); }
.faq-chevron {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.25s ease;
}
.faq-question[aria-expanded="true"] .faq-chevron { transform: rotate(180deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 1.2rem;
}
.faq-answer.open { max-height: 400px; padding: 0 1.2rem 1.1rem; }
.faq-answer p {
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.9rem;
}

/* --- Inner pages (terms, contact, about) ------------------------- */
.inner-hero {
  margin-bottom: 2.5rem;
}
.inner-hero .page-title {
  margin-bottom: 0.4rem;
}
.inner-hero .subtitle {
  margin-bottom: 0;
}

/* Terms page - each block is a separate card, not fused together */
.content-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;           /* visible gap between each section card */
  margin-bottom: 2rem;
}
.content-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2.4rem 2.6rem;
  border-left: 3px solid var(--border);
  transition: border-left-color 0.2s;
}
.content-block:hover {
  border-left-color: var(--accent);
}
.content-block h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border);
}
.content-block h2 .block-num {
  font-size: 0.9rem;
  color: var(--accent);
  font-family: 'Bebas Neue', sans-serif;
  letter-spacing: 0.08em;
  opacity: 0.7;
}
.content-block p {
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 1.3rem;
}
.content-block p:last-child { margin-bottom: 0; }
.content-block strong { color: var(--white); }
.content-block ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.3rem;
}
.content-block ul li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.7;
}
.content-block ul li::before {
  content: '\203a';
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
  font-weight: bold;
}
/* Links - accent red (#e63946) matching the 'Virgin' logo colour */
.content-block a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(230,57,70,0.4);
  transition: border-color 0.2s, opacity 0.2s;
}
.content-block a:hover {
  opacity: 0.8;
  border-color: var(--accent);
}
.content-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1.2rem 1.4rem;
  border-radius: 4px;
  font-size: 0.92rem;
  line-height: 1.7;
  margin-bottom: 1.3rem;
}
.content-notice:last-child { margin-bottom: 0; }
.content-notice.notice-red   { background: rgba(230,57,70,0.07);  border: 1px solid rgba(230,57,70,0.25);  color: var(--muted); }
.content-notice.notice-green { background: rgba(57,255,20,0.04);  border: 1px solid rgba(57,255,20,0.18);  color: var(--muted); }
.content-notice.notice-gold  { background: rgba(201,168,76,0.07); border: 1px solid rgba(201,168,76,0.25); color: var(--muted); }
.content-notice-icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 0.1rem; }
.terms-updated {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* --- Contact form ------------------------------------------------- */
/* Outer card wrapping the two-column layout */
.contact-card {
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.7fr;
  gap: 1px;
}
.contact-info {
  background: var(--panel);
  padding: 2.4rem 2.2rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.contact-info-item {
  padding: 0 0 2rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.contact-info-item:last-child {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}
/* h3 for sidebar headings - semantic SEO value */
.contact-info h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--white);
  margin-bottom: 0.6rem;
}
.contact-info p {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.75;
}
.contact-form-wrap {
  background: var(--surface);
  padding: 2.4rem 2.6rem;
}
/* h2 inside form wrap */
.contact-form-wrap h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: 0.5rem;
}
.contact-form-wrap .form-intro {
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 1.8rem;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--border);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.2rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}
.form-group:last-of-type { margin-bottom: 0; }
.form-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--white);
  font-weight: 700;
}
.form-label .required { color: var(--accent); margin-left: 2px; }
.form-input,
.form-textarea {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.95rem 1.1rem;
  font-family: 'Space Mono', monospace;
  font-size: 0.9rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  width: 100%;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--muted); opacity: 0.45; }
.form-input:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: #1c1c26;
  box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
}
.form-input.error,
.form-textarea.error { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 160px; }
/* Submit row - button full width */
.form-submit-row {
  margin-top: 1.6rem;
}
.form-submit-btn {
  display: block;
  width: 100%;
  padding: 1.1rem 2.2rem;
  background: var(--accent);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.25rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s, opacity 0.2s;
}
.form-submit-btn:hover  { background: #c1121f; box-shadow: 0 0 28px var(--glow); }
.form-submit-btn:active { transform: scale(0.99); }
.form-submit-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
/* Privacy note below button */
.form-privacy-note {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  opacity: 0.7;
  line-height: 1.6;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
/* Honeypot - completely off-screen, invisible to humans */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
/* Form messages */
.form-msg {
  display: none;
  padding: 1.1rem 1.3rem;
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 1.3rem;
}
.form-msg.success { display: block; background: rgba(57,255,20,0.06); border: 1px solid rgba(57,255,20,0.22); color: #a0e87a; }
.form-msg.error   { display: block; background: rgba(230,57,70,0.08); border: 1px solid rgba(230,57,70,0.3);  color: #f08080; }
.form-field-error {
  font-size: 0.68rem;
  color: var(--accent);
  letter-spacing: 0.04em;
  display: none;
}
.form-field-error.visible { display: block; }

@media (max-width: 760px) {
  .contact-card   { grid-template-columns: 1fr; }
  .form-row       { grid-template-columns: 1fr; }
}

/* --- Metronome page ----------------------------------------------- */
.metro-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1.4rem;
  align-items: start;
}

/* -- Visual panel ------------------------------------------------ */
.metro-visual-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2rem 1.6rem 1.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  position: sticky;
  top: 1.5rem;
}

/* Tempo name badge */
.metro-tempo-name {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  text-align: center;
}

/* Pendulum stage */
.metro-stage {
  position: relative;
  width: 260px;
  height: 320px;
  display: flex;
  justify-content: center;
}

/* Classic trapezoid metronome body */
.metro-body-shape {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 270px;
  background: linear-gradient(170deg, #18181f 0%, #111116 100%);
  border: 1px solid var(--border);
  border-radius: 2px;
  clip-path: polygon(18% 0%, 82% 0%, 100% 100%, 0% 100%);
}
/* Subtle inner bevel */
.metro-body-shape::after {
  content: '';
  position: absolute;
  inset: 8px 12px;
  clip-path: polygon(17% 0%, 83% 0%, 100% 100%, 0% 100%);
  border: 1px solid rgba(255,255,255,0.04);
  pointer-events: none;
}

/* Window / face of the metronome */
.metro-face {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 190px;
  background: var(--bg);
  border: 1px solid var(--border);
  clip-path: polygon(12% 0%, 88% 0%, 100% 100%, 0% 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tick marks on the face */
.metro-tick-marks {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Pendulum pivot dot */
.metro-pivot {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: var(--border);
  border-radius: 50%;
  z-index: 5;
}

/* The swinging arm - pivot at top center */
.metro-arm {
  position: absolute;
  top: 14px;
  left: 50%;
  width: 4px;
  height: 295px;
  transform-origin: top center;
  transform: translateX(-50%) rotate(0deg);
  transition: none; /* JS drives this */
  z-index: 4;
}

/* The rod line */
.metro-rod {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: linear-gradient(to bottom, var(--border), var(--muted));
  transform: translateX(-50%);
  border-radius: 1px;
}

/* Adjustable weight on the rod - position reflects BPM zone */
.metro-weight {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 10px;
  background: var(--border);
  border-radius: 2px;
  border: 1px solid rgba(255,255,255,0.08);
  transition: top 0.4s ease;
}

/* Bob at bottom of arm */
.metro-bob {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 38%, #f03040, var(--accent));
  border: 2px solid rgba(255,255,255,0.1);
  transition: box-shadow 0.04s;
}
.metro-bob.accent {
  box-shadow: 0 0 16px var(--accent), 0 0 40px var(--glow), 0 0 70px rgba(230,57,70,0.2);
}
.metro-bob.beat {
  box-shadow: 0 0 8px rgba(230,57,70,0.5);
}

/* Beat dot indicators */
.metro-beat-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  min-height: 22px;
}
.metro-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: background 0.05s, box-shadow 0.05s;
}
.metro-dot.beat {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(201,168,76,0.6);
}
.metro-dot.accent {
  background: var(--accent);
  box-shadow: 0 0 12px var(--glow);
}
.metro-dot.bar-one {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
}

/* Beat counter */
.metro-counter-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
  min-height: 1.4rem;
}
.metro-counter-display .c-bar  { color: var(--white); }
.metro-counter-display .c-beat { color: var(--accent); }
.metro-counter-display .c-total{ color: var(--muted); font-size: 0.75rem; margin-left: 0.5em; }

/* -- Controls panel ---------------------------------------------- */
.metro-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}
.metro-ctrl-block {
  background: var(--surface);
  padding: 1.6rem 2rem;
}
.metro-ctrl-block:last-child { padding-bottom: 2rem; }

/* BPM section */
.metro-bpm-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.metro-bpm-number {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(4rem, 8vw, 6rem);
  line-height: 1;
  color: var(--white);
  letter-spacing: -0.02em;
}
.metro-bpm-unit {
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* BPM slider */
.metro-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin-bottom: 1rem;
}
.metro-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--glow);
  transition: transform 0.15s;
}
.metro-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }
.metro-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}

/* BPM nudge buttons */
.metro-nudge-row {
  display: flex;
  gap: 6px;
}
.metro-nudge {
  flex: 1;
  padding: 0.55rem 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  text-align: center;
}
.metro-nudge:hover { background: rgba(230,57,70,0.08); border-color: var(--accent); color: var(--accent); }
.metro-nudge:active { transform: scale(0.97); }

/* Section labels */
.metro-section-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Option pill groups (time sig, sound) */
.metro-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.metro-pill {
  padding: 0.45rem 0.9rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.metro-pill:hover { border-color: var(--accent); color: var(--accent); }
.metro-pill.active {
  background: rgba(230,57,70,0.12);
  border-color: var(--accent);
  color: var(--white);
  box-shadow: 0 0 10px var(--glow);
}

/* A440 button */
.metro-a440-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--gold);
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.metro-a440-btn:hover { background: rgba(201,168,76,0.08); border-color: var(--gold); box-shadow: 0 0 14px rgba(201,168,76,0.2); }
.metro-a440-btn.playing { background: rgba(201,168,76,0.12); border-color: var(--gold); box-shadow: 0 0 20px rgba(201,168,76,0.35); }
.metro-a440-pulse {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--gold);
  animation: a440pulse 0.8s ease-in-out infinite;
  display: none;
}
.metro-a440-btn.playing .metro-a440-pulse { display: inline-block; }
@keyframes a440pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.7); } }

/* Start/Stop button */
.metro-startstop {
  width: 100%;
  padding: 1.2rem;
  background: var(--accent);
  border: none;
  border-radius: 3px;
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
}
.metro-startstop:hover  { background: #c1121f; box-shadow: 0 0 32px var(--glow); }
.metro-startstop:active { transform: scale(0.98); }
.metro-startstop.running { background: #1a1a22; border: 2px solid var(--accent); color: var(--accent); }
.metro-startstop.running:hover { background: rgba(230,57,70,0.1); }

/* Beat flash overlay on the face panel */
.metro-flash-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px; height: 60px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  border: 2px solid var(--accent);
  opacity: 0;
  pointer-events: none;
}
.metro-flash-ring.fire {
  animation: ring-fire 0.35s ease-out forwards;
}
@keyframes ring-fire {
  0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

@media (max-width: 860px) {
  .metro-layout { grid-template-columns: 1fr; }
  .metro-visual-panel { position: static; }
}

/* --- Footer ------------------------------------------------------- */
footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.8rem;
  background: var(--surface);
}
.footer-copy { font-size: 0.82rem; letter-spacing: 0.06em; color: var(--muted); }
.footer-link { font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-decoration: none; border-bottom: 1px solid var(--border); padding-bottom: 1px; transition: color 0.2s, border-color 0.2s; }
.footer-link:hover { color: var(--accent); border-color: var(--accent); }

/* --- Scrollbar ---------------------------------------------------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* --- Responsive --------------------------------------------------- */
@media (max-width: 780px) {
  .title-row { flex-direction: column; }
  .ad-top-right { width: 100%; height: 100px; }
}

@media (max-width: 720px) {
  .analyser-wrap,
  .analyser-wrap.has-results {
    grid-template-columns: 1fr !important;
    gap: 1px;
  }
  .left-col { min-height: 200px; height: 200px; border-radius: 4px 4px 0 0 !important; }
  .analyser-wrap.has-results .left-col { height: auto; }
  .right-col { border-radius: 0 0 4px 4px; padding: 1.5rem; transform: none !important; }
  .analyser-wrap.has-results .right-col { opacity: 1; }
}

@media (max-width: 480px) {
  header { padding: 0 1rem; }
  main   { padding: 2rem 1rem 3rem; }
  footer { flex-direction: column; text-align: center; }
}

/* --- Homepage Styles ---------------------------------------------- */

/* -- Hero section --------------------------------------------------- */
.home-hero {
  text-align: center;
  padding: 4rem 0 3rem;
}
.home-hero .page-title {
  margin-bottom: 1rem;
}
.home-hero .subtitle {
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* -- Animated Equalizer --------------------------------------------- */
.eq-container {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 80px;
  margin: 0 auto 2rem;
}
.eq-bar {
  width: 8px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 12px var(--glow), 0 0 24px var(--glow);
  animation: eq-pulse 0.8s ease-in-out infinite;
}
.eq-bar:nth-child(1)  { height: 30px; animation-delay: 0.0s; }
.eq-bar:nth-child(2)  { height: 50px; animation-delay: 0.1s; }
.eq-bar:nth-child(3)  { height: 70px; animation-delay: 0.2s; }
.eq-bar:nth-child(4)  { height: 45px; animation-delay: 0.3s; }
.eq-bar:nth-child(5)  { height: 60px; animation-delay: 0.15s; }
.eq-bar:nth-child(6)  { height: 35px; animation-delay: 0.25s; }
.eq-bar:nth-child(7)  { height: 55px; animation-delay: 0.05s; }
.eq-bar:nth-child(8)  { height: 40px; animation-delay: 0.35s; }
.eq-bar:nth-child(9)  { height: 65px; animation-delay: 0.12s; }
.eq-bar:nth-child(10) { height: 50px; animation-delay: 0.22s; }
.eq-bar:nth-child(11) { height: 75px; animation-delay: 0.08s; }
.eq-bar:nth-child(12) { height: 55px; animation-delay: 0.18s; }
.eq-bar:nth-child(13) { height: 40px; animation-delay: 0.28s; }
.eq-bar:nth-child(14) { height: 60px; animation-delay: 0.04s; }
.eq-bar:nth-child(15) { height: 45px; animation-delay: 0.14s; }

@keyframes eq-pulse {
  0%, 100% { transform: scaleY(1); opacity: 1; }
  50% { transform: scaleY(0.4); opacity: 0.7; }
}

/* -- Tool cards grid ------------------------------------------------ */
.tools-section {
  margin-bottom: 3rem;
}
.tools-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  letter-spacing: 0.08em;
  color: var(--white);
  text-align: center;
  margin-bottom: 2rem;
}
.tools-section h2 span {
  color: var(--accent);
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}
.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(230,57,70,0.08) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: 0 0 30px var(--glow), 0 8px 32px rgba(0,0,0,0.4);
}
.tool-card:hover::before {
  opacity: 1;
}
.tool-card-icon {
  width: 56px;
  height: 56px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.tool-card:hover .tool-card-icon {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--glow);
}
.tool-card-icon svg {
  width: 28px;
  height: 28px;
  stroke: var(--accent);
  stroke-width: 1.5;
  fill: none;
}
.tool-card h3 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.06em;
  color: var(--white);
  margin-bottom: 0.6rem;
  position: relative;
}
.tool-card p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1rem;
  position: relative;
}
.tool-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  position: relative;
}
.tool-card-cta svg {
  width: 14px;
  height: 14px;
  stroke: var(--accent);
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s ease;
}
.tool-card:hover .tool-card-cta svg {
  transform: translateX(4px);
}

/* -- About section -------------------------------------------------- */
.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}
.about-section h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  letter-spacing: 0.08em;
  color: var(--white);
  margin-bottom: 1.2rem;
}
.about-section h2 span {
  color: var(--accent);
}
.about-section p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1rem;
}
.about-section p:last-of-type {
  margin-bottom: 0;
}
.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.about-feature {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.about-feature-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--glow);
  flex-shrink: 0;
}

/* -- Homepage ad slot ----------------------------------------------- */
.home-ad-slot {
  margin: 2rem 0;
}

/* -- Homepage responsive -------------------------------------------- */
@media (max-width: 600px) {
  .eq-container { gap: 4px; height: 60px; }
  .eq-bar { width: 6px; }
  .about-section { padding: 1.5rem; }
  .tool-card { padding: 1.5rem; }
}

/* --- AI Detector Styles ------------------------------------------- */

/* -- AI Detector Results ------------------------------------------- */
.ai-result-main {
  text-align: center;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.ai-orb-display .ai-result-main {
  border-bottom: none;
  padding: 0 0 1rem;
  margin-bottom: 0;
}
.ai-verdict {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.ai-probability {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(3rem, 10vw, 5rem);
  letter-spacing: 0.02em;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.ai-probability-low { color: #39ff14; }
.ai-probability-medium { color: #ffd700; }
.ai-probability-high { color: var(--accent); }
.ai-confidence {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ai-breakdown-heading {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 0.08em;
  color: var(--white);
  text-align: center;
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
}

/* -- Indicator meters ----------------------------------------------- */
.ai-indicators {
  display: grid;
  gap: 1rem;
}
.ai-indicator {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
}
.ai-indicator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
}
.ai-indicator-name {
  font-size: 0.8rem;
  color: var(--white);
  font-weight: 700;
}
.ai-indicator-value {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
}
.ai-indicator-bar {
  height: 6px;
  background: var(--surface);
  border-radius: 3px;
  overflow: hidden;
}
.ai-indicator-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease-out;
}
.ai-indicator-fill.low { background: linear-gradient(90deg, #39ff14, #7fff00); }
.ai-indicator-fill.medium { background: linear-gradient(90deg, #ffd700, #ffa500); }
.ai-indicator-fill.high { background: linear-gradient(90deg, #ff6b35, var(--accent)); }
.ai-indicator-desc {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* -- Disclaimer banner ---------------------------------------------- */
.ai-disclaimer {
  background: rgba(230, 57, 70, 0.1);
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 4px;
  padding: 1rem;
  margin-top: 1.5rem;
}
.ai-disclaimer-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.4rem;
}
.ai-disclaimer p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

/* -- Processing animation ------------------------------------------- */
.ai-processing {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.ai-processing.active {
  display: flex;
}
.ai-scanner {
  width: 120px;
  height: 120px;
  border: 3px solid var(--border);
  border-radius: 50%;
  position: relative;
  margin-bottom: 1.5rem;
}
.ai-scanner::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ai-scan 1.2s linear infinite;
}
.ai-scanner::after {
  content: '';
  position: absolute;
  inset: 20px;
  border: 2px solid transparent;
  border-bottom-color: var(--accent2);
  border-radius: 50%;
  animation: ai-scan 1.8s linear infinite reverse;
}
@keyframes ai-scan {
  to { transform: rotate(360deg); }
}
.ai-processing-text {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.ai-processing-step {
  color: var(--accent);
  font-weight: 700;
}

/* -- Results container ---------------------------------------------- */
.ai-results {
  display: none;
}
.ai-results.active {
  display: block;
}

/* -- Robot icon for drop zone --------------------------------------- */
.drop-icon-ai {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

/* -- AI Orb Animation (shown after analysis) ----------------------- */
.ai-orb-display {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1.5rem 1rem;
  min-height: 280px;
}
.ai-orb-display.active {
  display: flex;
}
.ai-orb-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.5rem 0;
}
.ai-orb {
  position: relative;
  width: 90px;
  height: 90px;
}
.ai-orb-core {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, 
    #ff6b9d 0%, 
    #c44569 20%, 
    #6c5ce7 50%, 
    #0984e3 80%, 
    #00cec9 100%);
  animation: ai-core-pulse 3s ease-in-out infinite, ai-core-morph 8s ease-in-out infinite;
  box-shadow: 
    0 0 40px rgba(108, 92, 231, 0.6),
    0 0 80px rgba(196, 69, 105, 0.4),
    inset 0 0 30px rgba(255, 255, 255, 0.3);
}
@keyframes ai-core-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.9; }
}
@keyframes ai-core-morph {
  0%, 100% { border-radius: 50%; }
  25% { border-radius: 45% 55% 60% 40% / 55% 45% 55% 45%; }
  50% { border-radius: 60% 40% 45% 55% / 40% 60% 40% 60%; }
  75% { border-radius: 40% 60% 55% 45% / 60% 40% 55% 45%; }
}

/* Orbiting rings */
.ai-orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}
.ai-orb-ring-1 {
  inset: -5px;
  border-top-color: rgba(255, 107, 157, 0.8);
  border-right-color: rgba(108, 92, 231, 0.4);
  animation: ai-ring-spin 4s linear infinite;
}
.ai-orb-ring-2 {
  inset: -15px;
  border-bottom-color: rgba(9, 132, 227, 0.7);
  border-left-color: rgba(0, 206, 201, 0.3);
  animation: ai-ring-spin 6s linear infinite reverse;
}
.ai-orb-ring-3 {
  inset: -25px;
  border-top-color: rgba(0, 206, 201, 0.5);
  border-right-color: rgba(255, 107, 157, 0.2);
  border-width: 1px;
  animation: ai-ring-spin 8s linear infinite;
}
@keyframes ai-ring-spin {
  to { transform: rotate(360deg); }
}

/* Floating particles */
.ai-orb-particles {
  position: absolute;
  inset: -40px;
}
.ai-orb-particles span {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}
.ai-orb-particles span:nth-child(1) { top: 10%; left: 50%; color: #ff6b9d; animation: ai-particle-float 3s ease-in-out infinite; }
.ai-orb-particles span:nth-child(2) { top: 30%; left: 10%; color: #6c5ce7; animation: ai-particle-float 3.5s ease-in-out infinite 0.3s; }
.ai-orb-particles span:nth-child(3) { top: 50%; left: 5%; color: #0984e3; animation: ai-particle-float 4s ease-in-out infinite 0.6s; }
.ai-orb-particles span:nth-child(4) { top: 70%; left: 15%; color: #00cec9; animation: ai-particle-float 3.2s ease-in-out infinite 0.9s; }
.ai-orb-particles span:nth-child(5) { top: 85%; left: 40%; color: #ff6b9d; animation: ai-particle-float 3.8s ease-in-out infinite 1.2s; }
.ai-orb-particles span:nth-child(6) { top: 90%; left: 60%; color: #6c5ce7; animation: ai-particle-float 3.3s ease-in-out infinite 0.2s; }
.ai-orb-particles span:nth-child(7) { top: 75%; left: 85%; color: #0984e3; animation: ai-particle-float 4.2s ease-in-out infinite 0.5s; }
.ai-orb-particles span:nth-child(8) { top: 55%; left: 95%; color: #00cec9; animation: ai-particle-float 3.6s ease-in-out infinite 0.8s; }
.ai-orb-particles span:nth-child(9) { top: 35%; left: 90%; color: #ff6b9d; animation: ai-particle-float 3.4s ease-in-out infinite 1.1s; }
.ai-orb-particles span:nth-child(10) { top: 15%; left: 75%; color: #6c5ce7; animation: ai-particle-float 3.9s ease-in-out infinite 0.4s; }
.ai-orb-particles span:nth-child(11) { top: 5%; left: 35%; color: #0984e3; animation: ai-particle-float 4.1s ease-in-out infinite 0.7s; }
.ai-orb-particles span:nth-child(12) { top: 20%; left: 25%; color: #00cec9; animation: ai-particle-float 3.7s ease-in-out infinite 1.0s; }

@keyframes ai-particle-float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.8; }
  50% { transform: translateY(-10px) scale(1.3); opacity: 1; }
}

/* Background glow */
.ai-orb-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, 
    rgba(108, 92, 231, 0.3) 0%, 
    rgba(196, 69, 105, 0.2) 30%,
    rgba(9, 132, 227, 0.1) 60%,
    transparent 70%);
  animation: ai-glow-pulse 4s ease-in-out infinite;
  filter: blur(20px);
}
@keyframes ai-glow-pulse {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* Track name below orb */
.ai-track-name {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}


/* =================================================================
   RETRO POWER METER - AMP WIDGET STYLES
   Unique classes only. No nav/footer/faq overrides needed since
   the page uses the standard site injected header and footer.
   Custom properties scoped to .amp-faceplate so they don't
   touch any other page.
================================================================= */

/* Amp-specific custom properties - scoped to the widget */
.amp-faceplate {
  --amber:      #e8a020;
  --amber-glow: rgba(232,160,32,0.22);
  --text-dim:   #55556a;
}

/* --- Amp unit wrapper --- */
.amp-unit {
  margin: 0 auto 2.5rem;
}

.amp-faceplate {
  background: linear-gradient(180deg, #18181e 0%, #101014 100%);
  border-radius: 14px;
  border: 1px solid #2a2a32;
  padding: 22px 24px 26px;
  position: relative;
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.7),
    0 12px 40px rgba(0,0,0,0.85),
    0 0 80px rgba(232,160,32,0.04),
    inset 0 1px 0 rgba(255,255,255,0.065);
}

/* Brushed metal grain */
.amp-faceplate::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background-image: repeating-linear-gradient(
    90deg,
    transparent 0px,
    transparent 3px,
    rgba(255,255,255,0.008) 3px,
    rgba(255,255,255,0.008) 6px
  );
  pointer-events: none;
  z-index: 0;
}

.amp-faceplate > * {
  position: relative;
  z-index: 1;
}

/* --- Source selection bar --- */
.source-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,0.055);
  flex-wrap: wrap;
}

.source-label {
  font-size: 0.7rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-source,
.btn-stop {
  padding: 6px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1.4;
}

.btn-source:hover {
  border-color: var(--accent);
  color: var(--white);
}

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

.btn-stop:hover {
  border-color: #993020;
  color: #cc4030;
}

#status-text {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 3px;
  transition: color 0.3s;
}

#status-text.status-active { color: var(--eq-active); }
#status-text.status-error  { color: var(--accent); }

/* --- Meters row --- */
.meters-row {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 18px;
  align-items: center;
}

/* --- Individual meter panel --- */
.meter-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.meter-glass {
  background: #080810;
  border-radius: 8px;
  border: 2px solid #252530;
  padding: 3px;
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.7),
    0 0 22px var(--amber-glow),
    0 0 60px rgba(232,160,32,0.07);
  transition: box-shadow 0.4s;
}

.meter-glass.lit {
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.7),
    0 0 30px rgba(232,160,32,0.35),
    0 0 80px rgba(232,160,32,0.12);
}

.meter-glass::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    145deg,
    rgba(255,255,255,0.045) 0%,
    transparent 45%,
    rgba(0,0,0,0.15) 100%
  );
  pointer-events: none;
  z-index: 3;
  border-radius: 6px;
}

.meter-face {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.meter-label {
  text-align: center;
  margin-top: 6px;
  font-size: 0.62rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(90,70,30,0.7);
}

/* --- Centre controls panel --- */
.controls-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

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

.knob-polarity {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.6rem;
  letter-spacing: 1px;
  color: #3a3a48;
  text-transform: uppercase;
}

.knob-title {
  font-size: 0.65rem;
  letter-spacing: 2px;
  color: #555568;
}

.vol-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.vol-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  color: var(--amber);
  letter-spacing: 2px;
  text-align: center;
  min-width: 44px;
  text-shadow: 0 0 8px rgba(232,160,32,0.4);
}

/* --- Rotary knobs --- */
.knob {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #4a4a58 0%, #1e1e28 65%, #141420 100%);
  border: 2px solid #2e2e3a;
  box-shadow:
    0 5px 14px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 0 0 1px rgba(255,255,255,0.04);
  cursor: ns-resize;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  transition: box-shadow 0.15s;
  outline: none;
}

.knob:hover {
  box-shadow:
    0 5px 14px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(255,255,255,0.07),
    0 0 16px rgba(230,57,70,0.25);
}

.knob:focus-visible {
  box-shadow:
    0 5px 14px rgba(0,0,0,0.65),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 2px var(--accent);
}

.knob:active { cursor: grabbing; }

.knob::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    rgba(255,255,255,0.04) 0deg 6deg,
    rgba(0,0,0,0.06) 6deg 12deg
  );
  z-index: 0;
  pointer-events: none;
}

.knob-indicator {
  position: absolute;
  top: 6px;
  left: calc(50% - 1.5px);
  width: 3px;
  height: 14px;
  background: linear-gradient(to bottom, #e0e0e8, #888898);
  border-radius: 2px;
  transform-origin: 50% 20px;
  transform: rotate(0deg);
  z-index: 1;
}

.knob-vol {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 38% 30%, #52525e 0%, #1c1c26 65%, #121218 100%);
  border: 2px solid #303040;
  box-shadow:
    0 8px 24px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(255,255,255,0.045),
    0 0 30px rgba(230,57,70,0.06);
}

.knob-vol:hover {
  box-shadow:
    0 8px 24px rgba(0,0,0,0.75),
    inset 0 1px 0 rgba(255,255,255,0.14),
    0 0 0 1px rgba(255,255,255,0.07),
    0 0 30px rgba(230,57,70,0.22);
}

.knob-vol .knob-indicator {
  top: 8px;
  height: 20px;
  transform-origin: 50% 32px;
}

/* --- Controls bar --- */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.055);
  flex-wrap: wrap;
}

.btn-ctrl {
  padding: 7px 22px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-ctrl:hover {
  border-color: var(--accent);
  color: var(--white);
}

.btn-ctrl.muted {
  background: rgba(180,40,30,0.18);
  border-color: rgba(180,40,30,0.45);
  color: #e05040;
}

.keys-hint {
  font-size: 0.7rem;
  color: var(--border);
  letter-spacing: 0.04em;
}

kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  font-size: 0.68rem;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  user-select: none;
  font-family: 'Space Mono', monospace;
}

.toggle-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  cursor: pointer;
}

.toggle-label:hover { color: var(--white); }

/* --- Responsive --- */
@media (max-width: 700px) {
  .meters-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .controls-center {
    flex-direction: row;
    justify-content: center;
    padding: 4px 0;
  }
}

@media (max-width: 480px) {
  .source-bar  { gap: 8px; }
  .btn-source,
  .btn-stop    { padding: 6px 12px; font-size: 0.68rem; }
}


/* =================================================================
   VIRTUAL PIANO PAGE STYLES
   Classes scoped to piano-specific elements. No bleed to other pages.
================================================================= */

/* Piano page layout */
.piano-page-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* Controls bar */
.piano-controls {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
}

.ctrl-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ctrl-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  font-family: 'Space Mono', monospace;
}

.ctrl-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Piano buttons */
.piano-btn {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 0.5rem 0.9rem;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  user-select: none;
}
.piano-btn:hover  { border-color: var(--accent); color: var(--white); }
.piano-btn.active { background: var(--accent); border-color: var(--accent); color: var(--white); }
.piano-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.piano-btn.recording {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  animation: pulse-record 1s infinite;
}

@keyframes pulse-record {
  0%, 100% { box-shadow: 0 0 0 0 var(--glow); }
  50%       { box-shadow: 0 0 0 6px transparent; }
}

/* Sound type buttons */
.sound-btn-group { display: flex; gap: 0.4rem; }

/* Toggle switches */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.toggle-wrap input[type="checkbox"] {
  width: 36px; height: 20px;
  appearance: none; -webkit-appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-wrap input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: all 0.2s;
}
.toggle-wrap input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-wrap input[type="checkbox"]:checked::after {
  left: 18px;
  background: #fff;
}
.toggle-wrap span {
  font-size: 0.8rem;
  color: var(--text);
  user-select: none;
}

/* Volume slider */
.volume-slider {
  -webkit-appearance: none;
  width: 90px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.volume-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
#volume-display {
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 32px;
}

/* Scale select */
.scale-select {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 0.45rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  cursor: pointer;
  outline: none;
}
.scale-select:focus { border-color: var(--accent); }

/* Octave display */
#octave-display {
  font-size: 0.8rem;
  color: var(--white);
  min-width: 72px;
  text-align: center;
  font-weight: 700;
}

/* Piano wrap */
.piano-outer {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 0.5rem 0.5rem;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.04);
}

/* Lid detail */
.piano-outer::before {
  content: '';
  display: block;
  height: 8px;
  margin: -1.5rem 0.5rem 1rem;
  background: linear-gradient(180deg, #2a2a38 0%, #1a1a22 100%);
  border-radius: 6px 6px 0 0;
}

#piano-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 1rem 1rem;
  cursor: default;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
#piano-wrap::-webkit-scrollbar { height: 6px; }
#piano-wrap::-webkit-scrollbar-track { background: transparent; }
#piano-wrap::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Keys container */
#piano-keys {
  display: flex;
  align-items: flex-start;
  gap: 0;
  height: 168px;
  width: max-content;
  position: relative;
  user-select: none;
}

/* Key groups (one per octave) */
.key-group {
  display: flex;
  position: relative;
  height: 168px;
}

/* White keys */
.white-key {
  width: 42px;
  height: 168px;
  background: linear-gradient(180deg, #f0ede8 0%, #e8e4dc 60%, #d8d4cc 100%);
  border: 1px solid #888;
  border-top: none;
  border-radius: 0 0 5px 5px;
  position: relative;
  cursor: pointer;
  transition: background 0.06s ease, box-shadow 0.06s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 10px;
  gap: 4px;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.12), 2px 0 0 rgba(0,0,0,0.06);
  flex-shrink: 0;
  touch-action: none;
}
.white-key:hover {
  background: linear-gradient(180deg, #fffdf8 0%, #f5f0e8 100%);
}
.white-key.active {
  background: linear-gradient(180deg, #ffd0d4 0%, #ffb0b8 100%) !important;
  box-shadow: inset 0 3px 8px rgba(230,57,70,0.3), 2px 0 0 rgba(0,0,0,0.06);
}
.white-key.scale-note {
  background: linear-gradient(180deg, #e8f4e8 0%, #d4ecd4 100%);
}
.white-key.root-note {
  background: linear-gradient(180deg, #ffe0e0 0%, #ffc8c8 100%);
}
.white-key.scale-note:hover {
  background: linear-gradient(180deg, #f0fdf0 0%, #e0f4e0 100%);
}

/* Black keys */
.black-key {
  width: 27px;
  height: 106px;
  background: linear-gradient(180deg, #1a1a1a 0%, #2a2a2a 50%, #1a1a1a 100%);
  border: 1px solid #000;
  border-top: none;
  border-radius: 0 0 4px 4px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  margin-left: -14px;
  margin-right: -13px;
  transition: background 0.06s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 8px;
  gap: 3px;
  box-shadow: 2px 4px 8px rgba(0,0,0,0.6), inset 0 -2px 4px rgba(0,0,0,0.4);
  flex-shrink: 0;
  touch-action: none;
}
.black-key:hover {
  background: linear-gradient(180deg, #2a2a2a 0%, #3a3a3a 100%);
}
.black-key.active {
  background: linear-gradient(180deg, #7a1820 0%, #e63946 100%) !important;
  box-shadow: 1px 2px 6px rgba(0,0,0,0.5), inset 0 -2px 4px rgba(0,0,0,0.3);
}
.black-key.scale-note {
  background: linear-gradient(180deg, #1a2e1a 0%, #2a3e2a 100%);
}
.black-key.root-note {
  background: linear-gradient(180deg, #3a1010 0%, #5a1818 100%);
}

/* Key labels */
.key-note-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.52rem;
  font-weight: 700;
  pointer-events: none;
  letter-spacing: -0.02em;
}
.white-key .key-note-label { color: #666; }
.black-key .key-note-label { color: #aaa; }

.key-qwerty-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  pointer-events: none;
  letter-spacing: 0;
}
.white-key .key-qwerty-label { color: var(--accent); }
.black-key .key-qwerty-label { color: #ff9999; }

/* Sustain indicator */
.sustain-indicator {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border);
  margin-left: 0.4rem;
  transition: background 0.2s, box-shadow 0.2s;
  vertical-align: middle;
}
.sustain-indicator.on {
  background: var(--accent);
  box-shadow: 0 0 6px var(--glow);
}

/* How-to section */
.piano-howto {
  margin-top: 2rem;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
}

.shortcut-item {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shortcut-key {
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  padding: 0.3rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

.shortcut-desc {
  font-size: 0.8rem;
  color: var(--text);
}

/* QWERTY diagram */
.qwerty-diagram {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin-top: 1rem;
  overflow-x: auto;
}

.qwerty-row {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: nowrap;
}

.qk {
  width: 36px; height: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qk .qk-key  { font-size: 0.6rem; color: var(--muted); font-family: 'Space Mono', monospace; }
.qk .qk-note { font-size: 0.55rem; color: var(--accent); font-family: 'Space Mono', monospace; font-weight: 700; }
.qk.inactive { opacity: 0.3; }
.qk.black-mapped { border-color: var(--accent); }

/* Glow buttons (fullscreen + metronome link) */
.piano-btn-glow {
  position: relative;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 5px;
  border: 1px solid var(--accent);
  background: rgba(230,57,70,0.12);
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  animation: glow-pulse 2.5s ease-in-out infinite;
}
.piano-btn-glow:hover {
  background: rgba(230,57,70,0.28);
  box-shadow: 0 0 18px var(--glow), 0 0 36px rgba(230,57,70,0.2);
  animation: none;
}
.piano-btn-glow.active {
  background: var(--accent);
  box-shadow: 0 0 18px var(--glow), 0 0 36px rgba(230,57,70,0.3);
  animation: none;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(230,57,70,0.4), 0 0 12px rgba(230,57,70,0.15); }
  50%       { box-shadow: 0 0 14px rgba(230,57,70,0.7), 0 0 28px rgba(230,57,70,0.3); }
}

/* Metronome link - teal variant */
.piano-btn-metronome {
  border-color: #00c9b1;
  background: rgba(0,201,177,0.1);
  animation: glow-pulse-teal 2.5s ease-in-out infinite;
  animation-delay: 1.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.piano-btn-metronome:hover {
  background: rgba(0,201,177,0.25);
  box-shadow: 0 0 18px rgba(0,201,177,0.45), 0 0 36px rgba(0,201,177,0.2);
  animation: none;
  color: var(--white);
}
@keyframes glow-pulse-teal {
  0%, 100% { box-shadow: 0 0 6px rgba(0,201,177,0.4), 0 0 12px rgba(0,201,177,0.15); }
  50%       { box-shadow: 0 0 14px rgba(0,201,177,0.7), 0 0 28px rgba(0,201,177,0.3); }
}

/* Fullscreen piano mode */
.piano-fullscreen {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  border-radius: 0 !important;
  animation: piano-expand 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 10;
}
@keyframes piano-expand {
  from { transform: scaleX(0.92); opacity: 0.6; }
  to   { transform: scaleX(1);    opacity: 1; }
}
.piano-fullscreen #piano-wrap {
  padding: 0 2rem 1rem;
}
.piano-fullscreen .white-key {
  width: 58px;
  height: 200px;
}
.piano-fullscreen .black-key {
  width: 36px;
  height: 130px;
  margin-left: -18px;
  margin-right: -18px;
}
.piano-fullscreen #piano-keys {
  height: 200px;
}
.piano-fullscreen .key-note-label { font-size: 0.58rem; }
.piano-fullscreen .key-qwerty-label { font-size: 0.72rem; }

/* Close button shown only in fullscreen */
.piano-fs-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 16px;
  background: rgba(230,57,70,0.15);
  border: 1px solid var(--accent);
  color: var(--white);
  font-family: 'Space Mono', monospace;
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  z-index: 11;
}
.piano-fullscreen .piano-fs-close { display: block; }

/* MIDI status */
.midi-status {
  font-size: 0.68rem;
  font-family: 'Space Mono', monospace;
  padding: 0.3rem 0.65rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
}
.midi-status.midi-connected {
  border-color: #00c9b1;
  color: #00c9b1;
  background: rgba(0,201,177,0.08);
}
.midi-status.midi-unsupported { opacity: 0.5; }

/* iOS audio banner */
#ios-audio-banner {
  display: none;
  background: rgba(230,57,70,0.12);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.78rem;
  color: var(--text);
  text-align: center;
}

/* Recording timer */
#rec-timer {
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
  min-width: 36px;
  display: inline-block;
}
.rec-limit-note {
  font-size: 0.65rem;
  color: var(--muted);
}

/* Best-viewed banner */
.best-viewed-banner {
  background: rgba(201,168,76,0.08);
  border: 1px solid rgba(201,168,76,0.3);
  border-radius: 6px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.75rem;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Bueller badge */
.bueller-badge {
  font-family: 'Space Mono', monospace;
  font-size: 0.62rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
  white-space: nowrap;
  align-self: center;
}
.bueller-badge.loaded  { border-color: #9b59b6; color: #b57fd4; background: rgba(155,89,182,0.1); }
.bueller-badge.failed  { border-color: #e63946; color: var(--accent); }

/* Bueller button */
.piano-btn[data-sound="bueller"] { border-color: #9b59b6; }
.piano-btn[data-sound="bueller"]:hover { border-color: #a76fc0; color: var(--white); }
.piano-btn[data-sound="bueller"].active { background: #7d3c98; border-color: #9b59b6; }

/* 80s synth button */
.piano-btn[data-sound="synth80s"] { border-color: #00b4d8; }
.piano-btn[data-sound="synth80s"]:hover { border-color: #48cae4; color: var(--white); }
.piano-btn[data-sound="synth80s"].active { background: #0096c7; border-color: #00b4d8; }

/* Piano mobile responsive */
@media (max-width: 768px) {
  .piano-controls { gap: 0.75rem; }
  .ctrl-group { gap: 0.3rem; }
  .white-key { width: 36px; height: 144px; }
  .black-key { width: 23px; height: 90px; margin-left: -12px; margin-right: -11px; }
  #piano-keys { height: 144px; }
  .key-note-label { font-size: 0.48rem; }
  .key-qwerty-label { font-size: 0.55rem; }
}

@media (max-width: 480px) {
  .piano-page-wrap { padding: 0 0.75rem 2rem; }
  .piano-controls { padding: 1rem; }
}

/* =================================================================
   LED GRAPHIC EQUALISER + VU METER PAGE STYLES
   Scoped to .eq-faceplate and .eq-* classes.
   Used by eq-display.html and vu-meter.html.
================================================================= */

/* Faceplate extension - inherits .amp-faceplate from styles.css */

.eq-faceplate {
  padding-bottom: 20px;
}

/* ----------------------------------------------------------------
   LED canvas wrapper
   Full-width dark screen with inner bezel glow
---------------------------------------------------------------- */

.eq-display-wrap {
  background: #020408;
  border-radius: 6px;
  border: 2px solid #1a1a22;
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.9),
    inset 0 0 80px rgba(0,20,0,0.6),
    0 0 18px rgba(0,255,80,0.06),
    0 0 1px rgba(0,255,80,0.18);
  padding: 18px 16px 6px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

/* Subtle scanline overlay */
.eq-display-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.12) 3px,
    rgba(0,0,0,0.12) 4px
  );
  pointer-events: none;
  z-index: 2;
  border-radius: 4px;
}

/* Screen glare reflection */
.eq-display-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(
    180deg,
    rgba(255,255,255,0.025) 0%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 3;
  border-radius: 4px 4px 0 0;
}

.eq-canvas-container {
  position: relative;
  z-index: 1;
}

#eq-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}

/* ----------------------------------------------------------------
   Frequency band labels beneath the canvas
---------------------------------------------------------------- */

.eq-freq-labels {
  display: flex;
  justify-content: space-around;
  padding: 6px 0 4px;
  position: relative;
  z-index: 1;
}

.eq-freq-label {
  font-family: 'Space Mono', monospace;
  font-size: 0.48rem;
  letter-spacing: 0;
  color: rgba(0,220,60,0.5);
  text-align: center;
  flex: 1;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
  user-select: none;
}

/* ----------------------------------------------------------------
   Controls row
---------------------------------------------------------------- */

.eq-controls-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 32px;
  padding: 4px 0 8px;
}

/* Keep each control block upright inside the horizontal row */
.eq-controls-row .knob-wrap,
.eq-controls-row .vol-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.eq-peak-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* ----------------------------------------------------------------
   Related tool banner
---------------------------------------------------------------- */

.related-tool-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 10px 18px;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.related-tool-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #555568;
}

.related-tool-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e8a020;
  text-decoration: none;
  font-family: 'Space Mono', monospace;
  transition: color 0.18s;
}

.related-tool-link:hover {
  color: #ffbc40;
}

.related-tool-sep {
  color: #333340;
  font-size: 0.9rem;
}

.related-tool-desc {
  font-size: 0.72rem;
  color: #555568;
  letter-spacing: 0.04em;
}

/* ----------------------------------------------------------------
   Status text colours (EQ uses same #eq-status id as VU uses
   #status-text, so we duplicate the colour rules here scoped)
---------------------------------------------------------------- */

#eq-status {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: rgba(170,170,180,0.8);
  padding: 4px 10px;
  border-radius: 3px;
  transition: color 0.3s;
}

#eq-status.status-active {
  color: #39ff14;
}

#eq-status.status-error {
  color: #e63946;
}

/* ----------------------------------------------------------------
   Lit state: faceplate glows green when active
---------------------------------------------------------------- */

.eq-faceplate.eq-lit {
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.7),
    0 12px 40px rgba(0,0,0,0.85),
    0 0 60px rgba(0,220,60,0.08),
    inset 0 1px 0 rgba(255,255,255,0.065);
}

.eq-faceplate.eq-lit .eq-display-wrap {
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.85),
    inset 0 0 80px rgba(0,20,0,0.4),
    0 0 30px rgba(0,255,80,0.14),
    0 0 1px rgba(0,255,80,0.4);
}

/* ----------------------------------------------------------------
   Responsive
---------------------------------------------------------------- */

@media (max-width: 640px) {
  .eq-controls-row {
    gap: 18px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .eq-freq-label {
    font-size: 0.42rem;
  }

  .related-tool-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .related-tool-sep {
    display: none;
  }

  .related-tool-desc {
    display: none;
  }
}

@media (max-width: 400px) {
  .eq-display-wrap {
    padding: 12px 8px 4px;
  }
}

/* ================================================================
   HOME ARTICLES SECTION
================================================================ */

.home-articles {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}

.home-articles__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.home-articles__head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2rem;
  letter-spacing: 0.08em;
  color: #fff;
  margin: 0;
  line-height: 1;
}

.home-articles__head h2 span {
  color: #e94560;
}

.home-articles__all {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e94560;
  text-decoration: none;
  transition: opacity 0.2s;
}

.home-articles__all:hover {
  opacity: 0.75;
}

.home-articles__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.home-article-card {
  background: #111118;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.home-article-card:hover {
  border-color: rgba(233, 69, 96, 0.4);
  transform: translateY(-3px);
}

.home-article-card__img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

.home-article-card__body {
  padding: 1rem 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.home-article-card__cat {
  display: inline-block;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e94560;
  margin-bottom: 0.4rem;
}

.home-article-card__title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.home-article-card__title a {
  color: #fff;
  text-decoration: none;
  transition: color 0.2s;
}

.home-article-card__title a:hover {
  color: #e94560;
}

.home-article-card__excerpt {
  font-size: 0.78rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 0.75rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-article-card__date {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.04em;
}

@media (max-width: 720px) {
  .home-articles__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .home-articles__grid {
    grid-template-columns: 1fr;
  }
  .home-articles__head {
    flex-direction: column;
    gap: 0.75rem;
  }
}
