:root {
  --bg-color: #020202;
  --panel-bg: rgba(20, 20, 20, 0.6);
  --primary: #ff3333;
  /* Alert Red */
  --dim-red: #5c1818;
  --text-main: #dcdcdc;
  --text-muted: #777;
  --border-width: 2px;
  --font-tech: "Consolas", "Monaco", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-tech);
  overflow-x: hidden;
  border: 4px solid var(--dim-red);
  min-height: 100vh;
}

/* --- CRT SCANLINE EFFECT --- */
body::before {
  content: " ";
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
    linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
  z-index: 1000;
  background-size: 100% 3px, 3px 100%;
  pointer-events: none;
  /* CRITICAL: Allows clicks through scanlines */
}

/* Scanline Animation */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: rgba(255, 51, 51, 0.1);
  animation: scan 6s linear infinite;
  pointer-events: none;
  /* CRITICAL: Allows clicks through scan bar */
  z-index: 1001;
}

@keyframes scan {
  0% {
    top: -10%;
  }

  100% {
    top: 110%;
  }
}

/* --- CONTENT WRAPPER --- */
.interface-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
  z-index: 2000;
  /* Ensures content is ABOVE scanlines */
}

/* --- HEADER / HUD TOP --- */
header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 10px;
  margin-bottom: 3rem;
}

.sys-status {
  font-size: 0.7rem;
  color: var(--primary);
  display: flex;
  gap: 15px;
}

.sys-status span {
  border: 1px solid var(--dim-red);
  padding: 2px 6px;
}

h1 {
  font-size: 3rem;
  margin: 0;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: -2px;
}

.highlight-text {
  color: var(--primary);
}

.sub-glitch {
  color: var(--primary);
  font-size: 1rem;
  margin-left: 5px;
}

/* --- NAVIGATION --- */
nav {
  display: flex;
  gap: 2px;
  margin-bottom: 4rem;
}

nav a {
  flex: 1;
  text-align: center;
  background: var(--dim-red);
  color: #aaa;
  text-decoration: none;
  padding: 10px;
  font-size: 0.9rem;
  transition: 0.2s;
  border: 1px solid transparent;
  position: relative;
  z-index: 10;
}

nav a:hover {
  background: var(--primary);
  color: #000;
  font-weight: bold;
  box-shadow: 0 0 15px var(--primary);
}

/* --- SECTIONS (HUD PANELS) --- */
section {
  margin-bottom: 5rem;
}

.panel-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
}

.panel-title {
  background: var(--primary);
  color: #000;
  padding: 5px 15px;
  font-weight: bold;
  font-size: 1.1rem;
  margin-right: 10px;
}

.panel-line {
  height: 1px;
  background: var(--primary);
  flex-grow: 1;
  opacity: 0.5;
}

/* --- GRID LAYOUT --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

/* --- TACTICAL CARDS --- */
.tactical-card {
  background: var(--panel-bg);
  padding: 20px;
  position: relative;
  border: 1px solid #333;
  transition: 0.3s;
}

/* Corner Brackets Logic */
.tactical-card::before,
.tactical-card::after {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-color: var(--primary);
  border-style: solid;
  transition: 0.3s;
  pointer-events: none;
  /* FIX: Makes border transparent to clicks */
  z-index: 1;
}

/* Top Left */
.tactical-card::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.tactical-card:hover {
  border-color: var(--primary);
  box-shadow: inset 0 0 20px rgba(255, 51, 51, 0.1);
}

.tactical-card:hover::before {
  width: 100%;
  height: 100%;
  border-width: 2px;
}

/* Helper Classes for specific cards */
.centered-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.no-border {
  border: none;
}

.no-border::before,
.no-border::after {
  display: none;
}

/* Content inside card needs to be clickable */
.tactical-card h3,
.tactical-card p,
.tactical-card .stat-row,
.tactical-card a,
.tactical-card div {
  position: relative;
  z-index: 5;
  /* FIX: Lifts text and buttons above the border animation */
}

.tactical-card h3 {
  color: #fff;
  margin-top: 0;
  border-bottom: 1px dashed #444;
  padding-bottom: 10px;
}

.tactical-card p {
  color: #999;
  font-size: 0.9rem;
  line-height: 1.5;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-top: 15px;
  color: var(--primary);
}

.experience-number {
  font-size: 4rem;
  color: var(--primary);
  line-height: 1;
}

.experience-text {
  /* Basic text styling if needed */
}

/* --- CONTACT TERMINAL & BUTTONS --- */
.cmd-input {
  width: 100%;
  background: black;
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 15px;
  font-family: var(--font-tech);
  margin-bottom: 10px;
  position: relative;
  z-index: 10;
}

.cmd-input:focus {
  outline: none;
  box-shadow: 0 0 10px var(--dim-red);
}

/* Shared Button Style */
.cmd-btn {
  background: var(--primary);
  color: black;
  border: none;
  padding: 10px 30px;
  font-family: var(--font-tech);
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
  transition: 0.3s;
  position: relative;
  z-index: 10;
}

.cmd-btn:hover {
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.social-links {
  margin-top: 20px;
}

.social-link {
  color: var(--primary);
  margin-right: 15px;
  text-decoration: none;
}

.comms-grid {
  grid-template-columns: 1fr 1fr;
}

footer {
  text-align: center;
  color: #555;
  font-size: 0.8rem;
  margin-top: 4rem;
  border-top: 1px dashed #333;
  padding-top: 20px;
}

/* --- MOBILE --- */
.hamburger {
  display: none;
  color: var(--primary);
  font-size: 1.5rem;
  cursor: pointer;
  margin-bottom: 1rem;
  position: relative;
  z-index: 2001;
}

@media (max-width: 768px) {
  h1 {
    font-size: 2rem;
  }

  .hamburger {
    display: block;
  }

  nav {
    display: none;
    flex-direction: column;
    gap: 5px;
  }

  nav.active {
    display: flex;
  }

  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .grid {
    grid-template-columns: 1fr !important;
  }

  .comms-grid {
    grid-template-columns: 1fr !important;
  }
}
