/* ============================================================
   LATHE BIOSAS - BATTLEMECH REPAIR FACILITY THEME
   Metalheart / Depthcore inspired industrial aesthetic
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Core palette */
  --metal-dark: #1a1a1a;
  --metal-mid: #2a2a2a;
  --metal-light: #3a3a3a;
  --metal-highlight: #4a4a4a;
  --metal-shine: #5a5a5a;
  --metal-edge: #666;

  /* Accent colors */
  --green-glow: #00ff41;
  --green-dim: #00cc33;
  --green-dark: #006622;
  --green-text: #00dd38;
  --amber-warn: #ff9900;
  --red-alert: #ff2200;
  --red-dim: #cc1100;
  --blue-data: #0088ff;
  --cyan-info: #00cccc;

  /* Caution stripe colors */
  --caution-yellow: #ffcc00;
  --caution-black: #111;

  /* Background layers */
  --bg-base: #0a0a0a;
  --bg-panel: #151515;
  --bg-inset: #0d0d0d;
  --bg-terminal: #050a05;

  /* Typography */
  --font-mono: 'Courier New', 'Lucida Console', monospace;
  --font-display: 'Impact', 'Arial Black', sans-serif;
  --font-ui: 'Trebuchet MS', 'Arial', sans-serif;

  /* Spacing */
  --rivet-size: 8px;
  --panel-gap: 3px;
  --border-width: 2px;

  /* CRT */
  --scanline-opacity: 0.08;
  --crt-flicker-speed: 0.05s;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--green-dim) var(--metal-dark);
}

body {
  background: var(--bg-base);
  color: var(--green-text);
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--metal-dark);
  border-left: 1px solid var(--metal-highlight);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--metal-highlight), var(--metal-mid), var(--metal-highlight));
  border: 1px solid var(--metal-shine);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--metal-shine), var(--metal-light), var(--metal-shine));
}

/* --- CRT Scanline Overlay --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 2px,
    rgba(0, 0, 0, var(--scanline-opacity)) 4px
  );
  pointer-events: none;
  z-index: 10000;
  animation: scanlineShift 10s linear infinite;
}

/* CRT vignette */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
    ellipse at center,
    transparent 60%,
    rgba(0, 0, 0, 0.4) 100%
  );
  pointer-events: none;
  z-index: 9999;
}

@keyframes scanlineShift {
  0% { background-position: 0 0; }
  100% { background-position: 0 100vh; }
}

/* --- Metal Textures (CSS Generated) --- */
.metal-texture {
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.02) 2px,
      rgba(255, 255, 255, 0.02) 4px
    ),
    linear-gradient(
      180deg,
      var(--metal-light) 0%,
      var(--metal-mid) 20%,
      var(--metal-dark) 50%,
      var(--metal-mid) 80%,
      var(--metal-light) 100%
    );
}

.metal-brushed {
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 1px,
      rgba(255, 255, 255, 0.03) 1px,
      rgba(255, 255, 255, 0.03) 2px
    ),
    linear-gradient(
      180deg,
      #333 0%,
      #2a2a2a 30%,
      #222 50%,
      #2a2a2a 70%,
      #333 100%
    );
}

.metal-diamond-plate {
  background:
    linear-gradient(45deg, var(--metal-mid) 25%, transparent 25%),
    linear-gradient(-45deg, var(--metal-mid) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--metal-mid) 75%),
    linear-gradient(-45deg, transparent 75%, var(--metal-mid) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: var(--metal-dark);
}

/* --- Rivet System --- */
.rivet {
  width: var(--rivet-size);
  height: var(--rivet-size);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    var(--metal-shine),
    var(--metal-light) 40%,
    var(--metal-mid) 60%,
    var(--metal-dark) 100%
  );
  box-shadow:
    inset 0 -1px 2px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.1);
  position: absolute;
  z-index: 10;
}

/* Rivet positions for panels */
.riveted {
  position: relative;
}
.riveted::before,
.riveted::after {
  content: '';
  width: var(--rivet-size);
  height: var(--rivet-size);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    var(--metal-shine),
    var(--metal-light) 40%,
    var(--metal-mid) 60%,
    var(--metal-dark) 100%
  );
  box-shadow:
    inset 0 -1px 2px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.1);
  position: absolute;
  z-index: 10;
}

/* Corner rivets - top */
.rivets-top::before {
  top: 8px;
  left: 8px;
}
.rivets-top::after {
  top: 8px;
  right: 8px;
}

/* Corner rivets - bottom (via extra element) */
.rivets-all {
  position: relative;
}
.rivets-all .rivet-bl,
.rivets-all .rivet-br {
  content: '';
  width: var(--rivet-size);
  height: var(--rivet-size);
  border-radius: 50%;
  background: radial-gradient(
    circle at 35% 35%,
    var(--metal-shine),
    var(--metal-light) 40%,
    var(--metal-mid) 60%,
    var(--metal-dark) 100%
  );
  box-shadow:
    inset 0 -1px 2px rgba(0,0,0,0.6),
    0 1px 1px rgba(255,255,255,0.1);
  position: absolute;
  z-index: 10;
}

/* --- Caution Stripes --- */
.caution-stripe {
  background: repeating-linear-gradient(
    -45deg,
    var(--caution-yellow),
    var(--caution-yellow) 10px,
    var(--caution-black) 10px,
    var(--caution-black) 20px
  );
  height: 16px;
  width: 100%;
  border-top: 2px solid var(--metal-highlight);
  border-bottom: 2px solid var(--metal-highlight);
}

.caution-stripe-thin {
  background: repeating-linear-gradient(
    -45deg,
    var(--caution-yellow),
    var(--caution-yellow) 6px,
    var(--caution-black) 6px,
    var(--caution-black) 12px
  );
  height: 8px;
  width: 100%;
}

.caution-stripe-red {
  background: repeating-linear-gradient(
    -45deg,
    var(--red-alert),
    var(--red-alert) 10px,
    var(--caution-black) 10px,
    var(--caution-black) 20px
  );
  height: 16px;
  width: 100%;
  border-top: 2px solid var(--metal-highlight);
  border-bottom: 2px solid var(--metal-highlight);
}

/* --- Panel System --- */
.panel {
  background: var(--bg-panel);
  border: var(--border-width) solid var(--metal-highlight);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    inset 0 -1px 0 rgba(0,0,0,0.3),
    0 2px 8px rgba(0,0,0,0.5);
  position: relative;
}

.panel-inset {
  background: var(--bg-inset);
  border: 2px solid var(--metal-dark);
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.5),
    inset 0 0 20px rgba(0,0,0,0.3);
}

.panel-raised {
  background: linear-gradient(
    180deg,
    var(--metal-light) 0%,
    var(--metal-mid) 5%,
    var(--metal-dark) 95%,
    #111 100%
  );
  border: 1px solid var(--metal-highlight);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 3px 6px rgba(0,0,0,0.4);
}

/* --- Column System --- */
.column-left,
.column-right {
  width: 60px;
  background:
    repeating-linear-gradient(
      180deg,
      var(--metal-mid) 0px,
      var(--metal-light) 2px,
      var(--metal-mid) 4px
    ),
    linear-gradient(
      90deg,
      var(--metal-dark) 0%,
      var(--metal-light) 30%,
      var(--metal-mid) 50%,
      var(--metal-light) 70%,
      var(--metal-dark) 100%
    );
  border-left: 1px solid var(--metal-highlight);
  border-right: 1px solid var(--metal-highlight);
  position: relative;
  flex-shrink: 0;
}

.column-left::before,
.column-right::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.1) 0%,
    rgba(255,255,255,0.03) 50%,
    rgba(255,255,255,0.1) 100%
  );
}

/* Column bolts */
.column-bolts {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 80px;
  padding: 20px 0;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
}

.bolt {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 40% 35%,
    var(--metal-shine) 0%,
    var(--metal-light) 30%,
    var(--metal-mid) 60%,
    var(--metal-dark) 100%
  );
  box-shadow:
    inset 0 -2px 3px rgba(0,0,0,0.5),
    0 1px 2px rgba(255,255,255,0.1);
  position: relative;
  flex-shrink: 0;
}

.bolt::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 2px;
  background: var(--metal-dark);
  box-shadow: 0 0 1px rgba(0,0,0,0.5);
}

.bolt::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(90deg);
  width: 8px;
  height: 2px;
  background: var(--metal-dark);
  box-shadow: 0 0 1px rgba(0,0,0,0.5);
}

/* --- Header Bar --- */
.site-header {
  background: linear-gradient(
    180deg,
    var(--metal-light) 0%,
    var(--metal-mid) 3%,
    var(--metal-dark) 50%,
    var(--metal-mid) 97%,
    var(--metal-light) 100%
  );
  border-bottom: 3px solid var(--metal-highlight);
  box-shadow: 0 4px 12px rgba(0,0,0,0.6);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  height: 70px;
}

/* --- Logo --- */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--green-glow);
}

.logo-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow:
    0 0 10px rgba(0, 255, 65, 0.5),
    0 0 20px rgba(0, 255, 65, 0.3),
    0 0 40px rgba(0, 255, 65, 0.1);
  line-height: 1;
}

.logo-subtitle {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 6px;
  text-transform: uppercase;
  color: var(--green-dim);
  opacity: 0.7;
}

/* --- Navigation --- */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green-dim);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid transparent;
  background: transparent;
  transition: all 0.2s ease;
  position: relative;
  cursor: pointer;
}

.nav-link:hover {
  color: var(--green-glow);
  background: rgba(0, 255, 65, 0.05);
  border-color: var(--green-dark);
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}

.nav-link.active {
  color: var(--green-glow);
  background: rgba(0, 255, 65, 0.08);
  border: 1px solid var(--green-dark);
  box-shadow:
    inset 0 0 10px rgba(0, 255, 65, 0.1),
    0 0 5px rgba(0, 255, 65, 0.1);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--green-glow);
  box-shadow: 0 0 6px var(--green-glow);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 80%;
}

/* --- Status Bar (under header) --- */
.status-bar {
  background: var(--bg-base);
  border-bottom: 1px solid var(--metal-mid);
  padding: 4px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: var(--green-dark);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.status-bar .status-left,
.status-bar .status-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green-glow);
  box-shadow: 0 0 4px var(--green-glow);
  animation: blink 2s infinite;
}

.status-dot.amber {
  background: var(--amber-warn);
  box-shadow: 0 0 4px var(--amber-warn);
  animation: blink 1.5s infinite;
}

.status-dot.red {
  background: var(--red-alert);
  box-shadow: 0 0 4px var(--red-alert);
  animation: blink 0.8s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Main Layout --- */
.site-layout {
  display: flex;
  min-height: calc(100vh - 100px);
  max-width: 1400px;
  margin: 0 auto;
}

.main-content {
  flex: 1;
  padding: 20px;
  min-width: 0;
}

/* --- Section Headers --- */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--metal-highlight);
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--green-glow);
  text-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.section-header .header-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--green-dark), transparent);
}

.section-header .section-id {
  font-size: 10px;
  color: var(--metal-edge);
  letter-spacing: 2px;
}

/* --- Terminal Display --- */
.terminal {
  background: var(--bg-terminal);
  border: 2px solid var(--green-dark);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.8;
  color: var(--green-text);
  position: relative;
  overflow: hidden;
  box-shadow:
    inset 0 0 30px rgba(0, 255, 65, 0.03),
    0 0 10px rgba(0, 0, 0, 0.5);
}

.terminal::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(180deg, rgba(0,255,65,0.05), transparent);
  pointer-events: none;
}

.terminal .prompt {
  color: var(--green-glow);
  font-weight: bold;
}

.terminal .cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--green-glow);
  animation: cursorBlink 1s step-end infinite;
  vertical-align: text-bottom;
  margin-left: 2px;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* --- Warning Lights --- */
.warning-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--metal-highlight);
  position: relative;
}

.warning-light.green {
  background: var(--green-glow);
  box-shadow: 0 0 6px var(--green-glow), inset 0 -2px 4px rgba(0,0,0,0.3);
  animation: glow-green 3s ease-in-out infinite;
}

.warning-light.amber {
  background: var(--amber-warn);
  box-shadow: 0 0 6px var(--amber-warn), inset 0 -2px 4px rgba(0,0,0,0.3);
  animation: glow-amber 2s ease-in-out infinite;
}

.warning-light.red {
  background: var(--red-alert);
  box-shadow: 0 0 6px var(--red-alert), inset 0 -2px 4px rgba(0,0,0,0.3);
  animation: glow-red 1s ease-in-out infinite;
}

@keyframes glow-green {
  0%, 100% { box-shadow: 0 0 6px var(--green-glow), inset 0 -2px 4px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 12px var(--green-glow), 0 0 24px rgba(0,255,65,0.2), inset 0 -2px 4px rgba(0,0,0,0.3); }
}

@keyframes glow-amber {
  0%, 100% { box-shadow: 0 0 6px var(--amber-warn), inset 0 -2px 4px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 12px var(--amber-warn), 0 0 24px rgba(255,153,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3); }
}

@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 6px var(--red-alert), inset 0 -2px 4px rgba(0,0,0,0.3); }
  50% { box-shadow: 0 0 12px var(--red-alert), 0 0 24px rgba(255,34,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3); }
}

/* --- Warning Labels --- */
.warning-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(255, 34, 0, 0.1);
  border: 1px solid var(--red-dim);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--red-alert);
}

.info-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid var(--green-dark);
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green-dim);
}

/* --- Gauge / Meter --- */
.gauge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gauge-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--metal-edge);
  width: 60px;
  flex-shrink: 0;
}

.gauge-track {
  flex: 1;
  height: 8px;
  background: var(--bg-inset);
  border: 1px solid var(--metal-mid);
  position: relative;
  overflow: hidden;
}

.gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-dark), var(--green-glow));
  box-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
  transition: width 1s ease;
}

.gauge-fill.amber {
  background: linear-gradient(90deg, #664400, var(--amber-warn));
  box-shadow: 0 0 6px rgba(255, 153, 0, 0.3);
}

.gauge-fill.red {
  background: linear-gradient(90deg, #660000, var(--red-alert));
  box-shadow: 0 0 6px rgba(255, 34, 0, 0.3);
}

.gauge-value {
  font-size: 10px;
  color: var(--green-glow);
  width: 35px;
  text-align: right;
  flex-shrink: 0;
}

/* --- Card System --- */
.card {
  background: var(--bg-panel);
  border: 1px solid var(--metal-highlight);
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}

.card:hover {
  border-color: var(--green-dark);
  box-shadow:
    0 0 15px rgba(0, 255, 65, 0.1),
    inset 0 0 15px rgba(0, 255, 65, 0.02);
}

.card-header {
  background: linear-gradient(180deg, var(--metal-light), var(--metal-dark));
  padding: 10px 16px;
  border-bottom: 1px solid var(--metal-highlight);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green-glow);
}

.card-body {
  padding: 16px;
}

/* --- Footer --- */
.site-footer {
  background: linear-gradient(
    180deg,
    var(--metal-dark) 0%,
    var(--metal-mid) 3%,
    var(--metal-dark) 100%
  );
  border-top: 3px solid var(--metal-highlight);
  padding: 30px 20px 20px;
  text-align: center;
  position: relative;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-bottom: 20px;
  text-align: left;
}

.footer-section h4 {
  font-family: var(--font-ui);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--green-glow);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--metal-mid);
}

.footer-section a {
  display: block;
  color: var(--green-dim);
  text-decoration: none;
  font-size: 12px;
  padding: 3px 0;
  transition: color 0.2s;
}

.footer-section a:hover {
  color: var(--green-glow);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid var(--metal-mid);
  font-size: 10px;
  color: var(--metal-edge);
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* --- Utility Classes --- */
.glow-text {
  text-shadow:
    0 0 10px rgba(0, 255, 65, 0.5),
    0 0 20px rgba(0, 255, 65, 0.3);
}

.amber-text {
  color: var(--amber-warn);
}

.red-text {
  color: var(--red-alert);
}

.text-center { text-align: center; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

.hidden { display: none !important; }

/* --- Page Transition Overlay --- */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-base);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.page-transition.active {
  opacity: 1;
  pointer-events: all;
}

.page-transition .loading-text {
  font-family: var(--font-mono);
  color: var(--green-glow);
  font-size: 14px;
  letter-spacing: 3px;
  text-transform: uppercase;
  animation: loadingPulse 1s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* --- Decorative Pipe Borders --- */
.pipe-border-top {
  position: relative;
  padding-top: 12px;
}

.pipe-border-top::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: linear-gradient(
    180deg,
    var(--metal-highlight) 0%,
    var(--metal-light) 20%,
    var(--metal-mid) 50%,
    var(--metal-dark) 100%
  );
  border-top: 1px solid var(--metal-shine);
  border-bottom: 1px solid var(--metal-dark);
}

/* --- Hex bolt pattern for decorative use --- */
.hex-pattern {
  background-image:
    radial-gradient(circle at 50% 50%, var(--metal-light) 3px, transparent 3px);
  background-size: 24px 24px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .column-left, .column-right {
    display: none;
  }

  .site-layout {
    flex-direction: column;
  }

  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 12px 20px;
    gap: 8px;
  }

  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
  }

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

  .status-bar {
    display: none;
  }
}

/* --- Typing animation for terminal text --- */
.typewriter {
  overflow: hidden;
  white-space: nowrap;
  border-right: 2px solid var(--green-glow);
  animation:
    typewriter 2s steps(40) 1s forwards,
    blinkCaret 0.75s step-end infinite;
  width: 0;
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blinkCaret {
  0%, 100% { border-color: var(--green-glow); }
  50% { border-color: transparent; }
}

/* --- Glitch effect for headings --- */
.glitch {
  position: relative;
  animation: glitchShift 5s infinite;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch::before {
  left: 2px;
  text-shadow: -2px 0 var(--red-alert);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
  left: -2px;
  text-shadow: -2px 0 var(--blue-data);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitchShift {
  0%, 95%, 100% { transform: translate(0); }
  96% { transform: translate(-2px, 1px); }
  97% { transform: translate(2px, -1px); }
  98% { transform: translate(-1px, -1px); }
  99% { transform: translate(1px, 1px); }
}

@keyframes glitch-anim {
  0% { clip: rect(31px, 9999px, 94px, 0); }
  5% { clip: rect(70px, 9999px, 71px, 0); }
  10% { clip: rect(29px, 9999px, 71px, 0); }
  15% { clip: rect(2px, 9999px, 48px, 0); }
  20% { clip: rect(16px, 9999px, 89px, 0); }
  25% { clip: rect(85px, 9999px, 98px, 0); }
  30% { clip: rect(59px, 9999px, 93px, 0); }
  35% { clip: rect(71px, 9999px, 84px, 0); }
  40% { clip: rect(42px, 9999px, 68px, 0); }
  45% { clip: rect(11px, 9999px, 52px, 0); }
  50% { clip: rect(63px, 9999px, 99px, 0); }
  55% { clip: rect(18px, 9999px, 74px, 0); }
  60% { clip: rect(8px, 9999px, 45px, 0); }
  65% { clip: rect(33px, 9999px, 57px, 0); }
  70% { clip: rect(72px, 9999px, 96px, 0); }
  75% { clip: rect(14px, 9999px, 38px, 0); }
  80% { clip: rect(55px, 9999px, 86px, 0); }
  85% { clip: rect(26px, 9999px, 61px, 0); }
  90% { clip: rect(47px, 9999px, 79px, 0); }
  95% { clip: rect(3px, 9999px, 22px, 0); }
  100% { clip: rect(67px, 9999px, 91px, 0); }
}

@keyframes glitch-anim2 {
  0% { clip: rect(65px, 9999px, 99px, 0); }
  5% { clip: rect(12px, 9999px, 58px, 0); }
  10% { clip: rect(43px, 9999px, 87px, 0); }
  15% { clip: rect(77px, 9999px, 92px, 0); }
  20% { clip: rect(5px, 9999px, 33px, 0); }
  25% { clip: rect(51px, 9999px, 74px, 0); }
  30% { clip: rect(22px, 9999px, 66px, 0); }
  35% { clip: rect(88px, 9999px, 100px, 0); }
  40% { clip: rect(35px, 9999px, 59px, 0); }
  45% { clip: rect(9px, 9999px, 41px, 0); }
  50% { clip: rect(73px, 9999px, 95px, 0); }
  55% { clip: rect(28px, 9999px, 53px, 0); }
  60% { clip: rect(61px, 9999px, 82px, 0); }
  65% { clip: rect(15px, 9999px, 46px, 0); }
  70% { clip: rect(48px, 9999px, 76px, 0); }
  75% { clip: rect(82px, 9999px, 97px, 0); }
  80% { clip: rect(6px, 9999px, 29px, 0); }
  85% { clip: rect(38px, 9999px, 64px, 0); }
  90% { clip: rect(56px, 9999px, 88px, 0); }
  95% { clip: rect(19px, 9999px, 43px, 0); }
  100% { clip: rect(70px, 9999px, 93px, 0); }
}

/* --- Flicker animation for CRT feel --- */
@keyframes crtFlicker {
  0% { opacity: 0.97; }
  5% { opacity: 0.95; }
  10% { opacity: 0.98; }
  15% { opacity: 0.96; }
  20% { opacity: 0.99; }
  25% { opacity: 0.95; }
  30% { opacity: 0.98; }
  35% { opacity: 0.97; }
  40% { opacity: 0.99; }
  45% { opacity: 0.96; }
  50% { opacity: 0.98; }
  55% { opacity: 0.97; }
  60% { opacity: 0.95; }
  65% { opacity: 0.99; }
  70% { opacity: 0.97; }
  75% { opacity: 0.96; }
  80% { opacity: 0.98; }
  85% { opacity: 0.95; }
  90% { opacity: 0.99; }
  95% { opacity: 0.97; }
  100% { opacity: 0.98; }
}

.crt-flicker {
  animation: crtFlicker 0.15s infinite;
}

/* --- Data readout animation --- */
@keyframes dataScroll {
  0% { transform: translateY(0); }
  100% { transform: translateY(-50%); }
}

.data-scroll {
  animation: dataScroll 20s linear infinite;
}

/* --- Stencil text style --- */
.stencil-text {
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 4px;
  color: var(--metal-edge);
  text-shadow: 1px 1px 0 rgba(0,0,0,0.5);
  font-size: 11px;
}

/* --- Button Styles --- */
.btn-industrial {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: linear-gradient(180deg, var(--metal-light), var(--metal-mid) 50%, var(--metal-dark));
  border: 1px solid var(--metal-highlight);
  color: var(--green-glow);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    0 2px 4px rgba(0,0,0,0.3);
}

.btn-industrial:hover {
  background: linear-gradient(180deg, var(--metal-highlight), var(--metal-light) 50%, var(--metal-mid));
  border-color: var(--green-dark);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.15),
    0 0 10px rgba(0, 255, 65, 0.2),
    0 2px 4px rgba(0,0,0,0.3);
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.4);
}

.btn-industrial:active {
  background: linear-gradient(180deg, var(--metal-dark), var(--metal-mid));
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

/* --- Form Inputs --- */
.input-industrial {
  background: var(--bg-terminal);
  border: 1px solid var(--metal-mid);
  color: var(--green-text);
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 10px 14px;
  width: 100%;
  transition: all 0.2s ease;
}

.input-industrial:focus {
  outline: none;
  border-color: var(--green-dark);
  box-shadow:
    0 0 8px rgba(0, 255, 65, 0.15),
    inset 0 0 10px rgba(0, 255, 65, 0.03);
}

.input-industrial::placeholder {
  color: var(--green-dark);
  opacity: 0.5;
}

textarea.input-industrial {
  resize: vertical;
  min-height: 100px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--green-dim);
  margin-bottom: 6px;
}
