@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000000;
    color: #ffffff;
    min-height: 100vh;
}

/* Navigation - pill style */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: transparent;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
}

.navbar .logo img {
    height: 36px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 10px;
    margin: 0;
    padding: 0;
}

nav ul li {
    display: inline;
}

nav ul li a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    font-size: 14px;
    padding: 10px 20px;
    border-radius: 100px;
    background-color: #1c1c1e;
    transition: background-color 0.3s ease;
    display: inline-block;
}

nav ul li a:hover {
    background-color: #2c2c2e;
}

/* Container */
.container {
    padding: 100px 40px 60px;
}

/* Rows as grids */
.row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

/* Project boxes */
.box {
    position: relative;
    width: 100%;
    padding-top: 66.66%;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.3s ease;
    background-color: #1c1c1e;
}

.box:hover {
    transform: translateY(-4px);
}

.box::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    transition: background 0.3s ease;
}

.box:hover::before {
    background: rgba(0, 0, 0, 0.35);
}

.box.visible {
    opacity: 1;
}

.content, .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease-in-out;
}

.content p {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: white;
    text-align: center;
    padding: 24px;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.overlay {
    background: rgba(0, 0, 0, 0.7);
    top: 100%;
    justify-content: center;
    align-items: center;
}

.overlay p {
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
    padding: 8px 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}

.box:hover .overlay {
    top: 0;
}

/* Popup */
.popup {
    display: none;
    position: fixed;
    z-index: 300;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
}

.popup-content {
    background-color: #1c1c1e;
    margin: 5% auto;
    padding: 40px;
    width: 90%;
    max-width: 900px;
    border-radius: 24px;
    color: #ffffff;
}

.popup-content h1,
.popup-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #ffffff;
}

.popup-content h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 20px;
    margin-bottom: 8px;
    color: #ffffff;
}

.popup-content h4 {
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 16px;
}

.popup-content p {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    margin-bottom: 14px;
}

.popup-content ul {
    padding-left: 20px;
    margin-bottom: 14px;
}

.popup-content li {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 10px;
}

.popup-content a {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.3s ease;
}

.popup-content a:hover {
    text-decoration-color: #ffffff;
}

.popup-content img {
    max-width: 100%;
    border-radius: 12px;
    margin: 8px 0;
}

.popup-content video {
    border-radius: 12px;
    margin: 8px 0;
}

.popup-content iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 12px;
    margin-top: 12px;
}

/* Side-by-side media row (video + PDF) */
.media-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.media-row .media-item {
    flex: 1;
    max-width: 380px;
}

.media-row .media-item iframe,
.media-row .media-item object {
    width: 100%;
    height: 240px;
    border-radius: 12px;
    border: none;
}

/* Mobile-only fallback link for PDF embeds */
.pdf-mobile-link {
    display: none;
}

.close {
    color: rgba(255, 255, 255, 0.4);
    float: right;
    font-size: 28px;
    font-weight: 400;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #ffffff;
}

/* Staggered fade-in */
.row-1 .box { transition-delay: 0s; }
.row-2 .box { transition-delay: 0.15s; }
.row-3 .box { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 767px) {
    .navbar {
        padding: 16px 20px;
    }

    nav {
        min-width: 0;
        flex: 1 1 0;
    }

    nav ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 0 8px 4px 0;
    }

    nav ul::-webkit-scrollbar {
        display: none;
    }

    nav ul li {
        flex-shrink: 0;
    }

    nav ul li a {
        font-size: 14px;
        padding: 10px 18px;
    }

    .container {
        padding: 90px 16px 40px;
    }

    .row {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 16px;
    }

    .content p {
        font-size: 16px;
        padding: 20px;
    }

    .overlay p {
        font-size: 14px;
    }

    .popup-content {
        padding: 24px;
        margin: 80px auto 20px;
        width: 95%;
    }

    .popup-content iframe {
        height: 250px;
    }

    .media-row {
        flex-direction: column;
        align-items: center;
    }

    .media-row .media-item {
        max-width: 100%;
        width: 100%;
    }

    .media-row .media-item iframe,
    .media-row .media-item object {
        height: 220px;
    }

    /* Mobile browsers can't scroll multi-page embedded PDFs — keep first-page preview and add an inline link to open full PDF */
    .pdf-mobile-link {
        display: inline;
        color: #ffffff;
        text-decoration: underline;
        text-decoration-color: rgba(255, 255, 255, 0.4);
        font-weight: 500;
    }

    .pdf-reader {
        text-align: center;
    }

    .pdf-reader > .pdf-mobile-link {
        display: inline-block;
        margin-top: 10px;
        font-size: 14px;
    }

    .popup-content video {
        width: 100% !important;
        height: auto !important;
    }

    .popup-content img {
        width: 100% !important;
        height: auto !important;
    }
}

/* Box background images */
#box1 { background-image: url('images/urop_cover.png'); }
#box2 { background-image: url('images/robot_car_cover.png'); }
#box3 { background-image: url('images/kalshi_cover.png'); }
#box4 { background-image: url('images/KeepInTouch_cover.png'); }
#box5 { background-image: url('images/gameplan_cover.png'); }
#box6 { background-image: url('images/riscv_cover.png'); }
#box7 { background-image: url('images/fifa_cover.png'); }
#box8 { background-image: url('images/DP_cover.png'); }
#box9 { background-image: url('images/navilux_cover.png'); }

@media (max-width: 480px) {
    .navbar {
        padding: 14px 16px;
    }

    nav ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 6px;
        padding-right: 8px;
    }

    nav ul::-webkit-scrollbar {
        display: none;
    }

    nav ul li {
        flex-shrink: 0;
    }

    nav ul li a {
        font-size: 13px;
        padding: 9px 15px;
    }

    .container {
        padding: 85px 12px 32px;
    }

    .row {
        gap: 12px;
        margin-bottom: 12px;
    }

    .content p {
        font-size: 15px;
        padding: 16px;
    }

    .popup-content {
        padding: 20px;
        margin: 80px auto 20px;
        width: 96%;
        border-radius: 16px;
    }

    .popup-content iframe {
        height: 200px;
    }
}

.nav-scroll-hint {
    display: none;
}

@media (max-width: 768px) {
    .nav-scroll-hint {
        display: block;
        position: absolute;
        bottom: 4px;
        right: 16px;
        color: rgba(255, 255, 255, 0.9);
        font-size: 10px;
        font-weight: 500;
        font-family: 'Inter', sans-serif;
        z-index: 10;
        pointer-events: none;
        white-space: nowrap;
    }
}
