/* Grayscale Theme & Layout */
html {
    height: 100%;
}

body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f4f4f4;
    /* Fallback color */
    background-image: url('../images/background.jpg');
    /* Background Image */
    background-size: auto 100vh;
    /* 100% height, auto width */
    background-position: center;
    /* Centered */
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: #333;
    /* Dark gray text */
}

/* Sticky Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #ffffff;
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid #ddd;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

header .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header img.logo {
    max-height: 60px;
    width: auto;
    display: block;
}

/* Navigation Links */
nav {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

nav a {
    color: #333;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 6px;
    transition: all 0.3s ease;
    border-bottom: none;
    position: relative;
    overflow: hidden;
}

/* Animated underline effect */
nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #555, #000);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

nav a:hover::before {
    width: 80%;
}

nav a:hover {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

nav a.active {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

nav a.active:hover {
    background: linear-gradient(135deg, #3a3a3a 0%, #2c2c2c 100%);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
        gap: 15px;
        padding: 15px 10px;
    }

    header img.logo {
        max-height: 50px;
    }

    nav {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }

    nav a {
        font-size: 14px;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    nav a {
        font-size: 13px;
        padding: 6px 12px;
    }
}

main {
    flex: 1;
    /* Grow to fill available space */
    background: rgba(255, 255, 255, 0.9);
    /* Semi-transparent white background for readability */
    padding: 40px;
    margin: 40px auto;
    max-width: 900px;
    width: calc(100% - 80px);
    /* Responsive width */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

h1,
h2,
h3 {
    color: #000;
}

a {
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #999;
}

a:hover {
    color: #000;
    border-color: #000;
}

/* Project Cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.project-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    border: 2px solid #444;
    border-radius: 16px;
    padding: 32px;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #eee;
}

.project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    border-color: #666;
}

.project-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 24px;
    color: #fff;
}

.project-card p {
    margin-bottom: 20px;
    color: #fff;
    line-height: 1.5;
}

.project-card .btn-fancy {
    display: inline-block;
    width: fit-content;
    margin-top: auto;
    background: linear-gradient(135deg, #555 0%, #333 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 15px;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, transform 0.2s ease;
}

.project-card .btn-fancy:hover {
    background: linear-gradient(135deg, #666 0%, #444 100%);
    transform: translateY(-2px);
}

.project-card .btn-fancy:active {
    transform: translateY(1px);
}

/* Fancy CTA Button */
.cta-wrapper {
    text-align: center;
    margin-top: 30px;
}

.btn-fancy {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #ffffff;
    background: linear-gradient(to bottom, #444 0%, #2c2c2c 50%, #1a1a1a 100%);
    border: 1px solid #555;
    border-top: 1px solid #666;
    border-bottom: 3px solid #111;
    border-radius: 50px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 6px 0 #111,
        0 8px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-fancy::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
    transition: left 0.5s ease;
}

.btn-fancy:hover::before {
    left: 100%;
}

.btn-fancy:hover {
    background: linear-gradient(to bottom, #555 0%, #3a3a3a 50%, #2c2c2c 100%);
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 #111,
        0 10px 20px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-bottom: 3px solid #111;
}

.btn-fancy:active {
    transform: translateY(4px);
    box-shadow:
        0 2px 0 #111,
        0 3px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-bottom: 3px solid #111;
}

.btn-arrow {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 18px;
}

.btn-fancy:hover .btn-arrow {
    transform: translateX(5px);
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, #2c2c2c 0%, #1a1a1a 100%);
    color: #ffffff;
    padding: 20px 0;
    text-align: center;
    border-top: 2px solid #444;
    margin-top: auto;
    /* Push to bottom */
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

footer p {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
}

@media (max-width: 768px) {
    main {
        width: calc(100% - 40px);
        padding: 30px 20px;
        margin: 20px auto;
    }

    footer {
        padding: 15px 0;
    }

    footer p {
        font-size: 12px;
    }
}