/* Base styles */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    background-color: #111111;
    background-image: 
        linear-gradient(0deg, rgba(17, 17, 17, 0.95), rgba(17, 17, 17, 0.95)),
        url('data:image/svg+xml,<svg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><rect width="100" height="100" fill="none" stroke="%23FF4655" stroke-width="0.5" stroke-opacity="0.1"/></svg>');
}

/* Grid background */
.bg-grid {
    background-image: linear-gradient(to right, rgba(255, 70, 85, 0.1) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 70, 85, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    transform: skewY(-12deg);
    transform-origin: 0;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
}

/* Progress bar animation */
.progress-bar {
    transform-origin: 0%;
    transform: scaleX(0);
    background: linear-gradient(90deg, #FF4655, #FF8F9E);
}

/* Navigation styles */
[data-nav] {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 2px solid rgba(255, 70, 85, 0.1);
}

[data-nav].scrolled {
    background: rgba(17, 17, 17, 0.95);
    border-bottom: 2px solid rgba(255, 70, 85, 0.2);
}

/* Menu overlay */
[data-menu-overlay] {
    display: flex;
    align-items: flex-start;
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: linear-gradient(135deg, rgba(17, 17, 17, 0.97), rgba(17, 17, 17, 0.95));
}

[data-menu-overlay] .container {
    width: 100%;
    padding-top: 12rem;
    padding-left: 4.5rem;
}

[data-menu-overlay] .space-y-8 {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
}

[data-menu-overlay] a {
    opacity: 0;
    transform: translateY(20px);
    will-change: transform, opacity;
    position: relative;
    padding-left: 0;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}

[data-menu-overlay] a:hover {
    padding-left: 2rem;
    color: #FF4655;
}

[data-menu-overlay] a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 0;
    height: 2px;
    background-color: #FF4655;
    transform: translateY(-50%);
    transition: width 0.3s ease;
}

[data-menu-overlay] a:hover::before {
    width: 1rem;
}

/* Smooth reveal animation classes */
.reveal-hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Text balance for headings */
h1, h2, h3 {
    text-wrap: balance;
}

/* Smooth hover transitions */
a, button {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Card hover effects */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 20px rgba(255, 70, 85, 0.2);
    border-color: #FF4655 !important;
}

/* Custom selection color */
::selection {
    background: rgba(255, 70, 85, 0.3);
    color: currentColor;
}

/* Smooth image loading */
img {
    transition: opacity 0.3s ease;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

img.loading {
    opacity: 0;
}

img.loaded {
    opacity: 1;
}

/* Focus styles */
a:focus-visible, button:focus-visible {
    outline: 2px solid rgba(255, 70, 85, 0.5);
    outline-offset: 2px;
}

/* Button styles */
.bg-r6-red {
    position: relative;
    overflow: hidden;
    background-color: #FF4655;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

.bg-r6-red::after, 
.bg-yellow-200::after, 
.bg-purple-600::after, 
.bg-gray-900::after,
.bg0red-900::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 150%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.bg-r6-red:hover::after, 
.bg-yellow-200:hover::after, 
.bg-purple-600:hover::after, 
.bg-gray-900:hover::after,
.bg-red-900:hover::after {
    transform: translateX(100%);
}

.bg-yellow-200, .bg-purple-600, .bg-gray-900, .bg-red-900 {
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
}

/* Section dividers */
section {
    position: relative;
}

section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(255, 70, 85, 0) 0%,
        rgba(255, 70, 85, 0.2) 50%,
        rgba(255, 70, 85, 0) 100%
    );
}

.server-tiers-section {
    background: rgb(13, 13, 13);
}

/* Games Section */
#games h2,
#games h3,
#games img,
#games .bg-r6-red {
  clip-path: none;
}

/* Card glowing effect */
.bg-r6-dark {
    position: relative;
    background-color: #1A1A1A;
    border: 2px solid rgba(255, 70, 85, 0.1);
}

.bg-r6-dark::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, 
        rgba(255, 70, 85, 0.15),
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bg-r6-dark:hover::before {
    opacity: 1;
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }

    body {
        background: none;
    }

    main {
        max-width: 100%;
        margin: 0;
        padding: 0;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    html {
        font-size: 20px;
    }
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    #home {
        padding-top: 4rem;
    }
    [data-menu-overlay] .container {
        padding-top: 8rem;
        padding-left: 2rem;
    }
    [data-menu-overlay] .space-y-8 {
        gap: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    html {
        font-size: 21px;
    }
}

@media (min-width: 1025px) {
    html {
        font-size: 22px;
    }
}

/* Adjust home section padding */
#home {
    padding-top: 6rem;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

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

::-webkit-scrollbar-track {
    background: #111111;
}

::-webkit-scrollbar-thumb {
    background: #FF4655;
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: #cc3744;
}

/* R6S-specific styles */
.tactical-border {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
    border: 2px solid rgba(255, 70, 85, 0.2);
}

.tactical-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 70, 85, 0.05) 0px,
        rgba(255, 70, 85, 0.05) 2px,
        transparent 2px,
        transparent 8px
    );
    pointer-events: none;
}

.operator-card {
    position: relative;
    overflow: hidden;
}

.operator-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 70, 85, 0.1), transparent);
    pointer-events: none;
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: #FF4655;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}
