@font-face {
  font-family: 'Chakra Petch';
  src: url('https://maddervramsey.com/assets/fonts/ChakraPetch-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  /* High-Contrast Palette */
  --bg-deep: #050505;
  --bg-panel: rgba(10, 0, 15, 0.85);
  --neon-pink: #ff2bb3;
  --neon-cyan: #26ffe6;
  --neon-amber: #ffbf00;
  --text-primary: #e0e0e0;
  --text-dim: #948ca1;
  --border-sharp: 1px solid rgba(169, 94, 255, 0.5);
  
  /* Layout Constants */
  --max-width: 1400px;
  --sidebar-w: 280px;
  --gap: 1.5rem;
}

/* Sensory Management Toggle - Applied to Body via JS */
body.clean-feed {
  --backdrop-blur: 0px;
  --animation-speed: 0s;
  text-shadow: none !important;
}

body {
  font-family: 'Chakra Petch', sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.4;
  overflow-x: hidden;
}

/* --- Layout Architecture --- */

.wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "sidebar main";
  min-height: 100vh;
  max-width: var(--max-width);
  margin: 0 auto;
  gap: var(--gap);
}

.site-header {
  grid-area: sidebar;
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--bg-panel);
  border-right: var(--border-sharp);
  backdrop-filter: blur(12px);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
}

.page-content {
  grid-area: main;
  padding: 2rem;
}

/* --- Entity Workstation Grid --- */

.workstation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--gap);
  margin-top: 2rem;
}

.entity-tile {
  background: rgba(20, 0, 30, 0.6);
  border: 1px solid rgba(38, 255, 230, 0.3);
  border-radius: 4px; /* Sharper corners for forensic feel */
  padding: 1.5rem;
  position: relative;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.entity-tile:hover {
  border-color: var(--neon-cyan);
  box-shadow: 0 0 15px rgba(38, 255, 230, 0.15);
}

.entity-tile h3 {
  color: var(--neon-cyan);
  font-size: 1.2rem;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.tile-status {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--neon-amber);
  margin-bottom: 1rem;
  display: block;
}

/* --- Typography & Elements --- */

h1 {
  font-size: 2.2rem;
  color: var(--neon-pink);
  text-transform: uppercase;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

/* Content reading constraint for Autistic UX */
p, .glitch-line {
  max-width: 70ch;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.glitch-line {
  color: var(--text-dim);
  font-style: italic;
  border-left: 2px solid var(--neon-pink);
  padding-left: 1rem;
  text-align: left; /* Changed from centered for readability */
}

a {
  color: var(--neon-cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s;
}

a:hover {
  border-bottom: 1px solid var(--neon-cyan);
  text-shadow: 0 0 8px var(--neon-cyan);
}

.neon-line {
  height: 1px; /* Thinned for precision */
  background: var(--neon-pink);
  box-shadow: 0 0 10px var(--neon-pink);
  margin: 2rem 0;
  width: 100%;
}

/* Navigation Overhaul */
.site-nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.site-nav a {
  font-size: 0.9rem;
  padding: 0.5rem 0;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}

.site-nav a:hover, .site-nav a[aria-current="page"] {
  color: var(--neon-pink);
}

/* --- Utility --- */
.glossy-frame {
  background: var(--bg-panel);
  border: var(--border-sharp);
  padding: 2.5rem;
  border-radius: 8px;
  backdrop-filter: blur(14px);
}

/* Responsive Tweak */
@media (max-width: 1024px) {
  .wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: "sidebar" "main";
  }
  .site-header {
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: var(--border-sharp);
  }
}

footer {
  grid-column: 1 / 5;
  margin-top: auto; 
  padding: 1.5rem 0;
  border-top: 1px solid rgba(169, 94, 255, 0.2);
  width: 100%;
}

footer p {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

/* 3. Handle cases where content is shorter than the viewport */
.wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-areas: "sidebar main";
  min-height: 100vh; /* Forces the grid to at least fill the screen */
  align-items: stretch;
}

/* 4. Mobile adjustment: If sidebar moves to top, footer stays at very bottom */
@media (max-width: 1024px) {
  .site-header {
    height: auto;
    min-height: auto;
  }
  
  footer {
    position: relative;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--bg-panel);
    border-top: var(--border-sharp);
    text-align: center;
  }
}