/* CSS Variables for Cage Keeper Design System */
:root {
    --color-label: rgba(30, 74, 92, 0.95);
    --color-secondary-label: rgba(30, 74, 92, 0.7);
    --color-tertiary-label: rgba(30, 74, 92, 0.5);
    --color-system-background: #f0f4f6;
    --color-secondary-background: #e8f1f4;
    --color-tertiary-background: #f8fafb;
    --color-primary: #1e4a5c;
    --color-primary-light: #2d5f74;
    --color-accent: #4a9bb8;
    --color-accent-light: #6db4cc;
    --color-system-blue: #4a9bb8;
    --color-system-green: #34C759;
    --color-system-red: #FF3B30;
    --color-system-orange: #FF9500;
    --color-separator: rgba(60, 60, 67, 0.12);
    --corner-radius: 12px;
    --corner-radius-large: 20px;
    --transition-standard: all 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@media (prefers-color-scheme: dark) {
    :root {
        --color-label: rgba(255, 255, 255, 0.85);
        --color-secondary-label: rgba(235, 235, 245, 0.6);
        --color-tertiary-label: rgba(235, 235, 245, 0.3);
        --color-system-background: #0a1a22;
        --color-secondary-background: #132831;
        --color-tertiary-background: #1e3440;
        --color-primary: #4a9bb8;
        --color-primary-light: #6db4cc;
        --color-accent: #7fc8dc;
        --color-accent-light: #9dd6e7;
        --color-system-blue: #6db4cc;
        --color-separator: rgba(84, 84, 88, 0.6);
    }
}

/* SF Pro Font Loading */
@font-face {
    font-family: 'SF Pro Display';
    src: url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-regular-webfont.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-semibold-webfont.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-bold-webfont.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--color-system-background);
    color: var(--color-label);
    line-height: 1.47;
    overflow-x: hidden;
}

/* Typography */
.large-title {
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h1 {
    font-size: clamp(34px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h2 {
    font-size: clamp(28px, 4vw, 34px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h3 {
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.body-text {
    font-size: 17px;
    line-height: 1.47;
    color: var(--color-label);
}

.caption {
    font-size: 15px;
    color: var(--color-secondary-label);
    line-height: 1.4;
}

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

.section {
    padding: 100px 0;
    position: relative;
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .hero {
        padding-bottom: 120px;
    }

    .hero-icon {
        width: 100px;
        height: 100px;
        margin-bottom: 24px;
    }

    .hero-buttons {
        margin-bottom: 40px;
    }
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--color-separator);
    transition: var(--transition-standard);
}

@media (prefers-color-scheme: dark) {
    nav {
        background: rgba(0, 0, 0, 0.8);
    }
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-logo {
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--color-label);
}

.nav-links {
    display: flex;
    gap: 32px;
    align-items: center;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
}

.nav-link {
    color: var(--color-label);
    text-decoration: none;
    font-size: 17px;
    transition: var(--transition-standard);
    opacity: 0.8;
}

.nav-link:hover {
    opacity: 1;
}

/* Hero Section */
.hero {
    padding-top: 140px;
    padding-bottom: 260px;
    text-align: center;
    background: linear-gradient(180deg,
            var(--color-secondary-background) 0%,
            var(--color-system-background) 100%);
    position: relative;
    will-change: transform;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    color: white;
}

.hero-icon .app-icon {
    width: 100%;
    height: 100%;
    border-radius: 27.4%;
    object-fit: cover;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 24px;
    color: var(--color-secondary-label);
    margin-top: 16px;
    margin-bottom: 40px;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition-standard);
    cursor: pointer;
    border: none;
    min-width: 200px;
    position: relative;
    overflow: hidden;
}

.button-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    border: none;
}

.button-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(30, 74, 92, 0.3);
    background: linear-gradient(135deg, var(--color-primary-light), var(--color-accent-light));
}

.button-primary:active {
    transform: scale(0.98);
}

.button-secondary {
    background: var(--color-secondary-background);
    color: var(--color-system-blue);
}

.button-secondary:hover {
    background: var(--color-tertiary-background);
    transform: scale(1.02);
}

/* Feature Cards */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 64px;
}

.feature-card {
    background: var(--color-tertiary-background);
    border-radius: var(--corner-radius-large);
    padding: 32px;
    transition: var(--transition-standard);
    border: 1px solid var(--color-separator);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(30, 74, 92, 0.15);
}

.feature-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 24px;
    color: white;
}

.feature-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-description {
    color: var(--color-secondary-label);
    line-height: 1.5;
}

/* Screenshots Section */
.screenshots {
    background: var(--color-secondary-background);
    padding: 60px 0;
}

.screenshots-carousel {
    position: relative;
    max-width: 1200px;
    margin: 32px auto 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.screenshots-viewport {
    overflow: hidden;
    border-radius: var(--corner-radius);
}

.screenshots-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    gap: 32px;
    align-items: flex-start;
    padding: 20px 0;
}

.screenshot-card {
    flex: 0 0 calc(33.333% - 21.333px);
    /* 3 screenshots per view on desktop */
    text-align: center;
    min-width: 0;
    /* Allow flexbox to shrink */
}

.screenshot-card img {
    width: 100%;
    max-width: 220px;
    max-height: 400px;
    height: auto;
    border-radius: var(--corner-radius-large);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    margin-bottom: 12px;
    object-fit: contain;
}

.screenshot-caption {
    font-size: 14px;
    color: var(--color-secondary-label);
    line-height: 1.3;
    padding: 0 8px;
    max-width: 220px;
    margin: 0 auto;
}

/* Tablet view - 2 screenshots */
@media (max-width: 1024px) {
    .screenshots-carousel {
        max-width: 700px;
    }

    .screenshots-track {
        padding: 16px 0;
    }

    .screenshot-card {
        flex: 0 0 calc(50% - 16px);
        /* 2 screenshots per view on tablet */
    }

    .screenshot-card img {
        max-width: 200px;
        max-height: 350px;
    }

    .screenshot-caption {
        max-width: 200px;
        font-size: 13px;
    }
}

/* Mobile view - 1 screenshot */
@media (max-width: 768px) {
    .screenshots {
        padding: 40px 0;
    }

    .screenshots-carousel {
        max-width: 280px;
        margin: 24px auto 0;
        gap: 16px;
    }

    .screenshots-track {
        gap: 0;
        padding: 12px 0;
    }

    .screenshot-card {
        flex: 0 0 100%;
        /* 1 screenshot per view on mobile */
        padding: 0 10px;
    }

    .screenshot-card img {
        max-width: 200px;
        max-height: 340px;
    }

    .screenshot-caption {
        max-width: 200px;
        font-size: 13px;
    }
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
    margin-top: 64px;
}

.stat-card {
    text-align: center;
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    color: var(--color-system-blue);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 20px;
    color: var(--color-secondary-label);
}

/* Footer */
footer {
    background: var(--color-secondary-background);
    padding: 48px 0;
    border-top: 1px solid var(--color-separator);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-section h4 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-link {
    color: var(--color-secondary-label);
    text-decoration: none;
    font-size: 15px;
    transition: var(--transition-standard);
}

.footer-link:hover {
    color: var(--color-label);
}

.footer-bottom {
    text-align: center;
    padding-top: 32px;
    border-top: 1px solid var(--color-separator);
    color: var(--color-tertiary-label);
    font-size: 13px;
}

/* Page Sections */
.page-section {
    display: none;
    min-height: 100vh;
    padding-top: 64px;
}

.page-section.active {
    display: block;
}

/* Privacy & Support Pages */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 80px 20px;
}

.content-page h1 {
    margin-bottom: 16px;
}

.content-page h2 {
    margin-top: 48px;
    margin-bottom: 24px;
}

.content-page h3 {
    margin-top: 32px;
    margin-bottom: 16px;
}

.content-page p {
    margin-bottom: 16px;
    line-height: 1.6;
}

.content-page ul {
    margin-left: 32px;
    margin-bottom: 16px;
}

.content-page li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.content-page ol {
    margin-left: 32px;
    margin-bottom: 16px;
}

.content-page ol li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.last-updated {
    color: var(--color-tertiary-label);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-label);
    cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
}

.mobile-menu-open {
    display: flex !important;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--color-system-background);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--color-separator);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--color-system-green);
    color: white;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    margin-left: 12px;
}

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

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(0);
    }
}

.animate-in {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Testimonials Section (New) */
.testimonials {
    background: var(--color-secondary-background);
    padding: 80px 0;
}

.testimonials-carousel {
    position: relative;
    max-width: 800px;
    margin: 48px auto 0;
    overflow: hidden;
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.testimonial-card {
    min-width: calc(100% - 32px);
    width: calc(100% - 32px);
    flex-shrink: 0;
    background: var(--color-tertiary-background);
    border-radius: var(--corner-radius-large);
    padding: 32px;
    border: 1px solid var(--color-separator);
    margin: 0 16px;
    box-sizing: border-box;
}

.carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
}

.carousel-btn {
    background: var(--color-system-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.carousel-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    background: var(--color-separator);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.carousel-dot:hover {
    background: var(--color-system-blue);
    opacity: 0.7;
}

@media (max-width: 768px) {
    .testimonial-card {
        margin: 0 8px;
        padding: 24px;
    }

    .carousel-controls {
        gap: 16px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

.testimonial-card {
    background: var(--color-tertiary-background);
    border-radius: var(--corner-radius-large);
    padding: 32px;
    border: 1px solid var(--color-separator);
}

.testimonial-text {
    font-size: 17px;
    line-height: 1.6;
    color: var(--color-label);
    margin-bottom: 24px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 16px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.testimonial-info {
    flex: 1;
}

.testimonial-name {
    font-weight: 600;
    color: var(--color-label);
    margin-bottom: 4px;
}

.testimonial-role {
    font-size: 14px;
    color: var(--color-secondary-label);
}

.testimonial-rating {
    color: var(--color-system-orange);
    margin-bottom: 16px;
}

/* Newsletter Section (New) */
.newsletter {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: white;
    padding: 60px 0;
    text-align: center;
}

.newsletter h2 {
    color: white;
    margin-bottom: 16px;
}

.newsletter-subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 32px;
}

.newsletter-form {
    display: flex;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.newsletter-input {
    flex: 1;
    min-width: 250px;
    padding: 16px 24px;
    border-radius: 980px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 16px;
    transition: var(--transition-standard);
}

.newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.newsletter-input:focus {
    outline: none;
    border-color: white;
    background: rgba(255, 255, 255, 0.2);
}

.newsletter-button {
    padding: 16px 32px;
    background: white;
    color: var(--color-primary);
    border: none;
    border-radius: 980px;
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-standard);
}

.newsletter-button:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(30, 74, 92, 0.3);
}

/* Scroll Indicator */
.scroll-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--color-system-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(100px);
    transition: var(--transition-standard);
    z-index: 999;
}

.scroll-indicator.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-indicator:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 122, 255, 0.3);
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 122, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-system-blue);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success Message */
.success-message {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--color-system-green);
    color: white;
    padding: 16px 24px;
    border-radius: var(--corner-radius);
    box-shadow: 0 4px 12px rgba(52, 199, 89, 0.3);
    transform: translateX(400px);
    transition: transform 0.3s ease-out;
    z-index: 1001;
}

.success-message.show {
    transform: translateX(0);
}