/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Base Styles and Variables */
:root {
    --dark-bg: #0c0c15;
    --darker-bg: #060611;
    --primary: #8e44ad;
    --primary-light: #9b59b6;
    --text-light: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #2a2a2a;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    --glow: 0 0 15px rgba(142, 68, 173, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    overflow-x: hidden;
    /* Add subtle background pattern */
    background-image: 
        linear-gradient(to bottom, rgba(12, 12, 21, 0.8) 1px, transparent 1px),
        linear-gradient(to right, rgba(12, 12, 21, 0.8) 1px, transparent 1px);
    background-size: 30px 30px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

a {
    text-decoration: none;
    color: var(--text-light);
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 120px 0;
    position: relative;
}

/* Enhanced button with better hover effect */
.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 14px 34px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    z-index: -1;
    transition: var(--transition);
    opacity: 0;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--glow);
}

.btn:hover:before {
    opacity: 1;
}

.btn:active {
    transform: translateY(1px);
}

/* Enhanced section header with animation */
.section-header {
    text-align: center;
    margin-bottom: 70px;
    position: relative;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: white;
    position: relative;
    display: inline-block;
}

.section-header h2:after {
    content: '';
    position: absolute;
    width: 30%;
    height: 4px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    bottom: -10px;
    left: 35%;
    border-radius: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.section-header p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    margin-top: 25px;
}

/* Enhanced section divider */
.section-divider {
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid var(--primary);
    margin: 0 auto;
    opacity: 0.7;
    position: relative;
}

.section-divider:before, .section-divider:after {
    content: '';
    position: absolute;
    top: -15px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

.section-divider:before {
    left: -100px;
    width: 85px;
}

.section-divider:after {
    right: -100px;
    width: 85px;
}

/* Enhanced Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(6, 6, 17, 0.9);
    backdrop-filter: blur(15px);
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    padding: 20px 0;
    transition: var(--transition);
}

nav.scrolled {
    padding: 15px 0;
    background-color: rgba(6, 6, 17, 0.95);
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    position: relative;
}

.logo:after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    bottom: 5px;
    right: -10px;
    animation: blink 3s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.5); }
}

.s2 {
    color: var(--primary);
    font-weight: 800;
}

.soft {
    color: white;
    font-weight: 800;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    font-size: 16px;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
}

.nav-links a:hover {
    color: var(--primary);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a.active {
    color: var(--primary);
}

.nav-links a.active::after {
    width: 100%;
}

/* Enhanced hamburger with smoother animation */
.hamburger {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 20px;
    position: relative;
    transition: transform 0.3s ease-in-out;
}

.hamburger:hover {
    transform: scale(1.1);
}

.hamburger span {
    display: block;
    position: absolute;
    height: 2px;
    width: 100%;
    background: white;
    border-radius: 2px;
    opacity: 1;
    left: 0;
    transform: rotate(0deg);
    transition: .25s ease-in-out;
}

.hamburger span:nth-child(1) {
    top: 0px;
}

.hamburger span:nth-child(2), .hamburger span:nth-child(3) {
    top: 9px;
}

.hamburger span:nth-child(4) {
    top: 18px;
}

.hamburger.open span:nth-child(1) {
    top: 9px;
    width: 0%;
    left: 50%;
}

.hamburger.open span:nth-child(2) {
    transform: rotate(45deg);
}

.hamburger.open span:nth-child(3) {
    transform: rotate(-45deg);
}

.hamburger.open span:nth-child(4) {
    top: 9px;
    width: 0%;
    left: 50%;
}

/* Enhanced Portfolio Section */
.portfolio {
    background-color: var(--darker-bg);
    position: relative;
    overflow: hidden;
}

.portfolio:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(142, 68, 173, 0.08) 0%, transparent 30%),
        radial-gradient(circle at 80% 20%, rgba(52, 152, 219, 0.08) 0%, transparent 30%);
    pointer-events: none;
    animation: backgroundShift 15s infinite alternate ease-in-out;
}

@keyframes backgroundShift {
    0% { 
        background-position: 0% 0%;
    }
    100% { 
        background-position: 100% 100%;
    }
}

.portfolio-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
    flex-wrap: wrap;
    position: relative;
}

/* Enhanced filter buttons */
.filter-btn {
    background: rgba(19, 19, 31, 0.7);
    border: 1px solid var(--border-color);
    padding: 10px 25px;
    border-radius: 30px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.filter-btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    z-index: -1;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.filter-btn.active, .filter-btn:hover {
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(142, 68, 173, 0.3);
}

.filter-btn.active:before, .filter-btn:hover:before {
    transform: scaleX(1);
}

/* Enhanced portfolio grid with staggered animation */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
}

.portfolio-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    height: 300px;
    transform: translateY(0);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                box-shadow 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:nth-child(odd) {
    animation: fadeInUp 0.8s both;
}

.portfolio-item:nth-child(even) {
    animation: fadeInUp 0.8s 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--glow), 0 15px 30px rgba(0, 0, 0, 0.4);
    z-index: 2;
}

.portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(12, 12, 21, 0.95), rgba(142, 68, 173, 0.7));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 30px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    transform: translateY(0);
}

.portfolio-item:hover img {
    transform: scale(1.1) rotate(2deg);
}

.portfolio-overlay h3 {
    font-size: 24px;
    margin-bottom: 15px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s,
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
}

.portfolio-overlay p {
    margin-bottom: 20px;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s,
                opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s;
}

.portfolio-item:hover .portfolio-overlay h3,
.portfolio-item:hover .portfolio-overlay p {
    transform: translateY(0);
    opacity: 1;
}

/* Enhanced portfolio link with better hover effect */
.portfolio-link {
    width: 50px;
    height: 50px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    opacity: 0;
    transition: 
        transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s,
        opacity 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.3s,
        background-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease;
}

.portfolio-item:hover .portfolio-link {
    transform: translateY(0);
    opacity: 1;
}

.portfolio-link:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.3);
}

/* Enhanced Footer */
footer {
    background-color: var(--darker-bg);
    padding: 60px 0 20px;
    position: relative;
    overflow: hidden;
}

footer:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: 
        radial-gradient(circle at 85% 15%, rgba(142, 68, 173, 0.08) 0%, transparent 25%),
        radial-gradient(circle at 15% 85%, rgba(52, 152, 219, 0.08) 0%, transparent 25%);
    pointer-events: none;
    animation: backgroundPulse 10s infinite alternate ease-in-out;
}

@keyframes backgroundPulse {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    margin-bottom: 30px;
}

.footer-logo .s2 {
    color: var(--primary);
    font-weight: 800;
}

.footer-logo .soft {
    color: white;
    font-weight: 800;
}

.footer-logo p {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 15px;
}

.footer-links {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.footer-column {
    flex: 1;
}

.footer-column h4 {
    font-size: 18px;
    margin-bottom: 20px;
    color: white;
    position: relative;
    display: inline-block;
}

.footer-column h4:after {
    content: '';
    position: absolute;
    width: 30px;
    height: 2px;
    background: var(--primary);
    bottom: -10px;
    left: 0;
    border-radius: 2px;
}

.footer-column a {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
    transition: var(--transition);
    position: relative;
    padding-left: 0;
}

.footer-column a:before {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    background: var(--primary);
    left: 0;
    top: 50%;
    transition: width 0.3s ease;
    opacity: 0;
}

.footer-column a:hover {
    color: var(--primary);
    transform: translateX(8px);
    padding-left: 12px;
}

.footer-column a:hover:before {
    width: 8px;
    opacity: 1;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-muted);
    position: relative;
}

.footer-bottom:before {
    content: '';
    position: absolute;
    width: 100px;
    height: 3px;
    background: var(--primary);
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px;
}

/* Enhanced Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.back-to-top:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--primary), var(--primary-light));
    top: 0;
    left: 0;
    z-index: -1;
    transition: var(--transition);
    opacity: 0;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3), var(--glow);
}

.back-to-top:hover:before {
    opacity: 1;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* Responsive Design */
@media (max-width: 992px) {
    .nav-links {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 576px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Add page transition effect */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--darker-bg);
    z-index: 9999;
    transform-origin: bottom;
    transition: transform 0.6s cubic-bezier(0.77, 0, 0.175, 1);
    transform: scaleY(0);
}

.page-transition.active {
    transform: scaleY(1);
    transform-origin: top;
}

/* Add hover effect for all interactive elements */
button, 
a, 
.filter-btn, 
.portfolio-item, 
.hamburger {
    will-change: transform;
}

/* Add subtle loading animations for page elements */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

section {
    animation: fadeIn 1s ease-out;
}

/* Image hover effect with subtle zoom */
img {
    transition: transform 0.5s ease;
}

/* Add scroll reveal animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}