/* ===========================
   CSS Reset & Variables
   =========================== */

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

/* Prevent blank screen issues on iOS during fast scrolling */
img {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

:root {
    /* Colors - Getcodexa Brand */
    --primary-color: #009FB1;
    --primary-dark: #007A89;
    --primary-light: #33B5C4;
    --secondary-color: #10B981;
    --accent-color: #F59E0B;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;

    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-dark: #111827;

    --gradient-1: linear-gradient(135deg, #009FB1 0%, #007A89 100%);
    --gradient-2: linear-gradient(135deg, #33B5C4 0%, #009FB1 100%);
    --gradient-3: linear-gradient(135deg, #009FB1 0%, #00D4E8 100%);

    /* Spacing */
    --container-width: 1200px;
    --section-padding: 80px 20px;
    --border-radius: 12px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    /* Hardware acceleration for smoother scrolling on iOS */
    -webkit-overflow-scrolling: touch;
    /* Prevent blank screen issues on iOS */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Disable expensive effects during fast scrolling for better performance */
body.fast-scrolling * {
    animation-play-state: paused !important;
    transition-duration: 0.01ms !important;
    pointer-events: none;
}

body.fast-scrolling .header {
    pointer-events: all;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===========================
   Header & Navigation
   =========================== */

.header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: calc(100% - 40px);
    max-width: 1200px;
    transition: var(--transition);
}

.header.scrolled {
    top: 10px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px) saturate(180%);
    -webkit-backdrop-filter: blur(10px) saturate(180%);
    border-radius: 100px;
    border: 1px solid rgba(0, 159, 177, 0.1);
    box-shadow: 0 8px 32px rgba(0, 159, 177, 0.12);
    transition: var(--transition);
    /* Improve rendering performance on iOS */
    will-change: background, box-shadow;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.header.scrolled .nav {
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 159, 177, 0.18);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-color);
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    align-items: center;
}

.nav-menu a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 50px;
    transition: var(--transition);
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary-color);
    background: rgba(0, 159, 177, 0.1);
}

.nav-menu a::before {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 20px;
    height: 2px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: transform 0.3s ease;
}

.nav-menu a:hover::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

/* ===========================
   Hero Section
   =========================== */

.hero {
    position: relative;
    padding: 140px 20px 100px;
    min-height: 90vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    /* Improve rendering performance on iOS */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #E0F7FA 0%, #B2EBF2 50%, #80DEEA 100%);
    z-index: -1;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(0, 159, 177, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-background::after {
    content: '';
    position: absolute;
    bottom: -20%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.hero-logo-large {
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease;
}

.hero-logo-large img {
    max-width: 450px;
    width: 100%;
    height: auto;
}

.tagline {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    color: white;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 20px;
    animation: fadeInUp 0.8s ease;
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.6s ease 0.1s backwards;
    /* Performance optimization */
    will-change: opacity, transform;
}

.hero-description {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 40px;
    line-height: 1.8;
    animation: fadeInUp 0.6s ease 0.2s backwards;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease 0.3s backwards;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-large {
    padding: 18px 36px;
    font-size: 18px;
}

/* Hero Image */
.hero-image-wrapper {
    position: relative;
    animation: fadeInRight 0.7s ease 0.3s backwards;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-main-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    filter: drop-shadow(0 20px 40px rgba(0, 159, 177, 0.3));
    /* Simplified floating animation - reduced from 6s to 8s for smoother performance */
    animation: float 8s ease-in-out infinite;
    will-change: transform;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateZ(0);
    }
    50% {
        transform: translateY(-15px) translateZ(0);
    }
}

/* ===========================
   Section Styles
   =========================== */

.section {
    padding: var(--section-padding);
    /* Improve rendering performance during scroll */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
}

/* ===========================
   About Section
   =========================== */

.about-section {
    background: var(--bg-secondary);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-intro {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.8;
}

.feature-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.feature-list li:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(8px);
}

.feature-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.feature-text {
    font-size: 16px;
    line-height: 1.6;
}

.about-image {
    width: 100%;
    max-width: 550px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.about-image:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.screenshot-placeholder {
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    border-radius: var(--border-radius);
    padding: 60px 40px;
    text-align: center;
    box-shadow: var(--shadow-md);
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.screenshot-placeholder p {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.screenshot-placeholder span {
    font-size: 14px;
    color: var(--text-light);
}

/* ===========================
   Preview Section
   =========================== */

.preview-section {
    background: white;
}

.preview-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.preview-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.preview-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.preview-image {
    overflow: hidden;
    background: #F9FAFB;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    transition: transform 0.3s ease;
    /* Ensure images are visible even if JS fails */
    opacity: 1 !important;
}

.preview-card:hover .preview-image img {
    transform: scale(1.02);
}

.screenshot-placeholder.small {
    min-height: auto;
    height: 100%;
    padding: 40px 20px;
    font-size: 64px;
}

.preview-caption {
    padding: 24px;
}

.preview-caption h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.preview-caption p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===========================
   Pilot Section
   =========================== */

.pilot-section {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    color: white;
}

.pilot-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.pilot-section .section-title {
    color: white;
    text-align: left;
}

.pilot-intro {
    font-size: 18px;
    margin-bottom: 32px;
    line-height: 1.8;
    opacity: 0.95;
}

.pilot-list {
    list-style: none;
    margin-bottom: 40px;
}

.pilot-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    font-size: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.pilot-list li span {
    font-size: 24px;
    color: var(--secondary-color);
}

.pilot-section .btn-primary {
    background: white;
    color: var(--primary-color);
}

.pilot-section .btn-primary:hover {
    background: var(--bg-secondary);
}

.pilot-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.pilot-image:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

/* ===========================
   Why Section
   =========================== */

.why-section {
    background: var(--bg-secondary);
}

.why-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.why-text {
    order: 2;
}

.why-visual {
    order: 1;
}

.why-text .section-title {
    text-align: left;
    margin-bottom: 24px;
}

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

.why-text strong {
    color: var(--primary-color);
}

.why-image {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    transition: var(--transition);
}

.why-image:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

/* ===========================
   Founder Section
   =========================== */

.founder-section {
    background: white;
}

.founder-content {
    display: flex;
    justify-content: center;
    align-items: center;
}

.founder-quote {
    max-width: 900px;
    width: 100%;
}

.founder-quote blockquote {
    background: var(--bg-secondary);
    padding: 50px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-md);
    text-align: center;
}

.founder-quote p {
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-primary);
    font-style: italic;
    margin-bottom: 24px;
}

.founder-quote cite {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-style: normal;
}

.founder-quote strong {
    font-size: 18px;
    color: var(--text-primary);
}

.founder-quote span {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ===========================
   Contact Section
   =========================== */

.contact-section {
    background: var(--bg-secondary);
}

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

.contact-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--bg-secondary);
}

.contact-avatar {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 28px;
    font-weight: 700;
}

.contact-info h3 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.contact-info p {
    font-size: 15px;
    color: var(--text-secondary);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 32px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
}

.contact-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(8px);
}

.contact-link span:first-child {
    font-size: 24px;
}

.qr-placeholder {
    background: linear-gradient(135deg, #E5E7EB, #D1D5DB);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
}

.qr-placeholder span {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.qr-placeholder p {
    font-size: 14px;
    color: var(--text-light);
}

/* ===========================
   Footer
   =========================== */

.footer {
    background: var(--bg-dark);
    color: white;
    padding: 60px 20px 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 60px;
    margin-bottom: 40px;
}

.footer-brand .logo {
    color: white;
    margin-bottom: 16px;
}

.footer-tagline {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 400px;
}

.footer-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.footer-column h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

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

.footer-column li {
    margin-bottom: 12px;
}

.footer-column a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

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

.footer-bottom {
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.footer-bottom p {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 12px;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
}

.footer-legal-links a {
    color: var(--primary-light);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.footer-legal-links a:hover {
    color: white;
    text-decoration: underline;
}

.footer-legal-links .separator {
    color: rgba(255, 255, 255, 0.4);
}

/* ===========================
   Animations
   =========================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateZ(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px) translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateX(0) translateZ(0);
    }
}

/* ===========================
   Performance & Accessibility
   =========================== */

/* Reduce animations for users who prefer reduced motion and improve performance */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Optimize animations for mobile without disabling them */
@media (max-width: 768px) {
    .hero-main-image {
        /* Keep floating animation but slower for better performance */
        animation: float 10s ease-in-out infinite;
    }

    .hero-logo-large,
    .tagline,
    .hero-title,
    .hero-description,
    .hero-buttons,
    .hero-image-wrapper {
        animation-duration: 0.5s;
    }
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 968px) {
    .hero-content,
    .about-content,
    .pilot-content,
    .why-content,
    .founder-content,
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-title {
        font-size: 42px;
    }

    .section-title {
        font-size: 36px;
    }

    .hero-main-image {
        max-width: 450px;
    }

    .why-visual,
    .why-text {
        order: 0;
    }

    .footer-links {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .header {
        top: 10px;
        width: calc(100% - 20px);
    }

    .header.scrolled {
        top: 10px;
    }

    .nav {
        padding: 12px 20px;
        border-radius: 50px;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        border-radius: 24px;
        box-shadow: 0 8px 32px rgba(0, 159, 177, 0.2);
        border: 1px solid rgba(0, 159, 177, 0.1);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        /* Improve rendering on mobile */
        -webkit-transform: translateX(-50%) translateZ(0);
        transform: translateX(-50%) translateZ(0);
    }

    .nav-menu.active {
        opacity: 1;
        pointer-events: all;
    }

    .nav-toggle {
        display: flex;
    }

    .logo img {
        height: 32px;
    }

    .hero {
        padding: 120px 20px 60px;
        min-height: auto;
    }

    .hero-logo-large img {
        max-width: 320px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-description {
        font-size: 18px;
    }

    .section-title {
        font-size: 32px;
    }

    .preview-gallery {
        grid-template-columns: 1fr;
    }

    /* Ensure preview cards are visible on mobile */
    .preview-card {
        opacity: 1 !important;
        transform: none !important;
    }

    /* Prevent image loading issues on mobile */
    .preview-image {
        min-height: 200px;
        background: #F9FAFB;
    }

    .preview-image img {
        max-height: 600px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .hero-main-image {
        max-width: 350px;
    }

    .section {
        padding: 60px 20px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 28px;
    }

    .section-title {
        font-size: 28px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-main-image {
        max-width: 280px;
    }

    .contact-card {
        padding: 24px;
    }

    .founder-quote blockquote {
        padding: 24px;
    }

    .founder-quote p {
        font-size: 18px;
    }
}
