/* Paint the fixed rain above the page background and below every content layer. */
body {
  isolation: isolate;
}

.matrix-rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.matrix-playback {
  width: auto;
  min-height: 28px;
  padding: 3px 10px;
  border: 1px solid #42584a;
  background: #142019;
  color: #b6d7bd;
  font: 12px/1.4 Verdana, Arial, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}

.matrix-playback:hover { background: #213427; }
.matrix-playback:focus-visible { outline: 2px solid #b5eac1; outline-offset: 2px; }
.wordmark-row > .matrix-playback { margin-inline: auto 12px; }
.panel-title + .matrix-playback { margin: 10px 12px 0; }
.login > .matrix-playback, .denied-page .box > .matrix-playback { margin-top: 8px; }

@media (max-width: 700px) {
  .wordmark-row > .matrix-playback { margin-inline-end: 0; }
}

@media (pointer: coarse) {
  .matrix-playback { min-height: 44px; }
}

@media print, (forced-colors: active) {
  .matrix-rain, .matrix-playback { display: none; }
}

/* Transparent 3D depth shares the rain's background plane, beneath opaque panels. */
.matrix-scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: .86;
}

/* State feedback stays local: links, controls, and the existing header edges. */
:where(a, button, input, select, textarea, summary) {
  transition: color 150ms ease, background-color 150ms ease, border-color 150ms ease,
    text-decoration-color 150ms ease;
}

.site-header { transition: border-color 150ms ease; }
.site-header:focus-within { border-color: #59684f; }
.matrix-playback:active { background: #2b4432; }
.panel-title a, .site-footer a { text-underline-offset: 3px; }

@media (hover: hover) {
  .site-header:hover { border-color: #59684f; }
  .main-nav a:hover { color: #e3f1d5; }
}

@media (prefers-reduced-motion: reduce) {
  body:not([data-motion="play"]) :where(a, button, input, select, textarea, summary),
  body:not([data-motion="play"]) .site-header { transition: none; }
}

@media print, (forced-colors: active) {
  .matrix-scene { display: none; }
}
