/* --- VARIABLES & RESET --- */
html { scroll-behavior: smooth; }
:root {
    --bg-color: #05070a;
    --surface-color: rgba(10, 15, 30, 0.6);
    --primary-color: #00f2ea; /* Neon Cyan */
    --secondary-color: #ff0055; /* Neon Pink/Red */
    --text-main: #ffffff;
    --text-muted: #a0aec0;
    --glass-border: rgba(0, 242, 234, 0.1);
    --font-display: 'Exo 2', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- PRELOADER --- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-ring {
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    margin-top: 20px;
    font-family: var(--font-display);
    letter-spacing: 3px;
    color: var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* --- SCROLL PROGRESS BAR --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    z-index: 1002;
    box-shadow: 0 0 10px var(--primary-color);
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #0b0d17; }
::-webkit-scrollbar-thumb { background: var(--surface-color); border: 1px solid var(--glass-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-color); }

/* --- ANIMATED BACKGROUND --- */
#canvas-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #111521 0%, #000000 100%);
}

/* --- TYPOGRAPHY --- */
h1, h2, h3 {
    font-family: var(--font-display);
    text-transform: uppercase;
    letter-spacing: 2px;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- HEADER --- */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 5%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: 0.4s ease;
}

header.scrolled {
    background: rgba(5, 7, 10, 0.85);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--glass-border);
    padding: 15px 5%;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.8);
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 1px;
}

header .logo img {
    transition: 0.4s ease;
    filter: drop-shadow(0 0 12px rgba(0, 242, 234, 0.4));
    height: 100px;
}

.logo span { color: white; }

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav a {
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    color: var(--text-muted);
}

nav a::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0%;
    height: 2px;
    background: var(--primary-color);
    transition: 0.3s ease;
    box-shadow: 0 0 10px var(--primary-color);
}

nav a:hover { color: var(--primary-color); text-shadow: 0 0 10px var(--primary-color); }
nav a:hover::before { width: 100%; }

/* --- HERO SECTION --- */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 20px;
    position: relative;
}

.glitch-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.hero h1 {
    font-size: 4.5rem;
    font-weight: 800;
    position: relative;
    /* Gradient Text */
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 15px rgba(0, 242, 234, 0.3), 0 0 25px rgba(255, 0, 85, 0.2);
    /* Enable selection for hacker effect */
    display: inline-block;
}

.hero p {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-height: 1.6em; /* Prevent layout shift */
    font-family: monospace;
    text-shadow: 0 0 5px rgba(0, 242, 234, 0.3);
}

.cursor-blink {
    display: inline-block;
    width: 10px;
    background-color: var(--secondary-color);
    animation: blink 1s infinite;
}

@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.btn-cyber {
    margin-top: 50px;
    padding: 15px 40px;
    background: rgba(0, 242, 234, 0.05);
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    box-shadow: 0 0 15px rgba(0, 242, 234, 0.1);
    letter-spacing: 2px;
}

.btn-cyber::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 242, 234, 0.4), transparent);
    transition: 0.5s;
}

.btn-cyber:hover {
    background: var(--primary-color);
    color: #000;
    box-shadow: 0 0 40px var(--primary-color);
}

.btn-cyber:hover::before { left: 100%; }

/* --- CARDS / GLASSMORPHISM --- */
.content-section {
    max-width: 1400px;
    margin: 0 auto;
    padding: 120px 20px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
    perspective: 1000px;
}

.service-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 50px 35px;
    border-radius: 15px;
    text-align: left;
    transition: 0.5s;
    transform-style: preserve-3d;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

/* Scanline Effect */
.service-card::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(0, 242, 234, 0.2), transparent);
    transition: 0s;
}

.service-card:hover::after {
    animation: scan 1.5s linear infinite;
}

@keyframes scan {
    0% { top: -100%; }
    100% { top: 200%; }
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-15px) rotateX(5deg) rotateY(5deg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 20px rgba(0, 242, 234, 0.1);
}

.service-card .icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    text-shadow: 0 0 15px rgba(0, 242, 234, 0.5);
    transition: 0.3s;
}

.service-card:hover .icon {
    transform: scale(1.1) translateZ(20px);
    text-shadow: 0 0 25px var(--primary-color);
}

.service-card h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: white;
    transform: translateZ(10px);
}

.service-card p {
    color: var(--text-muted);
    font-size: 1.05rem;
    transform: translateZ(5px);
    line-height: 1.7;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    transform: scaleX(0);
    transition: 0.5s;
}

.service-card:hover::before { transform: scaleX(1); }

.about-card {
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid var(--primary-color);
}

.about-card p {
    font-size: 1.2rem;
    line-height: 1.9;
}

/* Align the "System Identity" title to the right */
.about-card .section-title {
    left: auto;
    right: 0;
    transform: none;
}

/* --- FOOTER & FLOATING BTN --- */
footer {
    text-align: center;
    padding: 50px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.9rem;
    background: rgba(5, 7, 10, 0.9);
    position: relative;
}

footer p { letter-spacing: 1px; }

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 40px;
}

.tool-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 40px 35px;
    border-radius: 15px;
    text-align: center;
    transition: 0.4s;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.tool-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.7), 0 0 20px rgba(0, 242, 234, 0.1);
}

.tool-icon {
    color: var(--primary-color);
    margin-bottom: 25px;
    filter: drop-shadow(0 0 10px var(--primary-color));
    transition: 0.3s;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1);
}

.tool-card h3 {
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.tool-card p {
    color: var(--text-muted);
    margin-bottom: 30px;
}

.btn-tool {
    display: inline-block;
    padding: 10px 25px;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}

.wip-card {
    opacity: 0.7;
    border-style: dashed;
}

.wip-card:hover {
    opacity: 1;
}

.wip-btn {
    cursor: not-allowed;
    border-color: var(--text-muted);
    color: var(--text-muted);
}

.floating-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 70px;
    height: 70px;
    background: rgba(255, 0, 85, 0.1);
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(255, 0, 85, 0.2);
    transition: 0.3s;
    z-index: 1000;
    cursor: pointer;
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.1);
    background: var(--secondary-color);
    color: white;
    box-shadow: 0 0 40px var(--secondary-color);
}

/* --- ANIMATION HELPERS --- */
.reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- MOBILE & ACCESSIBILITY --- */
@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;
    }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2.8rem; }
    .hero p { font-size: 1.1rem; }
    nav { display: none; }
    .service-card:hover { transform: none; } /* Disable tilt on touch */
}

/* --- MODAL STYLES --- */
.modal-section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px; /* Add padding for smaller screens */
}

.modal-section.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--surface-color);
    padding: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-muted);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal:hover {
    color: var(--secondary-color);
}

/* --- PRIVACY POLICY MODAL --- */
#privacy-policy {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#privacy-policy.active {
    opacity: 1;
    visibility: visible;
}

.privacy-content {
    background: var(--surface-color);
    padding: 40px;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    text-align: left;
}

.close-privacy {
    position: absolute;
    top: 15px;
    right: 25px;
    color: var(--text-muted);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close-privacy:hover {
    color: var(--secondary-color);
}