/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-y: scroll;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: 'Parkinsans', sans-serif;
    background: #fff;
    color: #030b2a;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ============================================
   Navigation
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px 60px;
}

.navbar::before {
    content: '';
    position: absolute;
    inset: 0;
    bottom: -20px;
    z-index: -1;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 85%, transparent 100%);
    transition: opacity 0.4s ease;
}

.nav-logo {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    animation: logo-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes logo-enter {
    to { opacity: 1; }
}

.nav-logo img {
    height: 48px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: 1000px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: #030b2a;
    text-decoration: none;
    transition: color 0.2s ease, background 0.2s ease;
    white-space: nowrap;
    opacity: 0;
    animation: nav-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

@keyframes nav-enter {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav exit — slide up */
.nav-exiting .nav-link {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.nav-link:hover {
    background: rgba(0, 0, 0, 0.06);
}

.nav-link.active {
    color: #1180f9;
    background: rgba(17, 128, 249, 0.08);
}

.hamburger {
    display: none;
}

.mobile-menu {
    display: none;
}

[id] {
    scroll-margin-top: 100px;
}

/* ============================================
   Case Study Layout
   ============================================ */
.case-study {
    max-width: 90vw;
    margin: 0 auto;
    padding: 120px 80px 100px;
    display: flex;
    flex-direction: column;
    gap: 100px;
}

/* ============================================
   Shared Styles
   ============================================ */
.cs-label {
    color: #48a9a6;
    font-size: 16px;
    font-weight: 700;
}

.cs-header {
    display: flex;
    flex-direction: column;
    gap: 40px;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.cs-header.cs-visible {
    opacity: 1;
    transform: translateY(0);
}

.cs-header-text .cs-label {
    margin-bottom: 0;
}

.cs-title {
    font-size: 40px;
    font-weight: 400;
    color: #030b2a;
    line-height: 1.5;
}

.launching {
    color: #48a9a6;
    font-size: 48px;
    font-weight: 700;
    text-align: center;
    padding: 4rem;
}

/* ============================================
   Meta Grid
   ============================================ */
.cs-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 197px;
    column-gap: 64px;
    row-gap: 40px;
    font-size: 16px;
}

.cs-meta-overview {
    grid-column: 1 / 3;
}

.cs-meta-role {
    grid-column: 3;
}

.cs-meta-problem {
    grid-column: 1;
}

.cs-meta-solution {
    grid-column: 2;
}

.cs-meta-timeline {
    grid-column: 3;
}

.cs-meta-grid p:last-child {
    margin-bottom: 0;
}

/* ============================================
   Video Placeholder
   ============================================ */

.project-video {
    border-radius: 8px;
}

/* ============================================
   Page Entrance
   ============================================ */
.page-transition-cover {
    position: fixed;
    inset: 0;
    background: #000002;
    z-index: 99;
    pointer-events: none;
}

/* ============================================
   Page Exit
   ============================================ */
.cs-exiting .case-study {
    opacity: 0;
    transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.cs-exiting .nav-logo {
    opacity: 0 !important;
    transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
}

.cs-exiting .navbar::before {
    opacity: 0 !important;
    transition: opacity 0.5s cubic-bezier(0.25, 0.1, 0.25, 1) !important;
}

.cs-exiting::after {
    content: '';
    position: fixed;
    inset: 0;
    background: #000002;
    z-index: 98;
    opacity: 0;
    animation: darken-bg 0.3s ease 0.3s forwards;
}

@keyframes darken-bg {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
    .case-study {
        padding: 100px 40px 80px;
    }

    .navbar {
        padding: 16px 40px;
    }

    .cs-meta-grid {
        column-gap: 40px;
    }
}

@media (max-width: 900px) {
    .case-study {
        padding: 90px 24px 60px;
    }

    .navbar {
        padding: 12px 24px;
    }

    .nav-logo {
        left: 24px;
    }

    .nav-logo img {
        height: 40px;
    }

    .cs-title {
        font-size: 28px;
    }

    .cs-meta-grid {
        grid-template-columns: 1fr;
        row-gap: 24px;
    }

    .cs-meta-overview,
    .cs-meta-role,
    .cs-meta-problem,
    .cs-meta-solution,
    .cs-meta-timeline {
        grid-column: 1;
    }

    .cs-video-placeholder {
        height: 300px;
    }
}

@media (max-width: 640px) {
    .navbar {
        padding: 2rem;
        z-index: 110;
    }

    .nav-logo {
        left: 16px;
    }

    .nav-links {
        display: none !important;
    }

    .nav-logo img {
        height: 3rem;
    }

    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%);
        width: 40px;
        height: 40px;
        padding: 8px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 110;
    }

    .hamburger-line {
        display: block;
        width: 100%;
        height: 2px;
        background: #030b2a;
        border-radius: 2px;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .hamburger.is-open .hamburger-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.is-open .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .hamburger.is-open .hamburger-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .mobile-menu {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        position: fixed;
        inset: 0;
        z-index: 105;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-menu.menu-open {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-link {
        font-family: 'Inter', sans-serif;
        font-weight: 600;
        font-size: 24px;
        color: #030b2a;
        text-decoration: none;
        padding: 1rem 3rem;
        border-radius: 1000px;
        opacity: 0;
        transform: translateY(20px);
    }

    @keyframes mobile-nav-enter {
        to { opacity: 1; transform: translateY(0); }
    }

    .mobile-menu.menu-open .mobile-menu-link {
        animation: mobile-nav-enter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .mobile-menu.menu-open .mobile-menu-link:nth-child(1) { animation-delay: 0.1s; }
    .mobile-menu.menu-open .mobile-menu-link:nth-child(2) { animation-delay: 0.15s; }
    .mobile-menu.menu-open .mobile-menu-link:nth-child(3) { animation-delay: 0.2s; }

    .mobile-menu.menu-closing {
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.15s;
    }

    .mobile-menu.menu-closing .mobile-menu-link {
        opacity: 1;
        transform: translateY(0);
        animation: menu-exit 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .mobile-menu.menu-closing .mobile-menu-link:nth-child(3) { animation-delay: 0s; }
    .mobile-menu.menu-closing .mobile-menu-link:nth-child(2) { animation-delay: 0.05s; }
    .mobile-menu.menu-closing .mobile-menu-link:nth-child(1) { animation-delay: 0.1s; }

    @keyframes menu-exit {
        from { opacity: 1; transform: translateY(0); }
        to { opacity: 0; transform: translateY(12px); }
    }

    .mobile-menu-link.active {
        color: #1180f9;
        background: rgba(17, 128, 249, 0.08);
    }

    .nav-exiting .hamburger {
        opacity: 0 !important;
        transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .case-study {
        padding: 80px 0px 40px;
    }

    .cs-title {
        font-size: 24px;
    }
}
