        /* iOS-specific viewport handling */
        @supports (-webkit-touch-callout: none) {

            /* iOS Safari specific styles */
            body {
                -webkit-text-size-adjust: 100%;
            }
        }

        body {
            font-family: 'Audiowide', cursive;
            background: #111111;
            background-attachment: fixed;
            color: #f1f5f9;
        }

        /* Fix for mobile overscroll areas */
        html {
            background: #111111;
            min-height: 100%;
        }

        /* Additional mobile-specific fix for overscroll */
        @supports (-webkit-touch-callout: none) {
            html {
                background: #111111;
                /* Fallback solid color for overscroll areas */
                background-attachment: fixed;
            }

            body {
                background-attachment: scroll;
                /* Better for mobile */
                min-height: 100vh;
                min-height: 100dvh;
                /* Dynamic viewport height for mobile */
            }
        }

        body.body-modal-open {
            overflow: hidden;
        }

        /* Shared component styles to reduce duplication */
        .search-input-shared {
            width: 100%;
            background: #262626;
            border: 1px solid #404040;
            border-radius: 9999px;
            padding: 6px 32px;
            color: #ffffff;
            font-size: 1rem;
            line-height: 1.5;
            transition: all 0.3s;
            outline: none;
            backdrop-filter: blur(10px);
        }

        .search-input-shared:hover {
            border-color: #22c55e;
            background: #303030;
        }

        .search-input-shared:focus {
            border-color: #16a34a;
            background: #353535;
            box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.1);
            color: #ffffff;
            caret-color: #16a34a;
        }

        .search-input-shared:focus::placeholder {
            color: transparent;
        }

        .search-input-shared::placeholder {
            color: #ffffff;
        }

        .search-icon-shared {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            color: #ffffff;
        }

        .info-button-shared {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            color: #f1f5f9;
            border: 1px solid #404040;
            border-radius: 9999px;
            transition: all 0.3s;
            flex-shrink: 0;
            outline: none;
            background: rgba(17, 17, 17, 0.6);
            backdrop-filter: blur(10px);
        }

        .info-button-shared:hover {
            color: #f1f5f9;
            border-color: #22c55e;
            background: rgba(17, 17, 17, 0.8);
            transform: scale(1.05);
        }

        .info-button-shared:focus {
            box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
        }

        .info-icon-shared {
            font-size: 16px;
        }

        /* Fix bullet points in policy modals to be white */
        .policy-bullet {
            color: #ffffff !important;
        }

        /* Cookie Banner Styles */
        #cookie-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: #222;
            color: white;
            padding: 15px;
            font-size: 14px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* Desktop: horizontal layout */
        @media (min-width: 640px) {
            #cookie-banner {
                flex-direction: row;
                justify-content: space-between;
                align-items: center;
                gap: 16px;
            }
        }

        #cookie-banner button {
            color: white;
            border: none;
            padding: 10px 15px;
            cursor: pointer;
            border-radius: 4px;
            transition: background-color 0.3s;
        }

        #cookie-banner #accept-cookies {
            background: #00aaff;
        }

        #cookie-banner #accept-cookies:hover {
            background: #0099ee;
        }

        #cookie-banner #decline-cookies {
            background: #666;
        }

        #cookie-banner #decline-cookies:hover {
            background: #555;
        }

        .cookie-banner-text {
            flex: 1;
            line-height: 1.4;
        }

        .cookie-banner-buttons {
            display: flex;
            gap: 8px;
            flex-shrink: 0;
        }

        /* Desktop: adjust button container */
        @media (min-width: 640px) {
            .cookie-banner-buttons {
                gap: 12px;
            }
        }

        .cookie-policy-link {
            color: #22c55e;
            text-decoration: underline;
            transition: color 0.3s;
        }

        .cookie-policy-link:hover {
            color: #16a34a;
            text-decoration: none;
        }

        .youtube-placeholder {
            background: #000;
            color: #fff;
            padding: 2em;
            text-align: center;
            cursor: pointer;
            min-height: 200px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Mobile-specific YouTube placeholder and iframe scaling */
        @media (max-width: 767px) {
            .youtube-placeholder {
                padding: 1em;
                min-height: 180px;
                font-size: 0.9rem;
            }

            .media-carousel-item iframe {
                width: 100% !important;
                height: 100% !important;
                min-height: 180px;
            }

            .media-carousel {
                padding-left: 5%;
                padding-right: 5%;
            }

            /* Ensure mobile modal media carousel has proper sizing */
            .mobile-modal-container .media-carousel-item {
                height: auto;
                aspect-ratio: 16/9;
            }
        }

        /* Base carousel styles - consolidated to reduce duplication */
        .carousel-base {
            display: flex;
            overflow-x: auto;
            scroll-snap-type: x mandatory;
            gap: 1.5rem;
            padding-bottom: 1rem;
            padding-top: 5px;
            margin-top: -5px;
            scrollbar-width: none;
            -webkit-overflow-scrolling: touch;
        }

        .carousel-base::-webkit-scrollbar {
            display: none;
        }

        .carousel-base .app-card-wrapper,
        .carousel-base .hero-item {
            flex: 0 0 auto;
            scroll-snap-align: start;
        }

        .card-carousel .app-card-wrapper {
            width: 280px;
        }

        /* Mobile: Use percentage-based width for better screen utilization */
        @media (max-width: 767px) {
            .card-carousel .app-card-wrapper {
                width: 80vw;
                max-width: 400px;
                min-width: 250px;
            }
        }

        #hero-carousel .hero-item {
            width: 100%;
            min-width: 100%;
        }

        /* Media carousel specific styles */
        .media-carousel {
            padding-left: 10%;
            padding-right: 10%;
            gap: 0.5rem;
            /* Reduce gap for tighter media spacing */
        }

        /* This rule is now only for the simple carousel view on mobile */
        @media (max-width: 767px) {
            #hero-carousel .app-card-wrapper {
                width: 80vw;
                max-width: 400px;
                min-width: 250px;
            }
        }

        /* Enhanced tablet support for iOS */
        @media (min-width: 768px) and (max-width: 1024px) {

            /* Ensure hero layout works on tablets */
            #hero-carousel .hero-item {
                width: 100%;
                min-width: 100%;
            }

            /* Remove forced aspect ratio on tablets - let content height dictate */
            #hero-carousel .hero-item .md\:col-span-3 {
                aspect-ratio: unset !important;
            }
        }

        /* Desktop and larger tablet support */
        @media (min-width: 1025px) {

            /* On larger screens, also remove aspect ratio constraint for better content balance */
            #hero-carousel .hero-item .md\:col-span-3 {
                aspect-ratio: unset !important;
            }
        }

        /* iOS specific fixes */
        @supports (-webkit-touch-callout: none) {
            @media (min-width: 768px) {

                /* Ensure proper hero layout on iOS tablets */
                #hero-carousel .hero-item .grid {
                    display: grid !important;
                }

                #hero-carousel .hero-item .md\:col-span-3 {
                    grid-column: span 3 / span 3 !important;
                    /* Remove aspect ratio constraint for better content fit */
                    aspect-ratio: unset !important;
                }

                #hero-carousel .hero-item .md\:col-span-2 {
                    grid-column: span 2 / span 2 !important;
                }
            }
        }

        .media-grid-item {
            position: relative;
            cursor: pointer;
            overflow: hidden;
            border: 2px solid transparent;
            transition: border-color 0.3s ease;
        }

        .media-grid-item:hover {
            border-color: #22c55e;
        }

        .media-grid-item img,
        .media-grid-item iframe {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .media-grid-item:hover img {
            transform: scale(1.1);
        }

        .play-icon {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 48px;
            height: 48px;
            background-color: rgba(0, 0, 0, 0.6);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            pointer-events: none;
            transition: background-color 0.3s ease;
        }

        .media-grid-item:hover .play-icon {
            background-color: rgba(0, 0, 0, 0.8);
        }

        .main-display {
            width: 100%;
            height: 100%;
            min-height: 200px;
            /* Ensure minimum height for better visual balance */
        }

        .main-display img,
        .main-display iframe {
            width: 100%;
            height: 100%;
            object-fit: cover;
            border-radius: 0.5rem;
        }

        #app-detail-modal {
            padding: 0;
        }

        #app-detail-modal-content {
            width: 100vw;
            height: 100vh;
            border-radius: 0;
            -webkit-overflow-scrolling: touch;
        }

        /* Mobile-specific scrolling improvements */
        @media (max-width: 1023px) {
            #app-detail-modal-content {
                overflow-y: scroll;
                overscroll-behavior-y: contain;
                /* Prevent bounce effect on iOS */
                -webkit-overflow-scrolling: touch;
                /* Apply consistent scrollbar styling */
                scrollbar-width: thin;
                scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
            }

            #app-detail-modal-content::-webkit-scrollbar {
                width: 6px;
            }

            #app-detail-modal-content::-webkit-scrollbar-track {
                background: transparent;
            }

            #app-detail-modal-content::-webkit-scrollbar-thumb {
                background-color: rgba(156, 163, 175, 0.5);
                border-radius: 3px;
            }

            #app-detail-modal-content::-webkit-scrollbar-thumb:hover {
                background-color: rgba(156, 163, 175, 0.7);
            }

            /* Ensure the mobile layout container is properly scrollable */
            .mobile-modal-container {
                height: 100vh;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
                overscroll-behavior-y: contain;
                position: relative;
                /* Improve scrolling performance */
                transform: translateZ(0);
                will-change: scroll-position;
                /* Apply consistent scrollbar styling */
                scrollbar-width: thin;
                scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
            }

            .mobile-modal-container::-webkit-scrollbar {
                width: 6px;
            }

            .mobile-modal-container::-webkit-scrollbar-track {
                background: transparent;
            }

            .mobile-modal-container::-webkit-scrollbar-thumb {
                background-color: rgba(156, 163, 175, 0.5);
                border-radius: 3px;
            }

            .mobile-modal-container::-webkit-scrollbar-thumb:hover {
                background-color: rgba(156, 163, 175, 0.7);
            }

            /* Ensure close button stays visible during scroll */
            .mobile-modal-container+button {
                position: fixed !important;
                z-index: 60;
            }

            /* Prevent horizontal scrolling on mobile modal */
            #app-detail-modal {
                overflow-x: hidden;
            }
        }

        .media-carousel-item {
            flex-shrink: 0;
            width: 100%;
            scroll-snap-align: center;
        }

        /* --- Morphing Hamburger Animation --- */
        .hamburger-icon {
            width: 28px;
            height: 28px;
            position: relative;
            cursor: pointer;
        }

        .hamburger-line {
            display: block;
            height: 3px;
            width: 100%;
            background-color: currentColor;
            border-radius: 0;
            position: absolute;
            left: 0;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            transform-origin: center;
        }

        .hamburger-line:nth-child(1) {
            top: 5px;
        }

        .hamburger-line:nth-child(2) {
            top: 12px;
        }

        .hamburger-line:nth-child(3) {
            top: 19px;
        }

        /* Transform to X when menu is open */
        .hamburger-open .hamburger-line:nth-child(1) {
            top: 11px;
            transform: rotate(45deg);
        }

        .hamburger-open .hamburger-line:nth-child(2) {
            opacity: 0;
            transform: scaleX(0);
        }

        .hamburger-open .hamburger-line:nth-child(3) {
            top: 11px;
            transform: rotate(-45deg);
        }

        /* Focus effect for accessibility */
        #hamburger-btn:focus .hamburger-line {
            background-color: #f3f4f6;
        }

        /* --- Unified Nav Menu Animation --- */
        #nav-wrapper {
            overflow: hidden;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            max-height: 0;
            width: 100%;
        }

        #nav-wrapper.is-open {
            /* Now allows content to overflow for the dropdown */
            overflow: visible;
            max-height: 100px;
        }

        /* Shared fade-in animation for nav items */
        .nav-item-animated {
            opacity: 0;
            transform: translateY(-10px);
            transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Synchronized animation delays - only on mobile */
        @media (max-width: 767px) {
            .search-container.nav-item-animated {
                transition-delay: 0.1s;
                /* Fade in after nav opens */
            }

            .info-button.nav-item-animated {
                transition-delay: 0.1s;
                /* Fade in synchronized with search */
            }

            .library-button.nav-item-animated {
                transition-delay: 0.15s !important;
                /* Fade in slightly after search */
                transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
                    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) 0.15s,
                    background-color 0.2s ease-in-out !important;
                /* Preserve hover transition */
            }
        }

        /* Show nav items when menu is open */
        #nav-wrapper.is-open .nav-item-animated {
            opacity: 1;
            transform: translateY(0);
        }

        @media (min-width: 768px) {
            #nav-wrapper {
                max-height: none;
                overflow: visible;
                width: auto;
            }

            /* On desktop, nav items are always visible */
            .nav-item-animated {
                opacity: 1;
                transform: translateY(0);
                transition: none;
            }
        }

        /* Search Input Focus Animation - scale the entire container so icons scale too */
        .search-container:focus-within {
            transform: scale(1.02);
            transition: transform 0.3s ease;
        }

        /* Make search icon green when focused */
        .search-container:focus-within .search-icon-shared {
            color: #16a34a;
        }

        /* Search Dropdown Styles */
        .search-dropdown {
            /*
                This is now positioned relative to the search-container on desktop,
                but will be changed to `position: fixed` by JS on all screen sizes
                to avoid clipping issues on mobile.
            */
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #353535;
            border: 1px solid #16a34a;
            border-radius: 0.5rem;
            margin-top: 0.25rem;
            z-index: 50;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            backdrop-filter: blur(20px);
        }

        .search-dropdown.hidden {
            display: none;
        }

        .search-dropdown-item {
            padding: 0;
            cursor: pointer;
            border-bottom: 1px solid #16a34a;
            display: grid;
            grid-template-columns: auto 1fr;
            transition: background-color 0.2s ease;
            min-height: 2.25rem;
        }

        .search-dropdown-item:last-child {
            border-bottom: none;
        }

        .search-dropdown-item:hover,
        .search-dropdown-item.highlighted {
            background: rgba(128, 128, 128, 0.1);
        }

        .search-dropdown-item-thumbnail {
            width: 4rem;
            height: 100%;
            aspect-ratio: 16/9;
            object-fit: cover;
            border-radius: 0;
            display: block;
        }

        .search-dropdown-item:first-child .search-dropdown-item-thumbnail {
            border-top-left-radius: 0.5rem;
        }

        .search-dropdown-item:last-child .search-dropdown-item-thumbnail {
            border-bottom-left-radius: 0.5rem;
        }

        .search-dropdown-item-content {
            padding: 0.75rem 1rem;
            display: flex;
            align-items: center;
        }

        .search-dropdown-item-title {
            font-weight: 600;
            color: #f1f5f9;
            font-size: 0.75rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }



        .search-dropdown-no-results {
            padding: 1rem;
            text-align: center;
            color: #94a3b8;
            font-size: 0.875rem;
        }

        /* Mobile specific search dropdown adjustments */
        @media (max-width: 767px) {
            .search-dropdown {
                /* On mobile, ensure dropdown has proper spacing and visibility */
                max-height: 70vh;
                overflow-y: auto;
                margin-top: 0.5rem;
                border-radius: 0.75rem;
                box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
            }

            .search-dropdown-item {
                min-height: 3rem;
            }

            .search-dropdown-item-content {
                padding: 1rem;
            }

            .search-dropdown-item-thumbnail {
                width: 3.5rem;
            }

            .search-dropdown-item:first-child .search-dropdown-item-thumbnail {
                border-top-left-radius: 0.75rem;
            }

            .search-dropdown-item:last-child .search-dropdown-item-thumbnail {
                border-bottom-left-radius: 0.75rem;
            }

            /* Reduce button height on mobile for product modal buttons only */
            #app-detail-modal .mobile-modal-container a[class*="py-"],
            #app-detail-modal .mobile-modal-container button[class*="py-"] {
                padding-top: 0.5rem !important;
                /* py-1.5 */
                padding-bottom: 0.5rem !important;
                /* py-1.5 */
            }
        }

        /* Ensure search container has relative positioning */
        .search-container {
            position: relative;
        }

        /* Modal scrollbar improvements */
        .modal-content-scroll {
            scrollbar-width: thin;
            scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
        }

        .modal-content-scroll::-webkit-scrollbar {
            width: 6px;
        }

        .modal-content-scroll::-webkit-scrollbar-track {
            background: transparent;
        }

        .modal-content-scroll::-webkit-scrollbar-thumb {
            background-color: rgba(156, 163, 175, 0.5);
            border-radius: 3px;
        }

        .modal-content-scroll::-webkit-scrollbar-thumb:hover {
            background-color: rgba(156, 163, 175, 0.7);
        }

        /* Carousel dot pseudo-element styling */
        button[data-action="carousel-dot"]::after {
            content: '';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 1rem;
            /* w-4 equivalent */
            height: 0.25rem;
            /* h-1 equivalent */
            border-radius: 9999px;
            transition: background-color 0.3s;
            background-color: rgba(255, 255, 255, 0.5);
            /* Default inactive state */
        }

        /* Active dot styling */
        button[data-action="carousel-dot"].dot-active::after {
            background-color: rgba(255, 255, 255, 1);
            /* Active state */
        }

        /* Material Icons Styling */
        .material-symbols-outlined {
            font-variation-settings:
                'FILL' 0,
                'wght' 400,
                'GRAD' 0,
                'opsz' 24
        }
        #gumroad-follow-form-embed {
            margin: 0px;
            padding: 0px;
            box-sizing: border-box;
            min-width: 0px;
            max-width: 100%;
            vertical-align: bottom;
            background-origin: padding-box;
            border-style: solid;
            border-width: 0px;
            display: grid;
            grid-auto-flow: column;
            gap: 0.75rem;
            grid-template-columns: 1fr;
            grid-auto-columns: max-content;
            align-items: center;
        }

        /* Set color scheme for the Gumroad form to match website's dark theme */
        #gumroad-follow-form-embed {
            color-scheme: dark;
        }

        #gumroad-follow-form-embed-button {
            margin: 0px;
            padding: 0.75rem 1rem;
            box-sizing: border-box;
            border: none;
            color: white;
            border-radius: 0.375rem;
            font-family: 'Audiowide', cursive;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            cursor: pointer;
            text-decoration: none;
            transition: all 0.3s ease;
            background: linear-gradient(to right, #3b82f6, #2563eb);
            font-size: 1rem;
            line-height: 1.4;
            font-weight: 600;
            box-shadow: 0 10px 15px -3px rgba(59, 130, 246, 0.25);
        }

        #gumroad-follow-form-embed-button:hover {
            background: linear-gradient(to right, #60a5fa, #3b82f6);
            color: #ffffff;
            transform: translateY(-1px);
            box-shadow: 0 20px 25px -5px rgba(59, 130, 246, 0.4);
        }

        #gumroad-follow-form-embed-input {
            margin: 0px;
            padding: 0.75rem 1rem;
            box-sizing: border-box;
            font-family: 'Audiowide', cursive;
            font-size: 1rem;
            line-height: 1.4;
            border: 1px solid #404040;
            border-radius: 0.25rem;
            display: block;
            width: 100%;
            background-color: #111111;
            color: white;
            transition: all 0.2s ease;
        }

        #gumroad-follow-form-embed-input:disabled {
            cursor: not-allowed;
            opacity: 0.3;
        }

        #gumroad-follow-form-embed-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        #gumroad-follow-form-embed-input:focus-within {
            outline: none;
            border-color: #606060;
            box-shadow: 0 0 0 2px rgba(96, 96, 96, 0.2);
        }

        #gumroad-follow-form-embed-input:read-only {
            background-color: #1a1a1a;
            opacity: 0.7;
        }
