/* Reset & Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { 
    font-family: 'Nunito', 'Quicksand', 'Microsoft YaHei', sans-serif; 
    /* Warm, cozy background */
    background-color: #faf7f2; 
    color: #4a5568; 
    line-height: 1.7; 
    min-height: 100vh; 
    overflow-x: hidden; 
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* Theme Variables - 3D Yarn/Knit */
:root {
    --yarn-blue: #60a5fa;
    --yarn-blue-dark: #3b82f6;
    --yarn-white: #ffffff;
    --yarn-cream: #fdfbf7;
    --yarn-shadow: rgba(148, 163, 184, 0.2);
    --stitch-color: #cbd5e1;
    --text-main: #2d3748;
    --text-muted: #718096;
}

/* Typography */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* Navigation */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 5%; 
    background: rgba(255, 255, 255, 0.9); 
    backdrop-filter: blur(2px);
    position: sticky; 
    top: 0; 
    z-index: 100; 
    border-bottom: 3px dashed var(--stitch-color);
}
.nav-logo { 
    font-size: 26px; 
    font-weight: 900; 
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--yarn-blue-dark);
}
.nav-logo svg {
    width: 36px;
    height: 36px;
    /* Soft shadow to look like thick yarn */
    filter: drop-shadow(2px 3px 2px rgba(0,0,0,0.1));
}
.nav-links { display: flex; gap: 30px; align-items: center; font-weight: 700; }
.nav-links a { 
    color: var(--text-muted); 
    transition: all 0.3s; 
    font-size: 15px; 
}
.nav-links a:hover { 
    color: var(--yarn-blue); 
}

.btn-download-nav { 
    padding: 10px 24px !important; 
    background: var(--yarn-blue);
    color: #fff !important; 
    border-radius: 30px;
    font-weight: 800;
    transition: all 0.3s; 
    box-shadow: 0 4px 0 var(--yarn-blue-dark), 0 5px 10px rgba(96, 165, 250, 0.4);
}
.btn-download-nav:hover { 
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--yarn-blue-dark), 0 3px 5px rgba(96, 165, 250, 0.4);
}

/* Hero Section - Cozy Knit */
.hero-wrapper {
    position: relative;
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 5% 100px;
    overflow: hidden;
    background-color: #f0f4f8;
    /* Subtle knit texture background */
    background-image: radial-gradient(var(--stitch-color) 10%, transparent 11%), radial-gradient(var(--stitch-color) 10%, transparent 11%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
}

/* 3D Knitted Plane SVG */
.hero-plane-svg {
    position: absolute;
    top: 40%; left: 50%;
    transform: translate(-50%, -50%);
    width: 700px;
    height: 700px;
    z-index: 1;
    filter: drop-shadow(0 25px 25px rgba(0,0,0,0.1));
    animation: floatPlane 6s ease-in-out infinite alternate;
}
.yarn-stroke {
    fill: none;
    stroke: var(--yarn-blue);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
    /* Simulate yarn texture with dasharray */
    stroke-dasharray: 2 4;
}
.yarn-fill {
    fill: #ffffff;
    stroke: var(--yarn-blue-dark);
    stroke-width: 8;
    stroke-linejoin: round;
    stroke-dasharray: 1 3;
}
.yarn-tag {
    fill: #fef3c7;
    stroke: #d97706;
    stroke-width: 3;
    stroke-dasharray: 4 4;
    rx: 8;
}

@keyframes floatPlane {
    0% { transform: translate(-50%, -48%) rotate(-2deg); }
    100% { transform: translate(-50%, -52%) rotate(2deg); }
}

.hero-content { 
    z-index: 20; 
    max-width: 900px; 
    text-align: center;
    position: relative;
    background: rgba(255, 255, 255, 0.85);
    padding: 50px;
    border-radius: 30px;
    border: 4px dashed var(--stitch-color);
    backdrop-filter: blur(2px);
    box-shadow: 0 20px 40px var(--yarn-shadow);
}

.hero-title {
    font-size: 38px; /* Adjusted for longer title */
    margin-bottom: 20px;
    line-height: 1.4;
    color: var(--yarn-blue-dark);
}

.hero p { 
    font-size: 18px; 
    margin-bottom: 40px; 
    color: var(--text-muted);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
}

.hero-buttons { display: flex; gap: 20px; justify-content: center; margin-bottom: 40px; flex-wrap: wrap; }

.btn-primary { 
    padding: 16px 40px; 
    font-size: 18px; 
    font-weight: 800; 
    color: #fff; 
    background: var(--yarn-blue);
    border: none;
    border-radius: 40px;
    box-shadow: 0 6px 0 var(--yarn-blue-dark), 0 10px 20px rgba(96, 165, 250, 0.3);
    transition: all 0.2s;
}
.btn-primary:hover { 
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--yarn-blue-dark), 0 5px 10px rgba(96, 165, 250, 0.3);
}

.btn-outline { 
    padding: 16px 40px; 
    font-size: 18px; 
    font-weight: 800; 
    color: var(--yarn-blue-dark); 
    background: #fff;
    border: 3px dashed var(--yarn-blue);
    border-radius: 40px;
    box-shadow: 0 6px 0 var(--stitch-color);
    transition: all 0.2s;
}
.btn-outline:hover { 
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--stitch-color);
    background: #f8fafc;
}

.hero-images { 
    display: flex; 
    justify-content: center; 
    gap: 25px; 
    align-items: flex-end; 
    margin-top: 20px;
    z-index: 20;
}
.hero-images img { 
    max-width: 28%; 
    border-radius: 24px;
    border: 6px solid #fff;
    box-shadow: 0 15px 30px var(--yarn-shadow);
    transition: all 0.4s ease; 
}
.hero-images img:nth-child(2) {
    transform: translateY(-20px);
    z-index: 2;
}
.hero-images img:hover { 
    transform: translateY(-30px) scale(1.02); 
    box-shadow: 0 25px 40px rgba(0,0,0,0.15);
}

/* Features Section */
.features { padding: 100px 5%; background: var(--yarn-cream); position: relative; z-index: 10; }
.section-title { 
    text-align: center; 
    font-size: 38px; 
    margin-bottom: 60px; 
    color: var(--yarn-blue-dark);
}

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; max-width: 1200px; margin: 0 auto; }

.feature-card { 
    padding: 40px 30px; 
    text-align: center; 
    background: #fff;
    border-radius: 24px;
    border: 3px dashed var(--stitch-color);
    transition: all 0.3s; 
    box-shadow: 0 10px 20px var(--yarn-shadow);
}
.feature-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--yarn-blue);
    box-shadow: 0 15px 30px rgba(96, 165, 250, 0.2);
}
.feature-card h3 { 
    font-size: 22px; 
    margin-bottom: 15px; 
    color: var(--yarn-blue-dark);
}
.feature-card p { color: var(--text-muted); font-size: 15px; font-weight: 600;}

/* Blog Section */
.blog { padding: 100px 5%; background: #f8fafc; position: relative; border-top: 3px dashed var(--stitch-color);}
.blog-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 40px; max-width: 1100px; margin: 0 auto; }
.blog-card { 
    display: flex; 
    flex-direction: column; 
    background: #fff;
    border-radius: 24px;
    overflow: hidden;
    border: 3px dashed var(--stitch-color);
    box-shadow: 0 10px 20px var(--yarn-shadow);
    transition: all 0.3s;
}
.blog-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--yarn-blue);
}
.blog-card img { 
    width: 100%; height: 260px; object-fit: cover; 
    border-bottom: 3px dashed var(--stitch-color);
}
.blog-content { padding: 35px; }
.blog-date { display: inline-block; margin-bottom: 15px; font-size: 13px; color: #fff; background: var(--yarn-blue); padding: 6px 16px; border-radius: 20px; font-weight: 800; }
.blog-content h3 { font-size: 20px; margin-bottom: 15px; color: var(--text-main);}
.blog-content p { color: var(--text-muted); margin-bottom: 0; font-weight: 600; font-size: 15px;}
.btn-more { 
    display: block; 
    width: 240px; 
    margin: 60px auto 0; 
    text-align: center; 
    padding: 16px; 
    background: #fff;
    color: var(--yarn-blue-dark); 
    font-weight: 800; 
    border: 3px dashed var(--yarn-blue);
    border-radius: 40px;
    transition: all 0.3s; 
    box-shadow: 0 6px 0 var(--stitch-color);
}
.btn-more:hover { 
    transform: translateY(4px);
    box-shadow: 0 2px 0 var(--stitch-color);
    background: var(--yarn-blue);
    color: #fff;
}

/* FAQ Section */
.faq { padding: 100px 5%; max-width: 900px; margin: 0 auto; background: var(--yarn-cream); margin-top: 40px; margin-bottom: 80px; border-radius: 30px; border: 4px dashed var(--stitch-color); box-shadow: 0 20px 40px var(--yarn-shadow);}
.faq-item { 
    background: #fff; 
    margin-bottom: 20px; 
    padding: 25px 30px; 
    border-radius: 20px;
    border: 2px solid var(--stitch-color);
    transition: all 0.3s;
}
.faq-item:hover { 
    border-color: var(--yarn-blue);
    box-shadow: 0 5px 15px rgba(96, 165, 250, 0.1);
}
.faq-question { font-size: 18px; font-weight: 800; margin-bottom: 12px; color: var(--yarn-blue-dark); }
.faq-answer { color: var(--text-muted); font-size: 15px; font-weight: 600; line-height: 1.8;}

/* Footer */
.footer { background: #2d3748; padding: 80px 5% 30px; color: #a0aec0; border-top: 6px dashed var(--stitch-color);}
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px; max-width: 1200px; margin: 0 auto 50px; }
.footer-col h4 { font-size: 18px; color: #fff; margin-bottom: 25px; font-weight: 800; }
.footer-col ul li { margin-bottom: 15px; }
.footer-col ul li a { color: #cbd5e1; transition: all 0.2s; font-weight: 600; font-size: 15px;}
.footer-col ul li a:hover { color: #fff; text-decoration: underline; text-decoration-style: dashed;}
.footer-bottom { text-align: center; padding-top: 30px; border-top: 2px dashed #4a5568; font-size: 14px; font-weight: 600;}

/* Download Page Grid */
.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 30px; max-width: 1100px; margin: 60px auto; padding: 0 5%; }
.download-card { 
    padding: 40px 30px; 
    text-align: center; 
    background: #fff; 
    border-radius: 24px;
    border: 3px dashed var(--stitch-color);
    transition: all 0.3s;
    box-shadow: 0 10px 20px var(--yarn-shadow);
}
.download-card:hover { 
    transform: translateY(-8px); 
    border-color: var(--yarn-blue);
    box-shadow: 0 15px 30px rgba(96, 165, 250, 0.2);
}
.download-card h3 { font-size: 22px; margin-bottom: 15px; color: var(--yarn-blue-dark);}
.download-card p { color: var(--text-muted); margin-bottom: 30px; font-size: 15px; font-weight: 600;}
.btn-dl-card { 
    display: inline-block; 
    padding: 14px 30px; 
    background: var(--yarn-blue);
    color: #fff; 
    font-weight: 800; 
    border-radius: 30px;
    transition: all 0.2s; 
    box-shadow: 0 4px 0 var(--yarn-blue-dark);
}
.btn-dl-card:hover { 
    transform: translateY(2px);
    box-shadow: 0 2px 0 var(--yarn-blue-dark);
}

/* Page specific headers */
.page-header { 
    padding: 100px 5% 80px; 
    text-align: center; 
    background-color: #f0f4f8;
    background-image: radial-gradient(var(--stitch-color) 10%, transparent 11%), radial-gradient(var(--stitch-color) 10%, transparent 11%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    border-bottom: 4px dashed var(--stitch-color);
}
.page-header-content {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255,255,255,0.9);
    padding: 40px;
    border-radius: 30px;
    border: 3px dashed var(--stitch-color);
    box-shadow: 0 10px 20px var(--yarn-shadow);
}
.page-header h1 { 
    font-size: 42px; 
    margin-bottom: 20px; 
    color: var(--yarn-blue-dark);
}
.page-header p { font-size: 18px; color: var(--text-muted); font-weight: 600;}

/* === perf: reduce motion & lower GPU cost === */
.feature-card,
.blog-card,
.hero-content,
.glass-panel,
.pearl-card {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.navbar {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* perf: limit decorative infinite layers on mid/low-end devices */
@media (max-width: 768px) {
    .bubble:nth-child(n+3),
    .tiny-plane:nth-child(n+3),
    .bg-shard:nth-child(n+4),
    .orb:nth-child(n+2) {
        display: none !important;
    }
}
