/* ==========================================
   STREETMBA NEO-BRUTALIST DESIGN SYSTEM
   ========================================== */

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

:root {
  /* Colors - Neo-Brutalist Palette */
  --color-black: #0a0a0a;
  --color-white: #ffffff;
  --color-gray-dark: #1a1a1a;
  --color-gray-medium: #2a2a2a;
  --color-gray-light: #e5e5e5;

  /* Electric Accents */
  --color-electric-blue: #00e5ff;
  --color-neon-purple: #b026ff;
  --color-acid-green: #39ff14;
  --color-warning-red: #ff0050;

  /* Typography */
  --font-display: 'Space Grotesk', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Courier New', monospace;

  /* Brutalist Elements */
  --border-thick: 6px;
  --border-medium: 4px;
  --border-thin: 2px;
  --shadow-brutal: 8px 8px 0px rgba(0, 0, 0, 0.9);
  --shadow-brutal-hover: 12px 12px 0px rgba(0, 0, 0, 0.9);
}

/* ==========================================
   GLOBAL OVERRIDES
   ========================================== */

body {
  font-family: var(--font-display);
  background-color: var(--color-black);
  color: var(--color-white);
  overflow-x: hidden;
}

/* Fix: Reset form element text color for pages with light backgrounds */
input:not([type="submit"]):not([type="button"]), textarea, select {
  color: #111827;
}

/* Fix: Reset text color for light background containers (admin pages) */
.bg-white, .bg-gray-50, .bg-gray-100, .bg-green-50, .bg-blue-50, .bg-purple-50 {
  color: #374151;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

/* Monospace elements */
.mono {
  font-family: var(--font-mono);
  font-weight: 600;
}

/* ==========================================
   BRUTALIST COMPONENTS
   ========================================== */

/* Brutal Box */
.brutal-box {
  border: var(--border-thick) solid var(--color-white);
  background: var(--color-gray-dark);
  box-shadow: var(--shadow-brutal);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.brutal-box:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-brutal-hover);
}

.brutal-box-blue {
  border-color: var(--color-electric-blue);
  box-shadow: 8px 8px 0px var(--color-electric-blue);
}

.brutal-box-blue:hover {
  box-shadow: 12px 12px 0px var(--color-electric-blue);
}

.brutal-box-purple {
  border-color: var(--color-neon-purple);
  box-shadow: 8px 8px 0px var(--color-neon-purple);
}

.brutal-box-purple:hover {
  box-shadow: 12px 12px 0px var(--color-neon-purple);
}

/* Brutal Button */
.brutal-btn {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 2rem;
  border: var(--border-medium) solid var(--color-white);
  background: var(--color-black);
  color: var(--color-white);
  box-shadow: 6px 6px 0px var(--color-white);
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
}

.brutal-btn:hover {
  transform: translate(-3px, -3px);
  box-shadow: 9px 9px 0px var(--color-white);
}

.brutal-btn:active {
  transform: translate(0, 0);
  box-shadow: 3px 3px 0px var(--color-white);
}

.brutal-btn-blue {
  border-color: var(--color-electric-blue);
  background: var(--color-electric-blue);
  color: var(--color-black);
  box-shadow: 6px 6px 0px var(--color-electric-blue);
}

.brutal-btn-blue:hover {
  box-shadow: 9px 9px 0px var(--color-electric-blue);
}

.brutal-btn-purple {
  border-color: var(--color-neon-purple);
  background: var(--color-neon-purple);
  color: var(--color-white);
  box-shadow: 6px 6px 0px var(--color-neon-purple);
}

.brutal-btn-purple:hover {
  box-shadow: 9px 9px 0px var(--color-neon-purple);
}

/* ==========================================
   GLITCH EFFECTS
   ========================================== */

@keyframes glitch {
  0% {
    transform: translate(0);
  }
  20% {
    transform: translate(-2px, 2px);
  }
  40% {
    transform: translate(-2px, -2px);
  }
  60% {
    transform: translate(2px, 2px);
  }
  80% {
    transform: translate(2px, -2px);
  }
  100% {
    transform: translate(0);
  }
}

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

.glitch-text {
  position: relative;
  display: inline-block;
}

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

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

.glitch-text:hover::after {
  left: -2px;
  text-shadow: -2px 0 var(--color-neon-purple);
  clip: rect(44px, 450px, 56px, 0);
  animation: glitch-anim 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
  0% {
    clip: rect(10px, 9999px, 31px, 0);
  }
  10% {
    clip: rect(70px, 9999px, 71px, 0);
  }
  20% {
    clip: rect(60px, 9999px, 25px, 0);
  }
  30% {
    clip: rect(90px, 9999px, 42px, 0);
  }
  40% {
    clip: rect(20px, 9999px, 53px, 0);
  }
  50% {
    clip: rect(80px, 9999px, 76px, 0);
  }
  60% {
    clip: rect(40px, 9999px, 98px, 0);
  }
  70% {
    clip: rect(50px, 9999px, 14px, 0);
  }
  80% {
    clip: rect(30px, 9999px, 86px, 0);
  }
  90% {
    clip: rect(10px, 9999px, 67px, 0);
  }
  100% {
    clip: rect(70px, 9999px, 29px, 0);
  }
}

/* ==========================================
   GRID BACKGROUND
   ========================================== */

.grid-bg {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

.grid-bg-blue {
  background-image:
    linear-gradient(rgba(0, 229, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

.grid-bg-purple {
  background-image:
    linear-gradient(rgba(176, 38, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(176, 38, 255, 0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* ==========================================
   TERMINAL/CODE EFFECTS
   ========================================== */

.terminal-window {
  background: var(--color-gray-dark);
  border: var(--border-medium) solid var(--color-electric-blue);
  border-radius: 0;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  position: relative;
}

.terminal-window::before {
  content: '> _';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  color: var(--color-electric-blue);
  font-weight: 700;
  animation: blink 1s step-end infinite;
}

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

/* Matrix-style number reveal */
@keyframes compile-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  50% {
    opacity: 0.5;
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.compile-animation {
  animation: compile-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Stagger children */
.compile-stagger > * {
  opacity: 0;
}

.compile-stagger.active > *:nth-child(1) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both; }
.compile-stagger.active > *:nth-child(2) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both; }
.compile-stagger.active > *:nth-child(3) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both; }
.compile-stagger.active > *:nth-child(4) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.4s both; }
.compile-stagger.active > *:nth-child(5) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both; }
.compile-stagger.active > *:nth-child(6) { animation: compile-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.6s both; }

/* ==========================================
   SCROLL ANIMATIONS
   ========================================== */

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   DIAGONAL CUTS & SHAPES
   ========================================== */

.diagonal-cut-top-right {
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 80px), 0 100%);
}

.diagonal-cut-bottom-left {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 80px 100%);
}

/* ==========================================
   ACCENT BARS
   ========================================== */

.accent-bar-blue {
  position: relative;
}

.accent-bar-blue::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--color-electric-blue);
}

.accent-bar-purple {
  position: relative;
}

.accent-bar-purple::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 6px;
  height: 100%;
  background: var(--color-neon-purple);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.text-electric-blue {
  color: var(--color-electric-blue);
}

.text-neon-purple {
  color: var(--color-neon-purple);
}

.text-acid-green {
  color: var(--color-acid-green);
}

.bg-electric-blue {
  background-color: var(--color-electric-blue);
}

.bg-neon-purple {
  background-color: var(--color-neon-purple);
}

.border-electric-blue {
  border-color: var(--color-electric-blue);
}

.border-neon-purple {
  border-color: var(--color-neon-purple);
}

/* Scanline effect */
@keyframes scanline {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100vh);
  }
}

.scanline {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(to bottom, transparent, rgba(0, 229, 255, 0.5), transparent);
  animation: scanline 8s linear infinite;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.3;
}
