/* ===== CSS Variables ===== */
:root {
    --primary-color: #00ffff;
    --secondary-color: #ff00ff;
    --accent-color: #00ff88;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --bg-card: #111111;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #00ffff 0%, #0080ff 100%);
    --gradient-3: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    --font-primary: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

/* ===== Reset & Base Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Loading Screen ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 2rem;
    animation: pulse 1.5s infinite;
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto 1rem;
}

.loader-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: var(--gradient-2);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(200%);
    }
}

.loader-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ===== Navigation ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(5, 5, 5, 0.95);
    box-shadow: 0 2px 20px rgba(0, 255, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-text {
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary);
    margin: 3px 0;
    transition: 0.3s;
}

/* ===== Hero Section ===== */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#particle-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-line {
    display: block;
    animation: fadeInUp 1s ease-out;
}

.hero-line:nth-child(2) {
    animation-delay: 0.2s;
}

.glitch {
    position: relative;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.glitch::before {
    background: linear-gradient(135deg, #ff006e 0%, #8338ec 100%);
    animation: glitch1 0.3s infinite;
}

.glitch::after {
    background: linear-gradient(135deg, #00ff88 0%, #00ffff 100%);
    animation: glitch2 0.3s infinite;
}

@keyframes glitch1 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
    100% {
        transform: translate(0);
    }
}

@keyframes glitch2 {
    0% {
        transform: translate(0);
    }
    20% {
        transform: translate(2px, -2px);
    }
    40% {
        transform: translate(2px, 2px);
    }
    60% {
        transform: translate(-2px, -2px);
    }
    80% {
        transform: translate(-2px, 2px);
    }
    100% {
        transform: translate(0);
    }
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-family: var(--font-mono);
}

.typewriter {
    border-right: 2px solid var(--primary-color);
    animation: blink 1s infinite;
}

.cursor {
    color: var(--primary-color);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.btn {
    padding: 1rem 2rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-2);
    color: var(--bg-dark);
}

.btn-secondary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.btn:hover::before {
    left: 100%;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.scroll-indicator span {
    width: 2px;
    height: 10px;
    background: var(--primary-color);
    display: block;
    animation: scroll 1.5s infinite;
}

.scroll-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.scroll-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scroll {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    50% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(10px);
    }
}

/* ===== Sections ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-line {
    width: 80px;
    height: 4px;
    background: var(--gradient-2);
    margin: 0 auto;
    border-radius: 2px;
}

/* ===== About Section ===== */
.about {
    background: var(--bg-darker);
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.about-content p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: block;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.code-window {
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.window-header {
    background: #1e1e1e;
    padding: 0.5rem 1rem;
    display: flex;
    gap: 0.5rem;
}

.window-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.window-dot.red {
    background: #ff5f56;
}

.window-dot.yellow {
    background: #ffbd2e;
}

.window-dot.green {
    background: #27c93f;
}

.code-content {
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
    overflow-x: auto;
}

.code-comment {
    color: #6a9955;
}

.code-keyword {
    color: #569cd6;
}

.code-class {
    color: #4ec9b0;
}

.code-string {
    color: #ce9178;
}

.code-method {
    color: #dcdcaa;
}

/* ===== Services Section ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(0, 255, 255, 0.1), transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 255, 255, 0.2);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
}

.icon-hex {
    width: 100%;
    height: 100%;
    background: var(--gradient-2);
    clip-path: polygon(30% 0%, 70% 0%, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0% 70%, 0% 30%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-hex svg {
    width: 30px;
    height: 30px;
    color: var(--bg-dark);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.service-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.service-link:hover {
    gap: 0.5rem;
}

/* ===== Technology Section ===== */
.technology {
    background: var(--bg-darker);
}

.tech-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px;
}

.tech-orbit {
    position: relative;
    width: 500px;
    height: 500px;
}

.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: var(--gradient-2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--bg-dark);
    z-index: 10;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.5);
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: rotate 20s linear infinite;
}

.ring-1 {
    width: 200px;
    height: 200px;
    margin-top: -100px;
    margin-left: -100px;
}

.ring-2 {
    width: 300px;
    height: 300px;
    margin-top: -150px;
    margin-left: -150px;
    animation-duration: 30s;
    animation-direction: reverse;
}

.ring-3 {
    width: 400px;
    height: 400px;
    margin-top: -200px;
    margin-left: -200px;
    animation-duration: 40s;
}

.tech-item {
    position: absolute;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tech-item:hover {
    background: var(--primary-color);
    color: var(--bg-dark);
    transform: scale(1.2);
    z-index: 10;
}

.tech-item::after {
    content: attr(data-tech);
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tech-item:hover::after {
    opacity: 1;
}

/* Position tech items on rings */
.ring-1 .tech-item:nth-child(1) { top: -25px; left: 50%; margin-left: -25px; }
.ring-1 .tech-item:nth-child(2) { top: 50%; right: -25px; margin-top: -25px; }
.ring-1 .tech-item:nth-child(3) { bottom: -25px; left: 50%; margin-left: -25px; }
.ring-1 .tech-item:nth-child(4) { top: 50%; left: -25px; margin-top: -25px; }

.ring-2 .tech-item:nth-child(1) { top: -25px; left: 50%; margin-left: -25px; }
.ring-2 .tech-item:nth-child(2) { top: 20%; right: 0; }
.ring-2 .tech-item:nth-child(3) { top: 50%; right: -25px; margin-top: -25px; }
.ring-2 .tech-item:nth-child(4) { bottom: 20%; right: 0; }
.ring-2 .tech-item:nth-child(5) { bottom: -25px; left: 50%; margin-left: -25px; }
.ring-2 .tech-item:nth-child(6) { top: 50%; left: -25px; margin-top: -25px; }

.ring-3 .tech-item:nth-child(1) { top: -25px; left: 50%; margin-left: -25px; }
.ring-3 .tech-item:nth-child(2) { top: 10%; right: 10%; }
.ring-3 .tech-item:nth-child(3) { top: 30%; right: -25px; }
.ring-3 .tech-item:nth-child(4) { top: 60%; right: -25px; }
.ring-3 .tech-item:nth-child(5) { bottom: 10%; right: 10%; }
.ring-3 .tech-item:nth-child(6) { bottom: -25px; left: 50%; margin-left: -25px; }
.ring-3 .tech-item:nth-child(7) { bottom: 10%; left: 10%; }
.ring-3 .tech-item:nth-child(8) { top: 30%; left: -25px; }

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ===== Contact Section ===== */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.contact-link:hover {
    background: rgba(0, 255, 255, 0.1);
    transform: translateX(5px);
}

.link-icon {
    font-size: 1.5rem;
}

.contact-form {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    position: relative;
    margin-bottom: 2rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-bottom-color: var(--primary-color);
}

.form-group label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
    top: -0.5rem;
    left: 0;
    font-size: 0.8rem;
    color: var(--primary-color);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-darker);
    padding: 3rem 0 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-brand h3 {
    font-size: 1.5rem;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-brand p {
    color: var(--text-secondary);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: var(--bg-darker);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .about-grid,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .tech-orbit {
        width: 350px;
        height: 350px;
    }

    .ring-1 {
        width: 150px;
        height: 150px;
        margin-top: -75px;
        margin-left: -75px;
    }

    .ring-2 {
        width: 220px;
        height: 220px;
        margin-top: -110px;
        margin-left: -110px;
    }

    .ring-3 {
        width: 300px;
        height: 300px;
        margin-top: -150px;
        margin-left: -150px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}