:root {
    --bg-dark: #050505;
    --neon-cyan: #0ff;
    --neon-magenta: #f0f;
    --neon-yellow: #ff0;
    --text-color: #e0e0e0;
    --font-heading: 'Orbitron', sans-serif;
    --font-body: 'Rajdhani', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 18px;
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

/* Background Effects */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
}

.grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 200vw;
    height: 200vh;
    background-image:
        linear-gradient(var(--neon-cyan) 1px, transparent 1px),
        linear-gradient(90deg, var(--neon-cyan) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center bottom;
    opacity: 0.04;
    transform: perspective(500px) rotateX(60deg) translateY(-100px) translateZ(-200px);
    z-index: -1;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0) translateZ(-200px);
    }

    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px) translateZ(-200px);
    }
}

@keyframes flatGridMove {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(30px);
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section {
    padding: 100px 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    letter-spacing: 2px;
}

.section-title {
    font-size: clamp(1.5rem, 6vw, 3rem);
    color: var(--neon-cyan);
    margin-bottom: 3rem;
    text-transform: uppercase;
    position: relative;
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Glitch Effect */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

.glitch::before {
    left: 2px;
    text-shadow: -2px 0 var(--neon-magenta);
    clip: rect(24px, 550px, 90px, 0);
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -2px 0 var(--neon-cyan);
    clip: rect(85px, 550px, 140px, 0);
    animation: glitch-anim 2.5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% {
        clip: rect(10px, 9999px, 86px, 0);
    }

    20% {
        clip: rect(62px, 9999px, 21px, 0);
    }

    40% {
        clip: rect(32px, 9999px, 10px, 0);
    }

    60% {
        clip: rect(89px, 9999px, 59px, 0);
    }

    80% {
        clip: rect(15px, 9999px, 34px, 0);
    }

    100% {
        clip: rect(54px, 9999px, 78px, 0);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip: rect(65px, 9999px, 100px, 0);
    }

    20% {
        clip: rect(2px, 9999px, 46px, 0);
    }

    40% {
        clip: rect(88px, 9999px, 22px, 0);
    }

    60% {
        clip: rect(14px, 9999px, 77px, 0);
    }

    80% {
        clip: rect(55px, 9999px, 12px, 0);
    }

    100% {
        clip: rect(96px, 9999px, 34px, 0);
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--neon-cyan);
    z-index: 100;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.logo span {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    margin: 0 1.5rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: 0.3s;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--neon-yellow);
    text-shadow: 0 0 8px var(--neon-yellow);
}

/* Cyber Buttons */
.cyber-button {
    background: transparent;
    color: var(--neon-cyan);
    border: 2px solid var(--neon-cyan);
    padding: 0.8rem 2rem;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    text-decoration: none;
    display: inline-block;
}

.cyber-button.small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
}

.cyber-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--neon-cyan);
    transition: 0.3s;
    z-index: -1;
}

.cyber-button:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.cyber-button:hover::before {
    left: 0;
}

.cyber-button.primary {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
}

.cyber-button.primary::before {
    background: var(--neon-magenta);
}

.cyber-button.primary:hover {
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--neon-magenta);
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 2rem;
}

.hero h1 {
    font-size: clamp(2.5rem, 10vw, 5rem);
    color: var(--text-color);
    margin-bottom: 1rem;
    word-break: break-word;
}

.hero .subtitle {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    color: var(--neon-cyan);
    margin-bottom: 1.5rem;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.hero .description {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    line-height: 1.6;
    color: #aaa;
}

/* Terminal / About Section */
.terminal-window {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    overflow: hidden;
}

.terminal-header {
    background: #1a1a1a;
    padding: 10px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #333;
}

.terminal-header .btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.terminal-header .close {
    background: #ff5f56;
}

.terminal-header .min {
    background: #ffbd2e;
}

.terminal-header .max {
    background: #27c93f;
}

.terminal-header .title {
    color: #888;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin-left: 15px;
}

.terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 1rem;
    color: #0f0;
    line-height: 1.5;
}

.terminal-body p {
    margin-bottom: 10px;
}

.terminal-body .prompt {
    color: var(--neon-cyan);
}

.terminal-body .output {
    color: #ccc;
    margin-left: 15px;
}

.terminal-body .output.highlight {
    color: var(--neon-yellow);
}

.cursor {
    display: inline-block;
    width: 10px;
    height: 1.2em;
    background-color: #0f0;
    vertical-align: middle;
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.cyber-card {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid #333;
    position: relative;
    padding: 30px;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    width: 20px;
    height: 2px;
    background: var(--neon-cyan);
    transition: 0.3s;
}

.cyber-card::after {
    content: '';
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 20px;
    height: 2px;
    background: var(--neon-magenta);
    transition: 0.3s;
}

.cyber-card:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
    transform: translateY(-5px);
}

.cyber-card:hover::before,
.cyber-card:hover::after {
    width: 100%;
}

.card-tag {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--neon-yellow);
    margin-bottom: 10px;
}

.card-content h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 15px;
}

.card-content p {
    color: #aaa;
    margin-bottom: 25px;
    flex-grow: 1;
}

.cyber-link {
    color: var(--neon-cyan);
    text-decoration: none;
    font-family: var(--font-mono);
    font-weight: 500;
    transition: 0.3s;
}

.cyber-link:hover {
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta);
}

/* Footer & Contact */
.footer {
    text-align: center;
    padding: 80px 0 40px 0;
    border-top: 1px dashed #333;
    margin-top: 50px;
}

.footer h2 {
    font-size: 2.5rem;
    color: var(--neon-magenta);
    margin-bottom: 30px;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.copyright {
    font-family: var(--font-mono);
    color: #555;
    font-size: 0.9rem;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 4rem;
    }

    .hero .subtitle {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 2.5rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .grid-bg {
        transform: none;
        width: 100vw;
        height: 100vh;
        background-size: 30px 30px;
        opacity: 0.05;
        animation: flatGridMove 10s linear infinite;
    }

    .container {
        padding: 0 1.5rem;
    }

    .navbar {
        padding: 15px 10px;
        flex-direction: column;
        align-items: center;
    }

    .logo {
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    .nav-links {
        margin-top: 5px;
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .nav-links a {
        margin: 0;
        font-size: 0.75rem;
    }

    #lang-toggle {
        position: absolute;
        right: 15px;
        top: 12px;
        padding: 0.4rem 0.8rem;
        font-size: 0.7rem;
    }

    .hero {
        height: auto;
        min-height: 100vh;
        padding: 160px 1rem 60px 1rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero .subtitle {
        font-size: 1.2rem;
    }

    .hero .description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .terminal-window {
        max-width: 100%;
        border-radius: 0;
    }

    .terminal-body {
        font-size: 0.9rem;
        padding: 15px;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .footer h2 {
        font-size: 1.8rem;
    }

    .social-links {
        gap: 15px;
    }

    .cyber-button {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        margin-bottom: 1.5rem;
    }

    .footer h2 {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    .glitch::before {
        text-shadow: -1px 0 var(--neon-magenta);
        left: 1px;
    }

    .glitch::after {
        text-shadow: -1px 0 var(--neon-cyan);
        left: -1px;
    }

    .terminal-body {
        font-size: 0.8rem;
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .terminal-body .output {
        margin-left: 5px;
    }

    .card-content h3 {
        font-size: 1.2rem;
    }

    .social-links {
        flex-direction: column;
        width: 100%;
    }

    .social-links .cyber-button {
        width: 100%;
        text-align: center;
    }
}