/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --background: #384063;
    --card-bg: #FFFFFF0A;
    --accent: #5ac974;
    --text-primary: #ffffff;
    --text-secondary: #cfd3ff;
    --nav-height: 70px;
}

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

/* =========================================
   2. BASE STYLES
   ========================================= */
body {
    background: radial-gradient(circle at top, #1a1f3a, var(--background));
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.projects-page,
.contact-section,
.hero,
.container {
    flex: 1 0 auto;
}

h1,
h2,
h3 {
    letter-spacing: 0.5px;
}

.accent {
    color: var(--accent);
}

footer {
    flex-shrink: 0;
    background: #151a2e;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
    /* This is the magic line that pushes it to the bottom */
}

/* =========================================
   3. NAVIGATION BAR
   ========================================= */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(15, 18, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--nav-height);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: border-box;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* 1. Push the Logo to the left */
.nav-left {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

/* 2. Center the Banner */
.nav-center-banner {
    flex: 2;
    /* Takes up more space to stay centered */
    display: flex;
    justify-content: center;
}

/* 3. Push the Links to the right */
.nav-right-links {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.status-badge {
    background: rgba(83, 186, 107, 0.1);
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Hide banner on mobile to keep nav clean */
@media (max-width: 900px) {
    .nav-center-banner {
        display: none;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-img {
    height: 32px; /* This keeps it proportional to your nav-height */
    width: auto;
    display: block;
    object-fit: contain;
}

/* =========================================
   4. GALLERY & CONTENT LAYOUT
   ========================================= */
.gallery-container,
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.gallery-title {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    text-align: center;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* =========================================
   5. PROJECT CARDS
   ========================================= */
.project-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: block;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent);
}

.card-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    background-color: #1a1f3a;
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* =========================================
   6. UTILITIES & BUTTONS
   ========================================= */
.btn-primary,
.btn-secondary,
.btn-tertiary,
.btn-back {
    display: inline-block;
    text-decoration: none;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    transition: 0.3s;
    font-weight: 600;
    cursor: pointer;
    border: none;
    /* Reset borders so we can define them per-button */
    text-align: center;
}

/* PRIMARY: Your main accent color */
.btn-primary {
    background: var(--accent);
    color: #1a1f3a;
}

.btn-primary:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* SECONDARY: Outlined style */
.btn-secondary {
    border: 1px solid var(--text-secondary);
    color: var(--text-primary);
    background: transparent;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

/* TERTIARY: Your custom color "Wildcard" */
.btn-tertiary {
    background: #eae6e6;
    /* Change this to any background color you want */
    color: #1a1f3a;
    /* Change this to your desired text color */
}

.btn-tertiary:hover {
    background: #ffffff;
    /* Slight grey tint so user knows they are hovering */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Adds a bit of depth */
}

.back-button-container {
    margin-top: 4rem;
    margin-bottom: 4rem;
    display: flex;
    justify-content: center;
    /* This centers the button horizontally */
    width: 100%;
}

.btn-back {
    margin-top: 2rem;
    color: var(--accent);
    border: 1px solid var(--accent);
}

.btn-back:hover {
    background: var(--accent);
    color: var(--background);
}

/* =========================================
   7. HOMEPAGE HERO & ABOUT
   ========================================= */
.hero {
    height: calc(110vh - var(--nav-height));
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 5vh;
    align-items: center;
    text-align: center;
    padding-left: 2rem;
    padding-right: 2rem;
    color: white;

    /* Background with dark overlay */
    background: linear-gradient(rgba(15, 18, 32, 0.5), rgba(15, 18, 32, 0.5)),
        url('/images/calgary.jpeg');

    /* 1. CHANGE THIS: Using a percentage like 120% instead of 'cover' 
       gives the image room to "pan" or "nudge". */
    background-size: 110%;

    /* 2. NUDGE CONTROLS: 
       Horizontal: 80% (Pans left) 
       Vertical: 10% (Pans up) */
    background-position: 20% 100%;

    background-repeat: no-repeat;

    /* 3. IMPORTANT: If you have 'background-attachment: fixed' here, 
       DELETE IT or COMMENT IT OUT. It often prevents panning 
       from working correctly on many browsers. */
    background-attachment: scroll;
}

.hero-content {
    max-width: 800px;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 8vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.hero-cta {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.home-about {
    padding: 3rem 2rem 0rem; /* Changed bottom padding to 0 */
    text-align: center;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.05); 
}

/* Add a specific rule to remove the gap between About and Footer */
.home-about + footer {
    margin-top: 0; /* This removes the 4rem gap we set earlier */
}

/* Ensure the container inside about doesn't force a gap */
.home-about .container {
    padding-bottom: 3rem; /* Keep some space inside for the text, but no margin outside */
}

.home-about h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-about p {
    max-width: 650px;
    margin: 0 auto;
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* =========================================
   8. CONTACT PAGE SPECIFICS
   ========================================= */
.contact-section {
    padding: 4rem 2rem;
    text-align: center;
    min-height: calc(100vh - var(--nav-height));
    display: flex;
    align-items: center;
}

.contact-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: -2rem auto 4rem;
    font-size: 1.1rem;
}

.contact-grid {
    display: grid;
    /* This ensures cards are at least 280px wide but grow to fill space */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    /* Increased to allow 2x2 layout on tablets */
    margin: 0 auto;
    width: 100%;
    /* Ensures it doesn't overflow parent */
}

.contact-card {
    height: 100%;
    /* Keeps cards equal height in a row */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.contact-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3rem auto;
    /* Cleaned up margins */
    font-size: 1.1rem;
    padding: 0 1rem;
    /* Prevents text from hitting edges on mobile */
}

/* Mobile Tweak: Ensure the container doesn't force a width */
@media (max-width: 480px) {
    .container {
        padding: 2rem 1rem;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        /* Forces exactly 1 column on small phones */
    }
}

.contact-card .btn-primary,
.contact-card .btn-secondary {
    margin-top: 1.5rem;
    width: 100%;
    text-align: center;
}

/* =========================================
   9. EXPANDABLE PROJECT CARDS
   ========================================= */
/* Carousel Layout */
.projects-carousel {
    padding: 2rem;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.carousel-track {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.mini-card {
    min-width: 200px;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.3s;
    text-align: center;
}

.mini-card.active {
    opacity: 1;
    transform: scale(1.05);
}

.mini-img {
    height: 120px;
    border-radius: 12px;
    background-size: cover;
    margin-bottom: 0.5rem;
    border: 2px solid transparent;
}

.mini-card.active .mini-img {
    border-color: var(--accent);
}

/* Detail View - Wide & Spread Out */
.detail-view {
    max-width: 1400px;
    /* Wider than the rest of the site */
    margin: 4rem auto;
    padding: 0 4rem;
    animation: fadeIn 0.6s ease;
}

.detail-header {
    margin-bottom: 4rem;
    text-align: center;
}

.star-spread {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.star-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.star-row.wide {
    grid-template-columns: 1fr;
    background: rgba(255, 255, 255, 0.03);
    padding: 3rem;
    border-radius: 20px;
}

.star-box h3 {
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 2px;
    margin-bottom: 1rem;
}

.star-box p {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expandable-card {
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.expandable-card:hover {
    border-color: var(--accent);
}

.expand-label {
    font-size: 0.8rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 700;
}

/* Hidden Details Area */
.card-details {
    max-height: 0;
    opacity: 0;
    transition: all 0.5s ease;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 1.5rem;
}

/* When Card is Open */
.expandable-card.is-open {
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.expandable-card.is-open .card-details {
    max-height: 1000px;
    /* Large enough to fit content */
    opacity: 1;
    padding: 2rem 1.5rem;
}

/* STAR Grid Layout */
.star-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.star-item h4 {
    color: var(--accent);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.star-item p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* Responsive STAR grid for phones */
@media (max-width: 600px) {
    .star-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   10. MOBILE & OVERFLOW FIXES
   ========================================= */

/* Global Fix to prevent horizontal scrolling */
html,
body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Ensure containers never exceed the screen width */
.container,
.gallery-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    /* Sufficient breathing room for mobile */
}

/* Fix for the Contact Grid appearing off-screen */
.contact-grid {
    display: grid;
    /* auto-fit will wrap cards naturally as the screen shrinks */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
}

/* 1. HIDE THE BUTTON ON PC (This removes the white dot) */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2000;
}

.mobile-menu-btn .bar {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 10px;
}

@media (max-width: 768px) {
    .hero {
        /* 1. We might need a higher zoom for mobile to move things around */
        background-size: 200%;

        /* 2. ADJUST THESE NUMBERS: 
           First number (Horizontal): Try 50%, 60%, or 70% to center your face.
           Second number (Vertical): Try 5%, 10%, or 15% to pull the image UP. 
        */
        background-position: 35% 0%;

        /* 3. Reduce height slightly for mobile if it feels too long */
        height: 59vh;

        /* 4. Increase top padding so text doesn't cover your face */
        padding-top: 1vh;
    }

    /* Navbar Button Visibility */
    .mobile-menu-btn {
        display: flex;
    }

    .mobile-menu-btn.active .bar:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .mobile-menu-btn.active .bar:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active .bar:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }

    /* Side-drawer Menu */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(15, 18, 32, 0.98);
        backdrop-filter: blur(15px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2.5rem;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active {
        right: 0;
    }

    /* Stack cards vertically on small phones */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Reduce Hero font size for smaller screens */
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* =========================================
   11. FOOTER
   ========================================= */
footer {
    background: #151a2e;
    /* Slightly darker than main background */
    padding: 4rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-socials {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.footer-socials a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: 0.3s;
}

.footer-socials a:hover {
    color: var(--accent);
}

.footer-copyright {
    color: rgba(207, 211, 255, 0.5);
    /* Faded text-secondary */
    font-size: 0.8rem;
    letter-spacing: 1px;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .footer-socials {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
}