/* Base Styles (Mobile-First) */
* {
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: "Courier New", Courier, monospace;
    font-size: 18px; /* Base font size for smallest screens */
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    position: relative;
    background-color: white;
}

.container {
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 10vh; /* Reduced padding for mobile */
}

.content {
    text-align: center;
    margin-bottom: 20px;
    white-space: nowrap; /* Keep links on one line, can be adjusted for small screens if needed */
}

.content a {
    text-decoration: none;
    color: inherit;
    display: block;
    margin-top: 10px;
}

.content a:first-child {
    margin-top: 0;
}

.content a:hover {
    text-decoration: underline;
}

.contact-icons {
    margin-top: 20px;
    text-align: center;
}

.contact-icons a {
    display: inline-block;
    margin: 0 10px;
    vertical-align: middle;
}

.contact-icons img {
    width: 24px;
    height: 24px;
    filter: brightness(0);
}

.bottom-marquee-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px 0; /* Reduced padding for mobile */
    background-color: #f0f0f0;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, .1);
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    padding: 0;
}

.marquee-content {
    display: flex;
    align-items: center;
    width: max-content;
    animation: scrolling-marquee 40s linear infinite; /* Faster animation for less content on mobile */
    height: auto;
}

.project-card {
    flex-shrink: 0;
    width: 180px; /* Smaller card width for mobile */
    margin: 0 10px;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .08);
    text-align: left;
    transform: scale(1);
    transition: transform .3s ease-in-out, box-shadow .3s ease-in-out;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, .2);
}

.project-card a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.project-image {
    width: 100%;
    height: 90px; /* Smaller image height for mobile */
    overflow: hidden;
    border-bottom: 1px solid #eee;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform .3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

.project-info {
    padding: 15px;
}

.project-title {
    font-size: 14px; /* Smaller font size for mobile */
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Allow more lines on smaller cards */
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 4.2em; /* 3 lines * 1.4em line-height */
}

.project-metrics {
    font-size: 11px; /* Smaller font size for mobile */
    color: #777;
    display: flex;
    align-items: center;
}

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

/* Media Queries for larger screens (Tablet, Desktop) - Mobile First */

/* Small Tablets / Larger Phones (e.g., 481px and up) */
@media (min-width: 481px) {
    body {
        font-size: 20px;
    }
    .container {
        padding-top: 15vh;
    }
    .bottom-marquee-wrapper {
        padding: 15px 0;
    }
    .marquee-content {
        animation: scrolling-marquee 60s linear infinite; /* Adjusted speed */
    }
    .project-card {
        width: 220px;
        margin: 0 15px;
    }
    .project-image {
        height: 110px;
    }
    .project-title {
        font-size: 15px;
        -webkit-line-clamp: 2; /* Revert to 2 lines for wider cards */
        max-height: 2.8em;
    }
    .project-metrics {
        font-size: 12px;
    }
}

/* Medium Tablets (e.g., 769px and up) */
@media (min-width: 769px) {
    body {
        font-size: 22px; /* Slightly larger body font */
    }
    .container {
        padding-top: 20vh; /* Revert to original padding */
    }
    .bottom-marquee-wrapper {
        padding: 20px 0; /* Revert to original padding */
    }
    .marquee-content {
        animation: scrolling-marquee 80s linear infinite; /* Original speed for more content */
    }
    .project-card {
        width: 250px;
        margin: 0 20px;
    }
    .project-image {
        height: 130px;
    }
    .project-title {
        font-size: 16px;
    }
    .project-metrics {
        font-size: 13px;
    }
}

/* Large Tablets / Desktops (e.g., 1025px and up) */
@media (min-width: 1025px) {
    body {
        font-size: 24px; /* Original desktop font size */
    }
    .project-card {
        width: 280px;
        margin: 0 25px;
    }
    .project-image {
        height: 150px;
    }
    .project-title {
        font-size: 17px;
    }
    .project-metrics {
        font-size: 14px;
    }
}