@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&display=swap');

:root {
    --bg-color: #0a192f;
    --text-primary: #e6f1ff;
    --text-secondary: #a8b2d1;
    --accent-1: #66b2ff;
    --accent-2: #0073e6;
    --accent-gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    --glass-bg: rgba(10, 40, 80, 0.5);
    --glass-border: rgba(102, 178, 255, 0.2);
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
    font-size: 112.5%;
    /* Scales base to 18px, all rem units grow proportionally */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Page Transition */
.page-transition {
    opacity: 0;
    transform: translateY(20px);
    animation: pageIn 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-out {
    animation: pageOut 0.5s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes pageOut {
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

/* Navbar */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(10, 25, 47, 0.85);
    /* Updated for blue theme */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    transition: var(--transition);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-img {
    height: 45px;
    width: auto;
    border-radius: 8px;
    transition: var(--transition);
}

.logo-img:hover {
    transform: scale(1.05);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    bottom: -4px;
    left: 0;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Main Content */
main {
    flex: 1;
    padding: 8rem 5% 4rem;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

/* Typography & Utilities */
h1,
h2,
h3 {
    line-height: 1.2;
}

.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-top: 1rem;
    max-width: 600px;
}

/* Hero Section */
.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    margin-top: 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-primary);
    background: var(--accent-gradient);
    background-size: 200% auto;
    transition: 0.5s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(70, 156, 242, 0.6);
}

/* Background Blobs */
.blob {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    -webkit-filter: blur(100px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 600px;
    max-height: 600px;
    background: var(--accent-1);
}

.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    max-width: 500px;
    max-height: 500px;
    background: var(--accent-2);
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Cards (Projects) */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    transition: 0.5s;
}

.card:hover::before {
    left: 100%;
}

.card:hover {
    transform: translateY(-10px);
    border-color: var(--accent-1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Animations (Intersection Observer) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Contact Form */
.contact-wrapper {
    max-width: 700px;
    margin: 0 auto;
    background: var(--glass-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.input-group {
    margin-bottom: 2rem;
    position: relative;
}

.input-group input,
.input-group textarea {
    width: 100%;
    padding: 1rem 1rem 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--glass-border);
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
    outline: none;
    font-size: 1rem;
}

.input-group input:focus,
.input-group textarea:focus {
    border-bottom-color: var(--accent-1);
}

.input-group label {
    position: absolute;
    left: 0;
    top: 1rem;
    color: var(--text-secondary);
    transition: var(--transition);
    pointer-events: none;
}

.input-group input:focus~label,
.input-group input:valid~label,
.input-group textarea:focus~label,
.input-group textarea:valid~label {
    top: -1.2rem;
    font-size: 0.85rem;
    color: var(--accent-1);
}

/* --- New Sections Support --- */
.section {
    padding: 6rem 0;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 15px;
    padding: 2.5rem;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.service-icon {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: var(--glass-border);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -1px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 3px solid var(--accent-1);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
    border-color: var(--accent-2);
}

.timeline-content {
    padding: 20px 30px;
    background: var(--glass-bg);
    position: relative;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}

.timeline-date {
    color: var(--accent-1);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

/* Tags */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.5rem;
}

.tag {
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    color: var(--text-secondary);
}

/* Contact layout */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-info-block {
    background: var(--glass-bg);
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.contact-detail i {
    font-size: 1.5rem;
    color: var(--accent-1);
    width: 30px;
    text-align: center;
}

/* FAQ */
.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1.5rem;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.faq-question {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.faq-answer {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Navigation Mobile Styles */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001; /* Above the overlay menu */
    transition: var(--transition);
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: var(--transition);
}

/* Hamburger active animation */
.hamburger.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        order: -1;
    }

    .logo {
        order: 1;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
        background: rgba(10, 25, 47, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        z-index: 999;
        border-bottom: 1px solid var(--glass-border);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    html {
        font-size: 100%; /* Scale base down for mobile */
    }

    nav {
        padding: 1.5rem 5%;
    }

    .logo-img {
        height: 50px;
    }

    main {
        padding: 9rem 5% 2rem;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 8vw, 3.5rem);
    }

    .subtitle {
        font-size: 1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    /* Override inline styles for smaller displays */
    .hero, #about > div {
        gap: 2rem !important;
    }
    
    #about, #projects, #contact {
        padding-top: 2rem !important;
        margin-top: 0 !important;
    }

    .hero img, #about img {
        width: 100% !important;
        height: auto;
    }

    .grid {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
    }

    .nav-links a {
        font-size: 1rem;
        margin-bottom: 0.5rem;
    }

    .timeline::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #469cf2;
    /* Matching the sky blue from the reference image */
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(70, 156, 242, 0.4);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    background: #368ee0;
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(70, 156, 242, 0.6);
}

.scroll-top-btn svg {
    width: 28px;
    height: 28px;
}

/* Language Switcher Dropdown */
.lang-switcher {
    display: flex;
    align-items: center;
    position: relative;
}

.dropdown {
    position: relative;
    display: inline-block;
}

.dropbtn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-family: inherit;
}

.dropbtn:hover, .dropdown:hover .dropbtn {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.2);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--glass-bg);
    min-width: 80px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.5);
    z-index: 1000;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    overflow: hidden;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
}

.dropdown:hover .dropdown-content, .dropdown-content.show {
    display: block;
}

.dropdown-content a {
    color: var(--text-secondary) !important;
    padding: 10px 16px;
    text-decoration: none;
    display: block;
    font-size: 0.85rem !important;
    margin-bottom: 0 !important;
    font-weight: 600;
}

.nav-links .dropdown-content a::after {
    display: none;
}

.dropdown-content a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-primary) !important;
}

.dropdown-content a.active-lang {
    background-color: var(--accent-1);
    color: white !important;
}