/* ==========================================
   KarmaPlan Official Website
   White background + Reddit red accent
   ========================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: rgba(255, 255, 255, 0.8);
    --color-red: #FF4500;
    --color-orange: #FF6314;
    --color-dark-red: #CC3700;
    --text-primary: #1a1a1b;
    --text-secondary: #576f76;
    --text-muted: #878a8c;
    --gradient-main: linear-gradient(135deg, #FF6314 0%, #FF4500 50%, #CC3700 100%);
    --gradient-btn: linear-gradient(135deg, #FF4500 0%, #CC3700 100%);
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* --- Gradient Text --- */
.gradient-text {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Navigation --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 16px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 12px 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.nav-logo-icon {
    filter: drop-shadow(0 2px 4px rgba(255, 69, 0, 0.2));
    border-radius: 6px;
}

.nav-logo-text {
    background: linear-gradient(135deg, #FF6314 0%, #FF4500 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-main);
    transition: var(--transition);
    border-radius: 1px;
}

.nav-link:hover {
    color: var(--color-red);
}

.nav-link:hover::after {
    width: 100%;
}

/* Nav CTA Button */
.nav-cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    background: var(--gradient-btn);
    box-shadow: 0 2px 10px rgba(255, 69, 0, 0.25);
    transition: var(--transition);
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 69, 0, 0.35);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.hero-particles .particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--color-red);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    10% {
        opacity: 0.7;
        transform: scale(1);
    }
    90% {
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(0.5);
    }
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 69, 0, 0.06) 0%, rgba(255, 99, 20, 0.03) 40%, transparent 70%);
    border-radius: 50%;
    animation: glowPulse 6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glowPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
    50% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 0 24px;
}

.hero-logo {
    margin-bottom: 32px;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.hero-logo-img {
    width: 140px;
    height: auto;
    filter: drop-shadow(0 4px 16px rgba(255, 69, 0, 0.25));
    border-radius: 20px;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 16px;
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

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

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-btn);
    color: #fff;
    box-shadow: 0 4px 16px rgba(255, 69, 0, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 69, 0, 0.35);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: var(--transition);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.12);
}

.btn-ghost:hover {
    color: var(--color-red);
    border-color: rgba(255, 69, 0, 0.4);
    background: rgba(255, 69, 0, 0.04);
    transform: translateY(-2px);
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.1rem;
    border-radius: 14px;
}

/* --- Scroll Indicator --- */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--color-red);
    border-bottom: 2px solid var(--color-red);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.4; }
    50% { transform: rotate(45deg) translate(5px, 5px); opacity: 0.8; }
}

/* --- Features Section --- */
.features {
    padding: 120px 0;
    position: relative;
}

.features::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 5vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin-bottom: 64px;
}

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

/* --- Feature Card --- */
.feature-card {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    padding: 36px 28px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 99, 20, 0.4), transparent, rgba(255, 69, 0, 0.3));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255, 69, 0, 0.2);
    box-shadow: 0 12px 32px rgba(255, 69, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.06);
}

.feature-card:hover::before {
    opacity: 1;
}

.feature-icon {
    margin-bottom: 20px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 69, 0, 0.06);
    border-radius: 14px;
    border: 1px solid rgba(255, 69, 0, 0.1);
}

.feature-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-desc {
    font-size: 0.92rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* --- Download Section --- */
.download {
    padding: 120px 0;
    position: relative;
    background: var(--bg-secondary);
}

.download-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 300px;
    background: radial-gradient(ellipse, rgba(255, 69, 0, 0.04) 0%, transparent 60%);
    pointer-events: none;
}

.download-card {
    max-width: 600px;
    margin: 48px auto 24px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    padding: 40px;
    display: flex;
    align-items: center;
    gap: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.download-card:hover {
    border-color: rgba(255, 69, 0, 0.2);
    box-shadow: 0 8px 32px rgba(255, 69, 0, 0.1);
}

.download-platform {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.platform-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.download-info {
    flex: 1;
}

.download-version {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.download-req {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.download-btn {
    white-space: nowrap;
}

.download-note {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Contact Section --- */
.contact {
    padding: 120px 0;
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.06), transparent);
}

.contact-card {
    max-width: 640px;
    margin: 48px auto 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 24px;
    padding: 48px;
    display: flex;
    align-items: center;
    gap: 40px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    transition: var(--transition);
}

.contact-card:hover {
    border-color: rgba(255, 69, 0, 0.2);
    box-shadow: 0 8px 32px rgba(255, 69, 0, 0.1);
}

.contact-qr {
    flex-shrink: 0;
}

.qr-img {
    width: 180px;
    height: 180px;
    border-radius: 16px;
    border: 2px solid rgba(255, 69, 0, 0.12);
    object-fit: cover;
    transition: var(--transition);
}

.contact-card:hover .qr-img {
    border-color: rgba(255, 69, 0, 0.3);
    box-shadow: 0 4px 20px rgba(255, 69, 0, 0.12);
}

.contact-info {
    flex: 1;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 69, 0, 0.06);
    border: 1px solid rgba(255, 69, 0, 0.1);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-red);
    margin-bottom: 16px;
}

.contact-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.contact-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

@media (max-width: 640px) {
    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 36px 24px;
        gap: 24px;
    }

    .contact-list {
        align-items: center;
    }

    .qr-img {
        width: 200px;
        height: 200px;
    }
}

/* --- Footer --- */
.footer {
    padding: 32px 0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.9rem;
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --- Floating Action Button --- */
.fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-radius: 50px;
    background: var(--gradient-btn);
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(255, 69, 0, 0.35);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    animation: fabPulse 3s ease-in-out infinite;
}

.fab.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.fab:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 10px 32px rgba(255, 69, 0, 0.45);
}

@keyframes fabPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(255, 69, 0, 0.35); }
    50% { box-shadow: 0 6px 24px rgba(255, 69, 0, 0.35), 0 0 0 8px rgba(255, 69, 0, 0.08); }
}

.fab-label {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .fab {
        bottom: 20px;
        right: 20px;
        padding: 12px 18px;
        font-size: 0.85rem;
    }
}

/* --- Scroll Animations --- */
[data-animate] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

[data-animate].visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered animation for grid items */
.features-grid [data-animate]:nth-child(1) { transition-delay: 0s; }
.features-grid [data-animate]:nth-child(2) { transition-delay: 0.1s; }
.features-grid [data-animate]:nth-child(3) { transition-delay: 0.2s; }
.features-grid [data-animate]:nth-child(4) { transition-delay: 0.3s; }
.features-grid [data-animate]:nth-child(5) { transition-delay: 0.4s; }
.features-grid [data-animate]:nth-child(6) { transition-delay: 0.5s; }

/* --- Responsive --- */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .download-card {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }

    .download-info {
        margin-bottom: 16px;
    }

    .nav-links {
        gap: 20px;
    }

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

/* --- Grid background pattern --- */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 69, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 69, 0, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 70%);
}
