/* ---------- Colors & base ---------- */
:root {
    --navy-900: #071021;
    --navy-800: #0f1722;
    --accent-blue: #4ea8ff;
    --accent-blue-2: #66b7ff;
    --outline-blue: rgba(76, 144, 255, 0.95);
    --muted: #9aa6b2;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    overflow-x: hidden;
}

body.dark {
    background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-800) 100%);
    color: #e6eef8;
}

body.light {
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    color: #0f172a;
}

/* Container fix to prevent horizontal scroll */
.container-fix {
    max-width: 100%;
    overflow-x: hidden;
}

/* Consistent background for all sections */
section {
    background: transparent;
}

/* Natural paint spread effect for hero text in light mode */
body.light .hero-text-container {
    position: relative;
    padding: 2.5rem;
    margin-bottom: 2rem;
}

body.light .hero-text-container::before {
    content: '';
    position: absolute;
    top: -40px;
    left: -40px;
    right: -40px;
    bottom: -40px;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(135, 206, 250, 0.4) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 70%, rgba(147, 112, 219, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(100, 149, 237, 0.3) 0%, transparent 50%);
    z-index: -1;
    border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
    filter: blur(20px);
    opacity: 0.7;
    animation: paintSpread 8s ease-in-out infinite alternate;
}

@keyframes paintSpread {
    0% {
        border-radius: 40% 60% 60% 40% / 50% 40% 60% 50%;
        transform: scale(1) rotate(0deg);
    }
    100% {
        border-radius: 60% 40% 40% 60% / 40% 50% 50% 60%;
        transform: scale(1.05) rotate(2deg);
    }
}

/* glass header */
.glass {
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark .glass {
    background-color: rgba(8, 12, 20, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Improved mobile header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* Navbar text color fix for light mode */
body.light .site-header a {
    color: #0f172a;
    font-weight: 500;
}

body.light .site-header i {
    color: #3b82f6;
}

/* nav pill - Made border invisible and improved spacing */
.nav-pill {
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid transparent;
    margin-left: 8px;
    display: inline-block;
    font-weight: 500;
    transition: all 0.3s ease;
    color: inherit;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

body.dark .nav-pill {
    color: #e2e8f0;
}

.nav-pill:hover {
    background: rgba(94, 148, 255, 0.1);
    transform: translateY(-1px);
}

/* outline container used everywhere - Made transparent */
.outline-box {
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 24px;
    transition: all 0.3s ease;
    background-clip: padding-box;
    background: transparent;
}

body.dark .outline-box {
    box-shadow: none;
}

body.light .outline-box {
    box-shadow: none;
    border-color: transparent;
}

/* inner smaller boxed sections - Made border barely visible */
.outline-inner {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    padding: 16px;
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
}

body.light .outline-inner {
    border: 1px solid rgba(10, 26, 58, 0.03);
    background: linear-gradient(135deg, rgba(10, 26, 58, 0.02), rgba(10, 26, 58, 0.01));
}

/* hero card styles - Made border invisible */
.hero-card {
    max-width: 820px;
    margin: 0 auto;
    border-radius: 16px;
    border: 2px solid transparent;
    padding: 32px;
    background: transparent;
}

body.light .hero-card {
    border-color: transparent;
}

/* Updated hero title font sizes */
.hero-title {
    font-weight: 600;
    line-height: 1.1;
    font-size: clamp(2.5rem, 5vw, 4rem);
    letter-spacing: -0.02em;
}

/* Updated hero paragraph font size */
.hero-card p {
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .hero-card p {
        font-size: 1.25rem;
    }
}

.hero-highlight {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* buttons */
.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-blue-2));
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

.btn-outline {
    padding: 11px 23px;
    border-radius: 10px;
    border: 2px solid rgba(94, 148, 255, 0.3);
    background: transparent;
    color: inherit;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    min-height: 44px;
    min-width: 44px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(46, 118, 255, 0.25);
}

.btn-outline:hover {
    background: rgba(94, 148, 255, 0.1);
    border-color: rgba(94, 148, 255, 0.5);
    transform: translateY(-2px);
}

/* Project cards - Updated to show top of images */
.proj-card {
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(94, 148, 255, 0.08);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.light .proj-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(10, 26, 58, 0.08);
}

.proj-card:hover {
    transform: translateY(-5px);
    border-color: rgba(94, 148, 255, 0.2);
}

.proj-media {
    height: 200px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    overflow: hidden;
    position: relative;
    background: transparent !important;
}

.proj-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    border-radius: 8px;
    padding: 0;
    transition: all 0.3s ease;
}

.proj-card:hover .proj-media img {
    transform: scale(1.05);
}

/* Project content area */
.proj-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.proj-content h4 {
    font-weight: 600;
    color: #4ea8ff;
    font-size: 1.25rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

.proj-content p {
    color: #cbd5e1;
    margin-bottom: 1rem;
    flex-grow: 1;
    font-size: 0.95rem;
    line-height: 1.5;
}

body.light .proj-content p {
    color: #475569;
}

/* Tech Stack Styles */
.tech-stack {
    margin: 1rem 0;
}

.tech-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid rgba(94, 148, 255, 0.3);
    background: rgba(94, 148, 255, 0.1);
    color: #4ea8ff;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 2px;
    transition: all 0.3s ease;
}

body.light .tech-pill {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
    color: #3b82f6;
}

.tech-pill:hover {
    background: rgba(94, 148, 255, 0.2);
    transform: translateY(-1px);
}

.proj-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.proj-actions .btn-primary,
.proj-actions .btn-outline {
    flex: 1;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

/* Update projects heading padding */
#projects h2.gradient-heading {
    padding-bottom: 8px;
}

/* marquee / skill slider - Made transparent */
.skill-marquee {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
}

.skill-track {
    display: inline-flex;
    gap: 24px;
    align-items: center;
}

.skill-track.left {
    animation: scrollLeft 40s linear infinite;
}

.skill-track.right {
    animation: scrollRight 40s linear infinite;
}

@keyframes scrollLeft {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollRight {
    0% {
        transform: translateX(-50%);
    }
    100% {
        transform: translateX(0);
    }
}

/* Updated skill items to match reference */
.skill-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 0;
    padding: 0;
    min-width: 100px;
    height: auto;
    background: transparent;
    transition: all 0.3s ease;
    margin: 0;
}

.skill-item-inner {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 8px;
    transition: all 0.3s ease;
    margin: 0;
    border: 0;
}

body.dark .skill-item-inner {
    background: rgba(150, 142, 142, 0.1);
}

/* Make skill-item-inner invisible in light mode */
body.light .skill-item-inner {
    background: transparent;
}

.skill-item:hover .skill-item-inner {
    transform: scale(1.1);
}

.skill-item i {
    font-size: 48px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 0;
    padding: 0;
}

.skill-item span {
    margin-top: 8px;
    font-size: 0.875rem;
    color: #9ca3af;
}

body.dark .skill-item span {
    color: #9ca3af;
}

body.light .skill-item span {
    color: #6b7280;
}

/* Light mode adjustments for skills */
body.light .skill-item:hover {
    background: rgba(10, 26, 58, 0.05);
}

body.light .skill-marquee {
    border-color: transparent;
    background: transparent;
}

/* Light mode text visibility improvements */
body.light .text-slate-300 {
    color: #64748b;
}

body.light .text-blue-300 {
    color: #3b82f6;
}

body.light .text-slate-200 {
    color: #475569;
}

/* pills */
.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid rgba(94, 148, 255, 0.15);
    margin: 4px;
    font-size: 0.8rem;
    background: rgba(94, 148, 255, 0.08);
    color: inherit;
}

/* typing caret */
.typing::after {
    content: "|";
    display: inline-block;
    margin-left: 6px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* Mobile menu styles - Fixed positioning */
.mobile-menu {
    position: fixed;
    top: 70px;
    right: 15px;
    width: 85%;
    max-width: 280px;
    background: rgba(8, 12, 20, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 12px;
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-menu.open {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

.mobile-menu a {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid rgba(94, 148, 255, 0.1);
    text-decoration: none;
    color: #e6eef8;
    transition: all 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 44px;
    min-width: 44px;
}

.mobile-menu a:hover {
    background: rgba(94, 148, 255, 0.1);
    transform: translateX(5px);
}

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* Light mode mobile menu */
body.light .mobile-menu {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(10, 26, 58, 0.1);
}

body.light .mobile-menu a {
    color: #0f172a;
    border-color: rgba(10, 26, 58, 0.1);
}

body.light .mobile-menu a:hover {
    background: rgba(10, 26, 58, 0.05);
}

/* Devicon custom styles */
.devicon-express-original {
    color: #000000 !important;
}

body.dark .devicon-express-original {
    color: #ffffff !important;
}

/* Section padding for navbar offset */
section {
    scroll-margin-top: 80px;
}

/* Footer styling */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

body.light footer {
    border-top: 1px solid rgba(10, 26, 58, 0.08);
}

/* Gradient headings */
.gradient-heading {
    background: linear-gradient(135deg, #4ea8ff, #9d4edd, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
}

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

/* Contact icons - Updated to square shape */
.contact-icon {
    padding: 12px;
    border-radius: 8px;
    border: 2px solid rgba(94, 148, 255, 0.2);
    background: transparent;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    aspect-ratio: 1 / 1;
    min-height: 44px;
    min-width: 44px;
}

.contact-icon:hover {
    background: rgba(94, 148, 255, 0.1);
    border-color: rgba(94, 148, 255, 0.5);
    transform: translateY(-2px);
}

/* Ensure proper icon sizing in contact section */
.contact-icon i {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile-specific responsive fixes */
@media (max-width: 768px) {
    /* Base layout fixes */
    .max-w-screen-xl {
        max-width: 100%;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero section mobile fixes */
    #home {
        padding-top: 100px;
        padding-bottom: 60px;
        min-height: auto;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2;
    }
    
    .hero-card {
        padding: 20px 16px !important;
        margin: 0 auto;
    }
    
    .hero-text-container {
        padding: 1rem !important;
    }
    
    .hero-card p {
        font-size: 1.1rem !important;
        line-height: 1.6;
        margin-top: 1rem;
    }
    
    /* Button stack for mobile */
    .flex.items-center.justify-center.gap-6 {
        flex-direction: column;
        gap: 12px;
        margin-top: 2rem;
    }
    
    .btn-primary, .btn-outline {
        width: 100%;
        max-width: 280px;
        justify-content: center;
        padding: 14px 24px;
        font-size: 1.1rem;
    }
    
    /* About section mobile fixes */
    #about {
        padding: 60px 0;
    }
    
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-image-container {
        order: -1;
        margin-bottom: 2rem;
    }
    
    .about-image-container .rounded-full {
        width: 200px !important;
        height: 200px !important;
    }
    
    .about-image-container img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    /* Skills section mobile fixes */
    #skills {
        padding: 60px 0;
    }
    
    .skill-marquee {
        padding: 12px 8px;
    }
    
    .skill-item {
        min-width: 80px;
    }
    
    .skill-item-inner {
        width: 50px;
        height: 50px;
    }
    
    .skill-item i {
        font-size: 32px;
    }
    
    .skill-item span {
        font-size: 0.8rem;
    }
    
    /* Projects section mobile fixes */
    #projects {
        padding: 60px 0;
    }
    
    .grid.grid-cols-1.md\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .proj-card {
        padding: 16px;
        margin: 0 auto;
        max-width: 400px;
    }
    
    .proj-media {
        height: 160px;
    }
    
    .proj-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .proj-actions .btn-primary,
    .proj-actions .btn-outline {
        width: 100%;
        justify-content: center;
    }
    
    /* Contact section mobile fixes */
    #contact {
        padding: 60px 0;
    }
    
    .grid.grid-cols-1.md\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .contact-info, .connect-info {
        padding: 1.5rem !important;
    }
    
    /* Text sizing for mobile */
    .text-4xl, .text-5xl {
        font-size: 2.5rem !important;
    }
    
    .text-2xl {
        font-size: 1.75rem !important;
    }
    
    .text-lg {
        font-size: 1.1rem !important;
    }
    
    /* Section spacing */
    section {
        scroll-margin-top: 80px;
    }
    
    /* Header fixes */
    .site-header .flex.items-center.justify-between {
        padding: 12px 0;
    }
    
    .text-2xl.font-bold.text-white {
        font-size: 1.5rem;
    }
    
    /* Mobile menu adjustments */
    .mobile-menu {
        top: 65px;
    }

    .site-header .text-2xl {
        font-size: 1.25rem !important;
    }
    
    .site-header .flex.items-center.gap-3 {
        gap: 8px !important;
    }
    
    .site-header i.fa-code {
        font-size: 1rem !important;
    }

    #about .text-2xl.font-semibold.text-blue-400.mb-6 {
        text-align: center;
        width: 100%;
    }
    
    /* Also center the about content */
    #about .grid.grid-cols-1.md\:grid-cols-2 > div:first-child {
        text-align: center;
    }

    #about .text-justify {
        text-align: left !important;
        text-align: start !important;
        word-spacing: normal;
        letter-spacing: normal;
        line-height: 1.6;
    }
    
    #about p.text-slate-300 {
        text-align: left;
        hyphens: auto;
        -webkit-hyphens: auto;
        word-spacing: normal;
    }

    #contact .grid.grid-cols-1.md\:grid-cols-2 > div {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #contact .flex.items-start,
    #contact .flex.items-center {
        justify-content: center;
        text-align: center;
        width: 100%;
    }
    
    #contact .flex.items-start .mr-4,
    #contact .flex.items-center .mr-4 {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    #contact .flex.items-start,
    #contact .flex.items-center {
        flex-direction: column;
        align-items: center;
    }
    
    #contact .pt-6.flex.space-x-4 {
        justify-content: center;
        width: 100%;
    }
    
    #contact .contact-info,
    #contact .connect-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #contact .grid.grid-cols-1.md\:grid-cols-2 {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    #contact .p-8 {
        width: 100%;
        max-width: 500px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 2rem 1.5rem !important;
    }
    
    #contact .space-y-6 {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #contact .flex.items-start,
    #contact .flex.items-center {
        justify-content: center;
        text-align: center;
        width: 100%;
        flex-direction: column;
        align-items: center;
    }
    
    #contact .flex.items-start .mr-4,
    #contact .flex.items-center .mr-4 {
        margin-right: 0;
        margin-bottom: 12px;
    }
    
    #contact .pt-6.flex.space-x-4 {
        justify-content: center;
        width: 100%;
    }
    
    /* Ensure both contact boxes are centered */
    #contact .grid.grid-cols-1.md\:grid-cols-2 > div {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin: 0 auto;
    }
    
    /* Fix the gap between the two contact sections */
    #contact .gap-12 {
        gap: 2rem !important;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .text-4xl, .text-5xl {
        font-size: 2rem !important;
    }
    
    .px-6 {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .outline-box {
        padding: 1rem !important;
    }
    
    .btn-primary, .btn-outline {
        padding: 12px 20px;
        font-size: 1rem;
    }

    .contact-icon {
        width: 44px;
        height: 44px;
    }

    #contact .p-8 {
        padding: 1.5rem 1rem !important;
        max-width: 100%;
    }
    
    #contact .text-lg {
        font-size: 1rem;
    }
    
    #contact .text-2xl {
        font-size: 1.5rem;
    }

     /* Even smaller navbar text for very small screens */
    .site-header .text-2xl {
        font-size: 1.1rem !important;
    }
    
    /* Better paragraph spacing */
    #about p.text-slate-300 {
        font-size: 1rem;
        line-height: 1.7;
    }
}