html {
    font-family: 'Inter', sans-serif;
    background-color: #0a0a0a;
}

body {
    background-color: #0a0a0a;
    color: #e5e5e5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* clamp any overflow */
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 60;
    display: none;
}

.mobile-menu-overlay.is-open {
    display: block;
}

.mobile-menu-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 80%;
    max-width: 360px;
    background: #0f172a;
    border-left: 1px solid #1f2937;
    padding: 1.25rem;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.mobile-menu-overlay.is-open .mobile-menu-panel {
    transform: translateX(0);
}

.mobile-menu-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    color: #e5e7eb;
}
.project-overlay .secondary-contact-btn {
    margin-top: 0.5rem;
}

.mobile-menu-nav {
    margin-top: 3.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-link {
    display: block;
    color: #e5e7eb;
    font-weight: 600;
    font-size: 1.125rem;
    padding: 0.75rem 0.5rem;
    border-radius: 0.5rem;
}

.mobile-menu-link:hover {
    background: rgba(124, 58, 237, 0.12);
}

.mobile-menu-cta {
    margin-top: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.25);
}

.mobile-menu-cta:hover {
    filter: brightness(1.05);
}

/* Navigation */
.nav-link {
    color: #e5e7eb;
    font-weight: 500;
    padding: 8px 0;
    transition: color 0.2s ease;
    text-decoration: none;
}

.nav-link:hover {
    color: #ffffff;
}

/* Header with Smart Scroll */
#header {
    transform: translateY(0);
    transition: transform 0.3s ease, backdrop-filter 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(10, 10, 10, 0.85);
}

#header.header-hidden {
    transform: translateY(-100%);
}

#header.header-scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hire-me-btn {
    background-color: #7c3aed;
    color: white;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 600;
    transition: transform 0.2s;
}
.hire-me-btn:hover {
    transform: scale(1.05);
}

/* KS Logo - now SVG image */
#ks-logo {
    display: inline-block;
    height: 4.06rem; /* increased by 45% */
    width: auto;
    transition: transform 0.2s ease;
}

#ks-logo:hover {
    transform: translateY(-1px);
}

#ks-logo img {
    height: 100%;
    width: auto;
}

/* Improve tap targets on mobile */
@media (max-width: 640px) {
    #mobile-menu-button {
        padding: 10px; /* increase hit area */
        margin-right: -10px; /* keep alignment */
    }
    #ks-logo {
        min-height: 44px; /* minimum touch target */
    }
}

/* Hero */
#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    background-color: #0a0a0a;
    z-index: 1;
}

#hero {
    position: relative;
    z-index: 2;
    overflow: hidden; /* prevent particle canvas or animations from bleeding */
    /* Tiny overscan to guard against subpixel seams on some GPUs */
    margin-right: -1px;
    padding-right: 1px;
}

/* Mobile hero typography/spacing */
@media (max-width: 640px) {
    #hero { padding: 72px 0 32px; min-height: 80vh; }
    .hero-title { font-size: 1.75rem !important; line-height: 1.2; }
    .hero-subtitle { font-size: 0.98rem !important; line-height: 1.55; max-width: 22rem; margin-left: auto; margin-right: auto; }
    .cta-btn { padding: 14px 24px; font-size: 0.95rem; }
}

.hero-title span, .hero-subtitle span {
    opacity: 0;
    transform: translateY(100%);
    display: inline-block;
}

.cta-btn {
    display: inline-block;
    background-color: #7c3aed;
    color: white;
    padding: 16px 32px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: transform 0.3s;
}
.cta-btn:hover {
    transform: scale(1.05);
}

/* Work Section - Horizontal Scroll */
#work {
    padding-bottom: 10rem;
}

#work-container {
    width: 100%;
    height: 70vh;
    overflow: hidden;
}

.work-track {
    height: 100%;
    padding-left: 10vw;
    padding-right: 10vw;
    display: flex;
    align-items: center;
    gap: 4rem;
    width: max-content;
}

.project-card {
    width: 50vw; /* Default for larger screens */
    max-width: 800px; /* Max width for desktop */
    height: 60vh;
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    background-color: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(124, 58, 237, 0.25) inset;
}

.project-iframe-preview {
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none; /* Make it non-interactive */
    object-fit: cover;
}

/* Portrait project adjustments */
.project-card.portrait {
    width: 32vw; /* narrower on desktop for portrait */
    max-width: 520px;
}

.project-card.portrait .project-iframe-preview {
    object-fit: contain; /* fit portrait image without cropping */
    background: #0f0f0f; /* subtle backdrop around image */
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
    pointer-events: all;
}

.project-overlay h3 {
    position: static;
    margin-bottom: 1rem;
}

.project-description {
    color: #a3a3a3;
    margin-bottom: 1.5rem;
    max-width: 80%;
}

.view-site-btn {
    position: static;
    background-color: #7c3aed;
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: 600;
    z-index: 2;
    cursor: pointer;
}

/* Skills badges */
.skill-badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.85rem;
    color: #cbd5e1; /* slate-300 */
    background: rgba(148, 163, 184, 0.12); /* slate-400/12 */
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    color: #e2e8f0; /* slate-200 */
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(148, 163, 184, 0.18);
}

/* General Section Styling */
/* Section titles visible by default; GSAP will animate them in */
.section-title {
    color: #ffffff;
    font-size: 3rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

/* Super link: small RGB gradient glow */
.super-link {
    font-size: 0.75rem; /* small */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: transparent;
    background: linear-gradient(90deg, #ff0000, #ff4500, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    background-size: 400% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3), 0 0 12px rgba(255, 0, 0, 0.8), 0 0 18px rgba(0, 255, 255, 0.7);
    animation: super-rainbow 2s linear infinite, super-glow 1.2s ease-in-out infinite alternate;
}

@keyframes super-rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 100% 50%; }
}

/* Keep gradient text on hover */
.super-link:hover {
    color: transparent;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 0 16px rgba(255, 0, 0, 1), 0 0 24px rgba(0, 255, 255, 0.9);
}

@keyframes super-glow {
    0% { text-shadow: 0 0 8px rgba(255, 255, 255, 0.25), 0 0 12px rgba(255, 0, 0, 0.7), 0 0 18px rgba(0, 255, 255, 0.6); }
    100% { text-shadow: 0 0 12px rgba(255, 255, 255, 0.4), 0 0 16px rgba(255, 0, 0, 1), 0 0 24px rgba(0, 255, 255, 0.9); }
}

/* Contact & Footer */
/* Primary WhatsApp Button */
.primary-whatsapp-btn {
    display: grid;
    grid-template-columns: 50px 1fr auto; /* icon | text | arrow */
    align-items: center;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 30px;
    background: linear-gradient(135deg, #25d366 0%, #20bf58 100%);
    color: white;
    text-decoration: none;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(37, 211, 102, 0.3);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden; /* keep visuals contained */
    box-sizing: border-box;
    column-gap: 16px;
    z-index: 1; /* ensure button sits above nearby dividers */
    line-height: 1.1;
    isolation: isolate; /* create a new stacking context */
    min-height: 72px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Disabled sheen overlay for stability */
.primary-whatsapp-btn::before { display: none; }

.primary-whatsapp-btn:hover::before {
    left: 100%;
}

.primary-whatsapp-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.4);
    background: linear-gradient(135deg, #20c05a 0%, #0f7a6c 100%);
}

.whatsapp-icon-wrapper {
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin-right: 0;
}

.button-content { text-align: left; min-width: 0; }

.button-main-text {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: normal; /* allow wrapping on small screens */
    overflow-wrap: anywhere;
}

.button-sub-text {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.button-arrow {
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
    margin-left: 0;
}

.primary-whatsapp-btn:hover .button-arrow {
    transform: translateX(5px);
}

/* Ensure content layers above the sheen overlay */
.primary-whatsapp-btn > * {
    position: relative;
    z-index: 1;
}

/* Alternative Contact */
.alternative-contact {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #4b5563;
}

.secondary-contact-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.05);
    color: #a3a3a3;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 1px solid #4b5563;
}

.secondary-contact-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: #4b5563;
}

/* Enhanced Floating WhatsApp Button */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.whatsapp-float-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #25d366 0%, #20bf58 100%);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.4);
    transition: all 0.3s ease;
    position: relative;
    animation: whatsapp-pulse 2s infinite;
}

.whatsapp-float-btn::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
    animation: whatsapp-ripple 2s infinite;
}

.whatsapp-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 35px rgba(37, 211, 102, 0.6);
}

.float-tooltip {
    position: absolute;
    right: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.float-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #2d3748;
}

.whatsapp-float-btn:hover .float-tooltip {
    opacity: 1;
    visibility: visible;
}

@keyframes whatsapp-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes whatsapp-ripple {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.contact-email {
    transition: color 0.3s;
}
.contact-email:hover { color: #ffffff; }

footer a {
    transition: color 0.3s;
}
footer a:hover { color: #7c3aed; }

.social-link { 
    color: #a3a3a3; 
    transition: color 0.2s ease;
}
.social-link:hover { 
    color: #ffffff; 
}

/* Enhanced Skills Section Styles */
.skill-tag {
    border: 1px solid #4b5563;
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    color: #cbd5e1;
    background: rgba(148, 163, 184, 0.12);
    font-size: 0.85rem;
}

/* Contact form */
.contact-form {
    background: rgba(255,255,255,0.03);
    border: 1px solid #4b5563;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-field { margin-bottom: 1rem; }
.form-label { display: block; font-weight: 600; color: #e5e7eb; margin-bottom: 0.5rem; }

.form-input, .form-textarea, .contact-form select {
    width: 100%;
    background: #374151;
    border: 1px solid #4b5563;
    color: #ffffff;
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: 80px; /* ensure fields clear fixed header on focus */
}



.form-input:focus, .form-textarea:focus, .contact-form select:focus { border-color: #7c3aed; box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.25); }

.form-error { color: #f87171; font-size: 0.85rem; margin-top: 0.35rem; min-height: 1em; }

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-start;
    margin-top: 0.75rem;
}

.btn-whatsapp, .btn-email {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.12);
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-whatsapp { background: linear-gradient(135deg, #25d366 0%, #20bf58 100%); color: #fff; }
.btn-email { 
    background: rgba(255,255,255,0.06); 
    color: #ffffff; 
    border: 1px solid #4b5563;
}



.btn-whatsapp:hover, .btn-email:hover { transform: translateY(-2px); filter: brightness(1.05); }

.hp-field { display: none !important; }

@media (max-width: 768px) {
    .contact-form { padding: 1rem; }
    .form-grid { grid-template-columns: 1fr; }
}

/* Preloader */
.preloader {
    position: fixed;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.preloader.hidden { opacity: 0; visibility: hidden; }

.preloader-inner { text-align: center; }
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 12px auto;
}
.preloader-text { color: #a3a3a3; font-size: 0.95rem; }

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

/* Responsive adjustments */
@media (max-width: 768px) {
    .work-track {
        gap: 2rem;
        padding-left: 5vw;
        padding-right: 5vw;
    }

    .project-card {
        width: 85vw; /* Wider on smaller screens */
        height: 50vh; /* Adjust height for mobile */
    }

    /* portrait cards use same width on mobile */
    .project-card.portrait { width: 85vw; }

    .project-overlay {
        padding: 1rem;
    }

    .project-overlay h3 {
        font-size: 1.2rem;
    }

    .project-description {
        font-size: 0.9rem;
        max-width: 90%;
    }

    .view-site-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    /* Mobile WhatsApp Button Adjustments */
    .primary-whatsapp-btn {
        padding: 16px 20px;
        /* Avoid overflow: width accounts for margins */
        width: calc(100% - 2rem);
        margin: 0 auto;
        box-sizing: border-box;
        grid-template-columns: 44px 1fr auto; /* smaller icon size on mobile */
        column-gap: 12px;
    }

    .whatsapp-icon-wrapper {
        width: 40px;
        height: 40px;
        margin-right: 0; /* grid gap handles spacing */
    }

    .whatsapp-icon-wrapper svg {
        width: 24px;
        height: 24px;
    }

    .button-main-text {
        font-size: 1.1rem;
    }

    .button-sub-text {
        font-size: 0.8rem;
    }

    .float-tooltip {
        display: none; /* Hide tooltip on mobile */
    }

    .whatsapp-float-btn {
        width: 60px;
        height: 60px;
    }

    .whatsapp-float-btn svg {
        width: 24px;
        height: 24px;
    }
}
