/**
 * Visual polish layer — additive overrides only.
 * Loaded last; does not replace steampunk-theme or sacred-geometry.
 */

/* ── Depth & atmosphere ───────────────────────────────────────────────────── */
#root {
  min-height: 100vh;
  isolation: isolate;
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -30%, rgba(0, 245, 255, 0.07), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 50%, rgba(255, 45, 166, 0.04), transparent 50%),
    radial-gradient(ellipse 70% 50% at 0% 80%, rgba(201, 162, 39, 0.06), transparent 45%),
    var(--bg-void);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgba(0, 245, 255, 0.25);
  color: var(--text-primary);
}

a {
  color: var(--brass-light);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

a:hover {
  color: var(--neon-cyan);
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.35);
  text-decoration: none;
}

/* ── Main shell ───────────────────────────────────────────────────────────── */
.main-with-status {
  position: relative;
}

.main-with-status::before {
  content: '';
  position: fixed;
  top: 0;
  left: 260px;
  right: 0;
  height: 1px;
  z-index: 50;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(201, 162, 39, 0.35) 15%,
    rgba(0, 245, 255, 0.5) 50%,
    rgba(255, 45, 166, 0.25) 85%,
    transparent
  );
  opacity: 0.85;
}

.layout--mobile .main-with-status::before {
  left: 0;
}

.main-content {
  padding: 2rem 2.5rem 3rem;
}

/* ── Page chrome ──────────────────────────────────────────────────────────── */
.page,
.page.fade-in {
  animation: af-page-in 0.55s cubic-bezier(0.23, 1, 0.32, 1) both;
}

@keyframes af-page-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-header h1,
.page > h1.font-display {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  background: linear-gradient(
    105deg,
    var(--brass-light) 0%,
    var(--text-primary) 35%,
    var(--neon-cyan) 70%,
    var(--brass) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: af-title-shimmer 8s ease-in-out infinite;
}

@keyframes af-title-shimmer {
  0%,
  100% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
}

.page-header {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(201, 162, 39, 0.12);
  margin-bottom: 1.75rem;
}

.deck-hero h1 {
  filter: drop-shadow(0 0 28px rgba(201, 162, 39, 0.15));
}

.deck-eyebrow {
  text-shadow: 0 0 20px rgba(201, 162, 39, 0.25);
}

.page-subtitle {
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  max-width: 52rem;
  line-height: 1.5;
}

.deck-hero-status {
  border-radius: 6px;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.section h2,
.detail-section h3 {
  font-family: var(--font-tech);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--brass-light);
}

.header-count,
.header-status {
  backdrop-filter: blur(8px);
}

/* ── Cards & panels ───────────────────────────────────────────────────────── */
.card,
.neon-card {
  border-radius: 6px;
  transition:
    transform 0.35s cubic-bezier(0.23, 1, 0.32, 1),
    box-shadow 0.35s ease,
    border-color 0.3s ease;
}

.neon-card:hover,
.card:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 162, 39, 0.45);
}

.neon-card-cyan:hover {
  border-color: rgba(0, 245, 255, 0.45);
}

.stat-card {
  position: relative;
}

.stat-card::after {
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.stat-card:hover::after {
  opacity: 0.7;
}

.stat-value {
  text-shadow: 0 0 24px rgba(0, 245, 255, 0.12);
}

.stat-value.hashrate,
.neon-glow-cyan {
  text-shadow: 0 0 20px rgba(0, 245, 255, 0.35);
}

.neon-glow-gold,
.neon-glow-amber {
  text-shadow: 0 0 18px rgba(255, 176, 32, 0.35);
}

.neon-glow-purple {
  text-shadow: 0 0 18px rgba(178, 75, 243, 0.35);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  transition:
    transform 0.2s ease,
    box-shadow 0.25s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.45;
  filter: grayscale(0.3);
}

.crucible-op-btn,
.agent-action-btn,
.button {
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.crucible-op-btn:hover:not(:disabled),
.agent-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */
.input,
.select,
textarea.input {
  transition:
    border-color 0.2s ease,
    box-shadow 0.25s ease,
    background 0.2s ease;
}

.input:hover:not(:disabled),
.select:hover:not(:disabled) {
  border-color: rgba(201, 162, 39, 0.5);
}

.checkbox,
input[type='checkbox'] {
  accent-color: var(--neon-cyan);
}

input[type='range'] {
  accent-color: var(--brass);
}

.label {
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

/* ── Sidebar nav ───────────────────────────────────────────────────────────── */
.nav-item.active {
  text-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
}

.nav-item.active .nav-icon svg {
  filter: drop-shadow(0 0 4px rgba(0, 245, 255, 0.6));
}

/* ── Status & badges ───────────────────────────────────────────────────────── */
.status-badge,
.latency-badge {
  backdrop-filter: blur(6px);
}

.system-status-bar {
  border-bottom: 1px solid rgba(201, 162, 39, 0.15);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* ── Fleet / agent UI ──────────────────────────────────────────────────────── */
.tactical-panel,
.agent-detail-panel {
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: 6px;
  background: linear-gradient(165deg, rgba(22, 18, 14, 0.92), rgba(8, 6, 4, 0.96));
  box-shadow: var(--shadow-panel), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.agent-list-item,
.fleet-agent-row {
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.agent-list-item:hover,
.fleet-agent-row:hover {
  box-shadow: inset 0 0 24px rgba(0, 245, 255, 0.04);
}

/* ── Tables & code ─────────────────────────────────────────────────────────── */
table {
  border-collapse: collapse;
}

th {
  font-family: var(--font-tech);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brass-light);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

tr:hover td {
  background: rgba(0, 245, 255, 0.03);
}

pre,
.log-viewer,
.master-terminal,
.terminal-output {
  border-radius: 4px;
  border: 1px solid rgba(201, 162, 39, 0.15);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.35);
}

code {
  font-family: var(--font-tech);
  font-size: 0.88em;
  color: var(--neon-cyan);
  background: rgba(0, 245, 255, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 2px;
}

/* ── Session gate ──────────────────────────────────────────────────────────── */
.session-gate {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(0, 245, 255, 0.1), transparent 55%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(201, 162, 39, 0.08), transparent 50%),
    var(--bg-void);
}

.session-gate-card {
  border-radius: 8px;
  box-shadow:
    var(--shadow-panel),
    0 0 40px rgba(0, 245, 255, 0.08),
    0 0 80px rgba(201, 162, 39, 0.06);
  animation: af-page-in 0.7s cubic-bezier(0.23, 1, 0.32, 1) both;
}

.session-gate-card h1 {
  text-align: center;
  background: linear-gradient(135deg, var(--brass-light), var(--neon-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Ambient layer harmony ─────────────────────────────────────────────────── */
.ambient-vignette {
  opacity: 0.92;
}

.ambient-orb {
  filter: blur(90px);
}

/* ── Scrollbars (firefox) ──────────────────────────────────────────────────── */
* {
  scrollbar-color: var(--brass-dark) var(--bg-deep);
}

/* ── Reduced motion ────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .page,
  .page-header h1,
  .page > h1.font-display,
  .session-gate-card,
  .neon-card:hover,
  .card:hover,
  .btn:hover:not(:disabled) {
    animation: none !important;
    transform: none !important;
  }

  .page-header h1,
  .page > h1.font-display {
    -webkit-text-fill-color: var(--text-primary);
    background: none;
  }
}
