/* General Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #800000 0%, #000000 100%);
    color: #333;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-top: env(safe-area-inset-top);
}

.container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 20px;
}

.section-title {
    color: #333;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-align: center;
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
    text-align: center;
}

/* Animation Classes */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

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

/* Button Styles */
.btn {
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: inline-block;
    font-weight: 600;
    overflow: hidden;
    padding: 12px 30px;
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    color: #800000;
}

.btn-secondary {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
}

.btn:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
    transition: transform 0.1s;
}

.btn-secondary:hover {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
}

.cta-buttons {
    animation: slideInUp 0.8s ease-out 0.6s both;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Navigation */
nav {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    transition: all 0.3s ease;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 1rem 0;
}

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

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

.nav-links a {
    color: #333;
    font-weight: 500;
    position: relative;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #800000;
}

.nav-links a::after {
    background: linear-gradient(135deg, #800000, #000000);
    bottom: -5px;
    content: '';
    height: 2px;
    left: 0;
    position: absolute;
    transition: width 0.3s ease;
    width: 0;
}

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

/* Hero Section */
.hero {
    color: white;
    overflow: hidden;
    padding: 120px 0 80px;
    position: relative;
    text-align: center;
}

.hero::before {
    animation: float 6s ease-in-out infinite;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><radialGradient id="a" cx="50%" cy="50%"><stop offset="0%" stop-color="%23ffffff" stop-opacity="0.1"/><stop offset="100%" stop-color="%23ffffff" stop-opacity="0"/></radialGradient></defs><circle cx="200" cy="200" r="300" fill="url(%23a)"/><circle cx="800" cy="600" r="200" fill="url(%23a)"/></svg>');
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero h1 {
    animation: slideInUp 0.8s ease-out;
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    animation: slideInUp 0.8s ease-out 0.2s both;
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-description {
    animation: slideInUp 0.8s ease-out 0.4s both;
    font-size: 1.1rem;
    margin: 0 auto 2rem;
    max-width: 600px;
    opacity: 0.8;
}

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

/* Stats Section */
.stats {
    background: white;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    text-align: center;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9ff, #e8ecff);
    border-radius: 20px;
    padding: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
    box-shadow: 0 10px 30px rgba(128, 0, 0, 0.2);
    transform: translateY(-5px);
}

.stat-number {
    background: linear-gradient(135deg, #800000, #000000);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Services Section */
.services {
    background: linear-gradient(135deg, #f8f9ff 0%, #e8ecff 100%);
    padding: 80px 0;
}

.services-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 3rem;
}

.service-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    padding: 2.5rem 2rem;
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
}

.service-card::before {
    background: linear-gradient(135deg, #800000, #000000);
    content: '';
    height: 4px;
    left: -100%;
    position: absolute;
    top: 0;
    transition: left 0.3s ease;
    width: 100%;
}

.service-card:hover::before {
    left: 0;
}

.service-card:hover {
    box-shadow: 0 15px 40px rgba(128, 0, 0, 0.2);
    transform: translateY(-10px);
}

.service-icon {
    align-items: center;
    background: linear-gradient(135deg, #800000, #000000);
    border-radius: 20px;
    color: white;
    display: flex;
    font-size: 2rem;
    height: 80px;
    justify-content: center;
    margin: 0 auto 1.5rem;
    width: 80px;
}

.service-card h3 {
    color: #333;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: #666;
    line-height: 1.6;
}

/* Portfolio Preview */
.portfolio {
    background: white;
    padding: 80px 0;
}

.portfolio-grid {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    margin-top: 3rem;
}

.portfolio-item {
    background: #f8f9ff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.portfolio-media {
    background: #000;
    height: 0;
    overflow: hidden;
    /* 9:16 vertical aspect ratio */
    padding-top: 177.78%; /* 9:16 aspect ratio (16/9 * 100) */
    position: relative;
}

.portfolio-media.vertical {
    /* 9:16 vertical aspect ratio */
    padding-top: 177.78%; /* 9:16 aspect ratio (16/9 * 100) */
}

.portfolio-video {
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    transition: transform 0.3s ease;
    width: 100%;
}

/* Keep this class for backward compatibility but modify it */
.portfolio-media.widescreen {
    /* Now using 9:16 ratio */
    padding-top: 177.78%; /* 9:16 aspect ratio */
}

.portfolio-item:hover .portfolio-video {
    transform: scale(1.05);
}

.video-overlay {
    align-items: center;
    background: linear-gradient(135deg, rgba(128, 0, 0, 0.1), rgba(0, 0, 0, 0.3));
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: opacity 0.3s ease;
}

.portfolio-item:hover .video-overlay {
    opacity: 1;
}

.play-button {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #800000;
    cursor: pointer;
    display: flex;
    font-size: 2rem;
    height: 80px;
    justify-content: center;
    transition: all 0.3s ease;
    width: 80px;
}

.play-button:hover {
    background: white;
    transform: scale(1.1);
}

.video-controls {
    display: none; /* Hide video controls */
}

.control-btn {
    display: none; /* Hide control buttons */
}

.video-info {
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    bottom: 0;
    color: white;
    left: 0;
    padding: 20px 15px 15px;
    position: absolute;
    right: 0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .video-info {
    transform: translateY(0);
}

.video-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.video-description {
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

.portfolio-image {
    align-items: center;
    background: linear-gradient(135deg, #800000, #000000);
    color: white;
    display: flex;
    font-size: 1.2rem;
    font-weight: 600;
    height: 300px;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.portfolio-image::before {
    animation: sparkle 3s linear infinite;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="white" opacity="0.3"/><circle cx="80" cy="40" r="1.5" fill="white" opacity="0.4"/><circle cx="40" cy="80" r="1" fill="white" opacity="0.5"/></svg>');
    bottom: 0;
    content: '';
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

@keyframes sparkle {
    0%, 100% { transform: translateX(0) translateY(0) rotate(0deg); }
    25% { transform: translateX(10px) translateY(-5px) rotate(90deg); }
    50% { transform: translateX(-5px) translateY(10px) rotate(180deg); }
    75% { transform: translateX(-10px) translateY(-10px) rotate(270deg); }
}

.portfolio-content {
    padding: 1.5rem;
}

.portfolio-content h3 {
    color: #333;
    margin-bottom: 0.5rem;
}

.portfolio-content p {
    color: #666;
    font-size: 0.9rem;
}

/* Video Modal */
.video-modal {
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px); /* Safari support */
    background: rgba(0, 0, 0, 0.9);
    border: none;
    bottom: 0;
    display: flex;
    height: 100%;
    justify-content: center;
    left: 0;
    margin: 0;
    max-height: none;
    max-width: none;
    overscroll-behavior: contain; /* Prevent scrolling behind modal */
    padding: 0;
    position: fixed;
    right: 0;
    top: 0;
    width: 100%;
    will-change: transform; /* Performance optimization */
    z-index: 10000;
}

/* For browsers that don't support dialog */
.video-modal:not([open]) {
    display: none;
}

.video-modal.active {
    display: flex;
}

/* Remove default dialog backdrop */
.video-modal::backdrop {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.9);
}

.modal-content {
    aspect-ratio: 9/16; /* Changed to 9:16 aspect ratio */
    background: #000;
    border-radius: 10px;
    max-height: 95vh;
    overflow: hidden;
    position: relative;
    width: min(50vw, calc(95vh * 9/16)); /* Adjusted for 9:16 aspect ratio */
}

.modal-content.vertical {
    aspect-ratio: 9/16;
    width: min(50vw, calc(95vh * 9/16)); /* Responsive size that maintains 9:16 aspect ratio */
}

.modal-video {
    aspect-ratio: 9/16; /* Changed to 9:16 aspect ratio */
    display: block; /* Ensure proper display */
    height: auto;
    max-height: 95vh;
    object-fit: contain; /* Ensure video fits properly */
    width: 100%;
}

.modal-content.vertical .modal-video {
    aspect-ratio: 9/16; /* Ensure 9:16 aspect ratio */
    height: auto;
    width: 100%;
}

@media (max-width: 768px) {
    .modal-content {
        border-radius: 8px;
        max-height: 90vh;
        width: 90vw; /* Use more screen space on mobile */
    }
    
    .modal-close {
        font-size: 1.5rem;
        height: 40px;
        right: 10px;
        top: 10px;
        width: 40px;
    }
}

.modal-close {
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 2rem;
    height: 50px;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: all 0.3s ease;
    width: 50px;
}

.modal-close:hover {
    background: rgba(128, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-mute-btn {
    display: none;
}

.modal-info {
    display: none; /* Hide the modal info section */
}

.modal-title {
    display: none; /* Hide the title */
}

.modal-description {
    display: none; /* Hide the description */
}

/* Contact Section */
.contact {
    background: linear-gradient(135deg, #800000 0%, #000000 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.contact-content {
    margin: 0 auto;
    max-width: 600px;
}

.contact h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin: 2rem 0;
}

.contact-item {
    align-items: center;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    justify-content: center;
    min-height: 44px; /* Minimum touch target size */
    padding: 1rem 1.5rem;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.contact-item:active {
    transform: translateY(0);
}

.link {
    color: white;
}

/* Footer */
footer {
    background: #1a1a1a;
    color: white;
    padding: 2rem 0;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .container {
        padding: 0 15px;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .cta-buttons {
        align-items: center;
        flex-direction: column;
        width: 100%;
    }

    .cta-buttons .btn {
        max-width: 250px;
        text-align: center;
        width: 100%;
    }

    .stats {
        padding: 40px 0;
    }

    .stats-grid {
        gap: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }

    .stat-item {
        padding: 1.5rem 1rem;
    }

    .stat-number {
        font-size: 2.5rem;
    }

    .services {
        padding: 60px 0;
    }

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

    .service-card {
        padding: 2rem 1.5rem;
    }

    .portfolio {
        padding: 60px 0;
    }

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

    .contact-info {
        align-items: center;
        flex-direction: column;
        gap: 1rem;
    }
    
    /* Mobile vertical video adjustments */
    .portfolio-media {
        padding-top: 177.78%; /* Maintain 9:16 aspect ratio */
    }
    
    .portfolio-media.vertical {
        padding-top: 177.78%;
    }
    
    .portfolio-video {
        object-fit: cover;
    }

    /* Improve play button size for mobile */
    .play-button {
        font-size: 1.5rem;
        height: 60px;
        width: 60px;
    }
}

/* Mobile Navigation */
.mobile-menu-btn {
    background: none;
    border: none;
    color: #333;
    cursor: pointer;
    display: none;
    font-size: 1.5rem;
    height: 44px; /* Minimum touch target size */
    padding: 5px;
    width: 44px; /* Minimum touch target size */
    z-index: 2100; /* Ensure button is above other elements */
}

/* Native dialog for mobile menu */
.mobile-menu {
    background: transparent;
    border: none;
    margin: 0;
    max-height: 100vh;
    max-width: 100vw;
    overflow: hidden;
    padding: 0;
    width: 100%;
    z-index: 3000;
}

/* Reset default dialog styles */
.mobile-menu::-webkit-backdrop {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.5);
}

.mobile-menu::backdrop {
    backdrop-filter: blur(5px);
    background: rgba(0, 0, 0, 0.5);
}

/* For browsers that don't support dialog */
.mobile-menu:not([open]) {
    display: none;
}

.mobile-menu-content {
    align-items: center;
    background: rgba(255, 255, 255, 0.98);
    display: flex;
    flex-direction: column;
    height: 100vh;
    justify-content: center;
    position: relative;
    width: 100%;
}

.mobile-menu-close {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #333;
    cursor: pointer;
    font-size: 2rem;
    height: 44px; /* Minimum touch target size */
    padding: 0;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: all 0.2s ease;
    width: 44px; /* Minimum touch target size */
    z-index: 3100; /* Higher than mobile menu z-index */
}

.mobile-menu-close:hover {
    background: #fff;
    transform: scale(1.05);
}

.mobile-menu-close:active {
    transform: scale(0.95);
}

.mobile-menu .nav-links {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
    margin: 2rem 0;
    padding: 0;
    text-align: center;
    width: 100%;
}

.mobile-menu .nav-links a {
    border-radius: 12px;
    color: #333;
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 auto;
    padding: 15px 30px;
    position: relative;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 80%;
}

.mobile-menu .nav-links a:hover,
.mobile-menu .nav-links a:focus {
    background: rgba(128, 0, 0, 0.05);
    color: #800000;
    outline: none;
}

.mobile-menu .nav-links a:active {
    background: rgba(128, 0, 0, 0.1);
    transform: scale(0.98);
}

.mobile-menu .nav-links a::after {
    background: linear-gradient(135deg, #800000, #000000);
    border-radius: 2px;
    bottom: 10px;
    content: '';
    height: 3px;
    left: 30px;
    position: absolute;
    transition: width 0.3s ease;
    width: 0;
}

.mobile-menu .nav-links a:hover::after,
.mobile-menu .nav-links a:focus::after {
    width: calc(100% - 60px);
}

/* Improved Mobile Menu */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    /* Native dialog is hidden by default and shown with JS */
    .nav-container {
        padding: 0.8rem 0;
    }

    .logo {
        font-size: 1.3rem;
    }
    
    /* Hide desktop nav links */
    nav .nav-links {
        display: none;
    }
    
    /* Always show nav links in mobile dialog */
    .mobile-menu .nav-links {
        display: flex;
    }
    
    /* Dialog adjustments for mobile */
    .mobile-menu-content {
        padding: 60px 20px;
    }
}

/* Small phones */
@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .play-button {
        height: 50px;
        width: 50px;
    }
    
    .modal-content {
        max-height: 95vh;
        width: 95vw;
    }
    
    .modal-video {
        height: 100%;
        object-fit: contain;
        width: 100%;
    }
    
    .contact h2 {
        font-size: 2rem;
    }
    
    .contact p {
        font-size: 1rem;
    }
    
    .contact-item {
        padding: 0.8rem 1.2rem;
        text-align: center;
        width: 100%;
    }
    
    footer {
        font-size: 0.9rem;
        padding: 1.5rem 0;
    }
}

/* For touch devices */
@media (hover: none) {
    .portfolio-item .video-overlay {
        opacity: 0.4; /* Always show overlay partially on touch devices */
    }
    
    .portfolio-item .video-info {
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
        transform: translateY(0); /* Always show video info on touch devices */
    }
}
