/* Quorvix Design System */

/* Inter for Body, Space Grotesk for Headings, DM Mono for Data */
@import url('https://fonts.googleapis.com/css2?family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400;1,500&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Space+Grotesk:wght@300..700&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    :root {
      /* Light Mode / Base */
      --background: #F2F2F2;
      --foreground: #121212;
      
      --card: #FFFFFF;
      --card-foreground: #121212;
      
      --popover: #FFFFFF;
      --popover-foreground: #121212;
      
      --primary: #E2083F;
      --primary-foreground: #FFFFFF;
      --primary-glow: rgba(226, 8, 63, 0.5);

      --secondary: #EBEBEB;
      --secondary-foreground: #121212;
      
      --muted: #E0E0E0;
      --muted-foreground: #666666;
      
      --accent: #E2083F;
      --accent-foreground: #FFFFFF;
      
      --destructive: #EF4444;
      --destructive-foreground: #FFFFFF;
      
      --border: #D4D4D4;
      --input: #E0E0E0;
      --ring: #E2083F;
      
      --radius: 0px; /* Zero unnecessary rounded corners */
      
      /* Grid / Terminal Accents */
      --grid-line: rgba(0, 0, 0, 0.05);
      --terminal-text: #121212;
    }
  
    .dark {
      /* Dark Mode (Default) */
      --background: #080808;
      --foreground: #F8F8F8;
      
      --card: #111111;
      --card-foreground: #F8F8F8;
      
      --popover: #111111;
      --popover-foreground: #F8F8F8;
      
      --primary: #E2083F;
      --primary-foreground: #FFFFFF;
      --primary-glow: rgba(226, 8, 63, 0.8);
  
      --secondary: #1A1A1A;
      --secondary-foreground: #F8F8F8;
      
      --muted: #1F1F1F;
      --muted-foreground: #A1A1AA;
      
      --accent: #E2083F;
      --accent-foreground: #FFFFFF;
      
      --destructive: #991B1B;
      --destructive-foreground: #F8F8F8;
      
      --border: #2A2A2A;
      --input: #2A2A2A;
      --ring: #E2083F;
      
      /* Grid / Terminal Accents */
      --grid-line: rgba(255, 255, 255, 0.05);
      --terminal-text: #E2083F;
    }
}

@layer base {
  * {
    @apply border-border;
  }
  body {
    @apply bg-background text-foreground antialiased font-sans selection:bg-primary/30 selection:text-foreground;
  }
  h1, h2, h3, h4, h5, h6 {
    @apply font-display tracking-tight text-balance;
  }
}

@layer utilities {
    .text-balance {
      text-wrap: balance;
    }
    .neon-glow {
      box-shadow: 0 0 15px var(--primary-glow), inset 0 0 10px rgba(0,0,0,0.5);
    }
    .neon-glow-hover:hover {
        box-shadow: 0 0 20px var(--primary-glow), inset 0 0 15px rgba(226, 8, 63, 0.1);
        border-color: var(--primary);
    }
    .grid-bg {
        background-image: 
            linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
            linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
        background-size: 40px 40px;
    }
    .bg-dots {
      background-image: radial-gradient(var(--grid-line) 1px, transparent 1px);
      background-size: 20px 20px;
    }
    .scanline {
        background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,0) 50%, rgba(0,0,0,0.1) 50%, rgba(0,0,0,0.1));
        background-size: 100% 4px;
        pointer-events: none;
    }
    .clip-path-slant {
      clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%);
    }
}

/* Custom Cursor */
.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 6px;
    height: 6px;
    background-color: var(--foreground);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: background-color 0.2s ease, width 0.2s ease, height 0.2s ease;
    mix-blend-mode: difference;
}

.custom-cursor.active {
    background-color: var(--primary);
    width: 12px;
    height: 12px;
}

.custom-cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    border: 1px solid var(--foreground);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease;
    opacity: 0.5;
    mix-blend-mode: difference;
}
.custom-cursor-follower.active {
    width: 48px;
    height: 48px;
    border-color: var(--primary);
    opacity: 1;
}

/* Smooth Scrolling (Lenis) recommendation */
html.lenis, html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-scroll-container] {
  will-change: transform;
}

.lenis.lenis-scrolling iframe {
  pointer-events: none;
}

/* Marquee Animations */
@keyframes marquee-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@keyframes marquee-right {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}

.animate-marquee-left {
    display: inline-flex;
    white-space: nowrap;
    animation: marquee-left 30s linear infinite;
}
.animate-marquee-right {
    display: inline-flex;
    white-space: nowrap;
    animation: marquee-right 30s linear infinite;
}
.animate-marquee-left:hover, .animate-marquee-right:hover {
    animation-play-state: paused;
}

/* Page Transition Overlay */
.transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: var(--background);
    z-index: 10000;
    pointer-events: none;
    transform: translateY(100%);
}

/* Preloader */
#preloader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background-color: var(--background);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.progress-bar-container {
    width: 200px;
    height: 2px;
    background-color: var(--muted);
    margin-top: 24px;
    position: relative;
    overflow: hidden;
}
.progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background-color: var(--primary);
    width: 0%;
}

/* Form & Toast Components */
@layer components {
    button[disabled] .btn-text {
        opacity: 0.7;
    }

    #toast-container {
        position: fixed;
        top: 20px;
        left: 20px;
        z-index: 9999;
        display: flex;
        flex-direction: column;
        gap: 10px;
        pointer-events: none;
    }

    .toast {
        background: var(--card);
        color: var(--foreground);
        padding: 12px 20px;
        border-left: 4px solid var(--primary);
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
        font-family: var(--font-mono);
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        pointer-events: auto;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .toast.show {
        transform: translateX(0);
    }

    .toast.error {
        border-left-color: #ef4444;
    }
}
