/* ============================
   BACKGROUND - Mech Cockpit
   ============================ */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    /* Subtle grid pattern */
    linear-gradient(90deg, var(--mech-hull) 1px, transparent 1px),
    linear-gradient(var(--mech-hull) 1px, transparent 1px),
    /* Dark gradient base */
    radial-gradient(ellipse at 30% 0%, var(--mech-hull-light) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 100%, var(--mech-panel) 0%, transparent 40%),
    var(--mech-hull-dark);
  background-size: 50px 50px, 50px 50px, 100% 100%, 100% 100%, 100% 100%;
  background-attachment: fixed;
}

/* Scanline overlay */
.scanlines {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 3px
  );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}

/* CRT vignette effect */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* ============================
   HUD FRAME SYSTEM
   ============================ */
.hud-frame {
  position: fixed;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--hud-padding);
  height: 40px;
  background: linear-gradient(
    90deg,
    var(--mech-hull-dark) 0%,
    var(--mech-hull) 50%,
    var(--mech-hull-dark) 100%
  );
  z-index: 100;
}

.hud-frame--top {
  top: 0;
  border-bottom: 1px solid var(--neon-cyan-dim);
  box-shadow: 0 1px 0 var(--neon-cyan-dim), inset 0 -1px 20px rgba(0, 212, 219, 0.1);
}

.hud-frame--bottom {
  bottom: 0;
  border-top: 1px solid var(--neon-cyan-dim);
  box-shadow: 0 -1px 0 var(--neon-cyan-dim), inset 0 1px 20px rgba(0, 212, 219, 0.1);
}

/* Corner brackets - targeting reticle style */
.hud-corner {
  width: 30px;
  height: 30px;
  position: relative;
  flex-shrink: 0;
}

.hud-corner::before,
.hud-corner::after {
  content: "";
  position: absolute;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.hud-corner--tl::before {
  top: 5px;
  left: 0;
  width: 15px;
  height: 2px;
}
.hud-corner--tl::after {
  top: 5px;
  left: 0;
  width: 2px;
  height: 15px;
}

.hud-corner--tr::before {
  top: 5px;
  right: 0;
  width: 15px;
  height: 2px;
}
.hud-corner--tr::after {
  top: 5px;
  right: 0;
  width: 2px;
  height: 15px;
}

.hud-corner--bl::before {
  bottom: 5px;
  left: 0;
  width: 15px;
  height: 2px;
}
.hud-corner--bl::after {
  bottom: 5px;
  left: 0;
  width: 2px;
  height: 15px;
}

.hud-corner--br::before {
  bottom: 5px;
  right: 0;
  width: 15px;
  height: 2px;
}
.hud-corner--br::after {
  bottom: 5px;
  right: 0;
  width: 2px;
  height: 15px;
}

/* Status bar */
.hud-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.hud-data-strip {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.7rem;
}

.data-cell {
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-indicator--online {
  background: var(--neon-green);
  box-shadow: var(--glow-green);
  animation: pulse-glow 2s ease-in-out infinite;
}

.status-text {
  color: var(--neon-cyan);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.status-divider {
  color: var(--mech-steel);
}

/* ============================
   CONTAINER
   ============================ */
.container {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 2rem 60px;
  gap: 3rem;
}

/* ============================
   PILOT BADGE / LOGO
   ============================ */
.pilot-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  animation: system-boot 1.5s ease-out forwards;
}

.pilot-frame {
  position: relative;
  width: 200px;
  height: 200px;
  padding: 4px;
  background: linear-gradient(135deg, var(--mech-panel) 0%, var(--mech-hull) 100%);
  clip-path: polygon(
    0 20px,
    20px 0,
    calc(100% - 20px) 0,
    100% 20px,
    100% calc(100% - 20px),
    calc(100% - 20px) 100%,
    20px 100%,
    0 calc(100% - 20px)
  );
  box-shadow: var(--shadow-panel), 0 0 30px rgba(0, 255, 247, 0.2);
}

.logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: polygon(
    0 16px,
    16px 0,
    calc(100% - 16px) 0,
    100% 16px,
    100% calc(100% - 16px),
    calc(100% - 16px) 100%,
    16px 100%,
    0 calc(100% - 16px)
  );
  filter: saturate(0.8) contrast(1.1);
  transition: var(--transition-mechanical);
}

.pilot-frame:hover .logo {
  filter: saturate(1) contrast(1.2);
}

/* Corner brackets on pilot frame */
.pilot-frame-corner {
  position: absolute;
  width: 20px;
  height: 20px;
}

.pilot-frame-corner::before,
.pilot-frame-corner::after {
  content: "";
  position: absolute;
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
  transition: var(--transition-mechanical);
}

.pilot-frame-corner--tl {
  top: -4px;
  left: -4px;
}
.pilot-frame-corner--tl::before {
  width: 12px;
  height: 2px;
}
.pilot-frame-corner--tl::after {
  width: 2px;
  height: 12px;
}

.pilot-frame-corner--tr {
  top: -4px;
  right: -4px;
}
.pilot-frame-corner--tr::before {
  right: 0;
  width: 12px;
  height: 2px;
}
.pilot-frame-corner--tr::after {
  right: 0;
  width: 2px;
  height: 12px;
}

.pilot-frame-corner--bl {
  bottom: -4px;
  left: -4px;
}
.pilot-frame-corner--bl::before {
  bottom: 0;
  width: 12px;
  height: 2px;
}
.pilot-frame-corner--bl::after {
  bottom: 0;
  width: 2px;
  height: 12px;
}

.pilot-frame-corner--br {
  bottom: -4px;
  right: -4px;
}
.pilot-frame-corner--br::before {
  bottom: 0;
  right: 0;
  width: 12px;
  height: 2px;
}
.pilot-frame-corner--br::after {
  bottom: 0;
  right: 0;
  width: 2px;
  height: 12px;
}

.pilot-frame:hover .pilot-frame-corner::before,
.pilot-frame:hover .pilot-frame-corner::after {
  background: var(--neon-cyan-bright);
  box-shadow: var(--glow-cyan-intense);
}

/* Pilot info text */
.pilot-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.site-title {
  font-family: "Orbitron", monospace;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-primary);
  text-shadow: 0 0 20px var(--neon-cyan-glow);
}

.pilot-subtitle {
  font-size: 0.75rem;
  color: var(--neon-cyan);
  letter-spacing: 0.3em;
  opacity: 0.8;
}

/* Glitch effect */
.glitch {
  position: relative;
}

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

.glitch::before {
  color: var(--neon-cyan);
  z-index: -1;
}

.glitch::after {
  color: var(--neon-red);
  z-index: -2;
}

.glitch:hover::before {
  animation: glitch-1 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) both infinite;
  opacity: 0.8;
}

.glitch:hover::after {
  animation: glitch-2 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) reverse both infinite;
  opacity: 0.8;
}

/* ============================
   MISSION DECK / PROJECTS
   ============================ */
.mission-deck {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: slide-up 0.8s ease-out 0.5s backwards;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
}

.section-marker {
  font-family: "Orbitron", monospace;
  font-size: 1.5rem;
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--text-secondary);
}

/* Power bar decoration */
.power-bar {
  width: 60px;
  height: 4px;
  background: var(--mech-panel);
  border: 1px solid var(--mech-steel);
  overflow: hidden;
  margin-left: 0.5rem;
}

.power-bar__fill {
  height: 100%;
  width: 75%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  box-shadow: var(--glow-cyan);
  animation: power-pulse 3s ease-in-out infinite;
}

/* Project Card / Mech Module */
.mech-module {
  position: relative;
  background: linear-gradient(
    135deg,
    var(--mech-hull) 0%,
    var(--mech-hull-light) 50%,
    var(--mech-hull) 100%
  );
  border: 1px solid var(--mech-steel);
  padding: 2rem;
  max-width: 380px;
  text-align: left;
  clip-path: polygon(
    0 12px,
    12px 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0 calc(100% - 12px)
  );
  box-shadow: var(--shadow-panel);
  transition: var(--transition-mechanical);
  overflow: visible;
}

.mech-module::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(0, 255, 247, 0.03) 0%, transparent 30%);
  pointer-events: none;
}

.mech-module:hover {
  border-color: var(--neon-cyan-dim);
  box-shadow: var(--shadow-panel), 0 0 30px rgba(0, 255, 247, 0.15);
  transform: translateY(-4px);
}

/* Module corner accents */
.module-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 2;
}

.module-corner::before,
.module-corner::after {
  content: "";
  position: absolute;
  background: var(--neon-cyan);
  transition: var(--transition-mechanical);
}

.module-corner--tl {
  top: -1px;
  left: -1px;
}
.module-corner--tl::before {
  width: 10px;
  height: 2px;
}
.module-corner--tl::after {
  width: 2px;
  height: 10px;
}

.module-corner--tr {
  top: -1px;
  right: -1px;
}
.module-corner--tr::before {
  right: 0;
  width: 10px;
  height: 2px;
}
.module-corner--tr::after {
  right: 0;
  width: 2px;
  height: 10px;
}

.module-corner--bl {
  bottom: -1px;
  left: -1px;
}
.module-corner--bl::before {
  bottom: 0;
  width: 10px;
  height: 2px;
}
.module-corner--bl::after {
  bottom: 0;
  width: 2px;
  height: 10px;
}

.module-corner--br {
  bottom: -1px;
  right: -1px;
}
.module-corner--br::before {
  bottom: 0;
  right: 0;
  width: 10px;
  height: 2px;
}
.module-corner--br::after {
  bottom: 0;
  right: 0;
  width: 2px;
  height: 10px;
}

.mech-module:hover .module-corner::before,
.mech-module:hover .module-corner::after {
  background: var(--neon-cyan-bright);
  box-shadow: var(--glow-cyan);
}

/* Module status indicator */
.module-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.status-led {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-led--active {
  background: var(--neon-green);
  box-shadow: 0 0 8px var(--neon-green-glow);
  animation: led-blink 2s ease-in-out infinite;
}

/* Module content */
.mech-module h3 {
  font-family: "Orbitron", monospace;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mech-module p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Module actions */
.module-actions {
  position: relative;
  z-index: 3;
}

/* Hazard stripe decoration */
.hazard-stripe {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(
    90deg,
    var(--neon-orange) 0px,
    var(--neon-orange) 10px,
    var(--mech-hull-dark) 10px,
    var(--mech-hull-dark) 20px
  );
  opacity: 0.6;
}

/* ============================
   MECH BUTTON
   ============================ */
.mech-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--mech-panel) 0%, var(--mech-hull) 100%);
  border: 1px solid var(--neon-cyan-dim);
  color: var(--neon-cyan);
  font-family: "Orbitron", monospace;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  transition: var(--transition-mechanical);
  position: relative;
  overflow: hidden;
}

.mech-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 247, 0.2), transparent);
  transition: left 0.4s ease;
}

.mech-button:hover {
  background: linear-gradient(135deg, var(--mech-panel-highlight) 0%, var(--mech-panel) 100%);
  border-color: var(--neon-cyan);
  color: var(--neon-cyan-bright);
  box-shadow: var(--glow-cyan), inset 0 0 20px rgba(0, 255, 247, 0.1);
  transform: translateX(4px);
}

.mech-button:hover::before {
  left: 100%;
}

.button-text {
  position: relative;
  z-index: 1;
}

.button-arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 6px solid currentColor;
  transition: var(--transition-mechanical);
  position: relative;
  z-index: 1;
}

.mech-button:hover .button-arrow {
  transform: translateX(4px);
}

/* ============================
   FOOTER - Mech Style
   ============================ */
.mech-footer {
  position: relative;
  z-index: 1;
  padding: 1.5rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, transparent 0%, var(--mech-hull) 100%);
  border-top: 1px solid var(--mech-steel);
  margin-bottom: 40px;
}

.footer-circuit-line {
  width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan-dim), transparent);
  margin: 0 auto 1rem;
}

.mech-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-family: "Share Tech Mono", monospace;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  transition: var(--transition-mechanical);
}

.mech-link:hover {
  color: var(--neon-cyan);
  border-color: var(--neon-cyan-dim);
  background: rgba(0, 255, 247, 0.05);
}

.link-bracket {
  color: var(--neon-cyan-dim);
  transition: var(--transition-mechanical);
}

.mech-link:hover .link-bracket {
  color: var(--neon-cyan);
  text-shadow: var(--glow-cyan);
}

.mech-link .icon-img {
  filter: brightness(0) invert(0.6);
  transition: var(--transition-mechanical);
}

.mech-link:hover .icon-img {
  filter: brightness(0) invert(1) sepia(1) saturate(5) hue-rotate(150deg);
}

/* ============================
   ANIMATIONS - Mechanical/Tech
   ============================ */

/* System boot sequence */
@keyframes system-boot {
  0% {
    opacity: 0;
    transform: scale(0.95);
    filter: brightness(2) saturate(0);
  }
  50% {
    opacity: 1;
    filter: brightness(1.5) saturate(0.5);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: brightness(1) saturate(1);
  }
}

/* Slide up entrance */
@keyframes slide-up {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Pulsing glow for status indicators */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
    opacity: 1;
  }
  50% {
    box-shadow: 0 0 10px currentColor, 0 0 20px currentColor, 0 0 30px currentColor;
    opacity: 0.8;
  }
}

/* LED blink */
@keyframes led-blink {
  0%,
  90%,
  100% {
    opacity: 1;
  }
  95% {
    opacity: 0.3;
  }
}

/* Power bar pulse */
@keyframes power-pulse {
  0%,
  100% {
    width: 70%;
    opacity: 0.8;
  }
  50% {
    width: 85%;
    opacity: 1;
  }
}

/* Glitch effect layer 1 */
@keyframes glitch-1 {
  0% {
    clip-path: inset(40% 0 61% 0);
    transform: translate(-2px, -2px);
  }
  20% {
    clip-path: inset(92% 0 1% 0);
    transform: translate(2px, 2px);
  }
  40% {
    clip-path: inset(43% 0 1% 0);
    transform: translate(-2px, 0);
  }
  60% {
    clip-path: inset(25% 0 58% 0);
    transform: translate(2px, -2px);
  }
  80% {
    clip-path: inset(54% 0 7% 0);
    transform: translate(-2px, 2px);
  }
  100% {
    clip-path: inset(58% 0 43% 0);
    transform: translate(0, 0);
  }
}

/* Glitch effect layer 2 */
@keyframes glitch-2 {
  0% {
    clip-path: inset(65% 0 13% 0);
    transform: translate(3px, 1px);
  }
  20% {
    clip-path: inset(10% 0 80% 0);
    transform: translate(-3px, -1px);
  }
  40% {
    clip-path: inset(72% 0 1% 0);
    transform: translate(1px, 3px);
  }
  60% {
    clip-path: inset(5% 0 69% 0);
    transform: translate(-1px, -3px);
  }
  80% {
    clip-path: inset(85% 0 8% 0);
    transform: translate(3px, -1px);
  }
  100% {
    clip-path: inset(23% 0 64% 0);
    transform: translate(-3px, 1px);
  }
}

/* Blink for REC indicator */
.blink {
  animation: blink-anim 1s steps(1) infinite;
}

@keyframes blink-anim {
  0%,
  50% {
    opacity: 1;
    color: var(--neon-red);
  }
  51%,
  100% {
    opacity: 0.3;
  }
}

/* ============================
   RESPONSIVE - Mobile Mech
   ============================ */
@media (max-width: 480px) {
  :root {
    --hud-padding: 10px;
  }

  .hud-frame {
    height: 30px;
  }

  .hud-status-bar {
    font-size: 0.65rem;
    gap: 8px;
  }

  .hud-data-strip {
    font-size: 0.6rem;
    gap: 12px;
  }

  .container {
    padding: 60px 1rem 50px;
    gap: 2rem;
  }

  .pilot-frame {
    width: 160px;
    height: 160px;
  }

  .site-title {
    font-size: 1.5rem;
    letter-spacing: 0.15em;
  }

  .pilot-subtitle {
    font-size: 0.65rem;
  }

  .mech-module {
    padding: 1.5rem;
    max-width: 300px;
  }

  .mech-module h3 {
    font-size: 1rem;
  }

  .section-marker {
    font-size: 1.2rem;
  }

  .section-title {
    font-size: 0.75rem;
  }

  .mech-footer {
    margin-bottom: 30px;
  }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scanlines {
    display: none;
  }

  .glitch::before,
  .glitch::after {
    display: none;
  }
}
