:root {
    --bg-dark: #0e0e0e;
    --bg-light: #ffffff;
    --text-dark: #f5f5f5;
    --text-light: #111;
    --accent: #6c5ce7;
    --card-bg-dark: rgba(255, 255, 255, 0.05);
    --card-bg-light: rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-dark);
    color: var(--text-dark);
    transition: 0.3s;
    overflow-x: hidden;
}

body.light {
    background: var(--bg-light);
    color: var(--text-light);
}

body.light .card {
    background: var(--card-bg-light);
    color: var(--text-light);
}

a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    position: fixed;
    /* Fixed for better dynamic feel */
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(14, 14, 14, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: 0.3s;
}

body.light .header {
    background: rgba(255, 255, 255, 0.9);
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-links a {
    opacity: 0.8;
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    opacity: 1;
    color: var(--accent);
}

#theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
    transition: transform 0.3s;
}

#theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
}

/* Hamburger Menu */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    transition: 0.3s;
}

body.light .hamburger span {
    background-color: var(--text-light);
}

/* Hero */
.hero {
    text-align: center;
    padding: 160px 20px 100px;
    /* More top padding for fixed header */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.hero h2 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    background: linear-gradient(90deg, #fff, #999);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light .hero h2 {
    background: linear-gradient(90deg, #111, #555);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: 500;
}

.typing-text {
    border-right: 2px solid var(--accent);
    padding-right: 5px;
    animation: blink 0.75s step-end infinite;
}

@keyframes blink {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent)
    }
}

.hero p {
    max-width: 600px;
    line-height: 1.6;
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 28px;
    background: var(--accent);
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 2px solid var(--accent);
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(108, 92, 231, 0.4);
}

.btn.outline {
    background: transparent;
    color: var(--text-dark);
}

body.light .btn.outline {
    color: var(--text-light);
}

.btn.outline:hover {
    background: rgba(108, 92, 231, 0.1);
}

/* Sections */
.section {
    padding: 100px 40px;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 60px;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Cards */
.card {
    background: var(--card-bg-dark);
    padding: 30px;
    border-radius: 16px;
    transition: 0.4s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

body.light .card {
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
}

body.light .card:hover {
    background: rgba(0, 0, 0, 0.08);
}

.card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--accent);
}

/* Grids */
.skills-grid,
.projects-grid,
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.project a {
    display: inline-block;
    margin-top: 15px;
    font-weight: 600;
    color: var(--accent);
    font-size: 0.9rem;
}

.project a:hover {
    text-decoration: underline;
}

/* About */
.about-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    max-width: 1000px;
    /* Constrain width */
    margin: 0 auto;
}

.photo {
    width: 280px;
    height: 280px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(108, 92, 231, 0.3);
    /* "Dynamic" floating effect */
    animation: float 6s ease-in-out infinite;
    transition: transform 0.3s;
}

.photo:hover {
    transform: scale(1.05) rotate(2deg);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

.about-content p {
    line-height: 1.7;
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Contact */
.contact-form {
    max-width: 600px;
    margin: 0 auto 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    font-size: 1rem;
}

body.light .contact-form input,
body.light .contact-form textarea {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-form textarea {
    height: 150px;
    resize: vertical;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.social-links a {
    font-size: 1.1rem;
    font-weight: 500;
}

.email {
    text-align: center;
    opacity: 0.8;
}

/* Footer */
.footer {
    text-align: center;
    padding: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 40px;
}

body.light .footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 20px;
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 70%;
        background: var(--bg-dark);
        flex-direction: column;
        justify-content: center;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    }

    body.light .nav-links {
        background: var(--bg-light);
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .about-content {
        flex-direction: column;
        text-align: center;
    }
}