/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #ec4899;
    --dark: #0f172a;
    --light: #f8fafc;
    --gray: #64748b;
    --card-bg: rgba(255, 255, 255, 0.05);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--light);
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    position: relative;
}

html {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    scroll-behavior: smooth;
    box-sizing: border-box;
}

*, *::before, *::after {
    box-sizing: inherit;
}

/* Navigation */
nav {
    padding: 20px 0;
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

nav.scrolled {
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

nav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--light);
    text-decoration: none;
    transition: color 0.3s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

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

/* Hero Section */
.hero {
    margin-top: 80px;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease-in;
}

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

.hero-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: center;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.bio {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #cbd5e1;
    margin-bottom: 20px;
}

.contact-row {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 25px;
    color: var(--light);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.95rem;
}

.contact-link:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* Primary CTA - CV Download */
.cv-link {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 28px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.cv-link:hover {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* Profile Photo */
.profile-photo {
    position: relative;
}

.photo-container {
    width: 350px;
    height: 350px;
    border-radius: 30px;
    overflow: hidden;
    border: 3px solid rgba(99, 102, 241, 0.3);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(236, 72, 153, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
}

.photo-placeholder {
    font-size: 6rem;
    color: var(--primary);
    display: none;
    position: absolute;
}

/* Stats Section */
.stats {
    padding: 40px 20px;
    background: rgba(99, 102, 241, 0.05);
}

.stats-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 30px;
    justify-items: center;
    padding: 0 20px;
}

@media (max-width: 1200px) {
    .stats-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    max-width: 240px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: var(--gray);
    margin-top: 10px;
}

/* Case Studies Section */
.cases {
    padding: 50px 20px;
    width: 100%;
    overflow-x: hidden;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    background: linear-gradient(135deg, var(--light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cases-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    gap: 30px;
    width: 100%;
}

/* Case Card */
.case-study {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.case-study:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 60px rgba(99, 102, 241, 0.2);
}

/* ========================================
   FEATURED CASE STUDY COMPONENT
   ========================================

   Usage:
   <div class="case-study case-study-featured theme-[game]">

   Available Themes:
   - theme-mttf2: Gold border (My Talking Tom Friends 2)
   - theme-stackball: Purple border (Stack Ball)
   - theme-ttgr: Orange border (Talking Tom Gold Run)
   - theme-generic: Default blue border

   Structure:
   .case-study-featured
     └── .featured-layout (2-col grid on desktop, 1-col on mobile)
         ├── .featured-media (sticky gallery on desktop)
         │   ├── .gallery-main (main display)
         │   └── .media-gallery-thumbs (thumbnail strip)
         └── .featured-content (text content)
             └── .case-section (sections with left border)
*/

/* Base Featured Case - No Colors (structure only) */
.case-study-featured {
    /* Override default case-study padding */
    padding: 20px;
}

/* Game Theme Modifiers - Add color schemes */
.case-study-featured.theme-mttf2 {
    border: 2px solid #fbbf24 !important; /* Gold */
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05), rgba(99, 102, 241, 0.05)) !important;
}

.case-study-featured.theme-stackball {
    border: 2px solid #a855f7 !important; /* Purple */
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.05), rgba(99, 102, 241, 0.05)) !important;
}

.case-study-featured.theme-generic {
    border: 2px solid var(--primary) !important; /* Blue */
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(236, 72, 153, 0.05)) !important;
}

.case-study-featured.theme-ttgr {
    border: 2px solid #f97316 !important; /* Orange */
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), rgba(239, 68, 68, 0.05)) !important;
}

.case-study-featured.theme-tthd {
    border: 2px solid #ef4444 !important; /* Red/Crimson - Superhero theme */
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.05), rgba(220, 38, 38, 0.05)) !important;
}

/* Portfolio Hero: Cinematic visual representation */
.portfolio-hero {
    position: relative;
    margin: 20px 0;
    height: 350px;
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.08) 0%,
        rgba(99, 102, 241, 0.05) 50%,
        rgba(168, 85, 247, 0.08) 100%
    );
    border-radius: 12px;
    overflow: hidden;
}

.portfolio-scatter {
    position: absolute;
    width: 100%;
    height: 100%;
}

.icon-float {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
    pointer-events: none;
}

.icon-float img {
    width: 100%;
    height: 100%;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Featured icons - stand out with glow */
.icon-float.featured img {
    box-shadow: 0 6px 30px rgba(168, 85, 247, 0.4),
                0 0 40px rgba(168, 85, 247, 0.2);
    border: 2px solid rgba(168, 85, 247, 0.3);
}

/* Faded icons - duplicates representing other titles */
.icon-float.faded {
    opacity: 0.25;
}

.icon-float.faded img {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    filter: grayscale(30%) brightness(0.9);
}

/* Placeholder blocks representing other titles */
.icon-placeholder {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--size);
    height: var(--size);
    background: linear-gradient(135deg,
        rgba(168, 85, 247, 0.15),
        rgba(99, 102, 241, 0.1)
    );
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
    pointer-events: none;
    opacity: 0.5;
}

/* Subtle floating animation */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* Hero text overlay - Main statement */
.portfolio-hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 30px;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(12px);
    padding: 35px 50px;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.hero-stat {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    text-align: center;
}

.hero-arrow {
    font-size: 2rem;
    color: var(--primary);
    font-weight: bold;
}

/* Portfolio Hero - Responsive */
@media (max-width: 768px) {
    .portfolio-hero-text {
        flex-direction: column;
        gap: 15px;
        padding: 25px 30px;
        max-width: 90%;
    }

    .hero-stat {
        font-size: 1.2rem;
    }

    .hero-arrow {
        font-size: 1.5rem;
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .portfolio-hero {
        height: 400px;
    }

    .portfolio-hero-text {
        padding: 20px 25px;
        gap: 12px;
    }

    .hero-stat {
        font-size: 1rem;
    }

    .hero-arrow {
        font-size: 1.2rem;
    }
}

@media (max-width: 375px) {
    .portfolio-hero-text {
        padding: 18px 20px;
        gap: 10px;
    }

    .hero-stat {
        font-size: 0.9rem;
    }

    .hero-arrow {
        font-size: 1rem;
    }
}

.case-study-featured .featured-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-top: 15px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

/* Left Column: Gallery + Narrative */
.featured-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.featured-media {
    max-width: 600px;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0 auto;
}

.featured-narrative {
    display: grid;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
}

/* Expandable Section */
.expandable-section {
    width: 100%;
}

.expand-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    justify-content: center;
}

.expand-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-1px);
}

.expand-icon {
    transition: transform 0.3s;
    font-size: 0.8rem;
}

.expand-btn.expanded .expand-icon {
    transform: rotate(180deg);
}

.expandable-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
    display: grid;
    gap: 15px;
}

.expandable-content.expanded {
    max-height: 2000px;
    margin-top: 15px;
    transition: max-height 0.6s ease-in;
}

/* Right Column: Impact */
.featured-impact {
    width: 100%;
    box-sizing: border-box;
    position: sticky;
    top: 100px;
    align-self: start;
}

.featured-impact h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.impact-details {
    margin-top: 20px;
}

.impact-details ul {
    list-style: none;
    padding-left: 0;
}

.impact-details li {
    padding: 8px 0;
    position: relative;
    padding-left: 20px;
    color: #cbd5e1;
    line-height: 1.6;
}

.impact-details li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Gallery Main Display */
.gallery-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    background: #000;
    box-sizing: border-box;
    min-width: 0;
}

.gallery-item {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.gallery-item.active {
    display: block;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

.gallery-item.case-video {
    position: absolute;
    padding-bottom: 0;
    height: 100%;
}

.gallery-item.case-video iframe {
    border-radius: 0;
}

/* Thumbnail Gallery */
.media-gallery-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    max-width: 600px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.5) rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    box-sizing: border-box;
}

.media-gallery-thumbs::-webkit-scrollbar {
    height: 6px;
}

.media-gallery-thumbs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.media-gallery-thumbs::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.5);
    border-radius: 10px;
}

.media-gallery-thumbs::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.8);
}

.thumb-item {
    width: 100px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.thumb-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.thumb-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-video {
    background: rgba(99, 102, 241, 0.2);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: bold;
    font-size: 0.9rem;
}

/* Portrait Gallery Variant - For Mobile Screenshots (9:16) */
.featured-media.gallery-portrait {
    max-width: 400px;
}

.gallery-portrait .gallery-main {
    aspect-ratio: 9 / 11;
    max-width: 400px;
}

.gallery-portrait .media-gallery-thumbs {
    max-width: 400px;
    gap: 8px;
}

.gallery-portrait .thumb-item {
    width: 45px;
    height: 55px;
}

.gallery-portrait .thumb-item img {
    object-fit: cover;
}

.featured-content {
    display: grid;
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.content-section {
    width: 100%;
    box-sizing: border-box;
}

.content-section h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.featured-content .case-section {
    padding-left: 12px;
    border-left: 3px solid rgba(99, 102, 241, 0.3);
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.featured-content .case-tags {
    margin-top: 12px;
}

/* Store Links */
.store-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
}

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 25px;
    color: var(--primary);
    text-decoration: none;
    font-size: clamp(0.8rem, 1.2vw + 0.2rem, 0.9rem);
    transition: all 0.3s;
    box-sizing: border-box;
    white-space: nowrap;
}

.store-link:hover {
    background: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.store-link svg {
    flex-shrink: 0;
}

/* Media Section */
.case-media {
    margin: 15px 0;
    border-radius: 15px;
    overflow: hidden;
}

.case-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 15px;
    background: #000;
}

.case-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.case-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.case-image {
    border-radius: 10px;
    overflow: hidden;
    background: rgba(99, 102, 241, 0.1);
    aspect-ratio: 16/9;
    cursor: pointer;
    transition: transform 0.3s;
}

.case-image:hover {
    transform: scale(1.05);
}

.case-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-caption {
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    margin-top: 6px;
    font-style: italic;
}

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.company-logo-watermark {
    position: absolute;
    top: 0;
    right: 0;
    width: 80px;
    height: auto;
    opacity: 0.3;
    filter: grayscale(0.3);
    transition: opacity 0.3s, filter 0.3s;
    pointer-events: none;
}

.case-study:hover .company-logo-watermark {
    opacity: 0.5;
    filter: grayscale(0);
}

@media (max-width: 768px) {
    .company-logo-watermark {
        width: 50px;
        opacity: 0.2;
    }

    .case-title-section {
        padding-right: 60px;
    }
}

@media (max-width: 480px) {
    .company-logo-watermark {
        width: 40px;
        opacity: 0.15;
    }

    .case-title-section {
        padding-right: 50px;
    }
}

.case-header-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
    margin-top: 10px;
}

.case-title-section {
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.case-title {
    font-size: clamp(1rem, 2.5vw + 0.5rem, 1.5rem);
    color: var(--light);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

.game-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.case-icon {
    font-size: 1.5rem;
}

.case-company {
    color: var(--gray);
    font-size: clamp(0.85rem, 1.5vw + 0.3rem, 1rem);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    box-sizing: border-box;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.company-badge {
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: clamp(0.75rem, 1.2vw + 0.3rem, 0.9rem);
    display: inline-block;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.award-badge {
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    max-width: 100%;
    text-align: left;
}

.award-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
}

.case-metrics {
    display: flex;
    gap: 20px;
}

.metric {
    text-align: center;
}

.metric-value {
    font-size: clamp(1rem, 1.8vw + 0.3rem, 1.2rem);
    font-weight: bold;
    color: var(--primary);
}

.metric-label {
    font-size: clamp(0.7rem, 1vw + 0.2rem, 0.75rem);
    color: var(--gray);
}

/* Case Content */
.case-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px 20px;
    width: 100%;
    box-sizing: border-box;
}

.case-section {
    padding-left: 12px;
    border-left: 3px solid rgba(99, 102, 241, 0.3);
    width: 100%;
    box-sizing: border-box;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.case-section h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: clamp(0.8rem, 1.2vw + 0.3rem, 0.95rem);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.case-section p,
.case-section ul {
    color: #cbd5e1;
    line-height: 1.5;
    font-size: clamp(0.875rem, 1.2vw + 0.3rem, 0.95rem);
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.case-section ul {
    list-style: none;
    padding-left: 0;
    width: 100%;
}

.case-section li {
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.case-section li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: var(--primary);
}

/* Impact Highlight */
.impact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.impact-item {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 10px;
    border-radius: 12px;
    text-align: center;
}

.impact-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #10b981;
}

.impact-label {
    font-size: 0.8rem;
    color: #cbd5e1;
    margin-top: 4px;
}

/* Tags */
.case-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    width: 100%;
    box-sizing: border-box;
}

.tag {
    padding: 4px 12px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: clamp(0.7rem, 1vw + 0.2rem, 0.8rem);
    color: var(--primary);
    box-sizing: border-box;
    white-space: nowrap;
}

/* Company Logos Section */
/* Companies Section - Hero Area */
.companies-hero {
    padding: 30px 20px 40px 20px;
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.02), transparent);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.companies-hero-title {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 20px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.companies-hero-grid {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 50px;
    flex-wrap: wrap;
}

.company-hero-item {
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(1);
}

.company-hero-item:hover {
    opacity: 1;
    transform: translateY(-2px);
    filter: grayscale(0);
}

.company-hero-logo {
    height: 35px;
    width: auto;
    max-width: 150px;
}

/* Old companies section (removed from bottom) */
.companies {
    padding: 40px 20px;
    background: rgba(99, 102, 241, 0.05);
}

.companies-title {
    text-align: center;
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 30px;
}

.logos-grid {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    flex-wrap: wrap;
}

.company-logo-item {
    opacity: 0.6;
    transition: opacity 0.3s, transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.company-logo-item:hover {
    opacity: 1;
    transform: scale(1.05);
}

.company-logo {
    height: 50px;
    max-width: 180px;
    width: auto;
    object-fit: contain;
}

.company-logo-item img {
    height: 50px;
    max-width: 180px;
    object-fit: contain;
}

.company-name {
    color: var(--gray);
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
footer {
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: var(--secondary);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .profile-photo {
        order: -1;
    }

    .photo-container {
        width: 250px;
        height: 250px;
        margin: 0 auto;
    }

    .contact-row {
        justify-content: center;
    }

    /* Optimize featured layout for tablets */
    .case-study-featured {
        padding: 18px;
    }

    .case-study-featured .featured-layout {
        gap: 22px;
    }

    .featured-media {
        max-width: 550px;
        margin: 0 auto;
    }

    .gallery-main {
        max-width: 550px;
    }

    .media-gallery-thumbs {
        max-width: 550px;
        gap: 9px;
    }

    .thumb-item {
        width: 90px;
        height: 54px;
    }
}

@media (max-width: 768px) {
    nav .container {
        flex-direction: column;
        gap: 15px;
    }

    .nav-links {
        gap: 20px;
    }

    .companies-hero-grid {
        gap: 35px;
    }

    .company-hero-logo {
        height: 30px;
    }

    .cases {
        padding: 40px 16px;
    }

    .cases-grid {
        gap: 20px;
    }

    .case-study {
        padding: 16px;
        margin: 0;
    }

    .case-content {
        grid-template-columns: 1fr;
    }

    .case-study-featured {
        padding: 16px;
    }

    .case-study-featured .featured-layout {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 0;
    }

    .featured-media {
        position: relative;
        top: 0;
        max-width: 100%;
        width: 100%;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    .featured-impact {
        position: relative;
        top: 0;
    }

    .gallery-main {
        max-width: 100%;
        width: 100%;
        border-radius: 8px;
        margin: 0 auto;
        min-width: 0;
    }

    .media-gallery-thumbs {
        max-width: 100%;
        width: 100%;
        padding: 0 0 8px 0;
        margin: 10px auto 0 auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .featured-content {
        padding: 0;
        margin: 0;
    }

    .case-section {
        padding-left: 10px;
        max-width: 100%;
    }

    .case-section p,
    .case-section ul,
    .case-section li {
        max-width: 100%;
        word-break: break-word;
    }

    /* Smaller thumbnails on mobile */
    .thumb-item {
        width: 75px;
        height: 45px;
        flex-shrink: 0;
    }

    .media-gallery-thumbs {
        gap: 8px;
        margin: 10px auto 0 auto;
        padding: 0 0 8px 0;
    }

    .case-metrics {
        flex-direction: column;
        gap: 10px;
    }

    .case-header {
        flex-direction: column;
        gap: 15px;
    }

    .case-metrics {
        width: 100%;
        justify-content: space-around;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .metric {
        flex: 1;
        min-width: 80px;
    }

    .impact-grid {
        grid-template-columns: 1fr;
    }

    .logos-grid {
        gap: 30px;
    }

    .contact-row {
        flex-direction: column;
    }

    .contact-link {
        justify-content: center;
    }

    .store-links {
        justify-content: center;
        flex-wrap: wrap;
    }

    .featured-content {
        width: 100%;
        overflow-x: hidden;
    }
}

/* Mobile Large - Phablets and Large Phones */
@media (max-width: 640px) {
    .cases {
        padding: 30px 12px;
    }

    .case-study {
        padding: 14px;
    }

    .case-study-featured {
        padding: 14px;
    }

    .thumb-item {
        width: 65px;
        height: 39px;
        flex-shrink: 0;
    }

    .media-gallery-thumbs {
        gap: 6px;
        margin: 8px auto 0 auto;
        padding: 0 0 6px 0;
    }

    .case-section {
        padding-left: 9px;
        border-left-width: 2px;
    }

    .case-section li {
        padding-left: 18px;
    }

    .tag {
        padding: 3px 10px;
    }
}

@media (max-width: 480px) {
    .hero {
        margin-top: 120px;
    }

    .hero-text h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1.1rem;
    }

    .bio {
        font-size: 1rem;
    }

    .cases {
        padding: 20px 10px;
    }

    .case-study {
        padding: 10px;
    }

    .case-study-featured {
        padding: 10px;
    }

    .case-title {
        font-size: 1.1rem;
        flex-wrap: wrap;
        word-break: break-word;
    }

    .case-company {
        word-break: break-word;
    }

    .game-icon {
        width: 32px;
        height: 32px;
        flex-shrink: 0;
    }

    .featured-layout {
        gap: 15px;
        padding: 0;
        min-width: 0;
    }

    .featured-media {
        padding: 0;
        margin: 0;
        overflow: hidden;
    }

    .gallery-main {
        margin: 0 auto;
        min-width: 0;
    }

    /* Even smaller thumbnails on small phones */
    .thumb-item {
        width: 60px;
        height: 36px;
        flex-shrink: 0;
    }

    .media-gallery-thumbs {
        gap: 5px;
        margin: 8px auto 0 auto;
        padding: 0 0 6px 0;
    }

    .case-section {
        padding-left: 8px;
        border-left-width: 2px;
    }

    .case-section li {
        padding-left: 16px;
    }

    .case-section h3 {
        font-size: 0.85rem;
    }

    .case-section p,
    .case-section ul,
    .case-section li {
        font-size: 0.9rem;
    }

    .metric-value {
        font-size: 1rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .impact-value {
        font-size: 1rem;
    }

    .impact-label {
        font-size: 0.75rem;
    }

    .tag {
        font-size: 0.75rem;
        padding: 3px 10px;
    }

    .store-link {
        font-size: 0.85rem;
        padding: 8px 16px;
    }

    .company-badge {
        font-size: 0.85rem;
        padding: 3px 10px;
    }

    .award-badge {
        text-align: center;
    }
}

/* Mobile Small - iPhone SE, Small Phones */
@media (max-width: 375px) {
    .cases {
        padding: 20px 8px;
    }

    .case-study {
        padding: 8px;
    }

    .case-study-featured {
        padding: 8px;
    }

    .thumb-item {
        width: 50px;
        height: 30px;
        flex-shrink: 0;
    }

    .media-gallery-thumbs {
        gap: 4px;
        margin: 8px auto 0 auto;
        padding: 0 0 6px 0;
    }

    .case-section {
        padding-left: 6px;
        border-left-width: 2px;
    }

    .case-section li {
        padding-left: 14px;
    }

    .tag {
        padding: 2px 8px;
        font-size: 0.7rem;
    }

    .store-link {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    .game-icon {
        width: 28px;
        height: 28px;
    }

    .featured-layout {
        gap: 12px;
        min-width: 0;
    }

    .featured-media {
        overflow: hidden;
    }

    .gallery-main {
        min-width: 0;
    }

    .company-badge {
        padding: 2px 8px;
        font-size: 0.8rem;
    }
}

/* ============================================
   Image Lightbox Modal
   ============================================ */

.lightbox {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    cursor: default;
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
    user-select: none;
}

.lightbox-close:hover,
.lightbox-close:focus {
    color: #bbb;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Make gallery images clickable */
.gallery-item img {
    cursor: zoom-in;
    transition: opacity 0.3s;
}

.gallery-item img:hover {
    opacity: 0.9;
}
