/*
 * Global Reset and Fonts
 */
* {
    /* Essential for responsive design: ensures padding and border are included in the element's total width/height */
    box-sizing: border-box; 
    /* Apply base styles */
    background-color: black;
    color: white;
    font-family: "Roboto Mono", monospace;
    font-optical-sizing: auto;
    /* Reset default margins and padding */
    margin: 0; 
    padding: 0;
}
html {
  scroll-behavior: smooth;
}


/* 1. Initial State (Hidden, Lowered, Blurred) */
/* This now applies to all sections and project cards */
section, .project-card { 
    opacity: 0;
    filter: blur(5px);
    transform: translateY(50px); /* Default for most sections and cards */
    
    /* CRITICAL: This line tells the browser to animate property changes over 0.8 seconds */
    transition: opacity 0.8s ease-out, 
                transform 0.8s ease-out, 
                filter 0.8s ease-out;
    
    /* Added will-change to hint browser for smoother animation */
    will-change: opacity, transform, filter; 
}

/* OVERRIDE for the Hero section's initial state: only fade/blur, no slide-up */
.hero {
    transform: translateY(0); /* Hero starts at its final Y position */
}
.project-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}
.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures image fills container nicely */
    display: block;
    transition: transform 0.4s ease;
}


/* 2. Final State (Visible, Normal Position, Clear) */
/* This remains the same, triggered by adding the 'visible' class in JavaScript */
section.visible, .project-card.visible {
    /* When JavaScript adds the 'visible' class, the element moves to these styles */
    opacity: 1;
    filter: blur(0);
    transform: translateY(0); /* All visible elements end at Y position 0 */
}

/* Specific font for name */
.myname {
    font-family: "Uchen", serif;
    font-weight: 400;
    font-style: normal;
}

/*
 * Hero Section (rest of hero styles, unchanged)
 */
.hero {
    position: relative;
    /* Use min-height for flexibility on content size */
    min-height: 95vh; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Content near the bottom */
    align-items: center;
    text-align: center;
    overflow: hidden;
    padding: 20px 0; 
}

#canvas1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.content {
    position: relative;
    z-index: 2;
    /* Use viewport height for better scaling on different devices */
    padding-bottom: 5vh; 
    padding-left: 15px;
    padding-right: 15px;
    width: 100%; /* Ensure content respects padding and width */
}

h1 {
    /* Fluid typography for large name */
    font-size: clamp(2.5rem, 8vw, 4rem); 
    margin-bottom: 20px;
    font-family: "Uchen", serif;
    font-weight: 400;
    font-style: normal;
}

.tagline {
    /* Fluid typography for tagline */
    font-size: clamp(0.9rem, 3vw, 1.2rem); 
    margin-bottom: 30px;
}

.buttons {
    display: flex;
    /* Allow buttons to wrap */
    flex-wrap: wrap; 
    gap: 10px; 
    justify-content: center;
    margin-bottom: 25px;
}

button {
    background: rgba(255, 255, 255, 0);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.407);
    /* Fluid padding */
    padding: 10px clamp(15px, 4vw, 25px); 
    cursor: pointer;
    transition: 0.3s ease;
    font-size: 0.9rem; 
}

button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.socials a {
    color: #aaa;
    text-decoration: none;
    transition: 0.3s;
    /* Added padding for easier tapping */
    padding: 0 5px; 
}

.socials a:hover {
    color: #fff;
}

/*
 * About Section
 */
.About {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Increased vertical padding */
    padding: 50px 15px; 
    background: black;
    /* Ensure section takes up a good amount of vertical space */
    min-height: 100vh; 
}

.card-container {
    position: relative;
    width: 100%;
    max-width: 1000px; 
    display: flex;
    justify-content: center;
    padding: 20px;
}

/* Removed the unused .card-wrapper */

.card {
    position: relative;
    width: 100%;
    display: flex;
    /* Essential for mobile stacking */
    flex-wrap: wrap; 
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    overflow: visible;
    margin: auto;
    box-sizing: border-box;
}

/* --- Corner Plus Signs --- */
.card::before,
.card::after,
.corner-bottom-left,
.corner-bottom-right {
    position: absolute;
    content: '+'; 
    color: white;
    font-size: 22px;
    font-weight: 300;
    line-height: 1;
    z-index: 3;
    /* CSS variable for offset control in media queries */
    --corner-offset: 50%; 
}

/* Top-left */
.card::before { top: 0; left: 0; transform: translate(calc(-1 * var(--corner-offset)), calc(-1 * var(--corner-offset))); }

/* Top-right */
.card::after { top: 0; right: 0; transform: translate(var(--corner-offset), calc(-1 * var(--corner-offset))); }

/* Bottom-left */
.corner-bottom-left { bottom: 0; left: 0; transform: translate(calc(-1 * var(--corner-offset)), var(--corner-offset)); }

/* Bottom-right */
.corner-bottom-right { bottom: 0; right: 0; transform: translate(var(--corner-offset), var(--corner-offset)); }

/* Left and Right Sections */
.left-section {
    /* Adjusted flex-basis for better balance before wrapping */
    flex: 1 1 300px; 
    min-width: 0; 
}

.image-wrapper {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Minimum height for better appearance on desktop and mobile stack */
    min-height: 250px; 
}

.right-section {
    /* Adjusted flex-basis for better balance before wrapping */
    flex: 2 1 450px; 
    min-width: 0;
    padding: 40px; 
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
}

.right-section h2 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-bottom: 5px;
}

.right-section h3 {
    color: #ccc;
    font-size: 1rem;
    margin-bottom: 10px;
}

.right-section p {
    line-height: 1.6;
    font-size: 0.95rem;
}

.skills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; 
    margin-top: 10px;
}

.skill-tag {
    padding: 6px 12px; 
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.8rem; 
    white-space: nowrap; 
}

/*
 * --- Responsive Adjustments ---
 */

/* Medium Screens (e.g., Tablets in Portrait) */
@media (max-width: 850px) {
    .card-container {
        padding: 10px;
    }
}

/* Mobile Screens (Stacking Layout) */
@media (max-width: 768px) {
    .card {
        /* Force single column layout for mobile */
        flex-direction: column; 
        width: 100%;
        max-width: 100%;
    }
    
    .left-section {
        min-width: 100%; 
    }

    .image-wrapper img {
        height: auto;
        min-height: 200px; /* Adjust minimum height for image on mobile */
    }

    .right-section {
        min-width: 100%;
        padding: 30px 20px; /* Reduced padding for mobile screens */
        gap: 15px;
    }

    /* Smaller corners for mobile */
    .card::before,
    .card::after,
    .corner-bottom-left,
    .corner-bottom-right {
        font-size: 16px;
        --corner-offset: 35%; 
    }
}
/*
 * Projects Section Styling
 */
.Projects {
    width: 100%;
    /* Use padding to create separation from other sections */
    padding: 80px 15px; 
    text-align: center;
    background: black;
}

.Projects h2 {
    /* Use a similar font size scale to the About section headers */
    font-size: clamp(2rem, 5vw, 3rem); 
    margin-bottom: 50px;
    font-family: "Uchen", serif;
    font-weight: 400;
}

.card-grid {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    /* Default: 3 equal columns */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 30px;
}

.project-card {
    background: rgba(255, 255, 255, 0);
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* Subtle background blur */
    backdrop-filter: blur(5px); 
    padding: 25px;
    text-align: left;
    transition: transform 0.3s ease, border-color 0.3s ease;
    /* Optional: Small lift on hover for a cool effect */
    will-change: transform; 
}

.project-card:hover {
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-5px);
}

.project-image-placeholder {
    width: 100%;
    height: 180px;
    background: rgba(255, 255, 255, 0.05); /* Dark image placeholder */
    border: 1px dashed rgba(255, 255, 255, 0.3);
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    color: #888;
}

.project-card h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.project-card p {
    font-size: 0.9rem;
    color: #ccc;
    margin-bottom: 20px;
    line-height: 1.5;
}
.project-card .imp {
    color: #a0a0a0;
    font-size: 0.7rem;
    line-height: 1.5;
    margin-top: 20px;
}
.project-card .imp b {
    color: #c0c0c0;
    font-size: 0.7rem;
   
 
}
.project-card .imp .boldimp {
    color: #ff0040;
    font-size: 0.9rem;
    
}

h3{
    
    font-weight: 400;
}

h2{
    
    font-weight: 400;
}
.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    /* Use the same style as skill-tag for consistency */
    padding: 6px 12px; 
    background: rgba(73, 102, 237, 0.1); /* Slightly blue/techy background */
    border: 1px solid rgba(73, 102, 237, 0.3);
    font-size: 0.75rem; 
    color: #92b0ff; /* Light blue text */
}

.project-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.project-links a {
    text-decoration: none;
    color: white;
    padding: 8px 15px;
    border: 1px solid white;
    transition: background 0.3s ease;
    font-size: 0.9rem;
}

.project-links a:hover {
    background: rgba(255, 255, 255, 0.1);
}

/*
 * Projects Media Queries
 */
@media (max-width: 900px) {
    /* Change to 2 columns on medium screens */
    .card-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    }
}

@media (max-width: 768px) {
    .Projects {
        padding: 60px 10px;
    }
}

@media (max-width: 480px) {
    /* Change to 1 column on small screens */
    .card-grid {
        grid-template-columns: 1fr; 
    }
    .project-card {
        padding: 20px;
    }
}

/* Small Mobile Screens (Button Stacking) */
@media (max-width: 480px) {
    .buttons {
        /* FIX: Keep buttons side-by-side on mobile */
        flex-direction: row; 
        flex-wrap: nowrap; /* Prevent unwanted wrapping */
        gap: 8px;
    }

    button {
        /* FIX: Revert to auto width and tighten padding so they fit horizontally */
        width: auto; 
        padding: 10px 8px; 
    }

    .socials a {
        font-size: 0.85rem;
    }

    .right-section {
        padding: 20px 15px; /* Tighter padding for very small screens */
        gap: 10px;
    }
    
    .right-section p {
        font-size: 0.9rem;
    }
}
