/* Import Font */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

/* CSS Variables */
:root {
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --background-color: #000000;
    --text-color: #ffffff;
    --hover-color: #2574a9;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 0 20px rgba(52, 152, 219, 0.3);
    --container-width: 1200px;
    --header-height: 70px;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
}

html {
    font-size: 62.5%;
    overflow-x: hidden;
    scroll-padding-top: var(--header-height);
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Particles Background */
#particles-js {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 2rem 9%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    transition: var(--transition);
}

header.sticky {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.logo {
    font-size: 3rem;
    color: var(--primary-color);
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.logo:hover {
    text-shadow: 0 0 15px var(--primary-color);
    transform: scale(1.05);
}

/* Navigation */
nav {
    display: flex;
    gap: 4rem;
}

nav a {
    font-size: 1.8rem;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

nav a:hover::after,
nav a.active::after {
    width: 100%;
}

/* Home Section */
.home {
    position: relative;
    min-height: 100vh;
    padding: 15rem 9% 5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.home-container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 3rem;
}

/* Profile Image */
.home-img {
    margin-bottom: 2rem;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.home-img img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 0 0 25px var(--primary-color);
    transition: var(--transition);
    animation: floatImage 4s ease-in-out infinite;
    object-fit: cover;
}

.home-img img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 35px var(--primary-color);
}

/* Content */
.home-content {
    max-width: 800px;
    margin: 0 auto;
}

.home-content h1 {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

/* Typing Animation */
.typing-container {
    min-height: 60px;
    margin: 1.5rem 0;
}

.typing-container h2 {
    font-size: 2.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.typing {
    color: var(--primary-color);
    position: relative;
}

.typing::after {
    content: '|';
    position: absolute;
    right: -8px;
    animation: blink 0.8s infinite;
}

/* Bio */
.bio {
    font-size: 1.6rem;
    margin: 2rem auto;
    max-width: 600px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Social Icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 3rem 0;
}

.social-icons a {
    width: 4.5rem;
    height: 4.5rem;
    display: grid;
    place-items: center;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    font-size: 2rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.social-icons a:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

/* Button */
.btn {
    display: inline-block;
    padding: 1.2rem 2.8rem;
    background-color: transparent;
    border: 2px solid var(--primary-color);
    border-radius: 4rem;
    font-size: 1.6rem;
    color: var(--primary-color);
    letter-spacing: 0.2rem;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.btn:hover {
    background-color: var(--primary-color);
    color: var(--background-color);
    box-shadow: var(--shadow);
    transform: scale(1.05);
}

/* Sound Toggle & Back to Top */
.sound-toggle,
.back-to-top {
    position: fixed;
    width: 4.5rem;
    height: 4.5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.sound-toggle {
    bottom: 8rem;
    right: 2rem;
}

.back-to-top {
    bottom: 2rem;
    right: 2rem;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.sound-toggle i,
.back-to-top i {
    color: var(--background-color);
    font-size: 2rem;
    transition: var(--transition);
}

.sound-toggle:hover,
.back-to-top:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
}

/* Animations */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes floatImage {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-24px); }
}

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

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
    background: transparent;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: var(--transition);
}

/* Media Queries */
@media (max-width: 1200px) {
    html { font-size: 55%; }
    .home { padding: 15rem 5% 5rem; }
    header { padding: 2rem 5%; }
}

@media (max-width: 991px) {
    section { padding: 10rem 5% 5rem; }
    .home-content h1 { font-size: 4rem; }
}

@media (max-width: 768px) {
    .nav-toggle { display: flex; }

    nav {
        position: absolute;
        top: 100%;
        right: -100%;
        width: 80%;
        padding: 1rem 4%;
        background-color: rgba(0, 0, 0, 0.9);
        backdrop-filter: blur(10px);
        flex-direction: column;
        gap: 2rem;
        transition: var(--transition);
    }

    nav.active { right: 0; }

    .home-img img {
        width: 150px;
        height: 150px;
    }

    .home-content h1 { font-size: 3.5rem; }
    .typing-container h2 { font-size: 2.2rem; }
    .bio { 
        font-size: 1.4rem;
        padding: 0 2rem;
    }
}

@media (max-width: 480px) {
    html { font-size: 50%; }
    .home-img img {
        width: 120px;
        height: 120px;
    }
    .home-content h1 { font-size: 3rem; }
    .typing-container h2 { font-size: 2rem; }
    .social-icons { gap: 1.5rem; }
    .btn { padding: 1rem 2.5rem; }
}

/* Print Styles */
@media print {
    .sound-toggle,
    .back-to-top,
    .nav-toggle {
        display: none !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --background-color: #000000;
        --text-color: #ffffff;
    }
}

/* High Contrast Mode */
@media (forced-colors: active) {
    * {
        border-color: ButtonText;
    }
}