/* 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%);
}

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

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Nav entrance — staggered slide down */
@keyframes rv-nav-enter {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-entering .nav-link {
    opacity: 0;
    animation: rv-nav-enter cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.nav-entering .nav-link:nth-child(1) { animation-delay: 0.15s; animation-duration: 0.5s; }
.nav-entering .nav-link:nth-child(2) { animation-delay: 0.19s; animation-duration: 0.47s; }
.nav-entering .nav-link:nth-child(3) { animation-delay: 0.23s; animation-duration: 0.44s; }
.nav-entering .nav-link:nth-child(4) { animation-delay: 0.27s; animation-duration: 0.41s; }
.nav-entering .nav-link:nth-child(5) { animation-delay: 0.31s; animation-duration: 0.38s; }
.nav-entering .nav-link:nth-child(6) { animation-delay: 0.35s; animation-duration: 0.35s; }

/* Nav exit — staggered slide up */
.nav-exiting .nav-link {
    opacity: 0 !important;
    transform: translateY(-20px) !important;
}

.nav-exiting .nav-link:nth-child(6) { transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0s !important; }
.nav-exiting .nav-link:nth-child(5) { transition: opacity 0.38s cubic-bezier(0.16, 1, 0.3, 1), transform 0.38s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0.04s !important; }
.nav-exiting .nav-link:nth-child(4) { transition: opacity 0.41s cubic-bezier(0.16, 1, 0.3, 1), transform 0.41s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0.08s !important; }
.nav-exiting .nav-link:nth-child(3) { transition: opacity 0.44s cubic-bezier(0.16, 1, 0.3, 1), transform 0.44s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0.12s !important; }
.nav-exiting .nav-link:nth-child(2) { transition: opacity 0.47s cubic-bezier(0.16, 1, 0.3, 1), transform 0.47s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0.16s !important; }
.nav-exiting .nav-link:nth-child(1) { transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important; transition-delay: 0.2s !important; }

.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;
}

.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;
}

/* ============================================
   Back to Top Button
   ============================================ */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #030b2a;
    text-decoration: none;
    z-index: 99;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, box-shadow 0.2s ease;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: #fff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

[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 — Blue Labels
   ============================================ */
.cs-label {
    color: #083569;
    font-size: 16px;
    font-weight: 700;
}

.cs-subtitle {
    color: #083569;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
}

.cs-sidebar-label {
    color: #083569;
    font-size: 16px;
    font-weight: 700;
    /* width: 108px; */
    flex-shrink: 0;
}

.cs-card {
    background: #dde3ec;
    border-radius: 10px;
    padding: 20px;
}

.cs-divider {
    border: none;
    border-top: 1px solid #030b2a;
    margin: 0;
}

/* ============================================
   Header Section
   ============================================ */
.cs-header {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

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

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

/* Hero Banner — dark blue with Reveal title + logo */
.cs-hero-banner {
    width: 100%;
    background: #083569;
    border-radius: 8px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.cs-hero-title {
    flex: 1;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 128px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
    letter-spacing: -2.56px;
    line-height: 1;
}

.cs-hero-video {
    flex: 1;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.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;
}

/* ============================================
   Two Column Layout
   ============================================ */
.cs-two-col {
    display: flex;
    gap: 217px;
    align-items: flex-start;
}

.cs-content {
    flex: 1;
    min-width: 0;
    font-size: 16px;
}

.cs-content p {
    margin-bottom: 8px;
}

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

/* ============================================
   Section
   ============================================ */
.cs-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================
   Background — Photos with Overlays
   ============================================ */
.cs-bg-photo {
    position: relative;
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
}

.cs-bg-photo > img:first-child {
    width: 100%;
    height: auto;
    display: block;
}

.cs-bg-pin {
    position: absolute;
    width: 75px;
    height: 75px;
}

.cs-bg-overlay {
    position: absolute;
    width: 372px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: #fff;
    font-size: 16px;
    backdrop-filter: blur(8px);
}

.cs-bg-overlay-heading {
    font-weight: 700;
    margin-bottom: 0;
}

.cs-bg-overlay-section p:last-child {
    margin-bottom: 0;
}

.cs-bg-overlay-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0;
}

/* ============================================
   PACT Analysis — 2x2 Grid
   ============================================ */
.cs-pact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.cs-pact-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-size: 16px;
}

.cs-pact-heading {
    color: #083569;
    font-size: 20px;
    font-weight: 500;
}

/* ============================================
   Low Fidelity — Image Rows
   ============================================ */
.cs-lofi-row {
    display: flex;
    gap: 20px;
}

.cs-lofi-row img {
    flex: 1;
    min-width: 0;
    height: auto;
    object-fit: cover;
}

/* ============================================
   User Testing — Before/After Comparison
   ============================================ */
.cs-testing-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cs-testing-comparison {
    display: flex;
    gap: 20px;
}

.cs-testing-card {
    flex: 1;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: hidden;
    color: #fff;
}

.cs-testing-before {
    background: rgba(193, 0, 0, 0.5);
}

.cs-testing-after {
    background: rgba(0, 133, 53, 0.5);
}

.cs-testing-card img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.cs-testing-card-title {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 20px;
    font-weight: 700;
}

.cs-testing-card-desc {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    font-size: 16px;
    font-weight: 400;
}

/* ============================================
   Features / Solution Overview
   ============================================ */
.cs-feature-row {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.cs-feature-text {
    width: 304px;
    flex-shrink: 0;
    font-size: 16px;
}

.cs-feature-title {
    font-size: 20px;
    font-weight: 700;
    color: #083569;
    margin-bottom: 4px;
}

.cs-feature-video {
    flex: 1;
    min-width: 0;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-feature-video p {
    font-size: 36px;
    font-weight: 400;
}

.cs-feature-row > video {
    flex: 1;
    min-width: 0;
    border-radius: 10px;
    height: auto;
}

/* ============================================
   Takeaways / Impact
   ============================================ */
.cs-impact-row {
    display: flex;
    gap: 20px;
}

.cs-impact-card {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.cs-impact-icon {
    font-size: 50px;
    color: #083569;
}

.cs-impact-title {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.46px;
}

.cs-impact-desc {
    font-size: 16px;
    font-weight: 500;
}

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

/* ============================================
   Page Exit
   ============================================ */
.cs-exiting .case-study,
.cs-exiting .back-to-top {
    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; }
}

/* Sections start hidden, animate in on scroll */
.cs-section,
.cs-header,
.cs-divider {
    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-section.cs-visible,
.cs-header.cs-visible,
.cs-divider.cs-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children within visible sections */
.cs-visible .cs-two-col,
.cs-visible .cs-card,
.cs-visible .cs-bg-photo,
.cs-visible .cs-pact-grid,
.cs-visible .cs-lofi-row,
.cs-visible .cs-testing-block,
.cs-visible .cs-feature-row,
.cs-visible .cs-impact-row {
    animation: cs-stagger-in 0.7s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

.cs-visible > :nth-child(1) { animation-delay: 0s; }
.cs-visible > :nth-child(2) { animation-delay: 0.08s; }
.cs-visible > :nth-child(3) { animation-delay: 0.16s; }
.cs-visible > :nth-child(4) { animation-delay: 0.24s; }
.cs-visible > :nth-child(5) { animation-delay: 0.32s; }
.cs-visible > :nth-child(6) { animation-delay: 0.4s; }

@keyframes cs-stagger-in {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

    .navbar {
        padding: 16px 40px;
    }

    .nav-link {
        padding: 8px 16px;
        font-size: 13px;
    }

    .cs-two-col {
        gap: 80px;
    }

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

    .cs-hero-title {
        font-size: 80px;
    }

    .cs-bg-overlay {
        width: 300px;
    }
}

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

    .navbar {
        padding: 12px 24px;
    }

    .nav-logo {
        left: 24px;
    }

    .nav-link {
        padding: 6px 12px;
        font-size: 12px;
    }

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

    .back-to-top {
        bottom: 24px;
        right: 24px;
        width: 40px;
        height: 40px;
    }

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

    .cs-two-col {
        flex-direction: column;
        gap: 16px;
    }

    .cs-sidebar-label {
        width: auto;
    }

    .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-hero-banner {
        flex-direction: column;
        padding: 30px 20px;
    }

    .cs-hero-title {
        font-size: 56px;
    }

    .cs-hero-logo {
        max-width: 80%;
    }

    .cs-bg-overlay {
        position: relative;
        width: 100%;
        right: auto !important;
        bottom: auto !important;
        border-radius: 0 0 8px 8px;
    }

    .cs-bg-photo {
        display: flex;
        flex-direction: column;
    }

    .cs-bg-pin {
        display: none;
    }

    .cs-pact-grid {
        grid-template-columns: 1fr;
    }

    .cs-lofi-row {
        flex-direction: column;
    }

    .cs-testing-comparison {
        flex-direction: column;
    }

    .cs-feature-row {
        flex-direction: column;
    }

    .cs-feature-text {
        width: 100%;
    }

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

    .cs-impact-row {
        flex-direction: column;
    }
}

@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;
        gap: 48px;
    }

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

    .cs-hero-title {
        font-size: 40px;
    }
}
