/* ================================================
   iOS Glassmorphism — Custom Styles
   ================================================ */

/* ---------- Custom Scrollbar ---------- */
/* WebKit (Chrome, Safari, Edge) */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 9999px;
    border: 2px solid transparent;
    background-clip: content-box;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.45);
    border: 2px solid transparent;
    background-clip: content-box;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

/* Prevent horizontal scroll from scaled iframe */
html {
    overflow-x: hidden;
}

/* ---------- Nav Pills ---------- */
.nav-pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.45);
    transition: all 0.25s ease;
}

.nav-pill:hover,
.nav-pill.active {
    color: rgba(0, 0, 0, 0.85);
    background: rgba(0, 0, 0, 0.06);
}

#navbar.scrolled .nav-pill {
    color: rgba(0, 0, 0, 0.5);
}

#navbar.scrolled .nav-pill:hover,
#navbar.scrolled .nav-pill.active {
    color: rgba(0, 0, 0, 0.85);
    background: rgba(0, 0, 0, 0.06);
}

#navbar.scrolled #logoText {
    color: rgba(0, 0, 0, 0.85);
}

#navbar.scrolled .toggle-line {
    background: #1c1c1e;
}

/* Navbar scroll state */
#navbar.scrolled {
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

/* ---------- Mobile Menu ---------- */
#mobileMenu>div:first-child {
    transition: opacity 0.3s ease;
}

#mobileMenu>div:last-child {
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    transform: translateX(100%);
}

#mobileMenu:not(.hidden)>div:last-child {
    transform: translateX(0);
}

.mobile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 17px;
    font-weight: 600;
    color: #3a3a3c;
    transition: background 0.2s, color 0.2s;
}

.mobile-link:hover,
.mobile-link.active {
    background: rgba(0, 122, 255, 0.08);
    color: #007AFF;
}

/* ---------- Toggle Animation ---------- */
#navToggle.is-open .toggle-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#navToggle.is-open .toggle-line:nth-child(2) {
    opacity: 0;
}

#navToggle.is-open .toggle-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- iOS Card ---------- */
.ios-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 20px;
    padding: 28px 24px;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
}

.ios-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.06);
}

/* ---------- iOS Glass Card ---------- */
.ios-glass-card {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: saturate(180%) blur(40px);
    -webkit-backdrop-filter: saturate(180%) blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* ---------- Buttons ---------- */
.ios-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #007AFF 0%, #5856D6 100%);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ios-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px rgba(0, 122, 255, 0.45);
}

.ios-btn-primary:active {
    transform: translateY(0) scale(0.98);
}

.ios-btn-glass {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.7);
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background 0.25s, border-color 0.25s;
}

.ios-btn-glass:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.12);
}

/* ---------- Hero Mesh ---------- */
.hero-mesh {
    background-image:
        linear-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ---------- Embed ---------- */
.embed-aspect {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 */
}

/* Force desktop rendering: iframe always 1024px wide, scaled to fit */
.embed-aspect .embed-desktop-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 1024px;
    height: 576px;
    transform-origin: top left;
    overflow: hidden;
    /* scale is set via JS */
}

.embed-aspect .embed-desktop-frame iframe {
    width: 1024px;
    height: 800px;
    border: none;
}

/* Prevent desktop-frame from causing horizontal overflow */
#safariFrame {
    overflow: hidden;
}

/* Fullscreen — native API (desktop) */
#safariFrame:fullscreen {
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #fff;
}

#safariFrame:fullscreen .embed-aspect {
    flex: 1;
    padding-bottom: 0 !important;
    overflow: hidden;
}

#safariFrame:fullscreen .embed-aspect .embed-desktop-frame {
    transform-origin: top left;
}

#safariFrame:fullscreen .embed-aspect .embed-desktop-frame iframe {
    width: 1024px;
    height: 800px;
}

#safariFrame:fullscreen .embed-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
}

/* Simulated fullscreen (mobile fallback) */
#safariFrame.sim-fullscreen {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #fff;
    display: flex;
    flex-direction: column;
}

#safariFrame.sim-fullscreen .embed-aspect {
    flex: 1;
    padding-bottom: 0 !important;
    overflow: hidden;
}

#safariFrame.sim-fullscreen .embed-aspect .embed-desktop-frame {
    transform-origin: top left;
}

#safariFrame.sim-fullscreen .embed-aspect .embed-desktop-frame iframe {
    width: 1024px;
    height: 800px;
}

#safariFrame.sim-fullscreen .embed-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
}

/* ---------- Metric Bars ---------- */
.metric-bar {
    width: 0;
    transition: width 1.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.metric-bar.animate {
    width: var(--width);
}

/* ---------- Particles ---------- */
.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(0, 122, 255, 0.15);
    border-radius: 50%;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(40px);
        opacity: 0;
    }
}

/* ---------- Scroll Animations (AOS override polish) ---------- */
[data-aos] {
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ---------- Pulse Slow ---------- */
.animate-pulse-slow {
    animation: pulse-slow 4s ease-in-out infinite alternate;
}

.delay-1 {
    animation-delay: 1s;
}

.delay-2 {
    animation-delay: 2s;
}

@keyframes pulse-slow {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.15);
        opacity: 1;
    }
}

/* ---------- Scroll Dot ---------- */
.animate-scroll-dot {
    animation: scroll-dot 2s ease-in-out infinite;
}

@keyframes scroll-dot {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }

    50% {
        transform: translateY(10px);
        opacity: 1;
    }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}

/* ---------- Mobile Gamma Card ---------- */
.mobile-gamma-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 24px;
    text-decoration: none;
    color: inherit;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.04) 0%, rgba(88, 86, 214, 0.06) 100%);
    border-radius: 16px;
    transition: background 0.3s ease;
}

.mobile-gamma-card:active {
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.10) 0%, rgba(88, 86, 214, 0.12) 100%);
}

.mobile-gamma-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 122, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-gamma-title {
    font-size: 20px;
    font-weight: 700;
    color: #1c1c1e;
}

.mobile-gamma-sub {
    font-size: 14px;
    color: #8e8e93;
    font-weight: 500;
}

.mobile-gamma-arrow {
    margin-top: 4px;
    color: #007AFF;
}