/* ========================================
   Tendril Studio Clone - Main Stylesheet
   ======================================== */

/* CSS Variables with fallbacks for older browsers */
:root {
    --color-black: #000000;
    --color-white: #ffffff;
    --color-gray-100: #fbfbfb;
    --color-gray-200: #f5f5f5;
    --color-gray-300: #e5e5e5;
    --color-gray-400: #cccccc;
    --color-gray-500: #9b9b9b;
    --color-gray-600: #7c7c7c;
    --color-gray-700: #4a4a4a;
    --color-gray-800: #2b2b2b;
    --color-gray-900: #1a1a1a;

    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fallback for browsers that don't support CSS Variables (IE11) */
@supports not (--css: variables) {
    /* These will be used as fallbacks in the individual rules */
}

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

html {
    scroll-behavior: smooth;
    /* Fallback for browsers that don't support smooth scroll */
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: var(--font-primary);
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-gray-800);
    background-color: var(--color-white);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent infinite scaling on ultra-wide screens */
    max-width: 1920px;
    margin: 0 auto;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-gray-600);
}

img,
video {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Navigation
   ======================================== */
.navbar {
    /* Base background for all browsers */
    background-color: rgba(0, 0, 0, 0.5);
    padding: 1.5rem 0;
    -webkit-transition: background-color 0.4s ease, padding 0.4s ease;
    -o-transition: background-color 0.4s ease, padding 0.4s ease;
    transition: background-color 0.4s ease, padding 0.4s ease;
    z-index: 9999 !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    /* Backdrop filter with fallback */
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

/* Enhanced backdrop for browsers that support it */
@supports (backdrop-filter: blur(5px)) or (-webkit-backdrop-filter: blur(5px)) {
    .navbar {
        background-color: rgba(0, 0, 0, 0.3);
    }
}

.navbar.scrolled {
    background-color: rgba(0, 0, 0, 0.95);
    padding: 1rem 0;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

/* Ensure navbar background is solid in Edge and older browsers */
@supports not (backdrop-filter: blur(5px)) {
    .navbar {
        background-color: rgba(0, 0, 0, 0.85) !important;
    }

    .navbar.scrolled {
        background-color: rgba(0, 0, 0, 0.98) !important;
    }
}

/* Ensure navbar is always visible */
.navbar,
.navbar * {
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar-brand,
.navbar-nav,
.navbar-toggler {
    visibility: visible !important;
    opacity: 1 !important;
}

.navbar-brand {
    /* Fallback color for browsers without CSS variables */
    color: #ffffff !important;
    color: var(--color-white) !important;
    -webkit-transition: opacity 0.2s ease, transform 0.2s ease;
    -o-transition: opacity 0.2s ease, transform 0.2s ease;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar-brand svg {
    width: 48px;
    height: 48px;
}

.navbar-brand:hover {
    opacity: 0.7;
}

.navbar-nav {
    /* Fallback for browsers that don't support gap */
    margin-left: -0.25rem;
    margin-right: -0.25rem;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Modern gap property */
    gap: 0.5rem;
}

.navbar-nav>.nav-item {
    /* Fallback spacing for browsers without gap support */
    margin-left: 0.25rem;
    margin-right: 0.25rem;
}

.navbar-nav .nav-link {
    /* Fallback color for browsers without CSS variables */
    color: #ffffff !important;
    color: var(--color-white) !important;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1.5rem !important;
    opacity: 0.85;
    -webkit-transition: opacity 0.2s ease;
    -o-transition: opacity 0.2s ease;
    transition: opacity 0.2s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    opacity: 1;
}

/* Navigation Divider */
.nav-item-divider {
    padding: 0 !important;
}

.nav-divider {
    display: block;
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.5rem;
}

/* Login/Signup Buttons */
.nav-link-login {
    opacity: 0.9 !important;
    padding: 0.5rem 1.25rem !important;
    font-size: 1.1rem !important;
    font-weight: 500 !important;
}

.nav-link-signup {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 6px !important;
    padding: 0.6rem 1.75rem !important;
    font-size: 1.1rem !important;
    opacity: 1 !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: all var(--transition-fast) !important;
    font-weight: 500 !important;
    position: relative;
    overflow: hidden;
}

.nav-link-signup::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link-signup:hover::before {
    left: 100%;
}

.nav-link-signup:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    -webkit-transform: translateY(-1px);
    -ms-transform: translateY(-1px);
    transform: translateY(-1px);
    -webkit-box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* User Dropdown */
.nav-link-user {
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Fallback for gap */
    padding: 0.4rem 0.75rem !important;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1) !important;
    -webkit-border-radius: 8px !important;
    border-radius: 8px !important;
    opacity: 1 !important;
    -webkit-transition: all 0.2s ease !important;
    -o-transition: all 0.2s ease !important;
    transition: all 0.2s ease !important;
}

.nav-link-user:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-white);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.user-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.dropdown-menu {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    min-width: 220px;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.9);
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Fallback for gap */
    margin-left: -0.375rem;
    margin-right: -0.375rem;
    gap: 0.75rem;
    -webkit-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.dropdown-item>* {
    margin-left: 0.375rem;
    margin-right: 0.375rem;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-white);
}

.dropdown-item svg {
    opacity: 0.7;
}

.dropdown-item:hover svg {
    opacity: 1;
}

.dropdown-header {
    padding: 0.75rem 1.25rem;
}

.user-info {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
    /* Fallback for gap */
    margin-top: -0.125rem;
    margin-bottom: -0.125rem;
    gap: 0.25rem;
}

.user-info>* {
    margin-top: 0.125rem;
    margin-bottom: 0.125rem;
}

.user-info strong {
    color: var(--color-white);
    font-size: 0.95rem;
}

.user-info small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
}

.dropdown-divider {
    border-color: rgba(255, 255, 255, 0.1);
    margin: 0.5rem 0;
}

.navbar-toggler {
    border: none;
    padding: 0;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 600px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 50%, #16213e 100%);
    border: none;
    outline: none;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height:1700px;
}

.hero-media {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.hero-video {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    transform: translateY(15%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9) 0%, rgba(15, 15, 30, 0.95) 50%, rgba(22, 33, 62, 0.9) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

.hero-audience {
    margin-bottom: 2rem;
}

.audience-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.hero-headline {
    margin-bottom: 2rem;
}

.hero-title {
    color: #fff;
    font-size: 3.5rem;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.hero-description {
    margin-bottom: 3rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.25rem;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    max-width: 700px;
}

.hero-video-container {
    margin: 3rem 0;
    width: 100%;
    max-width: 800px;
}

.hero-center-video {
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    background: #000;
}

.hero-conversation {
    margin: 2.5rem 0;
    text-align: center;
    max-width: 900px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.conversation-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.3rem;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    flex: 1;
    min-width: 300px;
}

.conversation-cta {
    display: inline-block;
    background: linear-gradient(45deg, #25D366, #128C7E);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.conversation-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.conversation-cta:hover::before {
    left: 100%;
}

.conversation-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(37, 211, 102, 0.4);
    background: linear-gradient(45deg, #128C7E, #25D366);
}

.conversation-cta-text {
    position: relative;
    z-index: 1;
}

.hero-hook {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-badge {
    display: inline-block;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.25rem;
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    font-weight: 300;
    line-height: 1.6;
    max-width: 700px;
    margin: 1.5rem auto 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-value-props {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
    width: 100%;
    max-width: 900px;
}

.value-prop {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.value-prop:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.value-icon {
    font-size: 2rem;
    line-height: 1;
    flex-shrink: 0;
}

.value-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.value-text strong {
    color: #FFD700;
    font-size: 1.1rem;
    font-weight: 600;
}

.value-text span {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.4;
}

.hero-ctas {
    display: flex;
    gap: 1.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.cta-primary {
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #000;
    padding: 1.25rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.4);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.cta-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.cta-primary:hover::before {
    left: 100%;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(255, 215, 0, 0.6);
}

.cta-secondary {
    background: transparent;
    color: #fff;
    padding: 1.25rem 2.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.cta-text {
    font-size: 1rem;
    line-height: 1.2;
}

.cta-subtext {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0.5px;
}

.hero-credibility {
    display: flex;
    gap: 3rem;
    margin-top: 3rem;
    justify-content: center;
    flex-wrap: wrap;
}

.credibility-item {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.credibility-number {
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(45deg, #FFD700, #FF6B35);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.credibility-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ensure hero video and overlay don't cover navbar */
.hero-video,
.hero-media,
.hero-overlay {
    z-index: 0;
}

.hero-title {
    background: linear-gradient(45deg, #FFD700, #FF6B35, #FF1744, #D500F9, #2979FF);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-size: 2.5rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.2;
    max-width: 1000px;
    text-align: center;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    animation: gradientShift 4s ease-in-out infinite;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 auto;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    25% {
        background-position: 50% 0%;
    }

    50% {
        background-position: 100% 50%;
    }

    75% {
        background-position: 50% 100%;
    }
}

.hero-scroll-text {
    position: relative;
    width: 100%;
    padding: 2rem 5% 3rem;
    z-index: 10;
    opacity: 0;
    -webkit-transform: translateY(30px);
    -ms-transform: translateY(30px);
    transform: translateY(30px);
    will-change: opacity, transform;
    -webkit-transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    -o-transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transition: opacity 1s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    background-color: var(--color-white);
    margin: 0;
    border: none;
    outline: none;
}

.hero-scroll-text.visible {
    opacity: 1;
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

.hero-scroll-text-content {
    color: var(--color-gray-800);
    font-size: 0.85rem;
    font-weight: 400;
    text-align: center;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    margin: 0;
}

/* Hero scroll fade effect */
@keyframes heroFadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        pointer-events: none;
    }
}

.hero {
    animation: heroFadeOut linear both;
    animation-timeline: view();
    animation-range: exit 25% exit 85%;
}

.hero .hero-video,
.hero .hero-overlay {
    animation: heroFadeOut linear both;
    animation-timeline: view();
    animation-range: exit 25% exit 85%;
}

/* ========================================
   Portfolio Grid
   ======================================== */
.portfolio-section {
    padding: 6rem 0;
    background-color: var(--color-white);
}

.portfolio-header {
    margin-bottom: 4rem;
}

.portfolio-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-gray-800);
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.portfolio-controls {
    margin-top: 2rem;
}

.search-box {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-gray-800);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    color: var(--color-gray-500);
    pointer-events: none;
}

.sort-box {
    width: 100%;
}

.sort-box .form-label {
    display: block;
    margin-bottom: 0.25rem;
}

.sort-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--color-gray-300);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--color-white);
    cursor: pointer;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.sort-select:focus {
    outline: none;
    border-color: var(--color-gray-800);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.results-count {
    font-size: 0.9rem;
    color: var(--color-gray-500);
    margin-bottom: 1rem;
}

.portfolio-filters {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-flex-wrap: wrap;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    /* Fallback for gap */
    margin: -0.25rem -0.5rem;
    gap: 0.5rem 1rem;
}

.portfolio-filters>* {
    margin: 0.25rem 0.5rem;
}

.filter-btn {
    background: none;
    border: none;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--color-gray-500);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.filter-btn:hover,
.filter-btn.active {
    color: var(--color-gray-800);
}

.portfolio-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 350px), 1fr));
    /* Fallback for gap */
    margin: -2rem -1rem;
    gap: 4rem 2rem;
}

.portfolio-grid>* {
    margin: 2rem 1rem;
}

@media (max-width: 576px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

.portfolio-item {
    display: block;
    position: relative;
    overflow: hidden;
}

.portfolio-item-media {
    position: relative;
    width: 100%;
    padding-bottom: 66.67%;
    overflow: hidden;
    background-color: var(--color-gray-200);
}

.portfolio-item-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -webkit-transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    -o-transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

/* Video element in portfolio item */
.portfolio-item-media video.portfolio-item-image {
    -o-object-fit: cover;
    object-fit: cover;
    background-color: #000;
}

.portfolio-item:hover .portfolio-item-image {
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

.portfolio-item-info {
    padding: 1.5rem 0;
}

.portfolio-item-client {
    font-size: 0.85rem;
    color: var(--color-gray-600);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.portfolio-item-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-gray-800);
    margin-bottom: 0.5rem;
    transition: color var(--transition-fast);
}

.portfolio-item:hover .portfolio-item-title {
    color: var(--color-gray-600);
}

.portfolio-item-description {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    margin-bottom: 0.5rem;
    font-weight: 400;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portfolio-item-category {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    font-weight: 400;
}

/* Portfolio List View */
.portfolio-list {
    display: flex;
    flex-direction: column;
}

.portfolio-list-item {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-gray-300);
    transition: background-color var(--transition-fast), transform 0.2s ease;
    text-decoration: none;
    position: relative;
}

.portfolio-list-item:hover {
    background-color: var(--color-gray-100);
    -webkit-transform: translateX(4px);
    -ms-transform: translateX(4px);
    transform: translateX(4px);
}

.portfolio-list-item:first-child {
    border-top: 1px solid var(--color-gray-300);
}

.list-item-client {
    font-size: 0.95rem;
    color: var(--color-gray-800);
    font-weight: 400;
}

.list-item-title {
    font-size: 0.95rem;
    color: var(--color-gray-800);
    font-weight: 400;
    transition: color var(--transition-fast);
}

.portfolio-list-item:hover .list-item-title {
    color: var(--color-gray-600);
}

.list-item-category {
    font-size: 0.95rem;
    color: var(--color-gray-500);
    text-align: right;
    font-weight: 400;
}

@media (max-width: 768px) {
    .portfolio-list-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .list-item-category {
        text-align: left;
    }
}

/* ========================================
   Project Detail
   ======================================== */
.project-hero {
    width: 100%;
    height: 100vh;
    min-height: 600px;
    max-height: 900px;
    background-color: var(--color-gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    will-change: transform;
}

.project-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
    pointer-events: none;
}

.project-hero-image {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -o-object-position: center;
    object-position: center;
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
    -webkit-transition: transform 0.3s ease-out;
    -o-transition: transform 0.3s ease-out;
    transition: transform 0.3s ease-out;
    display: block !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    background-color: var(--color-gray-900);
}

.project-hero-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 2rem;
    z-index: 0;
    position: relative;
}

.project-hero-video {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.project-hero-media {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
    -webkit-transition: transform 0.3s ease-out;
    -o-transition: transform 0.3s ease-out;
    transition: transform 0.3s ease-out;
    will-change: transform;
}

.project-hero-embed {
    position: relative;
    width: 100%;
    height: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
}

.project-hero-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.project-content-rich {
    margin-top: 2rem;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-gray-700);
}

.project-content-rich h2,
.project-content-rich h3,
.project-content-rich h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.project-content-rich p {
    margin-bottom: 1.5rem;
}

.project-content-rich img {
    max-width: 100%;
    height: auto;
    margin: 2rem 0;
    border-radius: 4px;
}

.project-content-rich ul,
.project-content-rich ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.project-content-rich a {
    color: var(--color-gray-800);
    text-decoration: underline;
}

.project-content {
    padding: 5rem 0;
}

.project-header {
    margin-bottom: 3rem;
}

.project-client {
    font-size: 0.9rem;
    color: var(--color-gray-500);
    margin-bottom: 0.5rem;
}

.project-title {
    font-size: 3rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 400;
    color: var(--color-gray-800);
    line-height: 1.2;
    margin-bottom: 1rem;
}

.project-category {
    font-size: 0.9rem;
    color: var(--color-gray-500);
}

.project-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--color-gray-700);
    max-width: 800px;
}

/* Project Video/Animation Section */
.project-video-section {
    padding: 6rem 0;
    background: linear-gradient(to bottom, var(--color-white) 0%, var(--color-gray-100) 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.project-video-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    padding: 0 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-video-wrapper {
    position: relative;
    max-width: 1200px;
    width: 100%;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    background-color: var(--color-gray-900);
    -webkit-transform: translateY(30px) scale(0.98);
    -ms-transform: translateY(30px) scale(0.98);
    transform: translateY(30px) scale(0.98);
    opacity: 0;
    -webkit-transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    -o-transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    transition: transform 1s cubic-bezier(0.4, 0, 0.2, 1), opacity 1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-video-section.visible .project-video-wrapper {
    -webkit-transform: translateY(0) scale(1);
    -ms-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
    opacity: 1;
}

.project-video-wrapper:hover {
    box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    transform: translateY(-8px) scale(1.01);
}

.project-animation-video {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    background-color: var(--color-gray-900);
    margin: 0 auto;
    -o-object-fit: contain;
    object-fit: contain;
}

/* Video controls styling */
.project-animation-video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.7);
}

.project-animation-video::-webkit-media-controls-play-button,
.project-animation-video::-webkit-media-controls-pause-button {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
}

.project-animation-video::-webkit-media-controls-timeline {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.project-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.02) 50%,
            rgba(0, 0, 0, 0.05) 100%);
    pointer-events: none;
    border-radius: 12px;
    transition: opacity 0.3s ease;
}

.project-video-wrapper:hover .project-video-overlay {
    opacity: 0.7;
}

.project-video-embed {
    position: relative;
    width: 100%;
    max-width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    border-radius: 12px;
    overflow: hidden;
    margin: 0;
}

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

.project-content-rich-section {
    padding: 4rem 0 6rem;
}

/* Project Page Animations & Effects */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-nav-link {
    font-size: 0.9rem;
    color: var(--color-gray-600);
    display: inline-flex;
    align-items: center;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.project-nav-link:hover {
    color: var(--color-gray-800);
    transform: translateX(4px);
}

.project-nav-link svg {
    transition: transform var(--transition-fast);
}

.project-nav-link:hover svg {
    transform: translateX(-2px);
}

/* Parallax effect for hero video */
.project-hero.parallax-active .project-hero-media,
.project-hero.parallax-active .project-hero-image {
    transform: scale(1.1) translateY(var(--parallax-offset, 0px));
}

/* Smooth scroll reveal animations */
.project-content-rich img,
.project-content-rich video {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.project-content-rich img.visible,
.project-content-rich video.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Enhanced project header animations */
.project-header {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s,
        transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

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

.project-title {
    background: linear-gradient(135deg, var(--color-gray-800) 0%, var(--color-gray-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.3s ease;
}

/* Video play/pause overlay effect */
.project-hero-video::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 2;
    pointer-events: none;
    transition: background 0.3s ease;
}

.project-hero-video:hover::after {
    background: rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .project-hero {
        height: 60vh;
        min-height: 400px;
    }

    .fade-in-up {
        transform: translateY(20px);
    }

    .project-video-section {
        padding: 4rem 0;
    }

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

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

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

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

/* ========================================
   Studio Page
   ======================================== */
.studio-hero {
    padding: 10rem 0 5rem;
    background-color: var(--color-white);
}

.studio-intro {
    font-size: 2rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-gray-800);
    max-width: 1000px;
}

.studio-section {
    padding: 5rem 0;
}

.section-title {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-gray-500);
    margin-bottom: 2rem;
}

.team-grid {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    /* Fallback for gap */
    margin: -1rem;
    gap: 2rem;
}

.team-grid>* {
    margin: 1rem;
}

.team-member {
    text-align: center;
}

.team-photo {
    width: 100%;
    /* Fallback for browsers that don't support aspect-ratio */
    height: 0;
    padding-bottom: 100%;
    /* Creates 1:1 aspect ratio */
    aspect-ratio: 1;
    border-radius: 50%;
    -o-object-fit: cover;
    object-fit: cover;
    background-color: var(--color-gray-200);
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
}

.team-photo img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
}

.team-name {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-800);
    margin-bottom: 0.25rem;
}

.team-role {
    font-size: 0.85rem;
    color: var(--color-gray-500);
}

/* ========================================
   Careers Page
   ======================================== */
.careers-hero {
    padding: 10rem 0 5rem;
    background-color: var(--color-white);
}

.careers-intro {
    font-size: 1.75rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-gray-800);
    max-width: 800px;
}

.careers-list {
    padding: 3rem 0 6rem;
}

.career-item {
    display: -ms-grid;
    display: grid;
    -ms-grid-columns: 2fr 1fr 1fr auto;
    grid-template-columns: 2fr 1fr 1fr auto;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Fallback for gap */
    margin-left: -1rem;
    margin-right: -1rem;
    gap: 2rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-gray-300);
    -webkit-transition: background-color 0.2s ease;
    -o-transition: background-color 0.2s ease;
    transition: background-color 0.2s ease;
}

.career-item>* {
    margin-left: 1rem;
    margin-right: 1rem;
}

.career-item:first-child {
    border-top: 1px solid var(--color-gray-300);
}

.career-item:hover {
    background-color: var(--color-gray-100);
}

.career-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-800);
}

.career-department,
.career-location {
    font-size: 0.9rem;
    color: var(--color-gray-500);
}

.career-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--color-gray-800);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    transition: background-color var(--transition-fast);
}

.career-link:hover {
    background-color: var(--color-black);
    color: var(--color-white);
}

@media (max-width: 768px) {
    .career-item {
        grid-template-columns: 1fr auto;
        gap: 1rem;
    }

    .career-department,
    .career-location {
        display: none;
    }
}

/* ========================================
   Contact Page
   ======================================== */
.contact-hero {
    padding: 10rem 0 5rem;
    background-color: var(--color-white);
}

.contact-intro {
    font-size: 2rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-gray-800);
    max-width: 800px;
    margin-bottom: 3rem;
}

.contact-form-section {
    padding: 3rem 0 6rem;
}

.contact-form {
    max-width: 700px;
}

.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-gray-600);
    margin-bottom: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 1rem 0;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-gray-800);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--color-gray-300);
    border-radius: 0;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-gray-800);
    box-shadow: none;
}

.form-control::placeholder {
    color: var(--color-gray-400);
}

textarea.form-control {
    resize: vertical;
    min-height: 150px;
}

.btn-submit {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Fallback for gap */
    padding: 1rem 1.5rem;
    gap: 0.75rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-white);
    background-color: var(--color-gray-800);
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.btn-submit:hover {
    background-color: var(--color-black);
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
    background-color: var(--color-gray-100);
    padding: 6rem 0 3rem;
}

.footer-greeting {
    text-align: center;
    margin-bottom: 5rem;
}

.greeting-text {
    font-size: 2rem;
    /* Fallback for browsers that don't support clamp() */
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--color-gray-800);
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-gray-500);
}

.footer-locations {
    margin-bottom: 4rem;
}

.office-card {
    padding: 2rem;
    background-color: var(--color-white);
    border-radius: 4px;
}

.office-card h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-gray-800);
    margin-bottom: 0.5rem;
}

.office-time {
    font-size: 2rem;
    font-weight: 300;
    color: var(--color-gray-800);
    margin-bottom: 1rem;
}

.office-card address {
    font-style: normal;
    font-size: 0.9rem;
    color: var(--color-gray-600);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.office-card a {
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

.office-card a:hover {
    color: var(--color-gray-800);
}

.footer-newsletter {
    max-width: 400px;
    margin: 0 auto 4rem;
}

.newsletter-form {
    display: flex;
    border-bottom: 1px solid var(--color-gray-400);
}

.newsletter-form input {
    flex: 1;
    padding: 1rem 0;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--color-gray-800);
    background: transparent;
    border: none;
}

.newsletter-form input:focus {
    outline: none;
}

.newsletter-form input::placeholder {
    color: var(--color-gray-500);
}

.newsletter-form button {
    padding: 1rem;
    background: transparent;
    border: none;
    color: var(--color-gray-600);
    cursor: pointer;
    transition: color var(--transition-fast);
}

.newsletter-form button:hover {
    color: var(--color-gray-800);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid var(--color-gray-300);
}

.copyright {
    font-size: 0.85rem;
    color: var(--color-gray-500);
    margin: 0;
}

.social-links {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    /* Fallback for gap */
    margin-left: -0.75rem;
    margin-right: -0.75rem;
    gap: 1.5rem;
}

.social-links>* {
    margin-left: 0.75rem;
    margin-right: 0.75rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-gray-500);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.social-links a:hover {
    color: var(--color-gray-800);
    transform: translateY(-2px);
}

.social-links a svg {
    width: 100%;
    height: 100%;
}

@media (max-width: 576px) {
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ========================================
   Utility Classes
   ======================================== */
.section-spacing {
    padding: 6rem 0;
}

.text-muted-custom {
    color: var(--color-gray-500);
}

.bg-light-custom {
    background-color: var(--color-gray-100);
}

/* Loading Animation */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--color-gray-300);
    border-top-color: var(--color-gray-800);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Alert Messages */
.alert-custom {
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 992px) {
    .navbar-collapse {
        background-color: rgba(0, 0, 0, 0.95);
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        padding: 1rem;
        backdrop-filter: blur(10px);
    }

    .navbar-nav {
        gap: 0;
    }

    .navbar-nav .nav-link {
        padding: 0.75rem 1rem !important;
    }

    .nav-divider {
        display: none;
    }

    /* Hero responsive adjustments */
    .hero-content {
        padding: 1rem;
        max-width: 95%;
    }

    .hero-title {
        font-size: clamp(2rem, 7vw, 3rem);
    }

    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.2rem);
    }

    .hero-video-container {
        margin: 2rem 0;
    }

    .hero-center-video {
        border-radius: 8px;
    }

    .hero-conversation {
        margin: 2rem 0;
        flex-direction: column;
        gap: 1rem;
    }

    .conversation-text {
        font-size: clamp(1rem, 3vw, 1.2rem);
        min-width: auto;
        text-align: center;
    }

    .conversation-cta {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .hero-content {
        padding: 1rem;
        max-width: 95%;
    }

    .audience-badge {
        font-size: 0.7rem;
        padding: 0.4rem 1rem;
    }

    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.8rem);
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    }

    .hero-video-container {
        margin: 2rem 0;
    }

    .hero-center-video {
        border-radius: 6px;
    }

    .hero-conversation {
        margin: 1.5rem 0;
        flex-direction: column;
        gap: 1rem;
    }

    .conversation-text {
        font-size: clamp(0.95rem, 3.5vw, 1.1rem);
        min-width: auto;
        text-align: center;
    }

    .conversation-cta {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
    }

    .hero-ctas {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cta-primary,
    .cta-secondary {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .hero-content {
        padding: 0.5rem;
        max-width: 98%;
    }

    .audience-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.8rem;
    }

    .hero-title {
        font-size: clamp(1.5rem, 9vw, 2.5rem);
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1rem);
    }

    .hero-video-container {
        margin: 1.5rem 0;
    }

    .hero-center-video {
        border-radius: 4px;
    }

    .hero-conversation {
        margin: 1rem 0;
        flex-direction: column;
        gap: 1rem;
    }

    .conversation-text {
        font-size: clamp(0.9rem, 4vw, 1rem);
        min-width: auto;
        text-align: center;
    }

    .conversation-cta {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }

    .cta-primary,
    .cta-secondary {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }

    .cta-subtext {
        font-size: 0.7rem;
    }
}

@media (max-width: 992px) {
    .nav-link-signup {
        margin-top: 0.5rem;
        text-align: center;
    }

    .nav-link-user {
        margin-top: 0.5rem;
    }

    .dropdown-menu {
        position: static !important;
        transform: none !important;
        margin-top: 0.5rem;
        width: 100%;
    }
}

/* Smooth page transitions */
.page-content {
    animation: fadeIn 0.4s ease;
    border: none;
    outline: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll-triggered animations (Tendril-style) */
.portfolio-item,
.portfolio-list-item {
    opacity: 0;
    transform: translateY(20px);
    will-change: opacity, transform;
}

.portfolio-item.animate-in,
.portfolio-list-item.animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Enhanced hover effects */
.portfolio-item.animate-in {
    transition: opacity 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        box-shadow 0.3s ease;
}

.portfolio-item.animate-in:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Hover Preview Box (Tendril-style)
   ======================================== */
.hover-preview {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    opacity: 0 !important;
    visibility: hidden !important;
    display: none !important;
    transform: translate(-50%, -50%) scale(0.8);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.3s;
    will-change: transform, opacity;
}

.hover-preview.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.hover-preview-content {
    position: relative;
    width: 320px;
    height: 220px;
    background-color: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
    transform-origin: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.hover-preview-image {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
}

.hover-preview-video {
    width: 100%;
    height: 100%;
    -o-object-fit: cover;
    object-fit: cover;
    display: block;
    background-color: #000;
}

/* Ensure video is visible and plays */
.hover-preview-video::-webkit-media-controls {
    display: none !important;
}

.hover-preview-video::-webkit-media-controls-enclosure {
    display: none !important;
}

@media (max-width: 768px) {
    .hover-preview {
        display: none;
    }
}

@media (max-width: 992px) {
    .hover-preview-content {
        width: 280px;
        height: 190px;
    }
}

/* Work page list item hover preview */
.portfolio-list-item {
    position: relative;
    cursor: pointer;
}

.portfolio-list-item .list-item-title {
    position: relative;
    display: inline-block;
}

/* Index page grid item hover preview */
.portfolio-item-title {
    position: relative;
    display: inline-block;
}

/* Smooth filter transitions */
.portfolio-list-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Loading spinner enhancement */
.portfolio-loading .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--color-gray-300);
    border-top-color: var(--color-gray-800);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* Enhanced button styles */
.filter-btn {
    position: relative;
    transition: all 0.3s ease;
}

.filter-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-gray-800);
    transition: width 0.3s ease;
}

.filter-btn.active::after,
.filter-btn:hover::after {
    width: 100%;
}

/* Improved responsive design */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .project-hero {
        height: 60vh;
        min-height: 400px;
    }

    .hero-title {
        font-size: 1.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========================================
   Browser Compatibility Fallbacks
   ======================================== */

/* Edge and Mobile Browser Specific Fixes */
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {

    /* IE11 and Edge Legacy fixes */
    .navbar {
        background-color: rgba(0, 0, 0, 0.85) !important;
    }

    .navbar-nav {
        display: -ms-flexbox;
        -ms-flex-wrap: wrap;
        -ms-flex-direction: row;
        -webkit-flex-direction: row;
        flex-direction: row;
        -webkit-flex-wrap: wrap;
        flex-wrap: wrap;
    }

    .navbar-nav .nav-item {
        margin: 0 0.25rem;
    }
}

/* Mobile browser fixes (Brave, Chrome Mobile, etc.) */
@media screen and (max-width: 768px) {
    .navbar {
        /* Ensure solid background on mobile */
        background-color: rgba(0, 0, 0, 0.9) !important;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .navbar.scrolled {
        background-color: rgba(0, 0, 0, 0.98) !important;
    }

    /* Fix for mobile browsers that don't support backdrop-filter well */
    @supports not (backdrop-filter: blur(5px)) {
        .navbar {
            background-color: rgba(0, 0, 0, 0.95) !important;
        }
    }

    /* Brave mobile specific fixes */
    .nav-link-signup {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: rgba(255, 255, 255, 0.2) !important;
    }

    .dropdown-menu {
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        background: rgba(0, 0, 0, 0.98) !important;
    }
}

/* Ensure header styles work in all browsers */
.navbar-brand svg {
    display: block;
    width: 32px;
    height: 32px;
    fill: currentColor;
}

/* Fix for Edge and older browsers - ensure white text */
.navbar-nav .nav-link,
.navbar-brand {
    color: #ffffff !important;
}

/* Override with CSS variable if supported */
@supports (--css: variables) {

    .navbar-nav .nav-link,
    .navbar-brand {
        color: var(--color-white) !important;
    }
}

/* Fallback for browsers that don't support CSS Grid */
@supports not (display: grid) {
    .portfolio-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .portfolio-grid .portfolio-item {
        flex: 0 0 calc(33.333% - 2rem);
        margin: 1rem;
    }

    @media (max-width: 768px) {
        .portfolio-grid .portfolio-item {
            flex: 0 0 100%;
        }
    }

    .team-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .team-grid .team-member {
        flex: 0 0 calc(25% - 2rem);
        margin: 1rem;
    }
}

/* Fallback for browsers that don't support backdrop-filter */
@supports not (backdrop-filter: blur(5px)) {
    .navbar {
        background-color: rgba(0, 0, 0, 0.8) !important;
    }

    .navbar.scrolled {
        background-color: rgba(0, 0, 0, 0.95) !important;
    }

    .dropdown-menu {
        background-color: rgba(0, 0, 0, 0.98) !important;
    }

    .nav-link-signup {
        background: rgba(255, 255, 255, 0.2) !important;
    }
}

/* Fallback for browsers that don't support CSS Variables */
@supports not (--css: variables) {
    /* Fallback styles would go here if needed */

    body {
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        color: #2b2b2b;
        background-color: #ffffff;
    }

    .navbar {
        background-color: rgba(0, 0, 0, 0.8);
    }

    .navbar-brand,
    .navbar-nav .nav-link {
        color: #ffffff !important;
    }
}

/* Smooth scrolling fallback */
@supports not (scroll-behavior: smooth) {
    html {
        scroll-behavior: auto;
    }
}

/* Transform fallbacks with vendor prefixes */
.portfolio-item-image,
.project-hero-image,
.project-hero-media {
    -webkit-transform: scale(1);
    -ms-transform: scale(1);
    transform: scale(1);
}

.portfolio-item:hover .portfolio-item-image {
    -webkit-transform: scale(1.05);
    -ms-transform: scale(1.05);
    transform: scale(1.05);
}

/* Transition fallbacks */
.portfolio-item-image,
.project-hero-image,
.project-hero-media {
    -webkit-transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    -o-transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flexbox fallback for older browsers */
.portfolio-filters,
.navbar-nav,
.social-links,
.newsletter-form {
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
}

/* Grid fallback */
.portfolio-grid,
.team-grid {
    display: -ms-grid;
    display: grid;
}

/* Border-radius fallback */
.nav-link-signup,
.dropdown-menu,
.office-card,
.project-video-wrapper {
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    border-radius: 8px;
}

/* Box-shadow fallback */
.project-video-wrapper {
    -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    -moz-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* ========================================
   Responsive Adjustments (Mobile Check)
   ======================================== */
@media (max-width: 800px) {

    /* Prevent body overflow that forces mobile zoom out */
    html,
    body {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Enlarge Navbar details so they are legible without zooming */
    .navbar {
        padding: 1rem 0;
    }

    .navbar-brand svg {
        width: 42px;
        height: 42px;
    }

    .navbar-toggler {
        transform: scale(1.2);
    }

    .navbar-nav .nav-link {
        font-size: 1.15rem !important;
        padding: 0.75rem 1rem !important;
    }

    .nav-link-user {
        font-size: 1.15rem;
    }

    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .nav-link-signup,
    .nav-link-login {
        font-size: 1.15rem !important;
        padding: 0.8rem 1.5rem !important;
        display: block;
        text-align: center;
    }
}