/* Dankstronamuz Ventures — Industrial Psychedelia Upgrade
   Aesthetics: Cybernetic, High-Contrast, Glitch-heavy, Neo-Brutalist.
*/
:root {
  --bg0: #020204;
  --bg1: #0a0a0f;
  --ink: #e0e6ed;
  --muted: #8892b0;
  
  /* Neon Palette */
  --neon-cyan: #0ff;
  --neon-pink: #f0f;
  --neon-green: #0f0;
  --neon-yellow: #ff0;
  --plasma-violet: #bc13fe;
  
  --glass: rgba(10, 20, 30, 0.6);
  --glass-border: rgba(0, 255, 255, 0.2);
  --grid-line: rgba(255, 255, 255, 0.05);
  
  --font-display: "Courier New", Courier, monospace; /* Industrial/Code feel */
  --font-body: system-ui, -apple-system, sans-serif;
  
  --shadow-glow: 0 0 15px rgba(0, 255, 255, 0.15);
  --shadow-deep: 0 20px 50px rgba(0,0,0,0.9);
  
  --radius: 2px; /* Sharper, more industrial */
}

* { box-sizing: border-box; }
html, body { height: 100%; }

img, canvas, video {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--bg0);
  background-image: 
    linear-gradient(rgba(0, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px; /* Technical Grid */
  overflow-x: hidden;
  cursor: crosshair; /* Precision feel */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Typography Overrides */
h1, h2, h3, .brand b, .kicker, .tag {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1 {
  text-shadow: 2px 2px 0px var(--plasma-violet);
  position: relative;
}

a { color: inherit; text-decoration: none; transition: all 0.2s; }
a:hover { color: var(--neon-cyan); text-shadow: 0 0 8px var(--neon-cyan); }

/* Canvas Layers */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  opacity: 0.8;
  mix-blend-mode: screen;
}

#grain {
  position: fixed;
  inset: 0;
  z-index: 9999; /* Top level overlay */
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.15),
    rgba(0, 0, 0, 0.15) 1px,
    transparent 1px,
    transparent 2px
  );
  background-size: 100% 4px;
  opacity: 0.3;
  mix-blend-mode: overlay;
}

.container {
  width: min(1200px, 94vw);
  margin: 0 auto;
  padding: 40px 0 100px;
  position: relative;
  z-index: 10;
}

/* Navigation - HUD Style */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 2, 4, 0.7);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--neon-cyan);
  box-shadow: 0 2px 20px rgba(0, 255, 255, 0.1);
}

.navInner {
  width: min(1200px, 94vw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.brand {
  border: 1px solid var(--neon-cyan);
  padding: 8px 12px;
  background: rgba(0, 255, 255, 0.05);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
}
.brand b { color: var(--neon-cyan); }
.brand span { font-size: 10px; color: var(--muted); display: block; margin-top: 2px; }

.navLinks { display: flex; gap: 8px; flex-wrap: wrap; }

.pill {
  font-family: var(--font-display);
  font-size: 12px;
  padding: 8px 16px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.6); /* Increased opacity for readability */
  color: var(--muted);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(4px);
  white-space: nowrap; /* Prevent internal wrapping */
}

.pill:hover, .pill.active {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px var(--neon-cyan);
}

/* Buttons - Actuated Engines */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  padding: 14px 24px;
  border: 1px solid var(--neon-cyan);
  background: rgba(0,0,0,0.4);
  color: var(--neon-cyan);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  cursor: pointer;
  z-index: 1;
  margin: 4px; /* Prevent overlap */
  display: inline-block;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: var(--neon-cyan);
  transition: transform 0.3s ease;
  z-index: -1;
  transform: skewX(-20deg);
}

.btn:hover {
  color: #000;
  box-shadow: 0 0 20px var(--neon-cyan);
}

.btn:hover::before {
  transform: translateX(100%) skewX(-20deg);
  left: 0;
}

.btn.primary {
  background: var(--neon-cyan);
  color: #000;
  border-color: var(--neon-cyan);
}
.btn.primary:hover {
  background: #fff;
  border-color: #fff;
  box-shadow: 0 0 30px #fff;
}

/* Cards - Data Panes */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 40px;
}
@media (min-width: 860px) { .grid { grid-template-columns: repeat(12, 1fr); } }

.card {
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 20, 0.4);
  backdrop-filter: blur(12px);
  position: relative;
  transition: box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s;
  border-radius: var(--radius);
  overflow: hidden;
}

.card:hover {
  /* No transform to allow JS parallax */
  border-color: var(--neon-pink);
  box-shadow: 0 0 30px rgba(255, 0, 255, 0.2), inset 0 0 20px rgba(255, 0, 255, 0.05);
  background: rgba(10, 15, 20, 0.6);
}

.cardInner { padding: 24px; position: relative; z-index: 2; }

.card h2 {
  color: var(--ink);
  border-left: 3px solid var(--neon-pink);
  padding-left: 12px;
}

.cardGlow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255, 0, 255, 0.1), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
  mix-blend-mode: color-dodge;
}
.card:hover .cardGlow { opacity: 1; }

.tags { display: flex; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 10px;
  padding: 4px 8px;
  border: 1px solid var(--muted);
  color: var(--muted);
  background: rgba(0,0,0,0.5);
}

/* Utility */
.sectionTitle h2 {
  font-size: 28px;
  border-bottom: 2px solid var(--neon-green);
  display: inline-block;
  padding-bottom: 5px;
}
.sectionTitle .note { color: var(--neon-green); font-family: var(--font-display); }

footer {
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
  padding-top: 20px;
  font-family: var(--font-display);
  font-size: 11px;
  text-transform: uppercase;
  opacity: 0.6;
}

/* Glitch Animation Keyframes */
@keyframes glitch-skew {
  0% { transform: skew(0deg); }
  20% { transform: skew(-2deg); }
  40% { transform: skew(2deg); }
  60% { transform: skew(-1deg); }
  80% { transform: skew(1deg); }
  100% { transform: skew(0deg); }
}

/* Ecosystem map specific styles */
.mapWrap {
  height: min(62vh, 520px);
  border: 1px solid var(--neon-cyan);
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
  margin-top: 20px;
  border-radius: var(--radius);
}
#mapCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.mapLegend {
  position: absolute;
  left: 20px;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  pointer-events: none;
}
.legendItem {
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.8);
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-display);
  text-transform: uppercase;
}
.dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 5px currentColor; }
.dot.cyan { background: var(--neon-cyan); color: var(--neon-cyan); }
.dot.violet { background: var(--plasma-violet); color: var(--plasma-violet); }
.dot.gold { background: var(--neon-yellow); color: var(--neon-yellow); }
.dot.red { background: var(--neon-pink); color: var(--neon-pink); }

.small { font-size: 11px; color: var(--muted); }
hr.sep { border: 0; border-top: 1px solid var(--glass-border); margin: 30px 0; }

/* Shared Layout Refinements */
.hero {
  margin-top: 22px;
  margin-bottom: 20px;
}

.kicker {
  font-size: 11px;
  color: var(--neon-cyan);
  margin-bottom: 10px;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(1.8rem, 4.5vw, 3rem);
  line-height: 1.08;
}

.subhead {
  max-width: 74ch;
  color: #c6d0df;
  line-height: 1.65;
  font-size: clamp(1rem, 1.4vw, 1.15rem);
}

.ctaRow {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cardActions {
  margin-top: 18px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn:focus-visible,
.pill:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 2px;
}

.interactive-card {
  border-color: rgba(0, 255, 255, 0.35);
  box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.08);
}

.interactive-card:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.22), inset 0 0 18px rgba(0, 255, 255, 0.08);
}

.statusPill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border: 1px solid var(--glass-border);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--font-display);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.45);
}

.statusPill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--neon-cyan);
  box-shadow: 0 0 8px var(--neon-cyan);
}

.statusPill.warn::before {
  background: var(--neon-yellow);
  box-shadow: 0 0 8px var(--neon-yellow);
}

.statusPill.plan::before {
  background: var(--plasma-violet);
  box-shadow: 0 0 8px var(--plasma-violet);
}

.chipRow {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 11px;
  border: 1px solid var(--glass-border);
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.6);
  cursor: pointer;
}

.chip:hover,
.chip[aria-pressed="true"],
.chip.active {
  color: #000;
  border-color: var(--neon-cyan);
  background: var(--neon-cyan);
  box-shadow: 0 0 14px rgba(0, 255, 255, 0.25);
}

.panel {
  border: 1px solid var(--glass-border);
  background: rgba(10, 15, 20, 0.55);
  padding: 14px;
  border-radius: var(--radius);
}

.collapsible {
  border: 1px solid var(--glass-border);
  background: rgba(2, 6, 10, 0.5);
  margin-top: 10px;
}

.collapsible summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.collapsible summary::-webkit-details-marker {
  display: none;
}

.collapsible .content {
  padding: 0 14px 14px;
}

.readoutGrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.readoutCell {
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.35);
  padding: 10px;
}

.readoutCell b {
  display: block;
  font-family: var(--font-display);
  font-size: 11px;
  color: var(--neon-cyan);
  margin-bottom: 6px;
}

.stack16 > * + * {
  margin-top: 16px;
}

.stack24 > * + * {
  margin-top: 24px;
}

.moduleGrid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.signalTable {
  width: 100%;
  border-collapse: collapse;
}

.signalTable th,
.signalTable td {
  border-bottom: 1px solid rgba(0, 255, 255, 0.15);
  padding: 10px 8px;
  text-align: left;
  font-size: 12px;
}

.signalTable th {
  color: var(--neon-cyan);
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
}

@media (max-width: 880px) {
  .navInner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .container {
    padding-top: 26px;
  }

  .hero {
    margin-top: 8px;
  }
}

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

  #grain {
    opacity: 0.16;
  }
}
