/* The Terminal Cathedral: Public Observation Ledger V7
 * Pure-Black Immersive Digital Matter Instrument Presentation
 * Matches Approved V5 Laboratory immersive stage:
 *   - Pure black viewport (#000000), ONLY the Digital Matter instrument visible.
 *   - Zero legacy breadcrumbs, headers, footers, cards, or text panels around the instrument.
 *   - Explicit readable text fallback (#v7-text-fallback) is mutually exclusive with the instrument.
 */

:root {
  --v7-void: #000000;
  --v7-bg: #080d12;
  --v7-concord: #83b8d7;
  --v7-concord-bright: #e4f4ff;
  --v7-gold: #c5a267;
  --v7-gold-bright: #f8e7be;
  --v7-ember: #c87832;
  --v7-text: #dce7ef;
  --v7-muted: #7f97a8;
  --v7-mono: Consolas, "SFMono-Regular", Menlo, Monaco, "Liberation Mono", monospace;
}

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

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: var(--v7-void);
  color: var(--v7-text);
  font-family: var(--v7-mono);
  -webkit-font-smoothing: antialiased;
}

body.v7-instrument-active {
  overflow: hidden;
  background: var(--v7-void);
}

/* ============================================================================
   1. PURE-BLACK IMMERSIVE INSTRUMENT STAGE (ONLY VISIBLE INTERFACE BY DEFAULT)
   ============================================================================ */

.v7-instrument-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--v7-void);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.v7-instrument-stage[hidden] {
  display: none !important;
}

.v7-canvas-host {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--v7-void);
  touch-action: manipulation;
}

.v7-canvas-host canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  cursor: default;
}

/* Invisible geometry-matched semantic button overlay for keyboard & screen readers */
.v7-semantic-nav {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.v7-semantic-btn {
  position: absolute;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.v7-semantic-btn:focus-visible {
  outline: 2px solid var(--v7-concord-bright);
  outline-offset: 2px;
  background: rgba(131, 184, 215, 0.14);
}

/* Ultra-discreet top-right utility strip (only keyboard-accessible exit/text fallback) */
.v7-corner-actions {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;
}

.v7-corner-btn {
  font-family: var(--v7-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 3px;
  border: 1px solid rgba(131, 184, 215, 0.22);
  background: rgba(8, 13, 18, 0.72);
  color: rgba(198, 224, 240, 0.72);
  cursor: pointer;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.v7-corner-btn:hover,
.v7-corner-btn:focus-visible {
  border-color: var(--v7-concord-bright);
  color: var(--v7-concord-bright);
  background: rgba(13, 22, 30, 0.92);
  outline: none;
}

.v7-corner-btn--sensor[hidden] {
  display: none;
}

/* ============================================================================
   2. CRT POWER-ON / SHUTDOWN TRANSITION OVERLAY
   ============================================================================ */

.v7-crt-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.v7-crt-overlay.is-active {
  opacity: 1;
  pointer-events: auto;
}

.v7-crt-beam {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(228, 244, 255, 0.92);
  box-shadow: 0 0 18px rgba(131, 184, 215, 0.8), -2px 0 0 rgba(200, 120, 50, 0.45), 2px 0 0 rgba(131, 184, 215, 0.45);
  transition: width 180ms cubic-bezier(0.22, 0.85, 0.36, 1), height 180ms cubic-bezier(0.22, 0.85, 0.36, 1), border-radius 160ms ease, opacity 140ms ease;
}

.v7-crt-beam.is-line {
  width: 94vw;
  height: 2px;
  border-radius: 1px;
}

.v7-crt-beam.is-open {
  width: 100vw;
  height: 100vh;
  border-radius: 0;
  opacity: 0;
}

/* ============================================================================
   3. EXPLICIT READABLE TEXT FALLBACK (MUTUALLY EXCLUSIVE WITH INSTRUMENT)
   ============================================================================ */

.v7-text-fallback {
  min-height: 100vh;
  background: #080d12;
  color: var(--v7-text);
  padding: 24px 20px 64px;
}

.v7-text-fallback[hidden] {
  display: none !important;
}

.v7-text-inner {
  max-width: 820px;
  margin: 0 auto;
}

.v7-text-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(131, 184, 215, 0.2);
}

.v7-text-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--v7-gold);
  text-transform: uppercase;
  margin: 0 0 6px;
}

.v7-text-title {
  font-size: 20px;
  letter-spacing: 0.06em;
  color: var(--v7-concord-bright);
  margin: 0;
}

.v7-text-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.v7-text-btn {
  font-family: var(--v7-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 12px;
  border-radius: 3px;
  border: 1px solid rgba(131, 184, 215, 0.45);
  background: rgba(13, 22, 30, 0.9);
  color: var(--v7-concord-bright);
  text-decoration: none;
  cursor: pointer;
}

.v7-text-btn:hover,
.v7-text-btn:focus-visible {
  border-color: var(--v7-gold-bright);
  color: var(--v7-gold-bright);
  outline: none;
}

.v7-text-status {
  padding: 12px 14px;
  border: 1px solid rgba(197, 162, 103, 0.35);
  background: rgba(13, 22, 30, 0.72);
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.55;
}

.v7-text-section {
  margin-bottom: 26px;
  padding: 16px 18px;
  border: 1px solid rgba(131, 184, 215, 0.18);
  background: rgba(11, 18, 25, 0.78);
}

.v7-text-section h2 {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--v7-gold-bright);
  margin: 0 0 12px;
}

.v7-text-section p {
  font-size: 13px;
  line-height: 1.65;
  margin: 0 0 10px;
  color: var(--v7-text);
}

.v7-text-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.v7-text-table th,
.v7-text-table td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(131, 184, 215, 0.14);
}

.v7-text-table th {
  color: var(--v7-muted);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 11px;
}

.v7-text-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.v7-text-links a {
  color: var(--v7-concord-bright);
  text-decoration: none;
  border-bottom: 1px solid rgba(131, 184, 215, 0.45);
  font-size: 12px;
  padding-bottom: 2px;
}

.v7-text-links a:hover,
.v7-text-links a:focus-visible {
  color: var(--v7-gold-bright);
  border-bottom-color: var(--v7-gold-bright);
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
