:root {
    --primary: #4f8cff;
    --secondary: #f5f6fa;
    --accent: #ffb347;
    --text: #222;
    --bg: #f5f6fa;
    --glass: rgba(255,255,255,0.7);
    --glass-dark: rgba(34,34,34,0.7);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --border: 1px solid rgba(255,255,255,0.18);
}
body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
    transition: background 0.3s, color 0.3s;
}
body.dark {
    --primary: #4f8cff;
    --secondary: #23272f;
    --accent: #ffb347;
    --text: #f5f6fa;
    --bg: #181a20;
    --glass: rgba(34,34,34,0.7);
    --glass-dark: rgba(255,255,255,0.1);
    --shadow: 0 8px 32px 0 rgba(0,0,0,0.25);
    --border: 1px solid rgba(255,255,255,0.08);
}
.glass {
    background: var(--glass);
    box-shadow: var(--shadow);
    border-radius: 18px;
    border: var(--border);
    backdrop-filter: blur(8px);
}
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0.5rem 0;
    background: var(--glass);
    box-shadow: var(--shadow);
}
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}
.nav-logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-menu {
    display: flex;
    gap: 2rem;
}
.nav-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover {
    color: var(--primary);
}
.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text);
}
#darkModeToggle {
    position: fixed;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 200;
    background: var(--glass);
    border: none;
    border-radius: 50%;
    box-shadow: var(--shadow);
    padding: 0.7rem;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.3s;
}
#darkModeToggle:hover {
    background: var(--primary);
    color: #fff;
}
.hero {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.hero::before {
    content: "";
    position: absolute;
    top: -8px; left: -8px; right: -8px; bottom: -8px;
    z-index: 0;
    border-radius: 32px;
    padding: 0;
    background: conic-gradient(
        from 0deg,
        var(--primary),
        var(--accent),
        var(--primary),
        var(--primary)
    );
    filter: blur(2px);
    opacity: 0.7;
    animation: border-spin 8s linear infinite;
    pointer-events: none;
}

@keyframes border-spin {
    0% { transform: rotate(0deg);}
    100% { transform: rotate(360deg);}
}
.parallax {
    background-image: url('hero-bg.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
}
.hero-bg-shape {
    position: absolute;
    top: 10%;
    left: 50%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle at 60% 40%, var(--primary) 0%, transparent 70%);
    opacity: 0.18;
    filter: blur(32px);
    transform: translateX(-50%);
    z-index: 0;
    pointer-events: none;
    animation: bg-shape-move 8s ease-in-out infinite alternate;
}
@keyframes bg-shape-move {
    0% { top: 10%; left: 50%;}
    100% { top: 18%; left: 54%;}
}
.hero-content {
    text-align: center;
    z-index: 2;
    position: relative;
}
.hero-content h1 {
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% auto;
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
    animation: gradient-move 3s linear infinite;
}
@keyframes gradient-move {
    0% { background-position: 0% 50%;}
    100% { background-position: 100% 50%;}
}
.hero-img {
    width: 140px;
    height: 140px;
    max-width: 22vw;
    max-height: 22vw;
    min-width: 90px;
    min-height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 4px solid var(--primary);
    position: relative;
    z-index: 1;
    box-shadow: 0 0 32px 4px var(--primary), 0 0 0 8px rgba(79,140,255,0.15);
    animation: hero-float 3.5s ease-in-out infinite alternate, hero-glow 2.5s ease-in-out infinite alternate;
}
@keyframes hero-float {
    0% { transform: translateY(0);}
    100% { transform: translateY(-18px);}
}

@keyframes hero-glow {
    0% { box-shadow: 0 0 32px 4px var(--primary), 0 0 0 8px rgba(79,140,255,0.15);}
    100% { box-shadow: 0 0 48px 12px var(--accent), 0 0 0 16px rgba(255,179,71,0.12);}
}
.subtitle {
    font-size: 1.2rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}
.tagline {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}
.hero-buttons .btn {
    margin: 0 0.5rem;
}
.social-icons {
    margin-top: 1.2rem;
}
.social-icons a {
    color: var(--primary);
    font-size: 1.5rem;
    margin: 0 0.5rem;
    transition: color 0.2s, transform 0.2s;
}
.social-icons a:hover {
    color: var(--accent);
    transform: scale(1.2);
}
section {
    padding: 4rem 0 2rem 0;
}
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}
.about-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
}
.about-text {
    flex: 2;
}
.about-skills {
    flex: 1;
    text-align: center;
}
.about-skills img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--primary);
    display: block;
    margin-left: auto;
    margin-right: auto;
}
.skills {
    margin-top: 1rem;
}
.skill-group {
    margin-bottom: 1.2rem;
}
.skill-bar {
    background: var(--secondary);
    border-radius: 8px;
    margin: 0.3rem 0;
    position: relative;
    height: 18px;
    overflow: hidden;
}
.skill-bar::before {
    content: attr(data-skill);
    position: absolute;
    left: 10px;
    top: 0;
    height: 100%;
    color: #fff !important;
    font-weight: 500;
    line-height: 18px;
}
.skill-bar .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 8px;
    width: 0;
    transition: width 1.2s cubic-bezier(.77,0,.18,1);
}
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}
.project-card {
    padding: 1.2rem;
    border-radius: 18px;
    box-shadow: var(--shadow);
    background: var(--glass);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}
.project-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 12px 32px 0 rgba(31, 38, 135, 0.22);
}
.project-card img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.tags {
    margin: 0.5rem 0;
}
.tags span {
    background: var(--primary);
    color: #fff;
    border-radius: 6px;
    padding: 0.2rem 0.7rem;
    font-size: 0.9rem;
    margin-right: 0.4rem;
}
.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-top: 0.7rem;
    display: inline-block;
}
.project-link:hover {
    color: var(--accent);
}
.modal {
    display: none;
    position: fixed;
    z-index: 300;
    left: 0; top: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
}
.modal.active {
    display: flex;
}
.modal-content {
    background: var(--glass);
    padding: 2rem;
    border-radius: 18px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90vw;
    text-align: center;
    position: relative;
    animation: modalIn 0.4s cubic-bezier(.77,0,.18,1);
}
@keyframes modalIn {
    from { transform: scale(0.8) translateY(40px); opacity: 0; }
    to { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-content img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.close {
    position: absolute;
    top: 1rem; right: 1rem;
    font-size: 1.3rem;
    color: var(--primary);
    cursor: pointer;
}
.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}
.contact-info {
    flex: 1;
}
.info-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.2rem;
}
.info-item i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-right: 1rem;
}
.contact-form {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-form input, .contact-form textarea {
    padding: 0.8rem;
    border-radius: 8px;
    border: 1px solid var(--primary);
    font-size: 1rem;
    background: var(--secondary);
    color: var(--text);
    transition: border 0.2s;
}
.contact-form input:focus, .contact-form textarea:focus {
    border: 1.5px solid var(--accent);
    outline: none;
}
.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover {
    background: var(--accent);
    color: #222;
}
.btn-secondary {
    background: var(--accent);
    color: #222;
}
.btn-secondary:hover {
    background: var(--primary);
    color: #fff;
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
}
.form-message {
    margin-top: 0.7rem;
    font-size: 1rem;
    min-height: 1.2em;
}
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 150;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
#backToTop:hover {
    background: var(--accent);
    color: #222;
    transform: scale(1.1);
}
footer {
    text-align: center;
    padding: 1.5rem 0 1rem 0;
    background: var(--glass);
    color: var(--text);
    font-size: 1rem;
    border-radius: 18px 18px 0 0;
    margin-top: 2rem;
}
@media (max-width: 900px) {
    .about-grid, .contact-grid {
        flex-direction: column;
        gap: 2.5rem;
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        background: var(--glass);
        position: absolute;
        top: 60px;
        right: 2rem;
        border-radius: 12px;
        box-shadow: var(--shadow);
        padding: 1rem 2rem;
    }
    .nav-menu.active {
        display: flex;
    }
    .hamburger {
        display: block;
    }
}

.hero-decor {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 2;
}
.dot {
    position: absolute;
    border-radius: 50%;
    opacity: 0.5;
    filter: blur(1px);
    animation: float-dot 6s ease-in-out infinite alternate;
}
.dot1 { width: 18px; height: 18px; background: var(--primary); top: 8%; left: 12%; animation-delay: 0s;}
.dot2 { width: 12px; height: 12px; background: var(--accent); top: 80%; left: 18%; animation-delay: 1.5s;}
.dot3 { width: 14px; height: 14px; background: var(--primary); top: 20%; right: 10%; animation-delay: 2.5s;}
.dot4 { width: 10px; height: 10px; background: var(--accent); bottom: 12%; right: 16%; animation-delay: 3.5s;}

@keyframes float-dot {
    0% { transform: translateY(0);}
    100% { transform: translateY(-24px);}
}
.contact-subtitle {
    color: #0318f9;
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(90deg, #00ff04 0%, #ff0202 100%);
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(255,179,71,0.15);
    display: inline-block;
    letter-spacing: 0.5px;
    animation: subtitle-glow 2s ease-in-out infinite alternate;
}

@keyframes subtitle-glow {
    0% { box-shadow: 0 2px 12px rgba(20, 163, 235, 0.15); }
    100% { box-shadow: 0 4px 24px rgba(255,179,71,0.35); }
}
