/**
 * Matrix Terminal Website - Design System
 * Color palette: #002706, #00ff00, #ffffff, #5a5a5a, #000000
 */

/* ============================================
   DESIGN TOKENS
   ============================================ */
:root {
  /* Matrix Color Palette */
  --bg-dark: #000000;
  --bg-panel: #002706;
  --matrix-green: #00ff00;
  --white: #ffffff;
  --gray: #5a5a5a;

  /* Derived Colors */
  --glow-green: rgba(0, 255, 0, 0.4);
  --glass-bg: rgba(0, 39, 6, 0.2);
  --border-glow: rgba(0, 255, 0, 0.5);

  /* Typography */
  --font-mono: 'Courier New', 'Fira Code', monospace;
  --font-size-base: clamp(14px, 2.5vw, 18px);
  --font-size-sm: clamp(12px, 2vw, 14px);
  --font-size-lg: clamp(18px, 3vw, 24px);
  --font-size-xl: clamp(24px, 4vw, 36px);

  /* Spacing */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 20px;
  --space-lg: 32px;
  --space-xl: 48px;

  /* Effects */
  --radius: 8px;
  --radius-lg: 16px;
  --shadow-glow: 0 0 20px rgba(0, 255, 0, 0.3), 0 0 40px rgba(0, 255, 0, 0.1);
  --text-glow: 0 0 10px rgba(0, 255, 0, 0.8);
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
  overflow-x: hidden;
}

body {
  background: var(--bg-dark);
  color: var(--matrix-green);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  line-height: 1.6;
}

/* ============================================
   CRT SCANLINE EFFECT
   ============================================ */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(0deg,
      rgba(0, 0, 0, 0.15) 0px,
      rgba(0, 0, 0, 0.15) 1px,
      transparent 1px,
      transparent 2px);
}

/* ============================================
   MATRIX CANVAS BACKGROUND
   ============================================ */
#matrix-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.15;
}

/* ============================================
   MAIN LAYOUT
   ============================================ */
.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-md);
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ============================================
   TERMINAL WINDOW
   ============================================ */
.terminal-container {
  width: 100%;
  max-width: 900px;
  margin-bottom: var(--space-lg);
}

.terminal {
  background: var(--glass-bg);
  border: 2px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
  overflow: hidden;
  backdrop-filter: blur(10px);
}

/* Terminal Header */
.terminal-header {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid var(--border-glow);
}

.terminal-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.terminal-btn.close {
  background: #ff5f56;
}

.terminal-btn.minimize {
  background: #ffbd2e;
}

.terminal-btn.maximize {
  background: #27c93f;
}

.terminal-title {
  flex: 1;
  text-align: center;
  color: var(--gray);
  font-size: var(--font-size-sm);
  letter-spacing: 1px;
}

/* Terminal Body */
.terminal-body {
  padding: var(--space-md);
  min-height: 300px;
  max-height: 400px;
  overflow-y: auto;
}

.terminal-output {
  margin-bottom: var(--space-md);
}

.terminal-line {
  margin-bottom: var(--space-xs);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.terminal-line .prompt {
  color: var(--matrix-green);
  text-shadow: var(--text-glow);
}

.terminal-line .command {
  color: var(--white);
}

.terminal-line .response {
  color: var(--matrix-green);
  opacity: 0.9;
}

/* Terminal Input Row */
.terminal-input-row {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  border-top: 1px dashed rgba(0, 255, 0, 0.3);
  padding-top: var(--space-md);
}

.terminal-input-row .prompt {
  color: var(--matrix-green);
  text-shadow: var(--text-glow);
  white-space: nowrap;
}

#terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  caret-color: var(--matrix-green);
}

#terminal-input::placeholder {
  color: var(--gray);
}

/* Blinking Cursor */
.cursor {
  display: inline-block;
  width: 10px;
  height: 1.2em;
  background: var(--matrix-green);
  animation: blink 1s step-end infinite;
  margin-left: 2px;
  vertical-align: text-bottom;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ============================================
   NAVIGATION BUTTONS
   ============================================ */
.nav-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-md);
  border-top: 1px solid rgba(0, 255, 0, 0.2);
  background: rgba(0, 0, 0, 0.3);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--matrix-green);
  border-radius: 25px;
  color: var(--matrix-green);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-shadow: var(--text-glow);
}

.nav-btn:hover {
  background: rgba(0, 255, 0, 0.15);
  box-shadow: 0 0 20px var(--glow-green), inset 0 0 20px rgba(0, 255, 0, 0.1);
  transform: translateY(-2px);
}

.nav-btn:active {
  transform: translateY(0);
}

.nav-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
  width: 100%;
  max-width: 900px;
  margin-bottom: var(--space-xl);
  padding: var(--space-lg);
  background: var(--glass-bg);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glow);
}

.section-title {
  font-size: var(--font-size-xl);
  color: var(--matrix-green);
  text-shadow: var(--text-glow);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::before {
  content: ">";
  color: var(--white);
}

.section-content {
  color: var(--matrix-green);
  opacity: 0.9;
  line-height: 1.8;
}

.section-content p {
  margin-bottom: var(--space-md);
}

/* ============================================
   PRICING CARDS
   ============================================ */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.pricing-card {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--gray);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  transition: var(--transition);
}

.pricing-card:hover {
  border-color: var(--matrix-green);
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.2);
  transform: translateY(-5px);
}

.pricing-card.featured {
  border-color: var(--matrix-green);
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
  position: relative;
}

.pricing-card.featured::before {
  content: "POPULAR";
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--matrix-green);
  color: var(--bg-dark);
  padding: 4px 16px;
  border-radius: 20px;
  font-size: var(--font-size-sm);
  font-weight: bold;
}

.pricing-tier {
  font-size: var(--font-size-lg);
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.pricing-price {
  font-size: var(--font-size-xl);
  color: var(--matrix-green);
  text-shadow: var(--text-glow);
  margin-bottom: var(--space-md);
}

.pricing-price span {
  font-size: var(--font-size-sm);
  color: var(--gray);
}

.pricing-features {
  list-style: none;
  margin-bottom: var(--space-lg);
  text-align: left;
}

.pricing-features li {
  padding: var(--space-xs) 0;
  border-bottom: 1px dashed rgba(0, 255, 0, 0.2);
  color: var(--matrix-green);
  opacity: 0.8;
}

.pricing-features li::before {
  content: "✓ ";
  color: var(--matrix-green);
}

.pricing-btn {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: 1px solid var(--matrix-green);
  border-radius: var(--radius);
  color: var(--matrix-green);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: var(--transition);
}

.pricing-btn:hover {
  background: var(--matrix-green);
  color: var(--bg-dark);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  text-align: center;
  padding: var(--space-lg);
  color: var(--gray);
  font-size: var(--font-size-sm);
  border-top: 1px solid rgba(0, 255, 0, 0.1);
}

.footer a {
  color: var(--matrix-green);
  text-decoration: none;
}

.footer a:hover {
  text-shadow: var(--text-glow);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--matrix-green);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #00cc00;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .main-content {
    padding: var(--space-sm);
  }

  .terminal-body {
    min-height: 250px;
    max-height: 300px;
    padding: var(--space-sm);
  }

  .nav-buttons {
    padding: var(--space-sm);
    gap: var(--space-xs);
  }

  .nav-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 12px;
  }

  .section {
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
  }

  .section-title {
    font-size: var(--font-size-lg);
  }

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

@media (max-width: 480px) {
  .terminal-header {
    padding: var(--space-xs) var(--space-sm);
  }

  .terminal-title {
    font-size: 10px;
  }

  .terminal-input-row {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-xs);
  }

  .nav-buttons {
    flex-direction: column;
  }

  .nav-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes glitch {

  0%,
  100% {
    opacity: 1;
  }

  25% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }

  75% {
    opacity: 0.9;
  }
}

.glitch-text {
  animation: glitch 3s infinite;
}

/* Typing animation for initial load */
@keyframes typing {
  from {
    width: 0;
  }

  to {
    width: 100%;
  }
}

.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(40, end);
}