/* ============================================
   MODERN SILICON VALLEY STARTUP DESIGN
   ============================================ */

/* Base Styles & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: #ffffff;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

[data-theme="dark"] body {
    background: #1b2249;
}

main {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    padding-top: 80px;
    padding-bottom: 40px;
}

/* Modern Color Palette */
:root {
    /* Palette Colors */
    --palette-navy: #1b2249;
    --palette-sky-blue: #4ec0f9;
    --palette-green: #39b24a;
    --palette-red: #ed4848;
    --palette-pink: #ff85da;
    
    /* Primary Colors */
    --primary-blue: #4ec0f9;
    --primary-blue-dark: #1b2249;
    --primary-blue-light: #4ec0f9;
    
    /* Accent Colors */
    --accent-green: #39b24a;
    --accent-red: #ed4848;
    --accent-pink: #ff85da;
    
    /* Flat Colors (replacing gradients) */
    --gradient-primary: #4ec0f9;
    --gradient-blue: #4ec0f9;
    --gradient-cyan: #4ec0f9;
    --gradient-accent: #ff85da;
    
    /* Text Colors */
    --text-primary: #1a1a1a;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    
    /* Background Colors */
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --border-light: #e5e7eb;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Dark Mode Variables - Same Color Palette */
[data-theme="dark"] {
    /* Palette Colors - Same */
    --palette-navy: #1b2249;
    --palette-sky-blue: #4ec0f9;
    --palette-green: #39b24a;
    --palette-red: #ed4848;
    --palette-pink: #ff85da;
    
    /* Primary Colors - Same */
    --primary-blue: #4ec0f9;
    --primary-blue-dark: #1b2249;
    --primary-blue-light: #4ec0f9;
    
    /* Accent Colors - Same */
    --accent-green: #39b24a;
    --accent-red: #ed4848;
    --accent-pink: #ff85da;
    
    /* Flat Colors (replacing gradients) - Same */
    --gradient-primary: #4ec0f9;
    --gradient-blue: #4ec0f9;
    --gradient-cyan: #4ec0f9;
    --gradient-accent: #ff85da;
    
    /* Text Colors - Inverted */
    --text-primary: #f5f7fa;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Background Colors - Dark */
    --bg-white: #0f172a;
    --bg-light: #1e293b;
    --bg-card: #1e293b;
    --border-light: #334155;
    
    /* Shadows - Adjusted for dark mode */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

[data-theme="dark"] header {
    background: rgba(27, 34, 73, 0.95);
    border-bottom: 1px solid var(--border-light);
}

header:hover {
    box-shadow: var(--shadow-md);
}

/* Navigation Bar Layout */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem clamp(1rem, 2vw, 1.5rem);
    width: 100%;
    box-sizing: border-box;
}

nav a:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

nav a:first-child:hover {
    transform: translateY(-1px);
    color: var(--primary-blue-light);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-right a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

/* Case Study link hover - green */
.nav-right a[href="#case-study"],
.nav-right a[href="index.html#case-study"] {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.nav-right a[href="#case-study"]:hover,
.nav-right a[href="index.html#case-study"]:hover {
    color: var(--accent-green);
    background: rgba(57, 178, 74, 0.1);
    transform: translateY(-1px);
}

.nav-right a[href="#case-study"]::after,
.nav-right a[href="index.html#case-study"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--accent-green);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-right a[href="#case-study"]:hover::after,
.nav-right a[href="index.html#case-study"]:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Our Team link hover - light blue */
.nav-right a[href="team.html"]:hover {
    color: var(--primary-blue-light);
    background: rgba(78, 192, 249, 0.1);
    transform: translateY(-1px);
}

.nav-right a[href="team.html"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--primary-blue-light);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-right a[href="team.html"]:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Get Started button in navigation */
.nav-right a.nav-button {
    color: var(--text-secondary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
}

.nav-right a.nav-button:hover {
    color: var(--accent-red);
    background: rgba(237, 72, 72, 0.1);
    transform: translateY(-1px);
}

.nav-right a.nav-button::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: var(--accent-red);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-right a.nav-button:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* Navigation Bar Image Sizing */
nav a:first-child img {
    height: 40px;
    width: auto;
    max-width: 100%;
    vertical-align: middle;
    object-fit: contain;
}

.nav-right svg {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

/* Dark Mode Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    padding: 0;
}

.theme-toggle:hover {
    background: rgba(78, 192, 249, 0.1);
    color: var(--primary-blue-light);
    transform: translateY(-1px);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
}

.theme-toggle:hover svg {
    transform: rotate(15deg);
}

/* Hide sun icon in light mode, moon icon in dark mode */
.theme-toggle .sun-icon {
    display: block;
}

.theme-toggle .moon-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: none;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

/* GitHub icon hover - pink (#ff85da) */
.nav-right a:has(svg):hover {
    transform: translateY(-1px);
}

.nav-right a:has(svg):hover svg {
    color: #ff85da;
}

/* Logo and Links Container - Side by Side */
.logo-links-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: clamp(40px, 8vw, 80px);
    margin: 80px auto;
    padding: 60px clamp(20px, 4vw, 40px);
    animation: fadeInUp 0.6s ease-out;
    max-width: 100%;
    box-sizing: border-box;
    width: 100%;
    min-height: calc(100vh - 160px);
}

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

/* Logo Section */
.logo-section {
    text-align: left;
    max-width: 600px;
    width: 100%;
}

.logo-section img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    box-sizing: border-box;
}

/* Links Section - Stacked vertically on the right */
.links-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.links-section a {
    text-align: left;
    padding: 16px clamp(24px, 5vw, 40px);
    background: var(--gradient-blue);
    color: var(--primary-blue-dark);
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: clamp(0.95rem, 2.5vw, 1.1rem);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

.links-section a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left 0.5s ease;
}

.links-section a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.links-section a:hover::before {
    left: 100%;
}

.links-section a:first-child {
    background: var(--gradient-blue);
}

.links-section a:last-child {
    background: var(--gradient-accent);
}

/* Get Started Page Styles */
.get-started-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 0 clamp(20px, 4vw, 40px);
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.get-started-container h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 20px;
    color: var(--gradient-blue);
    font-weight: 800;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.intro-text {
    font-size: 1.25rem;
    margin-bottom: 50px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.instructions {
    margin-bottom: 40px;
}

.instruction-step {
    margin-bottom: 32px;
    padding: clamp(24px, 4vw, 32px);
    background: var(--bg-card);
    border-radius: 16px;
    border-left: 4px solid var(--gradient-blue);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.instruction-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-blue);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 0.3s ease;
}

.instruction-step:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.instruction-step:hover::before {
    transform: scaleY(1);
}

.instruction-step h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.instruction-step p {
    margin-bottom: 12px;
    line-height: 1.6;
}

.instruction-step ul {
    margin-left: 20px;
    margin-bottom: 12px;
}

.instruction-step li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.instruction-step pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    margin: 16px 0;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    max-width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
}

[data-theme="dark"] .instruction-step pre {
    background: #334155;
    border: 1px solid rgba(78, 192, 249, 0.2);
}

.instruction-step code {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    background: rgba(78, 192, 249, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--primary-blue);
    font-weight: 500;
}

.instruction-step pre code {
    color: #f8fafc;
    background: transparent;
    padding: 0;
}

.help-section {
    margin-top: 50px;
    padding: 32px;
    background: rgba(78, 192, 249, 0.1);
    border-radius: 16px;
    border: 1px solid rgba(78, 192, 249, 0.2);
    box-shadow: var(--shadow-md);
}

[data-theme="dark"] .help-section {
    background: rgba(78, 192, 249, 0.15);
    border: 1px solid rgba(78, 192, 249, 0.3);
}

.help-section h2 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 700;
}

.help-section ul {
    margin-left: 24px;
    list-style: none;
}

.help-section li {
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
}

.help-section li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}

.help-section a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.help-section a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

/* Case Study Content Styles */
.case-study-content {
    margin-top: 0;
    padding-top: 20px;
    display: flex;
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    min-height: 100vh;
}

.case-study-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 40px) 40px;
    line-height: 1.8;
    flex: 1;
    margin-left: 240px;
    width: 100%;
    box-sizing: border-box;
}

/* Table of Contents Sidebar - Clean minimal design */
.toc-sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 200px;
    max-width: 20vw;
    height: calc(100vh - 80px);
    overflow: hidden;
    padding: 16px clamp(10px, 2vw, 20px);
    background: transparent;
    z-index: 100;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    box-sizing: border-box;
}

.toc-sidebar.visible {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.toc-nav {
    position: sticky;
    top: 0;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: inherit;
    width: 100%;
}

.toc-list > li {
    margin-bottom: 12px;
}

.toc-sidebar .toc-nav .toc-list a {
    display: block;
    padding: 2px 0;
    color: var(--text-muted);
    text-decoration: none;
    font-size: inherit;
    line-height: 1.2;
    transition: color 0.2s ease;
    font-weight: 400;
    position: relative;
    margin-left: 0;
    scroll-behavior: smooth;
}

.toc-list a:hover {
    color: var(--text-primary);
}

.toc-list a.active {
    color: var(--text-primary);
    font-weight: 500;
}

/* Progress indicator - down arrow that grows with scroll */
.toc-list a.active::before {
    content: '';
    position: absolute;
    left: -17px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--primary-blue-light);
    transform-origin: top;
    transform: scaleY(var(--progress, 0));
}

/* Arrowhead at the end of the growing line - point at the end of the line */
.toc-list a.active::after {
    content: '';
    position: absolute;
    left: -21px;
    top: calc(100% * var(--progress, 0) - 4px);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid var(--primary-blue-light);
    pointer-events: none;
}

/* TOC Icons - Retriever logo and GitHub icon */
.toc-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-light);
    width: 100%;
    flex-shrink: 0;
}

.toc-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toc-icons a:hover {
    transform: translateY(-2px);
}

.toc-icons img {
    height: 24px;
    width: auto;
    max-width: 24px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    display: block;
    object-fit: contain;
}

.toc-icons a:hover img {
    opacity: 1;
}

.toc-icons svg {
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.toc-icons a:hover svg {
    color: #ff85da;
}

/* Responsive Design */
@media (max-width: 1100px) {
    .toc-sidebar {
        display: none;
    }
    
    .case-study-container {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
    
    nav {
        padding: 1rem clamp(0.5rem, 2vw, 1rem);
        flex-wrap: wrap;
    }
    
    nav a:first-child {
        font-size: 1.25rem;
    }
    
    .nav-right {
        gap: clamp(8px, 2vw, 12px);
        flex-wrap: wrap;
    }
    
    .nav-right a {
        font-size: 0.85rem;
        padding: 0.4rem clamp(0.5rem, 2vw, 0.8rem);
    }
    
    .logo-links-container {
        flex-direction: column;
        gap: 40px;
        margin: 40px auto;
        padding: 40px clamp(20px, 4vw, 40px);
        min-height: calc(100vh - 120px);
    }
    
    .logo-section {
        max-width: 100%;
        text-align: center;
    }
    
    .get-started-container h1,
    .case-study-container h1,
    .team-page-container h1 {
        font-size: clamp(1.75rem, 6vw, 2rem);
    }
    
    .case-study-container h2 {
        font-size: clamp(1.5rem, 5vw, 1.75rem);
    }
    
    .instruction-step {
        padding: clamp(20px, 4vw, 24px);
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-flow: row !important;
        gap: clamp(20px, 4vw, 30px);
        padding: 40px clamp(15px, 4vw, 20px) 0 clamp(15px, 4vw, 20px);
    }
    
    .team-member {
        min-width: 0;
        overflow: hidden;
    }
    
    .team-member img {
        max-width: clamp(120px, 25vw, 180px);
    }
    
    .team-name {
        font-size: clamp(1.1rem, 4vw, 1.35rem);
    }
    
    .team-role {
        font-size: clamp(0.95rem, 3.5vw, 1.15rem);
    }
    
    .team-location {
        font-size: clamp(0.85rem, 3vw, 1rem);
    }
    
    .team-social {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
    
    .logo-links-container {
        gap: 30px;
        padding: 30px clamp(15px, 4vw, 20px);
    }
    
    .links-section a {
        padding: 14px clamp(20px, 6vw, 32px);
        font-size: 0.95rem;
    }
    
    .team-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        grid-auto-flow: row !important;
        gap: clamp(15px, 4vw, 25px);
        padding: 40px clamp(10px, 3vw, 15px) 0 clamp(10px, 3vw, 15px);
    }
    
    .team-member {
        min-width: 0;
        overflow: hidden;
        max-width: 100%;
    }
    
    .team-member img {
        max-width: clamp(100px, 20vw, 140px);
    }
    
    .team-name {
        font-size: clamp(0.95rem, 3.5vw, 1.2rem);
    }
    
    .team-role {
        font-size: clamp(0.9rem, 3vw, 1.05rem);
    }
    
    .team-location {
        font-size: clamp(0.8rem, 2.5vw, 0.95rem);
    }
    
    .team-social {
        flex-wrap: nowrap;
        gap: 8px;
    }
    
    .team-social a {
        width: 36px;
        height: 36px;
    }
    
    .team-social svg {
        width: 20px;
        height: 20px;
    }
}

/* Smooth scrolling for TOC links - merged into main .toc-list a rule */

.case-study-container h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 32px;
    margin-top: 0;
    color: var(--primary-blue-dark);
    font-weight: 800;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="dark"] .case-study-container h1 {
    color: var(--primary-blue-light);
}

.case-study-container h2 {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    margin-top: 56px;
    margin-bottom: 24px;
    color: var(--primary-blue-dark);
    border-bottom: 3px solid var(--gradient-blue);
    padding-bottom: 12px;
    font-weight: 700;
    letter-spacing: -0.01em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

[data-theme="dark"] .case-study-container h2 {
    color: var(--primary-blue-light);
}

.case-study-container h3 {
    font-size: 1.75rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--primary-blue-dark);
    font-weight: 700;
}

[data-theme="dark"] .case-study-container h3 {
    color: var(--primary-blue-light);
}

.case-study-container h4 {
    font-size: 1.375rem;
    margin-top: 32px;
    margin-bottom: 16px;
    color: var(--primary-blue-dark);
    font-weight: 600;
}

[data-theme="dark"] .case-study-container h4 {
    color: var(--primary-blue-light);
}

.case-study-container p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.05rem;
}

/* Override paragraph margins for team section */
.case-study-container .team-name,
.case-study-container .team-role,
.case-study-container .team-location {
    margin-bottom: 0;
}

.case-study-container ul,
.case-study-container ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

.case-study-container li {
    margin-bottom: 12px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.case-study-container a {
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.case-study-container a:hover {
    color: var(--accent-green);
    border-bottom-color: var(--accent-green);
}

.case-study-container a.link-blue {
    color: var(--primary-blue-light);
    border-bottom-color: transparent;
}

.case-study-container a.link-blue:hover {
    color: var(--primary-blue-light);
    border-bottom-color: var(--primary-blue-light);
}

.diagram-placeholder {
    font-style: italic;
    color: var(--text-muted);
    background: rgba(78, 192, 249, 0.05);
    padding: 20px;
    border-left: 4px solid var(--gradient-primary);
    border-radius: 8px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .diagram-placeholder {
    background: rgba(78, 192, 249, 0.1);
}

/* Diagram image container with light background for visibility */
.diagram-image-container {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 50%;
    text-align: center;
}

[data-theme="dark"] .diagram-image-container {
    background: #ffffff;
    padding: 16px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 50%;
    text-align: center;
}

.diagram-image-container img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Larger diagram container for important diagrams */
.diagram-image-container-large {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    text-align: center;
}

[data-theme="dark"] .diagram-image-container-large {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 100%;
    text-align: center;
}

.diagram-image-container-large img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Medium diagram container for 75% width */
.diagram-image-container-medium {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 75%;
    text-align: center;
}

[data-theme="dark"] .diagram-image-container-medium {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    margin: 24px auto;
    box-shadow: var(--shadow-md);
    max-width: 75%;
    text-align: center;
}

.diagram-image-container-medium img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Image Modal Styles - Make all diagram containers clickable */
.diagram-image-container,
.diagram-image-container-medium,
.diagram-image-container-large,
.image-modal-trigger {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.diagram-image-container:hover,
.diagram-image-container-medium:hover,
.diagram-image-container-large:hover,
.image-modal-trigger:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.image-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
}

[data-theme="dark"] .image-modal-overlay {
    background: rgba(27, 34, 73, 0.98);
}

.image-modal-content {
    position: relative;
    z-index: 10001;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.image-modal-img {
    max-width: 100%;
    max-height: 95vh;
    height: auto;
    width: auto;
    object-fit: contain;
    border-radius: 8px;
}

.image-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: var(--accent-red);
    font-size: 48px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10002;
    line-height: 1;
    padding: 0;
}

.image-modal-close:hover {
    background: rgba(237, 72, 72, 0.1);
    transform: rotate(90deg);
}

[data-theme="dark"] .image-modal-close {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-red);
}

[data-theme="dark"] .image-modal-close:hover {
    background: rgba(237, 72, 72, 0.2);
}

/* Offset for anchor links to account for fixed header */
#case-study {
    scroll-margin-top: 80px;
}

/* Team Section Styles */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: row;
    gap: clamp(20px, 4vw, 30px);
    margin: 40px 0 0 0;
    padding: 40px clamp(20px, 4vw, 40px) 0 clamp(20px, 4vw, 40px);
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: hidden;
}

.team-member {
    text-align: center;
    transition: transform 0.3s ease;
    min-width: 0;
    overflow: hidden;
    word-wrap: break-word;
}

.team-member:hover {
    transform: translateY(-8px);
}

.team-member img {
    width: 100%;
    max-width: 240px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    aspect-ratio: 1;
    margin-bottom: 20px;
    box-shadow: var(--shadow-lg);
    border: 3px solid var(--bg-white);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

[data-theme="dark"] .team-member img {
    border: 3px solid var(--bg-card);
}

.team-member:hover img {
    box-shadow: var(--shadow-xl);
    border-color: var(--accent-green);
}

.team-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 4px 0 1px 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: none;
}

.team-role {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin: 0 0 1px 0;
    font-weight: 500;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.team-location {
    font-size: 1rem;
    color: var(--text-muted);
    margin: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.team-social {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 12px;
}

.team-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    transition: color 0.2s ease, background 0.2s ease;
    border-radius: 6px;
    border: none;
    border-bottom: none;
    text-decoration: none;
    position: relative;
}

/* Email icon hover - light blue */
.team-social a[href^="mailto:"]:hover {
    color: var(--primary-blue-light);
    background: rgba(78, 192, 249, 0.1);
}

/* GitHub icon hover - pink */
.team-social a[href*="github.com"]:hover {
    color: var(--accent-pink);
    background: rgba(255, 133, 218, 0.1);
}

/* LinkedIn icon hover - red */
.team-social a[href*="linkedin.com"]:hover {
    color: var(--accent-red);
    background: rgba(237, 72, 72, 0.1);
}

.team-social svg {
    width: 24px;
    height: 24px;
}

/* Team Page Styles */
.team-page-container {
    max-width: 1000px;
    margin: 80px auto 0 auto;
    padding: 0 clamp(20px, 4vw, 40px) 40px clamp(20px, 4vw, 40px);
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    box-sizing: border-box;
}

.team-page-container h1 {
    font-size: clamp(2rem, 6vw, 3rem);
    text-align: center;
    margin-bottom: 60px;
    color: var(--gradient-blue);
    font-weight: 800;
    letter-spacing: -0.02em;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

