/* ═══════════════════════════════════════════════════════════════════════════
   BACK POCKET MUSIC — SHARED DESIGN TOKENS + BENCH COMPONENTS
   The single :root token block for backpocketmusic.com (all pages).
   Part of the five-site system: tedkocher.com · backpocketmusic.com ·
   scorecanvas.io · pourover.me · tcaudio.co
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* base */
  --bg:       #0E0F12;
  --bg2:      #14161B;
  --bg3:      #1B1E24;
  --text:     #F2EFE9;
  --mid:      #9AA1A8;
  --dim:      #666E76;
  --faint:    #3A3F46;
  --line:     rgba(242, 239, 233, 0.10);
  --line2:    rgba(242, 239, 233, 0.05);

  /* this site's signature hue — phosphor green (10.3:1 on --bg) */
  --hue:      #59D499;
  --hue-dim:  rgba(89, 212, 153, 0.14);
  --hue-line: rgba(89, 212, 153, 0.35);

  /* cross-link rule: sibling links render in the DESTINATION's hue */
  --hue-ted:     #D8A24A;  /* tedkocher.com      (8.4:1)  */
  --hue-sc:      #4C6FFF;  /* scorecanvas.io — large type/CTA only (4.6:1) */
  --hue-sc-text: #8FA6FF;  /* scorecanvas.io — small text (canonical) */
  --hue-po:      #B07CE8;  /* pourover.me        (7.0:1)  */
  --hue-tc:      #E86352;  /* tcaudio.co         (5.5:1)  */

  /* type */
  --display: 'Fraunces', Georgia, serif;
  --body:    'Inter', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', 'Courier New', monospace;

  /* scale */
  --s1: 0.25rem; --s2: 0.5rem; --s3: 1rem; --s4: 1.75rem;
  --s5: 3rem;   --s6: 5rem;   --s7: 8rem;
}

/* ── base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: var(--hue); color: var(--bg); }
a { color: var(--hue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* cross-site links */
a.to-ted { color: var(--hue-ted); }
a.to-sc  { color: var(--hue-sc-text); }
a.to-po  { color: var(--hue-po); }
a.to-tc  { color: var(--hue-tc); }

/* WCAG 2.2 focus */
:focus-visible {
  outline: 2px solid var(--hue);
  outline-offset: 2px;
  border-radius: 1px;
}

/* ── silkscreen label (engraved-panel voice) ───────────────────────────── */
.silk {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.silk b, .silk strong { color: var(--hue); font-weight: 500; }

/* ── calibration ruler (section top edges) ─────────────────────────────── */
.cal-rule {
  height: 10px;
  background:
    repeating-linear-gradient(90deg,
      var(--hue-line) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(90deg,
      var(--hue) 0 1px, transparent 1px 60px);
  background-size: 100% 5px, 100% 10px;
  background-repeat: repeat-x;
  background-position: bottom, bottom;
  opacity: 0.55;
}

/* ── crossfade divider (patch-cable routing note) ──────────────────────── */
.xfade {
  display: flex;
  align-items: center;
  gap: var(--s3);
  padding: var(--s4) 2rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
}
.xfade::before, .xfade::after {
  content: '';
  height: 1px;
  background: var(--line2);
  flex: 1;
}

/* ── state readout (hardware LCD, bottom-left) ─────────────────────────── */
.state-lcd {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 900;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--hue);
  background:
    linear-gradient(rgba(89,212,153,0.06), rgba(89,212,153,0.02)),
    #0A0C0E;
  border: 1px solid rgba(89, 212, 153, 0.25);
  border-radius: 2px;
  padding: 7px 11px 6px;
  box-shadow: 0 0 18px rgba(89, 212, 153, 0.08), inset 0 0 12px rgba(0,0,0,0.5);
  pointer-events: none;
  max-width: calc(100vw - 28px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.state-lcd .lcd-dim { color: rgba(89, 212, 153, 0.45); }
/* faint scanline — decorative, static */
.state-lcd::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg,
    transparent 0 2px, rgba(0,0,0,0.18) 2px 3px);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .state-lcd b { transition: opacity 160ms linear; }
  .state-lcd.swap b { opacity: 0.25; }
}

/* ── caution label ─────────────────────────────────────────────────────── */
.caution {
  border: 1px solid rgba(216, 162, 74, 0.4);
  border-left: 14px solid transparent;
  border-image: repeating-linear-gradient(-45deg,
    #D8A24A 0 8px, #0E0F12 8px 16px) 1;
  background: rgba(216, 162, 74, 0.05);
  padding: var(--s3) var(--s4);
}
.caution-title {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--hue-ted);
  margin-bottom: var(--s2);
}
.caution-body {
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--mid);
}

/* ── spec-sheet table ──────────────────────────────────────────────────── */
.spec-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.spec {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.72rem;
}
.spec caption {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  padding-bottom: var(--s2);
}
.spec th {
  text-align: left;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  font-size: 0.62rem;
  padding: 9px 14px 9px 0;
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
  vertical-align: top;
}
.spec td {
  color: var(--text);
  padding: 9px 0;
  border-bottom: 1px solid var(--line2);
}

/* ── LED ───────────────────────────────────────────────────────────────── */
.led {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--hue);
  box-shadow: 0 0 8px var(--hue);
  vertical-align: middle;
}
@media (prefers-reduced-motion: no-preference) {
  .led { animation: led-breathe 3.2s ease-in-out infinite; }
  @keyframes led-breathe { 50% { opacity: 0.45; } }
}

/* ── global reduced-motion guard ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
