:root {
    --bg-color: #000000;
    --text-color: #ffffff;
    --text-secondary: #a1a1a6;
    --accent-color: #0a84ff;
    --card-bg: rgba(28, 28, 30, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(0, 0, 0, 0.8);
    --animation-duration: 0.8s;
    
    /* Button Colors (Default Dark Mode) */
    --btn-bg: #ffffff;
    --btn-text: #000000;
    --btn-primary-bg: #0a84ff;
    --btn-primary-text: #ffffff;
    
    /* Community Section Special Handling */
    --community-bg: rgba(28, 28, 30, 0.6);
    --community-text: #ffffff;
    --logo-card-surface: rgba(247, 241, 235, 0.96);
    --logo-card-shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
    
    /* Apple System Fonts */
    --font-stack: "SF Pro Text", "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="light"] {
    --bg-color: #ffffff;
    --text-color: #1d1d1f;
    --text-secondary: #6e6e73; /* Slightly darker for better contrast in light mode */
    --accent-color: #0071e3;
    --card-bg: rgba(245, 245, 247, 0.8);
    --glass-border: rgba(0, 0, 0, 0.08);
    --navbar-bg: rgba(255, 255, 255, 0.8);
    
    /* Button Colors (Light Mode Overrides) */
    --btn-bg: #1d1d1f;
    --btn-text: #ffffff;
    --btn-primary-bg: #0071e3;
    --btn-primary-text: #ffffff;
    
    /* Community Section Special Handling */
    --community-bg: #f5f5f7;
    --community-text: #1d1d1f;
    --logo-card-surface: rgba(255, 255, 255, 0.94);
    --logo-card-shadow: 0 28px 60px rgba(15, 23, 42, 0.16);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-stack);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    overflow-x: hidden;
}

h1, h2, h3 {
    font-family: var(--font-stack);
    font-weight: 600;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: var(--navbar-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    border-bottom: 1px solid var(--glass-border);
    transition: background 0.3s, border 0.3s;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-family: var(--font-stack);
    font-weight: 700;
    font-size: 1.2rem;
    text-decoration: none;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    font-weight: 400;
    transition: opacity 0.3s;
}

.nav-links a:hover {
    opacity: 0.7;
}

/* Hero Section */
.hero {
    padding-top: 120px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 4.2rem;
    line-height: 1.2;
    margin-bottom: 24px;
    letter-spacing: -1.5px;
}

.accent {
    color: var(--accent-color);
    display: block;
    white-space: nowrap;
}

.hero-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 500px;
    line-height: 1.6;
}

.hero-btns {
    display: flex;
    gap: 20px;
    align-items: center;
}

.hero-image-container {
    flex: 1.2;
    display: flex;
    justify-content: flex-end;
}

.hero-logo-stack {
    width: min(100%, 520px);
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-logo-carousel {
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    perspective: 1800px;
    perspective-origin: center center;
}

.hero-logo-card {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    border-radius: 40px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background:
        radial-gradient(circle at 18% 16%, rgba(var(--card-tint), 0.32) 0, rgba(var(--card-tint), 0.14) 24%, transparent 52%),
        linear-gradient(145deg, rgba(255, 255, 255, 0.92), var(--logo-card-surface) 42%, rgba(227, 230, 234, 0.84) 100%);
    box-shadow: var(--logo-card-shadow);
    transform-style: preserve-3d;
    backface-visibility: hidden;
    will-change: transform, opacity;
    transition: transform 780ms cubic-bezier(0.22, 1, 0.36, 1), opacity 780ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 780ms ease, filter 780ms ease;
}

.hero-logo-card::before,
.hero-logo-card::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.hero-logo-card::before {
    inset: 18px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 32%);
    opacity: 0.9;
}

.hero-logo-card::after {
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.hero-logo-stack:hover .hero-logo-card.is-active {
    box-shadow: 0 40px 82px rgba(0, 0, 0, 0.38);
}

.hero-logo-card.is-active {
    opacity: 1;
    z-index: 4;
    filter: none;
    transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) scale(1);
}

.hero-logo-card.is-next {
    opacity: 0.92;
    z-index: 3;
    filter: saturate(0.86) brightness(0.97);
    transform: translate3d(34px, 24px, -120px) rotateX(7deg) rotateY(-18deg) scale(0.92);
}

.hero-logo-card.is-prev {
    opacity: 0.56;
    z-index: 2;
    filter: saturate(0.72) brightness(0.9);
    transform: translate3d(-18px, 20px, -180px) rotateX(9deg) rotateY(18deg) scale(0.84);
}

.hero-logo-card.is-hidden {
    opacity: 0;
    z-index: 1;
    pointer-events: none;
    filter: blur(4px);
    transform: translate3d(0, 48px, -260px) rotateX(12deg) scale(0.78);
}

.hero-logo-card.is-flip-in {
    z-index: 6;
    animation: heroLogoFlipIn 820ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-logo-card.is-flip-out {
    z-index: 5;
    animation: heroLogoFlipOut 820ms cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-logo-image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.hero-logo-image--cover {
    object-fit: cover;
}

.hero-logo-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid var(--glass-border);
    background: rgba(12, 12, 14, 0.58);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
}

[data-theme="light"] .hero-logo-meta {
    background: rgba(255, 255, 255, 0.82);
}

.hero-logo-label {
    font-size: 0.72rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.hero-logo-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.hero-logo-meta-row strong {
    font-size: 1rem;
    font-weight: 600;
}

.hero-logo-meta-row span {
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
}

@keyframes heroLogoFlipIn {
    from {
        opacity: 0.52;
        transform: translate3d(52px, 24px, -150px) rotateX(8deg) rotateY(-26deg) scale(0.88);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) scale(1);
    }
}

@keyframes heroLogoFlipOut {
    from {
        opacity: 1;
        transform: translate3d(0, 0, 0) rotateX(0deg) rotateY(0deg) scale(1);
    }
    to {
        opacity: 0;
        transform: translate3d(-42px, 18px, -180px) rotateX(10deg) rotateY(26deg) scale(0.84);
    }
}

/* Sections */
.section-padding {
    padding: 120px 0;
}

.section-title {
    font-size: 3rem;
    margin-bottom: 60px;
    letter-spacing: -1px;
}

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

/* Grid & Cards */
.grid {
    display: grid;
    gap: 24px;
}

.features-grid {
    grid-template-columns: repeat(3, 1fr);
}

.glass {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 40px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass:hover {
    transform: scale(1.02);
    border-color: rgba(0, 113, 227, 0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
}

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

.feature-card p {
    color: var(--text-secondary);
}

.icon-header {
    font-size: 2.5rem;
    margin-bottom: 20px;
    display: block;
}

/* Community Section */
.community {
    padding: 80px 0;
}

.glass-dark {
    background: var(--community-bg);
    color: var(--community-text);
    border-radius: 40px;
    padding: 80px 40px;
    text-align: center;
    border: 1px solid var(--glass-border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-dark:hover {
    transform: scale(1.01);
}

.community-content h2 {
    font-size: 3.5rem;
    margin-bottom: 24px;
}

.community-content p {
    font-size: 1.25rem;
    color: var(--community-text);
    opacity: 0.8;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

[data-theme="light"] .sun-icon { display: block; }
[data-theme="light"] .moon-icon { display: none; }
.sun-icon { display: none; }
.moon-icon { display: block; }

/* Services */
.services-grid {
    grid-template-columns: repeat(3, 1fr);
}

.service-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.service-item h3 {
    margin-bottom: 15px;
    font-size: 1.4rem;
}

.service-item p {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.badge, .price, .status {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* CTA */
.cta {
    padding: 150px 0;
}

.cta h2 {
    font-size: 4rem;
    margin-bottom: 20px;
}

.cta p {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 50px;
}

/* Buttons */
.btn-main {
    background: var(--btn-bg);
    color: var(--btn-text) !important;
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    display: inline-block;
}

.btn-main:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text) !important;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
}

.btn-main.large {
    padding: 18px 40px;
    font-size: 1.2rem;
}

.btn-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
}

.btn-link:hover {
    text-decoration: underline;
}

.btn-outline {
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 12px 28px;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s;
    display: inline-block;
}

.btn-outline:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* Footer */
.footer {
    padding: 60px 0;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

/* Responsive */
@media (max-width: 1024px) {
    .hero-text h1 { font-size: 3.5rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .nav-links { display: none; }
    
    .hero-content {
        flex-direction: column;
        text-align: center;
        padding-top: 60px;
    }
    
    .hero-text h1 { font-size: 3rem; }
    .hero-text p { margin: 0 auto 30px; }
    .hero-btns { justify-content: center; }
    .hero-logo-stack {
        width: 100%;
        max-width: 320px;
        gap: 14px;
    }
    .hero-logo-card {
        padding: 18px;
        border-radius: 32px;
    }
    .hero-logo-card::before {
        inset: 12px;
        border-radius: 24px;
    }
    .hero-logo-card.is-next {
        transform: translate3d(20px, 16px, -90px) rotateX(7deg) rotateY(-16deg) scale(0.92);
    }
    .hero-logo-card.is-prev {
        transform: translate3d(-12px, 14px, -130px) rotateX(8deg) rotateY(15deg) scale(0.84);
    }
    .hero-logo-card.is-hidden {
        transform: translate3d(0, 36px, -180px) rotateX(12deg) scale(0.78);
    }
    .hero-logo-meta {
        padding: 14px 16px;
        border-radius: 18px;
    }
    .hero-logo-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .features-grid, .services-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .feature-card, .service-item {
        text-align: center;
    }

    .icon-header {
        margin-left: auto;
        margin-right: auto;
    }
    
    .glass, .glass-dark {
        margin-left: 10px;
        margin-right: 10px;
    }
    
    .section-title { font-size: 2.2rem; }
    .community-content h2 { font-size: 2.5rem; }
    .cta h2 { font-size: 2.5rem; }
}

/* iPhone Specific Tweaks */
@media (max-width: 480px) {
    .hero-text h1 { font-size: 2.5rem; }
    .hero-btns { flex-wrap: wrap; justify-content: center; }
    .btn-main { text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-logo-card,
    .hero-logo-card.is-flip-in,
    .hero-logo-card.is-flip-out {
        animation: none !important;
        transition: none !important;
    }
}
