:root {
    --primary: #009688;
    --primary-hover: #00796b;
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --text-main: #ffffff;
    --text-secondary: #aaaaaa;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
    --transition: all 0.3s ease;
    --spacing-unit: 1rem;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Ambient Background Glow */
.hero-bg-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 150, 136, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(80px);
    z-index: -1;
    animation: pulseGlow 10s infinite alternate ease-in-out;
    pointer-events: none;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.5;
        transform: translateX(-50%) scale(1);
    }

    100% {
        opacity: 0.8;
        transform: translateX(-50%) scale(1.1);
    }
}

/* Animations Keyframes */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

@keyframes fadeUpCenter {
    from {
        opacity: 0;
        transform: translateY(300px) translateZ(200px);
    }

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

/* Fan Out Animations */
@keyframes fanOutLeft1 {
    from {
        transform: translateX(0) translateZ(0) rotateY(0) scale(0.95) translateY(400px);
        opacity: 0;
    }

    to {
        transform: translateX(-260px) translateZ(50px) rotateY(15deg) scale(0.95) translateY(0);
        opacity: 1;
    }
}

@keyframes fanOutLeft2 {
    from {
        transform: translateX(0) translateZ(0) rotateY(0) scale(0.9) translateY(400px);
        opacity: 0;
    }

    to {
        transform: translateX(-500px) translateZ(-150px) rotateY(25deg) scale(0.9) translateY(0);
        opacity: 1;
    }
}

@keyframes fanOutRight1 {
    from {
        transform: translateX(0) translateZ(0) rotateY(0) scale(0.95) translateY(400px);
        opacity: 0;
    }

    to {
        transform: translateX(260px) translateZ(50px) rotateY(-15deg) scale(0.95) translateY(0);
        opacity: 1;
    }
}

@keyframes fanOutRight2 {
    from {
        transform: translateX(0) translateZ(0) rotateY(0) scale(0.9) translateY(400px);
        opacity: 0;
    }

    to {
        transform: translateX(500px) translateZ(-150px) rotateY(-25deg) scale(0.9) translateY(0);
        opacity: 1;
    }
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

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

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

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

.section {
    padding: 80px 0;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: rgba(30, 30, 30, 0.6);
    /* Liquid Glass Effect */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    background-color: rgba(40, 40, 40, 0.8);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
}

/* Button Shimmer Effect */
.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.btn-primary:hover::after {
    left: 100%;
}

/* Header */
header {
    padding: 15px 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(18, 18, 18, 0.7);
    /* More transparent for glass effect */
    backdrop-filter: saturate(180%) blur(20px);
    /* Liquid retina effect */
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1;
    /* Reset line-height for alignment */
}

.logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 9px;
    /* iOS standard is ~22.5% */
    object-fit: cover;
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
    /* Critical for vertical alignment */
}

nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

nav a:hover {
    color: var(--text-main);
    /* Brighter on hover */
}

/* Hero Section */
.hero {
    padding-top: 160px;
    padding-bottom: 100px;
    text-align: center;
    overflow: hidden;
    position: relative;
}

/* Hero Bottom Fade Mask */
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, transparent, var(--bg-dark));
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    margin-bottom: 60px;
}

/* Hero Content Entrance Animations */
.hero-content h1 {
    animation: fadeUp 1s ease-out backwards;
    animation-delay: 0.2s;
}

.hero-content p {
    animation: fadeUp 1s ease-out backwards;
    animation-delay: 0.4s;
}

.hero-content .btn {
    animation: fadeUp 1s ease-out backwards;
    animation-delay: 0.6s;
}


.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Carousel Controls (Mobile Only) */
.carousel-controls {
    display: none;
}

/* Phones Showcase */
.phones-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 600px;
    position: relative;
    perspective: 2500px;
    /* Increased perspective for realism */
    margin-top: 80px;
    transform-style: preserve-3d;
    /* crucial for 3d context */
}

.phone {
    width: 280px;
    height: 580px;
    background: transparent;
    border-radius: 44px;
    /* Hardware Bezel Removed */
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -140px;
    /* Center horizontally */
    margin-top: -290px;
    /* Center vertically */
    transform-origin: center center;
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backface-visibility: hidden;
}

.phone iframe,
.phone-screen {
    width: 100%;
    height: 100%;
    border: none;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.5rem;
    position: relative;
    overflow: hidden;
}

/* Center Phone */
.phone.center {
    z-index: 10;
    transform: translateZ(200px);
    box-shadow: 0 40px 80px -20px rgba(0, 150, 136, 0.3);
    /* Premium Teal Glow */
    animation: fadeUpCenter 1s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.2s;
    /* Reduced delay so it appears first */
}

/* Left Phones - Fan Layout */
/* Left Phones - Fan Layout */
/* Left Phones - Fan Layout */
/* Left Phones - Fan Layout */
/* Left Phones - Fan Layout */
/* Left Phones - Fan Layout */
.phone.left-1 {
    transform: translateX(-260px) translateZ(50px) rotateY(15deg) scale(0.95);
    z-index: 5;
    opacity: 1;
    filter: brightness(0.8);
    animation: fanOutLeft1 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.4s;
}

.phone.left-2 {
    transform: translateX(-500px) translateZ(-150px) rotateY(25deg) scale(0.9);
    z-index: 1;
    opacity: 1;
    filter: brightness(0.6);
    animation: fanOutLeft2 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.5s;
}

/* Right Phones - Fan Layout */
.phone.right-1 {
    transform: translateX(260px) translateZ(50px) rotateY(-15deg) scale(0.95);
    z-index: 5;
    opacity: 1;
    filter: brightness(0.8);
    animation: fanOutRight1 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.4s;
}

.phone.right-2 {
    transform: translateX(500px) translateZ(-150px) rotateY(-25deg) scale(0.9);
    z-index: 1;
    opacity: 1;
    filter: brightness(0.6);
    animation: fanOutRight2 1.2s cubic-bezier(0.25, 0.8, 0.25, 1) both;
    animation-delay: 0.5s;
}

/* Header & Mobile Responsive */
@media (max-width: 1200px) {

    .phone.left-2,
    .phone.right-2 {
        opacity: 0;
        pointer-events: none;
        transform: translateX(0) scale(0.5);
        /* Hide gracefully */
    }

    .phone.left-1 {
        transform: translateX(-240px) rotateY(15deg) scale(0.9);
    }

    .phone.right-1 {
        transform: translateX(240px) rotateY(-15deg) scale(0.9);
    }
}

@media (max-width: 768px) {

    /* Header Fixes */
    header .container {
        padding: 0 15px;
    }

    nav ul {
        gap: 15px;
    }

    nav a:not(.btn) {
        display: none;
        /* Hide text links on mobile, keep button */
    }

    /* Hero Fixes */
    .hero-bg-glow {
        width: 100%;
        height: 400px;
        filter: blur(60px);
    }

    h1 {
        font-size: 2.5rem;
    }

    .phones-container {
        height: auto;
        perspective: none;
        margin-top: 40px;
        /* Horizontal Scroll Settings */
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 10px;
        /* Spacing between phones */

        /* Break out of parent container */
        width: 100vw;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;

        /* Center the active item (230px width) */
        /* padding-left = 50vw - 115px (half item width) */
        padding: 40px calc(50vw - 115px) 30px calc(50vw - 115px);

        box-sizing: border-box;

        -webkit-overflow-scrolling: touch;
        z-index: 10;
        pointer-events: auto;
    }

    /* Hide scrollbar but keep functionality */
    .phones-container::-webkit-scrollbar {
        display: none;
    }

    .phones-container {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .phone {
        width: 230px;
        height: 460px;
        position: relative;
        /* Dynamic transform handled by JS */
        /* transform: scale(0.95); */

        opacity: 0.8;
        /* Increased from 0.7 for better visibility */
        transition: opacity 0.3s ease;
        /* Only animate opacity */
        border-radius: 24px;
        /* Adjusted radius for mobile (user requested 24px) */
        flex: 0 0 auto;
        scroll-snap-align: center;
        margin: 0;
        left: auto !important;
        right: auto !important;
        top: auto !important;
        /* Reset desktop animations */
        animation: none !important;
        filter: none !important;
        box-shadow: none !important;
    }

    .phone.active {
        /* transform: scale(1.0); - REMOVED to prevent jerking */
        opacity: 1 !important;
        z-index: 10;
        filter: none !important;
    }

    /* Override specific phone classes to ensure they reset */
    .phone.left-1,
    .phone.right-1,
    .phone.left-2,
    .phone.right-2,
    .phone.center {
        display: block;
        transform: scale(0.95);
        animation: none !important;
        margin: 0 !important;

        /* FORCE VISIBILITY ON MOBILE */
        opacity: 0.8 !important;
        /* Override the 1200px hide rule */
        pointer-events: auto !important;
    }

    .phone.active.left-1,
    .phone.active.right-1,
    .phone.active.left-2,
    .phone.active.right-2,
    .phone.active.center {
        transform: scale(0.95);
        /* Keep consistent scale even when active */
    }

    /* Add simple shadow for depth in flat view */
    .phone-screen {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    }

    /* Carousel Images - Force Immediate Visibility */
    .phone-screen img {
        opacity: 1 !important;
        transition: none !important;
        visibility: visible !important;
    }

    /* Carousel Dots */
    /* Carousel Dots */
    .carousel-controls {
        display: flex;
        justify-content: center;
        margin-top: -30px;
        /* Pull up into the container */
        width: 100%;
        position: relative;
        z-index: 20;
        pointer-events: none;
        /* Let clicks pass through to phones if needed */
    }

    .carousel-dots {
        display: flex;
        gap: 8px;
        background: rgba(255, 255, 255, 0.1);
        padding: 8px 12px;
        border-radius: 20px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        transition: all 0.3s ease;
    }

    .carousel-dot.active {
        background: var(--primary);
        transform: scale(1.2);
    }
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    background: rgba(30, 30, 30, 0.4);
    /* Liquid Glass */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 40px;
    border-radius: 20px;
    text-align: left;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

/* Feature Card Shimmer Effect */
.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.05), transparent);
    transform: skewX(-25deg);
    transition: 0.7s;
    pointer-events: none;
}

.feature-card:hover::after {
    left: 200%;
}

.feature-card {
    /* Scroll Reveal State */
    opacity: 0;
    transform: translateY(40px);
}

.feature-card.visible {
    opacity: 1;
    transform: translateY(0);
}


.feature-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.feature-card h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Footer */
footer {
    background: rgba(10, 10, 10, 0.7);
    /* Liquid Glass */
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    padding: 60px 0 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-links h4 {
    margin-bottom: 20px;
    color: #fff;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

.copyright {
    text-align: center;
    color: #555;
    font-size: 0.85rem;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Forms (Contact Page) */
.form-container {
    max-width: 600px;
    margin: 120px auto 60px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

input,
textarea {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: white;
    font-family: var(--font-family);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Text Content Pages (Privacy/Terms) */
.text-content {
    max-width: 800px;
    margin: 120px auto 60px;
}

.text-content h1 {
    margin-bottom: 40px;
    text-align: center;
}

.text-content p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.8;
}

.text-content h3 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: white;
}