/* === Root Variables === */
:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-color-secondary: #a0a0a0;
    --font-family: 'Poppins', sans-serif;
    --header-height: 70px;
}

/* === Global Styles & Resets === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: auto;
    padding: 5rem 2rem;
    overflow: hidden;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

/* === Header & Navigation === */
#main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    transition: background 0.3s ease-in-out;
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#main-header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

#main-header ul {
    list-style: none;
    display: flex;
}

#main-header ul li {
    margin-left: 2rem;
}

#main-header ul li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: color 0.3s ease;
}

#main-header ul li a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

#main-header ul li a:hover,
#main-header ul li a.active {
    color: #fff;
}

#main-header ul li a:hover::after,
#main-header ul li a.active::after {
    width: 100%;
}

/* === Hero Section === */
#hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--background-color) url('https://www.transparenttextures.com/patterns/cubes.png');
    position: relative;
    padding: 0 2rem;
}

#hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, rgba(106, 17, 203, 0.3) 0%, rgba(37, 117, 252, 0) 60%);
}

.hero-content {
    z-index: 1;
}

.hero-content h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-color-secondary);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-down a {
    display: block;
    width: 24px;
    height: 40px;
    border: 2px solid var(--text-color-secondary);
    border-radius: 20px;
    position: relative;
}

.scroll-down span {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 8px;
    background-color: var(--text-color-secondary);
    border-radius: 2px;
    animation: scroll 2s infinite;
}

@keyframes scroll {
    0% { top: 8px; opacity: 1; }
    100% { top: 20px; opacity: 0; }
}

/* === Section-Specific Styles === */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    max-width: 350px;
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.about-image img:hover {
    transform: scale(1.05);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-color-secondary);
}

.tech-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.tech-list li {
    position: relative;
    padding-left: 20px;
}

.tech-list li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--surface-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
}

.project-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

.project-info {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 { margin-bottom: 0.5rem; }
.project-info p { color: var(--text-color-secondary); margin-bottom: 1rem; flex-grow: 1; }
.project-tech { margin-bottom: 1rem; }

.project-tech span {
    background: rgba(106, 17, 203, 0.2);
    color: var(--text-color);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    font-size: 0.8rem;
    margin: 0.25rem 0.5rem 0.25rem 0;
    display: inline-block;
}

.project-links a { color: var(--secondary-color); text-decoration: none; margin-right: 1rem; font-weight: 600; }
.project-links a:hover { text-decoration: underline; }

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 2rem;
    text-align: center;
}

.skill-item {
    background: var(--surface-color);
    padding: 2rem 1rem;
    border-radius: 10px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.skill-item:hover {
    transform: translateY(-5px);
    background: linear-gradient(145deg, var(--primary-color), var(--secondary-color));
}

.skill-item i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.skill-item:hover i, .skill-item:hover p { color: #fff; }
.skill-item p { font-weight: 600; transition: color 0.3s ease; }

.contact-message {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 2rem auto;
    color: var(--text-color-secondary);
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: var(--surface-color);
    border: 1px solid transparent;
    border-radius: 5px;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
}

/* === Footer === */
footer {
    text-align: center;
    padding: 2rem;
    background: var(--surface-color);
    margin-top: 4rem;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    color: var(--text-color-secondary);
    font-size: 1.5rem;
    margin: 0 0.75rem;
    transition: color 0.3s ease;
}

.social-links a:hover {
    color: var(--secondary-color);
}

/* === Animations === */
.hero-content h1, .hero-content p, .hero-content .btn {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero-content p { animation-delay: 0.3s; }
.hero-content .btn { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 0.8s cubic-bezier(0.5, 0, 0, 1), transform 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* === Responsive Design === */
@media (max-width: 768px) {
    html { scroll-padding-top: 120px; }
    .container { padding: 4rem 2rem; }
    .section-title { font-size: 2rem; }

    #main-header { height: auto; }
    #main-header nav { flex-direction: column; height: auto; padding: 1rem; }
    .logo { margin-bottom: 1rem; }
    #main-header ul { flex-wrap: wrap; justify-content: center; }
    #main-header ul li { margin: 0.5rem; }

    .hero-content h1 { font-size: 2.5rem; }
    .hero-content p { font-size: 1.2rem; }

    .about-content { grid-template-columns: 1fr; text-align: center; }
    .about-image { margin: 0 auto 2rem auto; }
    .tech-list { justify-content: center; text-align: left; max-width: 400px; margin: 1rem auto 0; }
}

@media (max-width: 480px) {
    .container { padding: 3rem 1rem; }
    #main-header ul li { margin: 0.2rem 0.5rem; }
    .project-grid { grid-template-columns: 1fr; }
    .tech-list { grid-template-columns: 1fr; }
}