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

:root {
    --navy: #0a1628;
    --electric-blue: #0066cc;
    --cyan: #00b4d8;
    --turquoise: #00d9ff;
    --green: #00ff88;
    --red-accent: #ff6b6b;
    --dark-bg: #0f1419;
    --card-bg: #1a1f2e;
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --nav-height: 70px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: var(--nav-height);
}

nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 22, 40, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    height: var(--nav-height);
    padding: 0;
    border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--turquoise);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

header {
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1.75rem 2rem 1.5rem;
    margin-top: 3rem;
    text-align: center;
}

header h1 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    background: linear-gradient(135deg, var(--cyan), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.4rem;
    animation: fadeInUp 1s ease;
}

header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    animation: fadeInUp 1s ease 0.2s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem 2rem 0;
}

.tab-btn {
    padding: 0.6rem 1.6rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(0, 180, 216, 0.3);
    background: var(--card-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}

.tab-btn:hover {
    border-color: var(--turquoise);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--electric-blue), var(--cyan));
    border-color: transparent;
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.35);
}

.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 2rem 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.controls input[type="checkbox"] {
    accent-color: var(--turquoise);
    width: 16px;
    height: 16px;
}

.stage {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem 3rem;
}

.cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.cols.mobile-mode {
    grid-template-columns: minmax(0, 340px) minmax(0, 340px);
    justify-content: center;
}

.col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.col-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--turquoise);
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.dot.before { background: var(--red-accent); box-shadow: 0 0 8px rgba(255, 107, 107, 0.6); }
.dot.after { background: var(--green); box-shadow: 0 0 8px rgba(0, 255, 136, 0.6); }

.frame {
    background: var(--card-bg);
    border-radius: 15px;
    overflow-y: scroll;
    height: 78vh;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.frame.before-frame {
    border: 1px solid rgba(255, 107, 107, 0.25);
}

.frame.after-frame {
    border: 1px solid rgba(0, 255, 136, 0.25);
}

.frame:hover {
    box-shadow: 0 10px 30px rgba(0, 180, 216, 0.15);
}

.frame img {
    display: block;
    width: 100%;
    height: auto;
}

.frame::-webkit-scrollbar { width: 8px; }
.frame::-webkit-scrollbar-track { background: transparent; }
.frame::-webkit-scrollbar-thumb {
    background: rgba(0, 180, 216, 0.4);
    border-radius: 8px;
}
.frame::-webkit-scrollbar-thumb:hover {
    background: var(--turquoise);
}

/* Case Study Write-up */
#case-study-writeup {
    padding: 3rem 2rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

#case-study-writeup .section-title {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    text-align: center;
    margin-bottom: 2.5rem;
    background: linear-gradient(135deg, var(--cyan), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.case-study-content {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: 15px;
    padding: 2.5rem;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.case-study-content h3 {
    color: var(--turquoise);
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.case-study-content h3:not(:first-child) {
    margin-top: 2rem;
}

.case-study-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.approach-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0 0;
}

.approach-list li {
    position: relative;
    padding: 0.6rem 0 0.6rem 1.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-bottom: 1px solid rgba(0, 180, 216, 0.1);
}

.approach-list li:last-child {
    border-bottom: none;
}

.approach-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.6rem;
    color: var(--green);
    font-weight: bold;
}

.approach-list li strong {
    color: var(--text-primary);
}

.case-study-cta {
    display: block;
    max-width: 800px;
    margin: 2.5rem auto 0;
    text-align: center;
    padding: 2.5rem;
    background: var(--card-bg);
    border: 1px solid rgba(0, 255, 136, 0.25);
    border-radius: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s, opacity 0.6s ease;
}

.case-study-cta:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 255, 136, 0.2);
    border-color: var(--green);
}

.case-study-cta h3 {
    color: var(--turquoise);
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
}

.case-study-cta p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.link-gradient {
    background: linear-gradient(135deg, var(--cyan), var(--green));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    font-weight: 700;
}

footer {
    background: var(--navy);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid rgba(0, 180, 216, 0.2);
}

footer p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.scroll-note {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(0, 180, 216, 0.15);
    border-bottom: 1px solid rgba(0, 180, 216, 0.15);
}

@media (max-width: 768px) {
    .cols, .cols.mobile-mode {
        grid-template-columns: 1fr;
    }
    .frame { height: 60vh; }
    header { padding: 1.5rem 1rem 1.25rem; }
    .stage { padding: 1.5rem 1rem 2rem; }
    .tabs { padding: 1.25rem 1rem 0; }
    .controls { padding: 1rem 1rem 0.5rem; }
    #case-study-writeup { padding: 2rem 1rem 1.5rem; }
    .case-study-content { padding: 1.5rem; }

    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(10, 22, 40, 0.98);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3rem;
        transition: left 0.3s;
    }

    .nav-links.active {
        left: 0;
    }

    .mobile-menu-btn {
        display: block;
    }
}