@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;
  padding: 1.5rem;
  position: relative;
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.justice-banner {
  width: 80%;
  text-align: center;
  padding: 1rem 1.5rem;
  background:
    linear-gradient(90deg,
      rgba(0, 229, 255, 0.12),
      rgba(255, 75, 209, 0.12)
    ),
    rgba(8,10,16,0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid rgba(0,229,255,0.25);
  border-bottom: 1px solid rgba(255,75,209,0.25);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text);
}

/* Hovering the TILE triggers the style, but not the link */
.entity-tile:hover {
  transform: translateY(-5px);
  border-color: var(--neon-cyan);
  box-shadow: 0 5px 15px rgba(38, 255, 230, 0.2);
  background: rgba(30, 0, 50, 0.8);
}

/* Styling the links inside the tile */
.entity-tile h3 a,
.entity-tile .inspect-link {
  color: var(--neon-cyan);
  text-decoration: none;
  transition: text-shadow 0.2s ease;
}

/* Make the title look like a header but act like a link */
.entity-tile h3 a {
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 1.2rem;
}

/* Global hover effect for any link inside the tile */
.entity-tile:hover a {
  text-shadow: 0 0 8px var(--neon-cyan);
  text-decoration: underline;
}

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

.entity-tile p {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.4;
}

.inspect-link {
  margin-top: auto;
  font-weight: bold;
}

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

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;
}

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; 
  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;
  }
}