/* =========================================================================
   resonance.css — AI Resonance instrument styles.
   Gold/dust space-odyssey aesthetic. The instrument must be visible
   immediately — border, glow, and frame show even before JS animates.
   ========================================================================= */

/* ── section wrapper ────────────────────────────────────────────────────── */
.rs-main {
  padding: 80px 64px 96px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* ── head ───────────────────────────────────────────────────────────────── */
.rs-head .ttl {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(234,240,251,0.45);
  margin-bottom: 6px;
}

.rs-head .sub {
  font-size: 13px;
  letter-spacing: 0.12em;
  color: rgba(234,240,251,0.65);
  margin-bottom: 16px;
}

.rs-head .intro {
  max-width: 640px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(234,240,251,0.70);
}

/* ── profile controls ───────────────────────────────────────────────────── */
.rs-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.rs-ctl-label {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(234,240,251,0.35);
  margin-right: 4px;
}

.rs-profile-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(234,240,251,0.50);
  background: rgba(234,240,251,0.04);
  border: 1px solid rgba(234,240,251,0.12);
  padding: 5px 14px;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s;
}

.rs-profile-btn:hover {
  color: rgba(234,240,251,0.85);
  border-color: rgba(234,240,251,0.30);
}

.rs-profile-btn.active {
  color: #D4A24C;
  border-color: rgba(212,162,76,0.55);
  background: rgba(212,162,76,0.08);
  box-shadow: 0 0 12px rgba(212,162,76,0.15);
}

/* ── canvas wrap — visible frame even before JS ─────────────────────────── */
.rs-canvas-wrap {
  width: 100%;
  height: 480px;
  background: rgba(8,10,18,0.55);
  border: 1px solid rgba(212,162,76,0.35);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(8,10,18,0.9) inset,
    0 0 64px rgba(212,162,76,0.10) inset,
    0 0 24px rgba(212,162,76,0.08);
}

/* Corner accents — visible frame markers */
.rs-canvas-wrap::before,
.rs-canvas-wrap::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: rgba(212,162,76,0.45);
  border-style: solid;
  pointer-events: none;
  z-index: 2;
}
.rs-canvas-wrap::before {
  top: 6px; left: 6px;
  border-width: 1px 0 0 1px;
}
.rs-canvas-wrap::after {
  bottom: 6px; right: 6px;
  border-width: 0 1px 1px 0;
}

.rs-canvas {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

/* Fallback text — hidden once canvas is active */
.rs-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(212,162,76,0.50);
  z-index: 0;
  pointer-events: none;
}
.rs-canvas-wrap.active .rs-fallback {
  display: none;
}

/* ── legend ─────────────────────────────────────────────────────────────── */
.rs-legend {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 24px;
  max-width: 800px;
}

.rs-leg-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.rs-leg-key {
  font-size: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(234,240,251,0.55);
  white-space: nowrap;
  min-width: 84px;
}

.rs-leg-desc {
  font-size: 11px;
  color: rgba(234,240,251,0.38);
  line-height: 1.5;
}

/* ── doctrine line ──────────────────────────────────────────────────────── */
.rs-doctrine {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 11px;
  color: rgba(234,240,251,0.35);
  max-width: 600px;
  padding-top: 8px;
  border-top: 1px solid rgba(234,240,251,0.06);
}

.rs-doctrine .tick::before {
  content: "▸";
  color: rgba(212,162,76,0.50);
  font-size: 9px;
}

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .rs-main {
    padding: 60px 24px 72px;
  }
  .rs-canvas-wrap {
    height: 400px;
  }
}

@media (max-width: 480px) {
  .rs-canvas-wrap {
    height: 320px;
  }
  .rs-legend {
    grid-template-columns: 1fr;
  }
}
