/* VitGuru Main Stylesheet - Mobile First Approach */

/* 
   LOGO IMPLEMENTATION:
   Place your logo file as "logo-rounded.png" in the root directory
   
   Logo file recommendations:
   - Use a square image (1:1 aspect ratio) for best results
   - Recommended size: 200x200px or higher for retina displays
   - Format: PNG with transparent background or white background
   - File size: Optimize to under 50KB for fast loading
   
   HTML structure for logo:
   
   <a href="/" class="logo-wrapper">
       <div class="logo-img">
           <img src="/logo-rounded.png" alt="VitGuru Logo">
       </div>
       <span class="logo-text">VitGuru</span>
   </a>
*/

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

:root {
    --primary: #9B59B6;
    --primary-dark: #8E44AD;
    --secondary: #27ae60;
    --text-dark: #2c3e50;
    --text-light: #666;
    --bg-light: #f8f9fa;
    --bg-gradient: linear-gradient(135deg, #f8f4ff 0%, #fff 100%);
    
    /* Dynamic viewport units (set by JS) */
    --vh: 1vh;
    --dvh: 1dvh;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #ffffff;
    width: 100%;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    
    /* Safe area padding for notched devices */
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    
    /* Prevent highlight on tap */
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Container for consistent padding */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation - Mobile First with Safari fixes */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70px;
    background: rgba(255, 255, 255, 0.98);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    
    /* Ensure nav stays on top in Safari */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    height: 70px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    align-items: center;
    -webkit-justify-content: space-between;
    -webkit-align-items: center;
}

.logo-wrapper {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

/* Flexbox gap fallback for logo */
.logo-wrapper > * {
    margin-right: 0.75rem;
}
.logo-wrapper > *:last-child {
    margin-right: 0;
}

/* Gap support detection override */
@supports (gap: 1rem) {
    .logo-wrapper {
        gap: 0.75rem;
    }
    .logo-wrapper > * {
        margin-right: 0;
    }
}

.logo-img {
    /* Mobile first: smaller size */
    width: 36px;
    height: 36px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
    /* Subtle shadow for depth */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    -webkit-filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    background: transparent;
    border-radius: 12px;
}

.logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-object-fit: cover;
    display: block;
    /* Ensure image is always visible */
    min-width: 100%;
    min-height: 100%;
    /* Make sure image sits above fallback background */
    position: relative;
    z-index: 1;
    background: transparent;
    border-radius: 12px;
}

/* Hide fallback text when image loads */
.logo-img img:not([src=""]) {
    background: transparent;
}

/* Responsive logo sizing for different screens */
/* Small mobile (up to 375px) */
@media (max-width: 375px) {
    .logo-img {
        width: 32px;
        height: 32px;
    }
    .logo-text {
        font-size: 1.1rem;
    }
}

/* Standard mobile (376px to 767px) */
@media (min-width: 376px) and (max-width: 767px) {
    .logo-img {
        width: 38px;
        height: 38px;
    }
    .logo-text {
        font-size: 1.2rem;
    }
}

/* Tablet (768px to 1023px) */
@media (min-width: 768px) {
    .logo-img {
        width: 44px;
        height: 44px;
    }
    .logo-text {
        font-size: 1.35rem;
    }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
    .logo-img {
        width: 48px;
        height: 48px;
    }
    .logo-text {
        font-size: 1.5rem;
        font-weight: 700;
    }
}

/* Large desktop (1440px and up) */
@media (min-width: 1440px) {
    .logo-img {
        width: 52px;
        height: 52px;
    }
    .logo-text {
        font-size: 1.6rem;
    }
}

.logo-text {
    font-size: 1.2rem; /* Base size for mobile */
    font-weight: 700;
    color: var(--text-dark);
    /* Prevent text from wrapping */
    white-space: nowrap;
    /* Smooth transition when size changes */
    transition: font-size 0.3s ease;
    -webkit-transition: font-size 0.3s ease;
}

/* Desktop Navigation with gap fallback */
.nav-links {
    display: none;
}

.nav-links > * {
    margin-right: 1.5rem;
}
.nav-links > *:last-child {
    margin-right: 0;
}

@supports (gap: 1rem) {
    .nav-links {
        gap: 1.5rem;
    }
    .nav-links > * {
        margin-right: 0;
    }
}

/* Language Selector */
.language-selector {
    position: relative;
    display: inline-block;
    z-index: 1001;
}

.language-dropdown {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    min-width: 70px;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.language-dropdown:hover {
    border-color: var(--primary);
    background: var(--bg-light);
}

.language-dropdown::after {
    content: "▼";
    margin-left: 0.5rem;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    -webkit-transition: transform 0.3s ease;
}

.language-dropdown.active::after {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
}

.language-options {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 0.5rem 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    display: none;
    z-index: 1002;
    margin-top: 0.5rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.language-options.show {
    display: block;
}

.language-option {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    padding: 0.5rem 0.875rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    text-decoration: none;
    transition: background-color 0.3s ease;
    -webkit-transition: background-color 0.3s ease;
    -webkit-tap-highlight-color: transparent;
}

.language-option:hover {
    background-color: var(--bg-light);
}

.language-option.selected {
    background-color: var(--primary);
    color: white;
}

.language-option .flag {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Mobile language selector */
.mobile-language-selector {
    display: block;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-language-dropdown {
    width: 100%;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: space-between;
    -webkit-align-items: center;
    -webkit-justify-content: space-between;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}
.mobile-language-dropdown.active {
    border-color: var(--primary);
}
.mobile-language-dropdown.active span:last-child {
    transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    transition: transform 0.2s ease;
    -webkit-transition: -webkit-transform 0.2s ease;
}
.mobile-language-dropdown span:last-child {
    transition: transform 0.2s ease;
    -webkit-transition: -webkit-transform 0.2s ease;
}

.mobile-language-options {
    width: 100%;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    display: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.mobile-language-options.show {
    display: block;
}

.app-store-badge {
    background: #000;
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    margin-left: 0.5rem;
}

.app-store-badge.android-badge {
    background: #3DDC84;
    color: white !important;
}

.app-store-badge.ios-badge {
    background: #000;
    color: white !important;
}

/* Pricing Buttons Container */
.pricing-buttons {
    display: flex;
    gap: 1.5rem;
    width: 100%;
    padding: 0.75rem;
    justify-content: space-between;
}

.pricing-buttons .btn-secondary,
.pricing-buttons .btn-white {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
}

@media (max-width: 768px) {
    .pricing-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .pricing-buttons .btn-secondary,
    .pricing-buttons .btn-white {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    padding: 0.5rem;
    -webkit-tap-highlight-color: transparent;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    padding: 1rem;
    z-index: 999;
    
    /* Safari-compatible height calculation */
    max-height: calc(100vh - 70px - env(safe-area-inset-bottom));
    max-height: calc(var(--vh, 1vh) * 100 - 70px - env(safe-area-inset-bottom));
    
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    font-size: 1rem;
    -webkit-tap-highlight-color: transparent;
}

/* Hero Section - Mobile First */
.hero {
    margin-top: 70px;
    padding: 2rem 1rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    background: var(--bg-gradient);
    min-height: auto;
    scroll-margin-top: calc(70px + env(safe-area-inset-top));
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    align-items: center;
    -webkit-align-items: center;
    text-align: center;
}

/* Hero container gap fallback */
.hero-container > * {
    margin-bottom: 2rem;
}
.hero-container > *:last-child {
    margin-bottom: 0;
}

@supports (gap: 1rem) {
    .hero-container {
        gap: 2rem;
    }
    .hero-container > * {
        margin-bottom: 0;
    }
}

.hero-content {
    width: 100%;
}

.hero-content h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.hero-content p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    padding: 0 1rem;
}

.hero-buttons {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    margin-bottom: 1.5rem;
    width: 100%;
    padding: 0 1rem;
}

/* Hero buttons gap fallback */
.hero-buttons > * {
    margin-bottom: 1rem;
}
.hero-buttons > *:last-child {
    margin-bottom: 0;
}

@supports (gap: 1rem) {
    .hero-buttons {
        gap: 1rem;
    }
    .hero-buttons > * {
        margin-bottom: 0;
    }
}

/* Buttons - Mobile First with Safari fixes */
.btn-primary,
.btn-secondary,
.btn-white {
    padding: 0.875rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px; /* Prevents iOS zoom */
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}

/* Button icon gap fallback */
.btn-primary > *,
.btn-secondary > *,
.btn-white > * {
    margin-right: 0.5rem;
}
.btn-primary > *:last-child,
.btn-secondary > *:last-child,
.btn-white > *:last-child {
    margin-right: 0;
}

@supports (gap: 1rem) {
    .btn-primary,
    .btn-secondary,
    .btn-white {
        gap: 0.5rem;
    }
    .btn-primary > *,
    .btn-secondary > *,
    .btn-white > * {
        margin-right: 0;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
}

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

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

/* Badges with gap fallback */
.badge-row {
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    justify-content: center;
    -webkit-justify-content: center;
    width: 100%;
    padding: 0 1rem;
}

/* Badge row gap fallback */
.badge-row > * {
    margin: 0.25rem;
}

@supports (gap: 1rem) {
    .badge-row {
        gap: 0.5rem;
    }
    .badge-row > * {
        margin: 0;
    }
}

.badge {
    display: inline-flex;
    display: -webkit-inline-flex;
    align-items: center;
    -webkit-align-items: center;
    padding: 0.375rem 0.75rem;
    background: white;
    border-radius: 20px;
    font-size: 0.75rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Badge gap fallback */
.badge > * {
    margin-right: 0.25rem;
}
.badge > *:last-child {
    margin-right: 0;
}

@supports (gap: 1rem) {
    .badge {
        gap: 0.25rem;
    }
    .badge > * {
        margin-right: 0;
    }
}

.badge-new {
    background: var(--secondary);
    color: white;
    font-weight: 600;
}

.badge-coming {
    background: #f39c12;
    color: white;
    font-weight: 600;
}

/* Hero Image - Mobile */
.hero-image {
    width: 100%;
    max-width: 350px;
    margin: 0 auto;
}

.phone-mockup {
    width: 100%;
    background: white;
    border-radius: 30px;
    padding: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border: 2px solid #f0f0f0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.phone-screen {
    background: var(--bg-gradient);
    border-radius: 20px;
    padding: 1.5rem;
    min-height: 300px;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    align-items: center;
    justify-content: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
}

.screen-content {
    text-align: center;
    width: 100%;
}

.screen-content h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.vitamin-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin: 1rem 0;
}

/* Grid gap fallback */
@supports not (gap: 1rem) {
    .vitamin-grid {
        margin: calc(1rem - 0.25rem) calc(0 - 0.25rem);
    }
    .vitamin-grid > * {
        margin: 0.25rem;
    }
}

.vitamin-pill {
    background: white;
    padding: 0.5rem;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-size: 1.5rem;
}

/* Sections - Mobile First */
.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.section-header h2 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.section-header p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Science Section - Mobile */
.science-section {
    padding: 3rem 1rem;
    background: white;
}

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

/* Grid gap fallback */
@supports not (gap: 1rem) {
    .science-grid {
        margin: -0.75rem;
    }
    .science-grid > * {
        margin: 0.75rem;
    }
}

.science-card {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
}

.science-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #e8deff 0%, #f8f4ff 100%);
    border-radius: 15px;
    margin: 0 auto 1rem;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    font-size: 1.5rem;
}

.science-card h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.science-card p {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Features Section - Mobile */
.features-section {
    padding: 3rem 1rem;
    background: var(--bg-gradient);
}

.feature-row {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    margin-bottom: 3rem;
}

/* Feature row gap fallback */
.feature-row > * {
    margin-bottom: 2rem;
}
.feature-row > *:last-child {
    margin-bottom: 0;
}

@supports (gap: 1rem) {
    .feature-row {
        gap: 2rem;
    }
    .feature-row > * {
        margin-bottom: 0;
    }
}

.feature-row.reverse {
    direction: ltr;
}

.feature-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.feature-content p {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    display: flex;
    display: -webkit-flex;
    align-items: flex-start;
    -webkit-align-items: flex-start;
    margin-bottom: 0.75rem;
    color: var(--text-light);
    font-size: 0.9375rem;
}

/* Feature list gap fallback */
.feature-list li > * {
    margin-right: 0.75rem;
}
.feature-list li > *:last-child {
    margin-right: 0;
}

@supports (gap: 1rem) {
    .feature-list li {
        gap: 0.75rem;
    }
    .feature-list li > * {
        margin-right: 0;
    }
}

.feature-list li::before {
    content: "✓";
    color: var(--secondary);
    font-weight: bold;
    font-size: 1.125rem;
    flex-shrink: 0;
    -webkit-flex-shrink: 0;
}

.feature-visual {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    text-align: center;
    min-height: 200px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    -webkit-flex-direction: column;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.feature-mockup {
    width: 100%;
}

/* Pricing Section - Mobile */
.pricing-section {
    padding: 3rem 1rem;
    background: white;
}

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 400px;
    margin: 0 auto;
}

/* Grid gap fallback */
@supports not (gap: 1rem) {
    .pricing-grid {
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
    .pricing-grid > * {
        margin: 0.75rem;
    }
}

.pricing-card {
    background: var(--bg-light);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
}

.pricing-card.featured {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(155, 89, 182, 0.3);
}

.price-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.price-amount span {
    font-size: 1rem;
    font-weight: 400;
}

.price-features {
    list-style: none;
    margin: 1.5rem 0;
    padding: 0;
    text-align: left;
}

.price-features li {
    padding: 0.5rem 0;
    font-size: 0.9375rem;
}

/* CTA Section - Mobile */
.cta-section {
    padding: 3rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    text-align: center;
}

.cta-content h2 {
    font-size: 1.75rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
}

.cta-content p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.cta-buttons {
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    max-width: 300px;
    margin: 0 auto;
}

/* CTA buttons gap fallback */
.cta-buttons > * {
    margin-bottom: 1rem;
}
.cta-buttons > *:last-child {
    margin-bottom: 0;
}

@supports (gap: 1rem) {
    .cta-buttons {
        gap: 1rem;
    }
    .cta-buttons > * {
        margin-bottom: 0;
    }
}

/* Footer - Mobile */
footer {
    background: var(--text-dark);
    color: white;
    padding: 2rem 1rem 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

/* Grid gap fallback */
@supports not (gap: 1rem) {
    .footer-container {
        margin-left: -1rem;
        margin-right: -1rem;
    }
    .footer-container > * {
        margin: 1rem;
    }
}

.footer-brand h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.footer-brand p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.social-links {
    display: flex;
    display: -webkit-flex;
    justify-content: center;
    -webkit-justify-content: center;
}

/* Social links gap fallback */
.social-links > * {
    margin-right: 1rem;
}
.social-links > *:last-child {
    margin-right: 0;
}

@supports (gap: 1rem) {
    .social-links {
        gap: 1rem;
    }
    .social-links > * {
        margin-right: 0;
    }
}

.social-links a {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    justify-content: center;
    -webkit-align-items: center;
    -webkit-justify-content: center;
    text-decoration: none;
    font-size: 1.125rem;
    -webkit-tap-highlight-color: transparent;
}

.footer-column h4 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
}

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

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column ul li a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.875rem;
    -webkit-tap-highlight-color: transparent;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Page Specific - Mobile */
.page-hero {
    margin-top: 70px;
    padding: 2rem 1rem;
    padding-top: calc(2rem + env(safe-area-inset-top));
    background: var(--bg-gradient);
    text-align: center;
    scroll-margin-top: calc(70px + env(safe-area-inset-top));
}

.page-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.page-hero p {
    font-size: 1rem;
    color: var(--text-light);
}

.page-content {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.page-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 2rem 0 1rem;
}

.page-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 1.5rem 0 0.75rem;
}

.page-content p {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.page-content ul {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

/* Forms - Mobile with Safari fixes */
.contact-form {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 20px;
    margin-top: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9375rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px; /* Prevents iOS zoom */
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    -webkit-tap-highlight-color: transparent;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Utility classes for better mobile handling */
.w-100 {
    width: 100% !important;
}

.text-center {
    text-align: center !important;
}

.mx-auto {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Tablet Styles */
@media (min-width: 768px) {
    /* Navigation */
    .nav-container {
        padding: 0 2rem;
        /* Adjust height for larger logo */
        height: 75px;
    }
    
    nav {
        height: 75px;
    }
    
    .mobile-menu {
        top: 75px;
        max-height: calc(100vh - 75px - env(safe-area-inset-bottom));
        max-height: calc(var(--vh, 1vh) * 100 - 75px - env(safe-area-inset-bottom));
    }
    
    .hero,
    .page-hero {
        margin-top: 75px;
        scroll-margin-top: calc(75px + env(safe-area-inset-top));
    }
    
    .nav-links {
        display: flex;
        display: -webkit-flex;
        align-items: center;
        -webkit-align-items: center;
    }
    
    .nav-right {
        display: flex;
        display: -webkit-flex;
        align-items: center;
        -webkit-align-items: center;
    }
    
    .nav-right > * {
        margin-left: 1rem;
    }
    .nav-right > *:first-child {
        margin-left: 0;
    }
    
    @supports (gap: 1rem) {
        .nav-right {
            gap: 1rem;
        }
        .nav-right > * {
            margin-left: 0;
        }
    }
    
    .nav-links a {
        color: var(--text-light);
        text-decoration: none;
        font-weight: 500;
        transition: color 0.3s ease;
        -webkit-transition: color 0.3s ease;
        font-size: 0.9375rem;
    }
    
    .nav-links a:hover {
        color: var(--primary);
    }
    
    .mobile-menu-toggle {
        display: none;
    }
    
    /* Hero */
    .hero {
        padding: 3rem 2rem;
    }
    
    .hero-container {
        grid-template-columns: 1fr 1fr;
        display: grid;
        text-align: left;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content p {
        font-size: 1.125rem;
        padding: 0;
    }
    
    .hero-buttons {
        flex-direction: row;
        -webkit-flex-direction: row;
        width: auto;
        padding: 0;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-white {
        width: auto;
        padding: 0.875rem 2rem;
    }
    
    .badge-row {
        justify-content: flex-start;
        -webkit-justify-content: flex-start;
        padding: 0;
    }
    
    /* Sections */
    .science-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .feature-row {
        grid-template-columns: 1fr 1fr;
        display: grid;
    }
    
    .feature-row.reverse {
        direction: rtl;
    }
    
    .feature-row.reverse .feature-content {
        direction: ltr;
    }
    
    .pricing-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1000px;
    }
    
    .cta-buttons {
        flex-direction: row;
        -webkit-flex-direction: row;
        justify-content: center;
        -webkit-justify-content: center;
        max-width: none;
    }
    
    /* Footer */
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        text-align: left;
    }
    
    .social-links {
        justify-content: flex-start;
        -webkit-justify-content: flex-start;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    /* Navigation height adjustment for larger logo */
    nav,
    .nav-container {
        height: 80px;
    }
    
    .mobile-menu {
        top: 80px;
    }
    
    .hero,
    .page-hero {
        margin-top: 80px;
        scroll-margin-top: calc(80px + env(safe-area-inset-top));
    }
    
    /* Hero */
    .hero {
        padding: 4rem 2rem;
        min-height: 600px;
    }
    
    .hero-content h1 {
        font-size: 3.5rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-content p {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }
    
    .hero-image {
        max-width: 400px;
    }
    
    /* Sections */
    .section-header h2 {
        font-size: 2.5rem;
    }
    
    .section-header p {
        font-size: 1.2rem;
    }
    
    .science-section,
    .features-section,
    .pricing-section {
        padding: 5rem 2rem;
    }
    
    .feature-content h3 {
        font-size: 2rem;
    }
    
    .feature-content p {
        font-size: 1.1rem;
    }
    
    .feature-visual {
        min-height: 300px;
    }
    
    /* Page content */
    .page-content {
        margin: 3rem auto;
        padding: 0 2rem;
    }
    
    .page-content h2 {
        font-size: 2rem;
    }
    
    .page-content h3 {
        font-size: 1.5rem;
    }
    
    .page-content p,
    .page-content ul {
        font-size: 1rem;
    }
}

/* Fix for very small screens */
@media (max-width: 360px) {
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .price-amount {
        font-size: 2rem;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Additional Safari-specific fixes using feature detection */
@supports (-webkit-touch-callout: none) {
    /* This targets Safari/WebKit browsers */
    
    /* Ensure smooth scrolling */
    html {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix for Safari's handling of position: fixed */
    nav {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    /* Ensure buttons don't get Safari's default styling */
    button,
    input[type="button"],
    input[type="submit"],
    .btn-primary,
    .btn-secondary,
    .btn-white {
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
    }
    
    /* Fix Safari's flexbox rendering issues */
    .hero-container,
    .nav-container,
    .hero-buttons,
    .cta-buttons,
    .badge-row,
    .social-links {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}