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

:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --text-secondary: #333333;
    --border-color: #e0e0e0;
    --bg-text-color: hsla(0, 0%, 0%, 0.143);
    --profile-gradient-start: #999;
    --profile-gradient-end: #bbb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
}

body.dark-mode {
    --bg-color: #000000;
    --text-color: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #222222;
    --bg-text-color: rgba(255, 255, 255, 0.097);
    --profile-gradient-start: #555;
    --profile-gradient-end: #777;
    --shadow-color: rgba(0, 0, 0, 0.5);
    --navbar-bg: rgba(0, 0, 0, 0.95);
}

body {
    font-family: 'Fragment Mono', monospace;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #ff4444, #ff6b35);
    z-index: 9999;
    transition: width 0.1s ease;
}

/* Fixed Theme Toggle - Bottom Right */
.theme-toggle-fixed {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9998;
}

#theme-switch {
    display: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 60px;
    height: 30px;
    background-color: var(--border-color);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.4s ease;
    padding: 5px;
    box-shadow: 0 4px 10px var(--shadow-color);
}

.toggle-label .sun,
.toggle-label .moon {
    font-size: 16px;
    transition: opacity 0.4s ease;
}

.toggle-label .sun {
    opacity: 1;
}

.toggle-label .moon {
    opacity: 0.3;
}

body.dark-mode .toggle-label .sun {
    opacity: 0.3;
}

body.dark-mode .toggle-label .moon {
    opacity: 1;
}

.toggle-label::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background-color: #fff;
    border-radius: 50%;
    top: 4px;
    left: 4px;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#theme-switch:checked + .toggle-label::after {
    transform: translateX(30px);
    background-color: #000;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 3rem;
    background-color: var(--navbar-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: 1000;
    border-bottom: none;
    transition: all 0.4s ease;
}

.navbar.scrolled {
    box-shadow: 0 2px 20px var(--shadow-color);
}

/* Logo */
.logo {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-color);
    white-space: nowrap;
    transition: opacity 0.2s;
    position: relative;
}
.logo:hover { opacity: 0.55; }

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: var(--text-color);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

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

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

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

/* Overlay behind mobile menu */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 995;
    opacity: 0;
    transition: opacity 0.3s;
}
.nav-overlay.visible { opacity: 1; }

/* Link list */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.nav-link {
    font-family: 'Fragment Mono', monospace;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--text-secondary);
    position: relative;
    padding-bottom: 4px;
    transition: color 0.25s;
}

/* slide-in underline */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #fc440f, #ff6d44);
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }
.nav-link:hover {
    color: var(--text-color);
}

.nav-link.active {
    color: #fc440f;
}
.nav-link.active::after { width: 100%; }

/* ═══════════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════════ */
.page-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 4rem 2rem;
    font-size: 11px;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-top: none;
    background-color: var(--bg-color);
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    padding-top: 120px;
    overflow: hidden;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 3rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

/* Left Side */
.hero-left {
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.2s;
}

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

.section-title {
    font-size: 4rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Bracket Animation */
.bracket-animate {
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
    color: #ff4444;
}

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

/* Typing Animation Container */
.typing-text {
    display: inline-block;
    min-width: 250px;
    border-right: 3px solid #ff4444;
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { border-color: transparent; }
}

.name {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 2rem;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

/* Glitch Effect on Name */
.glitch-text {
    position: relative;
}

.glitch-text:hover {
    animation: glitch 0.5s ease;
}

@keyframes glitch {
    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); }
}

.glitch-text::before,
.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.glitch-text:hover::before {
    animation: glitchTop 0.5s ease;
    color: #ff4444;
    z-index: -1;
}

.glitch-text:hover::after {
    animation: glitchBottom 0.5s ease;
    color: #ff6b35;
    z-index: -2;
}

@keyframes glitchTop {
    0%, 100% { transform: translate(0); opacity: 0; }
    50% { transform: translate(-3px, -3px); opacity: 0.7; }
}

@keyframes glitchBottom {
    0%, 100% { transform: translate(0); opacity: 0; }
    50% { transform: translate(3px, 3px); opacity: 0.7; }
}

.description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    max-width: 580px;
    transition: color 0.4s ease;
}

/* Text Reveal Animation */
.reveal-text {
    opacity: 0;
    animation: revealText 1.5s ease forwards;
    animation-delay: 0.8s;
}

@keyframes revealText {
    from {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Right Side */
.hero-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    z-index: 2;
    opacity: 0;
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.5s;
}

.profile-image {
    width: 400px;
    height: 400px;
    position: relative;
}

.image-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--profile-gradient-start) 0%, var(--profile-gradient-end) 100%);
    box-shadow: 0 20px 60px var(--shadow-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 20px 60px var(--shadow-color);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 30px 80px rgba(255, 68, 68, 0.3);
}

/* Pulse Animation on Profile */
.pulse-animation {
    animation: pulseImage 3s ease-in-out infinite;
}

@keyframes pulseImage {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 20px 60px var(--shadow-color);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 25px 70px rgba(255, 68, 68, 0.2);
    }
}

.image-placeholder:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 30px 80px rgba(255, 68, 68, 0.3);
}

.social-links {
    display: flex;
    gap: 3rem;
}

.social-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2rem;
    letter-spacing: 1px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: inline-block;
}

.social-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ff4444, #ff6b35);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.social-link:hover {
    color: #ff4444;
    transform: translateY(-3px);
}

/* Individual Social Link Colors */
.social-link:nth-child(1):hover {
    color: #0077B5; /* LinkedIn Blue */
}

.social-link:nth-child(2):hover {
    color: #FFC01D; /* LeetCode Yellow */
}

/* GitHub - No color change on hover */

/* Magnetic Effect */
.magnetic {
    transition: transform 0.2s ease;
}

/* Background Text */
.bg-text {
    position: absolute;
    font-size: 25rem;
    font-weight: bold;
    color: var(--bg-text-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    letter-spacing: 20px;
    pointer-events: none;
    user-select: none;
    animation: floatText 6s ease-in-out infinite;
    transition: color 0.4s ease;
}

@keyframes floatText {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -52%) scale(1.02); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-right {
        align-items: center;
    }

    .description {
        margin: 0 auto;
    }

    .bg-text {
        font-size: 15rem;
    }
    .page-footer {
        padding: 3rem 1.5rem;
        font-size: 10px;
    }}

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

    .nav-menu {
        position: fixed;
        top: 0; right: 0;
        width: min(280px, 78vw);
        height: 100dvh;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 2rem;
        padding: 2rem 2.5rem;
        background: var(--navbar-bg);
        border-left: 1px solid rgba(255,255,255,0.05);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        transform: translateX(100%);
        transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
        z-index: 1005;
        box-shadow: -4px 0 30px var(--shadow-color);
    }

    .nav-menu.active {
        transform: translateX(0);
    }

    .nav-menu li { padding: 0; width: 100%; }
    .nav-link { font-size: 13px; letter-spacing: 2px; }

    /* Show overlay */
    .nav-overlay { display: block; }

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

    .typing-text {
        min-width: 180px;
    }

    .name {
        font-size: 1.5rem;
    }

    .description {
        font-size: 1rem;
    }

    .profile-image {
        width: 300px;
        height: 300px;
    }

    .social-links {
        gap: 2rem;
    }

    .bg-text {
        font-size: 10rem;
    }

    .theme-toggle-fixed {
        bottom: 1.5rem;
        right: 1.5rem;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 12px;
    }

    .section-title {
        text-align: center;
        font-size: 2rem;
    }

    .typing-text {
        min-width: 120px;
    }

    .profile-image {
        width: 250px;
        height: 250px;
    }

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

    .bg-text {
        font-size: 6rem;
    }

    .theme-toggle-fixed {
        bottom: 1rem;
        right: 1rem;
    }

    .page-footer {
        padding: 2rem 1.2rem;
        font-size: 9px;
    }
}
}