/* Base styles */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    cursor: none; /* Hide default cursor */
    text-rendering: optimizeLegibility;
}

/* Improve text rendering for feature cards */
.feature-card h3,
.feature-card p {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Screen reader only - SEO content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

body {
    overflow-x: hidden;
    background-color: #0A0A0A;
    background-image: 
        linear-gradient(0deg, rgba(10, 10, 10, 0.95), rgba(10, 10, 10, 0.95)),
        url('data:image/svg+xml,<svg width="200" height="200" viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"><rect width="200" height="200" fill="none" stroke="%234A7C59" stroke-width="1" stroke-opacity="0.1" shape-rendering="crispEdges"/></svg>');
    background-size: 200px 200px;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

main {
    display: block;
    visibility: visible;
    opacity: 1;
}

/* Toxic Cursor */
.toxic-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    font-size: 36px;
    color: #FF0000;
    line-height: 1;
    transform-origin: center;
    filter: drop-shadow(0 0 8px #FF0000) drop-shadow(0 0 4px rgba(255, 0, 0, 0.8)) drop-shadow(0 0 2px rgba(255, 0, 0, 0.6));
    animation: cursorGlow 2s ease-in-out infinite;
}

@keyframes cursorGlow {
    0%, 100% {
        filter: drop-shadow(0 0 8px #FF0000) drop-shadow(0 0 4px rgba(255, 0, 0, 0.8)) drop-shadow(0 0 2px rgba(255, 0, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 12px #FF0000) drop-shadow(0 0 6px rgba(255, 0, 0, 1)) drop-shadow(0 0 3px rgba(255, 0, 0, 0.8));
    }
}



/* Loading Screen */
.loading-screen {
    transition: opacity 0.5s ease-out;
    pointer-events: none;
}

.loading-screen.hidden {
    display: none;
}

.loading-shape {
    animation: loadingRotate 2s linear infinite;
    transform-origin: center;
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: loadingDash 2s ease-in-out infinite;
}

@keyframes loadingRotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes loadingDash {
    0% {
        stroke-dashoffset: 200;
    }
    50% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -200;
    }
}

.loading-progress {
    animation: loadingProgress 2s ease-in-out infinite;
}

@keyframes loadingProgress {
    0% {
        transform: translateX(-100%);
    }
    50% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Apocalypse Grid Background */
.apocalypse-grid {
    background-image: 
        linear-gradient(to right, rgba(74, 124, 89, 0.1) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(74, 124, 89, 0.1) 1px, transparent 1px);
    background-size: 60px 60px;
    transform: skewY(-5deg);
    transform-origin: 0;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1), rgba(0,0,0,0));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    will-change: transform;
    backface-visibility: hidden;
}

/* Apocalypse Shapes */
.apocalypse-shapes {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
    will-change: transform;
    backface-visibility: hidden;
}

.apocalypse-shapes::before,
.apocalypse-shapes::after {
    content: '';
    position: absolute;
    width: 50vmax;
    height: 50vmax;
    border: 2px solid rgba(74, 124, 89, 0.1);
    animation: shapeRotate 30s linear infinite;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
}

.apocalypse-shapes::before {
    top: -25vmax;
    left: -25vmax;
    border-radius: 45% 55% 70% 30% / 50% 50% 50% 50%;
    animation-duration: 40s;
}

.apocalypse-shapes::after {
    bottom: -25vmax;
    right: -25vmax;
    border-radius: 55% 45% 30% 70% / 50% 50% 50% 50%;
    animation-duration: 35s;
}

@keyframes shapeRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Glitch Text Effect */
.glitch-text {
    position: relative;
    animation: glitchText 4s infinite;
}

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

.glitch-text::before {
    left: 2px;
    text-shadow: -1px 0 #4A7C59;
    animation: glitchText-1 4s infinite linear alternate-reverse;
}

.glitch-text::after {
    left: -2px;
    text-shadow: 1px 0 #8B0000;
    animation: glitchText-2 4s infinite linear alternate-reverse;
}

@keyframes glitchText {
    0% {
        text-shadow: 0.05em 0 0 #4A7C59, -0.05em -0.025em 0 rgba(139, 0, 0, 0.75);
    }
    14% {
        text-shadow: 0.05em 0 0 #4A7C59, -0.05em -0.025em 0 rgba(139, 0, 0, 0.75);
    }
    15% {
        text-shadow: -0.05em -0.025em 0 #4A7C59, 0.025em 0.025em 0 rgba(139, 0, 0, 0.75);
    }
    49% {
        text-shadow: -0.05em -0.025em 0 #4A7C59, 0.025em 0.025em 0 rgba(139, 0, 0, 0.75);
    }
    50% {
        text-shadow: 0.025em 0.05em 0 #4A7C59, 0.05em 0 0 rgba(139, 0, 0, 0.75);
    }
    99% {
        text-shadow: 0.025em 0.05em 0 #4A7C59, 0.05em 0 0 rgba(139, 0, 0, 0.75);
    }
    100% {
        text-shadow: -0.025em 0 0 #4A7C59, -0.025em -0.025em 0 rgba(139, 0, 0, 0.75);
    }
}

/* Typing Text Effect */
.typing-text {
    border-right: 2px solid #4A7C59;
    white-space: nowrap;
    overflow: hidden;
    animation: typing 4s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: #4A7C59;
    }
}

/* Apocalypse Border */
.apocalypse-border {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 15px 100%, 0 calc(100% - 15px));
    border: 2px solid rgba(74, 124, 89, 0.3);
    transition: border-color 0.3s ease;
}

.apocalypse-border:hover {
    border-color: rgba(74, 124, 89, 0.6);
}

/* Apocalypse Card */
.apocalypse-card {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

.apocalypse-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, 
        rgba(74, 124, 89, 0.1),
        transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.apocalypse-card:hover::before {
    opacity: 1;
}

.apocalypse-card:hover {
    transform: translateY(-5px);
}

/* Apocalypse Heading */
.apocalypse-heading {
    position: relative;
    display: inline-block;
}

.apocalypse-heading::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, 
        rgba(74, 124, 89, 0) 0%,
        rgba(74, 124, 89, 0.5) 50%,
        rgba(74, 124, 89, 0) 100%
    );
}

/* Apocalypse Link */
.apocalypse-link {
    position: relative;
    transition: all 0.3s ease;
}

.apocalypse-link:hover .absolute {
    width: 30px;
}

/* Scroll Animation */
@keyframes scroll {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100%);
    }
}

.animate-scroll {
    animation: scroll 2s cubic-bezier(0.76, 0, 0.24, 1) infinite;
}

/* Feature Card */
.feature-card {
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top,
        rgba(10, 10, 10, 1) 0%,
        rgba(10, 10, 10, 0.85) 30%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 1;
}

.feature-card > div:last-child {
    position: relative;
    z-index: 2;
}

/* Hover Effects */
.hover\:scale-105:hover {
    transform: scale(1.05);
}

.hover\:border-apocalypse-green:hover {
    border-color: #4A7C59;
}

/* Apocalypse Button */
.apocalypse-button {
    position: relative;
    overflow: hidden;
}

.apocalypse-button-outline {
    position: relative;
    overflow: hidden;
}

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

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        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: #0A0A0A;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #3D5F47;
}

/* Decay Effect */
@keyframes decay {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 0.4;
    }
}

.decay-effect {
    animation: decay 3s ease-in-out infinite;
}

/* Text Glow Effect */
.text-glow-green {
    text-shadow: 0 0 10px rgba(74, 124, 89, 0.5),
                 0 0 20px rgba(74, 124, 89, 0.3),
                 0 0 30px rgba(74, 124, 89, 0.2);
}

.text-glow-orange {
    text-shadow: 0 0 10px rgba(210, 105, 30, 0.5),
                 0 0 20px rgba(210, 105, 30, 0.3),
                 0 0 30px rgba(210, 105, 30, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .apocalypse-grid {
        background-size: 50px 50px;
    }
    
    .glitch-text {
        font-size: 3rem !important;
    }
}
