/* ===========================
   Global Styles & Glassmorphism
   =========================== */

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

body {
    overflow-x: hidden;
}

/* Glassmorphism Effect */
.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

@media (prefers-color-scheme: dark) {
    .glass-card {
        background: rgba(44, 44, 46, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    }
}

/* ===========================
   Hero Section Enhancements
   =========================== */

#hero h1 {
    letter-spacing: -0.02em;
    line-height: 1.1;
}

#hero p {
    letter-spacing: -0.01em;
}

/* ===========================
   App Portfolio - Bento Grid
   =========================== */

/* Removed fixed height constraint and overflow hidden to prevent button cutoff */
.bento-grid {
    grid-auto-rows: auto;
}

.app-card {
    position: relative;
    /* overflow: hidden;  <-- REMOVED: This was likely clipping the button content */
    display: flex;
    flex-direction: column;
}

/* Add a pseudo-element safely behind contents if needed for hover effects, 
   but ensure it doesn't overlap interactive elements */
.app-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    /* Crucial: ensures this overlay doesn't block clicks */
    border-radius: inherit;
    z-index: 0;
}

.app-card:hover::before {
    opacity: 1;
}

.app-icon {
    transition: transform 0.3s ease;
}

.app-card:hover .app-icon {
    transform: scale(1.1) rotate(5deg);
}

/* ===========================
   Tech Stack Section
   =========================== */

.tech-tag {
    cursor: default;
    user-select: none;
}

/* Custom scrollbar for tech tags on mobile */
@media (max-width: 768px) {
    .tech-container {
        scrollbar-width: thin;
        scrollbar-color: rgba(107, 114, 128, 0.3) transparent;
    }

    .tech-container::-webkit-scrollbar {
        height: 6px;
    }

    .tech-container::-webkit-scrollbar-track {
        background: transparent;
    }

    .tech-container::-webkit-scrollbar-thumb {
        background-color: rgba(107, 114, 128, 0.3);
        border-radius: 3px;
    }
}

/* ===========================
   Contact Form Enhancements
   =========================== */

input:focus,
textarea:focus {
    transform: translateY(-2px);
}

button[type="submit"]:active {
    transform: scale(0.98);
}

/* ===========================
   Smooth Animations
   =========================== */

@keyframes gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ===========================
   Responsive Typography
   =========================== */

@media (max-width: 640px) {
    h1 {
        font-size: 3rem !important;
    }

    h2 {
        font-size: 2.5rem !important;
    }

    .text-2xl {
        font-size: 1.5rem !important;
    }
}

/* ===========================
   Accessibility
   =========================== */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 2px solid #0071e3;
    outline-offset: 2px;
}

/* ===========================
   Dark Mode Transitions
   =========================== */

* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Exclude specific elements from transition */
.animate-fade-in,
.animate-slide-up,
.animate-float {
    transition: none;
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    .glass-card {
        background: white;
        border: 1px solid #ddd;
    }

    button,
    form {
        display: none;
    }
}

/* ===========================
   Custom Utilities
   =========================== */

.section-padding {
    padding: 6rem 1.5rem;
}

@media (min-width: 768px) {
    .section-padding {
        padding: 8rem 1.5rem;
    }
}

/* Prevent layout shift */
img,
video {
    max-width: 100%;
    height: auto;
}

/* Better font rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}