/*
 * APOCH.NET — Centralized Theme System
 * All pages reference this file for consistent styling.
 * Page-specific layout/structure stays in inline <style> blocks.
 */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

/* ============================================
   COLOR SYSTEM
   ============================================ */
:root {
  /* Primary Red Palette */
  --apoch-red: #ff1a1a;
  --apoch-red-dim: #cc0000;
  --apoch-red-darker: #8b0000;
  --apoch-red-glow: rgba(255, 26, 26, 0.4);
  --apoch-red-faint: rgba(255, 26, 26, 0.08);
  --apoch-red-ultra-faint: rgba(255, 26, 26, 0.03);

  /* Background Colors */
  --apoch-bg: #050505;
  --apoch-bg-alt: #0a0303;

  /* Panel/Surface Colors */
  --apoch-panel: rgba(15, 0, 0, 0.6);
  --apoch-panel-dark: rgba(10, 0, 0, 0.72);
  --apoch-panel-darker: rgba(5, 0, 0, 0.85);

  /* Border Colors */
  --apoch-border: rgba(255, 26, 26, 0.15);
  --apoch-border-dim: rgba(255, 26, 26, 0.08);
  --apoch-border-bright: rgba(255, 26, 26, 0.55);

  /* Text Colors */
  --apoch-text: #e0e0e0;
  --apoch-text-muted: #555;
  --apoch-text-dim: #999;

  /* Accent Colors */
  --apoch-green: #00cc66;
  --apoch-green-glow: rgba(0, 204, 102, 0.4);
  --apoch-amber: #ff6600;
  --apoch-amber-glow: rgba(255, 102, 0, 0.4);
  --apoch-warn: #ff4444;
  --apoch-warn-glow: rgba(255, 68, 68, 0.4);

  /* Shadow/Glow Effects */
  --apoch-shadow: 0 0 28px rgba(255, 26, 26, 0.08),
                  inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  --apoch-glow-sm: 0 0 6px var(--apoch-red-glow);
  --apoch-glow-md: 0 0 14px var(--apoch-red),
                   0 0 30px rgba(255, 26, 26, 0.35);
  --apoch-glow-lg: 0 0 20px var(--apoch-red-glow),
                   0 0 40px rgba(255, 26, 26, 0.2);

  /* ============================================
     TYPOGRAPHY
     ============================================ */
  --apoch-font-brand: 'Orbitron', sans-serif;
  --apoch-font-body: 'Share Tech Mono', 'Courier New', monospace;
  --apoch-font-mono: 'Courier New', monospace;

  /* Fluid Font Sizes */
  --apoch-text-xs: clamp(7px, 0.6vw, 10px);
  --apoch-text-sm: clamp(9px, 0.7vw, 12px);
  --apoch-text-base: clamp(11px, 0.9vw, 14px);
  --apoch-text-lg: clamp(14px, 1.2vw, 18px);
  --apoch-text-xl: clamp(18px, 1.8vw, 24px);
  --apoch-text-2xl: clamp(28px, 3vw, 54px);
  --apoch-text-3xl: clamp(2.5rem, 8vw, 5rem);

  /* Letter Spacing */
  --apoch-tracking-tight: 0.05em;
  --apoch-tracking-normal: 0.12em;
  --apoch-tracking-wide: 0.2em;
  --apoch-tracking-wider: 0.24em;
  --apoch-tracking-widest: 0.35em;

  /* ============================================
     SPACING & LAYOUT
     ============================================ */
  --apoch-space-xs: clamp(5px, 0.5vh, 8px);
  --apoch-space-sm: clamp(8px, 0.8vh, 12px);
  --apoch-space-md: clamp(12px, 1.2vh, 18px);
  --apoch-space-lg: clamp(16px, 1.6vh, 24px);
  --apoch-space-xl: clamp(24px, 2.4vh, 36px);

  --apoch-radius-sm: 5px;
  --apoch-radius-md: 10px;
  --apoch-radius-lg: 18px;
  --apoch-radius-full: 999px;

  --apoch-transition-fast: 0.15s ease;
  --apoch-transition-base: 0.3s ease;
  --apoch-transition-slow: 0.5s ease;
}

/* ============================================
   BASE RESET
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--apoch-bg);
  color: var(--apoch-text);
  font-family: var(--apoch-font-body);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   COMMON OVERLAYS
   ============================================ */

/* Scanline overlay */
.apoch-scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.08) 2px,
    rgba(0, 0, 0, 0.08) 4px
  );
  pointer-events: none;
  z-index: 100;
}

/* Grid background */
.apoch-grid-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background-image:
    linear-gradient(var(--apoch-red-ultra-faint) 1px, transparent 1px),
    linear-gradient(90deg, var(--apoch-red-ultra-faint) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

/* ============================================
   PANEL COMPONENT
   ============================================ */
.apoch-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--apoch-border);
  background: linear-gradient(180deg, var(--apoch-panel-dark), var(--apoch-panel));
  backdrop-filter: blur(8px);
  border-radius: var(--apoch-radius-lg);
  box-shadow: var(--apoch-shadow);
}

.apoch-panel::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--apoch-red), transparent);
}

/* ============================================
   CORNER BRACKETS
   ============================================ */
.apoch-bracket {
  position: absolute;
  width: 16px; height: 16px;
  border-color: var(--apoch-border-bright);
}
.apoch-bracket-tl { top: 8px; left: 8px; border-top: 2px solid; border-left: 2px solid; }
.apoch-bracket-tr { top: 8px; right: 8px; border-top: 2px solid; border-right: 2px solid; }
.apoch-bracket-bl { bottom: 8px; left: 8px; border-bottom: 2px solid; border-left: 2px solid; }
.apoch-bracket-br { bottom: 8px; right: 8px; border-bottom: 2px solid; border-right: 2px solid; }

/* ============================================
   PULSE INDICATOR
   ============================================ */
.apoch-pulse {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--apoch-red);
  border-radius: 50%;
  box-shadow: var(--apoch-glow-sm);
  animation: apoch-pulse-anim 2s ease-in-out infinite;
}

@keyframes apoch-pulse-anim {
  0%, 100% {
    opacity: 1;
    box-shadow: var(--apoch-glow-sm), 0 0 15px rgba(255, 26, 26, 0.2);
  }
  50% {
    opacity: 0.4;
    box-shadow: 0 0 3px var(--apoch-red-glow);
  }
}

/* ============================================
   BUTTONS
   ============================================ */
.apoch-btn {
  padding: var(--apoch-space-sm) var(--apoch-space-md);
  background: var(--apoch-panel);
  border: 1px solid var(--apoch-border);
  border-radius: var(--apoch-radius-md);
  color: var(--apoch-text);
  font-family: var(--apoch-font-body);
  font-size: var(--apoch-text-sm);
  letter-spacing: var(--apoch-tracking-normal);
  text-transform: uppercase;
  cursor: pointer;
  transition: all var(--apoch-transition-base);
}

.apoch-btn:hover {
  background: var(--apoch-red-faint);
  border-color: var(--apoch-red-dim);
  box-shadow: var(--apoch-glow-md);
}

/* ============================================
   LINKS
   ============================================ */
.apoch-link {
  color: var(--apoch-red);
  text-decoration: none;
  transition: all var(--apoch-transition-base);
}

.apoch-link:hover {
  color: #fff;
  text-shadow: var(--apoch-glow-sm);
}

/* ============================================
   FLOATING PARTICLES
   ============================================ */
.apoch-particle {
  position: fixed;
  width: 2px; height: 2px;
  background: var(--apoch-red);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  animation: apoch-float linear infinite;
}

.apoch-particle:nth-child(1) { left: 15%; animation-duration: 18s; animation-delay: 0s; }
.apoch-particle:nth-child(2) { left: 35%; animation-duration: 22s; animation-delay: 3s; }
.apoch-particle:nth-child(3) { left: 55%; animation-duration: 16s; animation-delay: 6s; }
.apoch-particle:nth-child(4) { left: 75%; animation-duration: 20s; animation-delay: 2s; }
.apoch-particle:nth-child(5) { left: 90%; animation-duration: 24s; animation-delay: 5s; }

@keyframes apoch-float {
  0% { transform: translateY(100vh); opacity: 0; }
  10% { opacity: 0.3; }
  90% { opacity: 0.3; }
  100% { transform: translateY(-10vh); opacity: 0; }
}

/* ============================================
   SHARED ANIMATIONS
   ============================================ */
@keyframes apoch-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes apoch-logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ============================================
   DIVIDER
   ============================================ */
.apoch-divider {
  width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--apoch-red-dim), transparent);
  margin: 0.75rem auto;
  position: relative;
}

.apoch-divider::after {
  content: '';
  position: absolute;
  top: -2px; left: 50%;
  transform: translateX(-50%);
  width: 6px; height: 6px;
  background: var(--apoch-red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--apoch-red-glow);
}
