/* Background & Base */
body {
    margin: 0;
    background: #0d0d0d url('Images/mainbackground.gif') repeat center center fixed;
    background-size: cover;
    color: #ddd;
    font-family: 'Source Code Pro', monospace;
    text-align: center;
    line-height: 1.6;
}

/* Main Layout Container */
.main-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Transparent Box Behind Content */
.content-backdrop {
    flex: 0 0 65%;
    background-color: rgba(20, 20, 20, 0.7);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
    backdrop-filter: blur(6px);
    color: #ddd;
    text-align: left;
    padding: 2rem 3rem;
}

/* Side Box Container */
.side-boxes {
    flex: 0 0 30%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Navigation Bar */
.navbar {
    background-color: #111;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 1000;
}

    .navbar ul {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        gap: 2rem;
    }

    .navbar a {
        display: block;
        padding: 0.8rem 0.5rem;
        color: #ccc;
        text-decoration: none;
        font-size: 0.9rem;
        transition: color 0.2s;
    }

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

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-menu {
    display: block;
    position: absolute;
    background-color: #111;
    border: 1px solid #333;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 180px;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

    .dropdown-menu li a {
        padding: 0.6rem 1rem;
        text-align: left;
    }

.dropdown:hover .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header */
header {
    padding: 2rem 1rem;
}

/* Profile pic + Header Container */
.header-flex {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: left;
}

.profile-pic {
    width: 130px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 12px rgba(0,0,0,0.7);
    image-rendering: auto;
    flex-shrink: 0;
}

.my-name {
    flex: 1;
}

    .my-name .intro-text {
        max-width: none;
    }

.controller-img {
    max-width: 200px;
    margin-bottom: 1rem;
    image-rendering: pixelated;
}

h1 {
    font-size: 1.5rem;
    color: #fff;
}

.intro-text {
    max-width: 600px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: #bbb;
}

.contact-line {
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.social-btn, .blog-btn, .project-btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid #555;
    color: #ccc;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.2s, color 0.2s;
}

    .social-btn:hover, .blog-btn:hover, .project-btn:hover {
        background: #fff;
        color: #000;
    }


/* Sections */
hr {
    border: none;
    border-top: 1px solid #333;
    margin: 2rem auto;
    width: 80%;
}

section {
    padding: 1rem 0;
}

h2 {
    font-size: 1rem;
    color: #fff;
    margin-bottom: 1rem;
}

.sample-list {
    list-style: none;
    padding: 0;
    font-size: 0.9rem;
}

    .sample-list li {
        margin: 0.3rem 0;
    }

footer {
    font-size: 0.75rem;
    color: #555;
    padding: 1rem;
    border-top: 1px solid #333;
    margin-top: 2rem;
}


#whats-new {
    flex: 0 0 30%;
    background-color: rgba(20, 20, 20, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
    padding: 1rem 1.5rem;
    color: #ddd;
    text-align: left;
}

    #whats-new h2 {
        margin-top: 0;
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

.news-box {
    position: relative;
    height: 280px;
    overflow: hidden;
    font-size: 1rem;
    line-height: 1.4;
}

    .news-box marquee {
        display: block;
        height: 100%;
        width: 100%;
        margin: 0;
        padding: 0;
    }


#currently-working {
    background-color: rgba(20, 20, 20, 0.7);
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
    padding: 1.5rem 1.8rem;
    color: #ddd;
    text-align: left;
    font-size: 1rem;
}

    #currently-working h2 {
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 1.2rem;
    }

    #currently-working ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    #currently-working li {
        margin-bottom: 0.8rem;
        line-height: 1.4;
    }

    #currently-working strong {
        color: #ccc;
    }


#little-man {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    gap: 14px;
    z-index: 2000;
    flex-direction: row-reverse;
}

#man-image {
    width: 150px;
    height: auto;
    image-rendering: pixelated;
}

#speech-bubble {
    display: none;
    background: #111;
    color: #fff;
    border: 3px solid #555;
    padding: 14px 18px;
    font-size: 1.3rem;
    max-width: 280px;
    border-radius: 16px;
    box-shadow: 0 0 10px rgba(0,0,0,0.6);
    position: relative;
    line-height: 1.5;
    transform: translateY(-40%);
}

    #speech-bubble::after {
        content: '';
        position: absolute;
        bottom: 25%;
        right: -10px;
        width: 0;
        height: 0;
        border-left: 10px solid #555;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
    }

#ufo {
    position: fixed;
    top: 100px;
    left: -200px;
    width: 200px;
    height: auto;
    z-index: 3000;
    pointer-events: none;
    opacity: 0;
    transform: translateX(-200px);
}


@keyframes ufoFly {
    0% {
        transform: translateX(-200px) translateY(0);
    }

    25% {
        transform: translateX(25vw) translateY(-40px);
    }

    50% {
        transform: translateX(50vw) translateY(0);
    }

    75% {
        transform: translateX(75vw) translateY(40px);
    }

    100% {
        transform: translateX(110vw) translateY(0);
    }
}

/* Projects as a responsive grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem; /* space between grid items */
    margin-top: 2rem;
}

/* Left-align everything in each grid item */
.project-row {
    text-align: left;
}

    /* Title above each card */
    .project-row h2 {
        margin: 0 0 0.6rem 0;
        font-size: 1.3rem;
        color: #fff;
        text-align: left;
    }

/* Card container */
.project-card {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
    text-decoration: none; /* for <a> version */
}

    /* Standardize image shape and size */
    .project-card .project-img {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 9; /* keeps a clean, even grid */
        object-fit: cover; /* crops nicely to the ratio */
        transition: transform 0.4s ease, filter 0.4s ease;
        filter: grayscale(0%);
    }

    /* Overlay with title + description shown on hover */
    .project-card .overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        transition: opacity 0.35s ease;
        color: #fff;
        padding: 1rem;
    }

.overlay-content {
    max-width: 90%;
    text-align: center;
}

.overlay-title {
    display: block;
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.5rem;
}

.overlay-desc {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Hover effect */
.project-card:hover .project-img {
    filter: grayscale(100%) brightness(80%);
    transform: scale(1.05);
}

.project-card:hover .overlay {
    opacity: 1;
}

/* Small screens: relax the grid */
@media (max-width: 420px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

/* Legend pills (reuse) */
.blog-groups-legend {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin: .5rem 0 1.25rem;
}

.legend-pill, .post-tag {
    display: inline-block;
    padding: .2rem .55rem;
    border: 1px solid #555;
    border-radius: 999px;
    font-size: .75rem;
    color: #ccc;
}

.pill-dev {
    border-color: #6aa9ff;
    color: #9ec3ff;
}

.pill-tut {
    border-color: #6aff9e;
    color: #9effbe;
}

.pill-announce {
    border-color: #ffc36a;
    color: #ffd59e;
}

/* Group headings */
.blog-group {
    text-align: left;
    margin-bottom: 2.5rem;
}

.group-title {
    font-size: 1.2rem;
    color: #fff;
    margin: 0 0 .8rem;
}

/* Grid of cards */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* Post card with coloured accent */
/* Post card base */
/* Accent stripe via inset shadow driven by a CSS var */
.post-card {
    background: rgba(20,20,20,.7);
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    display: grid;
    grid-template-rows: auto 1fr;
    box-shadow: 0 0 12px rgba(0,0,0,.5), inset 6px 0 0 var(--accent, transparent);
}

    /* Set the accent color depending on which tag pill is inside the card */
    .post-card:has(.pill-dev) {
        --accent: #6aa9ff;
    }

    .post-card:has(.pill-tut) {
        --accent: #6aff9e;
    }

    .post-card:has(.pill-announce) {
        --accent: #ffc36a;
    }

.post-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
}

.post-body {
    padding: .9rem 1rem 1rem;
    text-align: left;
}

.post-title {
    margin: 0 0 .4rem;
    color: #fff;
    font-size: 1rem;
}

.post-meta {
    display: flex;
    gap: .6rem;
    align-items: center;
    font-size: .75rem;
    color: #aaa;
    margin-bottom: .5rem;
}

.post-excerpt {
    margin: 0 0 .75rem;
    font-size: .9rem;
    color: #bbb;
}

.post-link {
    font-size: .85rem;
    color: #ddd;
    text-decoration: none;
    border-bottom: 1px dashed #666;
}

    .post-link:hover {
        color: #fff;
        border-bottom-color: #bbb;
    }

/* Small screens */
@media (max-width:420px) {
    .post-grid {
        grid-template-columns: 1fr;
    }
}

.more-text {
    display: none;
}

.post-card.expanded .more-text {
    display: inline;
}

.post-card.expanded .post-link {
    display: none; /* hide 'Read more' once expanded */
}

/* Modal shell */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 4000;
}

    .modal.open {
        display: block;
    }

/* Backdrop */
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(2px);
}

/* Dialog */
.modal-dialog {
    position: relative;
    width: min(900px, 92vw);
    max-height: 86vh;
    margin: 6vh auto;
    background: rgba(20,20,20,0.92);
    border: 1px solid #333;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #111;
    color: #ddd;
    border: 1px solid #444;
    border-radius: 8px;
    padding: .25rem .5rem;
    cursor: pointer;
    z-index: 1;
}

    .modal-close:hover {
        background: #1a1a1a;
    }

/* Content area */
.modal-content {
    padding: 1rem 1rem 1.25rem;
    overflow: auto;
}

    /* Optional: hero image + typographic tweaks inside modal */
    .modal-content .full-post-hero {
        display: block;
        width: 100%;
        aspect-ratio: 16/9;
        object-fit: cover;
        border-radius: 8px;
        margin-bottom: .8rem;
        border: 1px solid #2a2a2a;
    }

    .modal-content h2 {
        margin: .2rem 0 .3rem;
        color: #fff;
        font-size: 1.3rem;
    }

    .modal-content em {
        color: #aaa;
        font-size: .9rem;
    }

    .modal-content p {
        color: #ccc;
        line-height: 1.6;
        margin: .7rem 0;
    }

/* Compact variant used in What's New */
#whats-new .post-card.compact {
    box-shadow: inset 6px 0 0 var(--accent, transparent);
    border: 1px solid #333;
    border-radius: 8px;
    margin: 0.4rem auto;
    padding: 0.4rem 0.6rem;
    background: rgba(20,20,20,0.7);
    text-align: left;
}

    #whats-new .post-card.compact .post-title {
        margin: 0;
        font-size: 0.9rem;
        color: #fff;
    }

        #whats-new .post-card.compact .post-title a {
            color: inherit;
            text-decoration: none;
        }

            #whats-new .post-card.compact .post-title a:hover {
                text-decoration: underline;
            }

    #whats-new .post-card.compact .post-tag {
        display: inline-block;
        margin-top: 0.25rem;
        font-size: 0.7rem;
    }

/* Pills you already have are reused; ensure they exist in CSS: 
   .legend-pill, .post-tag, .pill-dev, .pill-tut, .pill-announce */

/* If you’re using the :has() accent method, keep these too: */
.post-card:has(.pill-dev) {
    --accent: #6aa9ff;
}

.post-card:has(.pill-tut) {
    --accent: #6aff9e;
}

.post-card:has(.pill-announce) {
    --accent: #ffc36a;
}

/* Continuous vertical scroller */
#whats-new-scroll {
    position: relative;
    height: 280px; /* same height as before */
    overflow: hidden;
}

    #whats-new-scroll .scroll-content {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        /* duplicate list -> animate half its height */
        animation: whatsnew-scroll 20s linear infinite;
    }

@keyframes whatsnew-scroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-50%);
    }
}

/* Compact row (title + tag) with accent stripe */
#whats-new .post-card.compact {
    box-shadow: inset 6px 0 0 var(--accent, transparent);
    border: 1px solid #333;
    border-radius: 8px;
    margin: 0;
    padding: 0.4rem 0.6rem;
    background: rgba(20,20,20,0.7);
    text-align: left;
}

    #whats-new .post-card.compact .post-title {
        margin: 0;
        font-size: 0.9rem;
        color: #fff;
    }

        #whats-new .post-card.compact .post-title a {
            color: inherit;
            text-decoration: none;
        }

            #whats-new .post-card.compact .post-title a:hover {
                text-decoration: underline;
            }

    #whats-new .post-card.compact .post-tag {
        display: inline-block;
        margin-top: 0.15rem;
        font-size: 0.7rem;
    }

    #whats-new .post-card.compact .post-meta {
        display: flex;
        gap: 0.5rem;
        align-items: center;
        font-size: 0.75rem;
        color: #aaa;
        margin-top: 0.2rem;
    }

/* Gallery layout */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

    .gallery img {
        width: 100%;
        height: auto;
        border-radius: 8px;
        border: 1px solid #333;
        box-shadow: 0 0 10px rgba(0,0,0,0.6);
        object-fit: cover;
        cursor: pointer;
        transition: transform 0.2s;
    }

        .gallery img:hover {
            transform: scale(1.03);
        }

/* Lightbox overlay */
#lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 5000;
}

    #lightbox img {
        max-width: 90%;
        max-height: 90%;
        border-radius: 10px;
        box-shadow: 0 0 20px rgba(0,0,0,0.9);
    }

.project-layout {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

/* Left column */
.project-content {
    flex: 2;
}

/* Right column */
.project-gallery {
    flex: 1;
}

    .project-gallery h2 {
        margin-bottom: 0.8rem;
    }

    /* Stack images vertically */
    .project-gallery .gallery {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

        .project-gallery .gallery img {
            width: 100%;
            height: auto;
            border-radius: 8px;
            border: 1px solid #333;
            box-shadow: 0 0 10px rgba(0,0,0,0.6);
            object-fit: cover;
            cursor: pointer;
        }

@media (max-width: 900px) {
    .project-layout {
        flex-direction: column;
    }

    .project-gallery {
        margin-top: 2rem;
    }
}

#contact-form {
    margin: 3rem auto;
    padding: 2rem;
    max-width: 700px;
    background: rgba(20,20,20,0.8);
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0,0,0,0.7);
    text-align: left;
}

    #contact-form h2 {
        font-size: 1.2rem;
        color: #fff;
        margin-bottom: 1rem;
    }

.contact-box {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

    .contact-box label {
        display: flex;
        flex-direction: column;
        font-size: 0.9rem;
        color: #bbb;
    }

    .contact-box input,
    .contact-box textarea {
        margin-top: 0.4rem;
        padding: 0.6rem;
        font-size: 0.9rem;
        border: 1px solid #444;
        border-radius: 8px;
        background: #111;
        color: #fff;
    }

        .contact-box input:focus,
        .contact-box textarea:focus {
            outline: none;
            border-color: #6aa9ff; /* highlight color */
        }

    .contact-box button {
        align-self: flex-start;
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
        border: none;
        border-radius: 8px;
        background: #000000;
        color: #FFFFFF;
        cursor: pointer;
        transition: background 0.2s;
    }

        .contact-box button:hover {
            background: #4b8ad9;
        }

/* status message */
.status {
    margin-top: 0.5rem;
    min-height: 1.2rem; /* reserves space so layout doesn’t jump */
    font-size: 0.9rem;
}

    .status.success {
        color: #9effbe;
    }

    .status.error {
        color: #ff9e9e;
    }