/* =========================================
   Base & Resets
   ========================================= */
html {
    scroll-behavior: smooth;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --accent-color: #6366f1;
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-border: rgba(255, 255, 255, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-darker);
    color: var(--text-main);
    line-height: 1.6;
    width: 100%;
    /* Strictly prevents horizontal scrolling/bleeding */
    overflow-x: hidden; 
}

/* =========================================
   Header & Nav
   ========================================= */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    white-space: nowrap;
}

.logo span {
    color: var(--primary-color);
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s;
}

.btn-nav {
    background: var(--primary-color);
    color: white !important;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 120px 2rem 4rem;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
    z-index: 2;
}

.hero-content h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

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

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* =========================================
   3D Box Loader Animation (Unchanged Core)
   ========================================= */
.loader {
  --duration: 3s;
  --primary: rgba(39, 94, 254, 1);
  --primary-light: #2f71ff;
  --primary-rgba: rgba(39, 94, 254, 0);
  width: 200px;
  height: 320px;
  position: relative;
  transform-style: preserve-3d;
}

.loader:before, .loader:after {
  --r: 20.5deg;
  content: "";
  width: 320px;
  height: 140px;
  position: absolute;
  right: 32%;
  bottom: -11px;
  background: var(--bg-darker);
  transform: translateZ(200px) rotate(var(--r));
  -webkit-animation: mask var(--duration) linear forwards infinite;
  animation: mask var(--duration) linear forwards infinite;
}

.loader:after { --r: -20.5deg; right: auto; left: 32%; }

.loader .ground {
  position: absolute;
  left: -50px;
  bottom: -120px;
  transform-style: preserve-3d;
  transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1);
}

.loader .ground div {
  transform: rotateX(90deg) rotateY(0deg) translate(-48px, -120px) translateZ(100px) scale(0);
  width: 200px;
  height: 200px;
  background: linear-gradient(45deg, var(--primary) 0%, var(--primary) 50%, var(--primary-light) 50%, var(--primary-light) 100%);
  transform-style: preserve-3d;
  -webkit-animation: ground var(--duration) linear forwards infinite;
  animation: ground var(--duration) linear forwards infinite;
}

.loader .ground div:before, .loader .ground div:after {
  --rx: 90deg; --ry: 0deg; --x: 44px; --y: 162px; --z: -50px;
  content: ""; width: 156px; height: 300px; opacity: 0;
  background: linear-gradient(var(--primary), var(--primary-rgba));
  position: absolute;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translate(var(--x), var(--y)) translateZ(var(--z));
  -webkit-animation: ground-shine var(--duration) linear forwards infinite;
  animation: ground-shine var(--duration) linear forwards infinite;
}

.loader .ground div:after { --rx: 90deg; --ry: 90deg; --x: 0; --y: 177px; --z: 150px; }

.loader .box {
  --x: 0; --y: 0; position: absolute;
  -webkit-animation: var(--duration) linear forwards infinite;
  animation: var(--duration) linear forwards infinite;
  transform: translate(var(--x), var(--y));
}

.loader .box div {
  background-color: var(--primary); width: 48px; height: 48px;
  position: relative; transform-style: preserve-3d;
  -webkit-animation: var(--duration) ease forwards infinite;
  animation: var(--duration) ease forwards infinite;
  transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0);
}

.loader .box div:before, .loader .box div:after {
  --rx: 90deg; --ry: 0deg; --z: 24px; --y: -24px; --x: 0;
  content: ""; position: absolute; top: 0; left: 0;
  background-color: inherit; width: inherit; height: inherit;
  transform: rotateX(var(--rx)) rotateY(var(--ry)) translate(var(--x), var(--y)) translateZ(var(--z));
  filter: brightness(var(--b, 1.2));
}

.loader .box div:after { --rx: 0deg; --ry: 90deg; --x: 24px; --y: 0; --b: 1.4; }

.loader .box.box0 { --x: -220px; --y: -120px; left: 58px; top: 108px; }
.loader .box.box1 { --x: -260px; --y: 120px; left: 25px; top: 120px; }
.loader .box.box2 { --x: 120px; --y: -190px; left: 58px; top: 64px; }
.loader .box.box3 { --x: 280px; --y: -40px; left: 91px; top: 120px; }
.loader .box.box4 { --x: 60px; --y: 200px; left: 58px; top: 132px; }
.loader .box.box5 { --x: -220px; --y: -120px; left: 25px; top: 76px; }
.loader .box.box6 { --x: -260px; --y: 120px; left: 91px; top: 76px; }
.loader .box.box7 { --x: -240px; --y: 200px; left: 58px; top: 87px; }

.loader .box0 { animation-name: box-move0; } .loader .box0 div { animation-name: box-scale0; }
.loader .box1 { animation-name: box-move1; } .loader .box1 div { animation-name: box-scale1; }
.loader .box2 { animation-name: box-move2; } .loader .box2 div { animation-name: box-scale2; }
.loader .box3 { animation-name: box-move3; } .loader .box3 div { animation-name: box-scale3; }
.loader .box4 { animation-name: box-move4; } .loader .box4 div { animation-name: box-scale4; }
.loader .box5 { animation-name: box-move5; } .loader .box5 div { animation-name: box-scale5; }
.loader .box6 { animation-name: box-move6; } .loader .box6 div { animation-name: box-scale6; }
.loader .box7 { animation-name: box-move7; } .loader .box7 div { animation-name: box-scale7; }

@keyframes box-move0 { 12% { transform: translate(var(--x), var(--y)); } 25%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale0 { 6% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 14%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move1 { 16% { transform: translate(var(--x), var(--y)); } 29%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale1 { 10% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 18%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move2 { 20% { transform: translate(var(--x), var(--y)); } 33%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale2 { 14% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 22%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move3 { 24% { transform: translate(var(--x), var(--y)); } 37%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale3 { 18% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 26%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move4 { 28% { transform: translate(var(--x), var(--y)); } 41%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale4 { 22% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 30%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move5 { 32% { transform: translate(var(--x), var(--y)); } 45%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale5 { 26% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 34%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move6 { 36% { transform: translate(var(--x), var(--y)); } 49%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale6 { 30% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 38%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes box-move7 { 40% { transform: translate(var(--x), var(--y)); } 53%, 52% { transform: translate(0, 0); } 80% { transform: translate(0, -32px); } 90%, 100% { transform: translate(0, 188px); } }
@keyframes box-scale7 { 34% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(0); } 42%, 100% { transform: rotateY(-47deg) rotateX(-15deg) rotateZ(15deg) scale(1); } }
@keyframes ground { 0%, 65% { transform: rotateX(90deg) rotateY(0deg) translate(-48px, -120px) translateZ(100px) scale(0); } 75%, 90% { transform: rotateX(90deg) rotateY(0deg) translate(-48px, -120px) translateZ(100px) scale(1); } 100% { transform: rotateX(90deg) rotateY(0deg) translate(-48px, -120px) translateZ(100px) scale(0); } }
@keyframes ground-shine { 0%, 70% { opacity: 0; } 75%, 87% { opacity: 0.2; } 100% { opacity: 0; } }
@keyframes mask { 0%, 65% { opacity: 0; } 66%, 100% { opacity: 1; } }

/* =========================================
   Plans, Features & General Formatting
   ========================================= */
.plans { padding: 6rem 2rem; max-width: 1200px; margin: 0 auto; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-header h2 { font-size: 2.5rem; margin-bottom: 1rem; }
.section-header p { color: var(--text-muted); font-size: 1.1rem; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    display: flex; 
    flex-direction: column;
}

.plan-card.featured {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.2);
}

.plan-name { font-size: 1.5rem; font-weight: 700; margin-bottom: 1rem; }
.plan-price { font-size: 3rem; font-weight: 800; margin-bottom: 2rem; }
.plan-price span { font-size: 1.5rem; vertical-align: middle; }
.plan-price small { font-size: 1rem; color: var(--text-muted); }
.plan-features { list-style: none; margin-bottom: 2.5rem; text-align: left; }
.plan-features li { margin-bottom: 1rem; color: var(--text-muted); display: flex; align-items: center; gap: 0.75rem; }
.plan-features li i { color: var(--primary-color); }
.btn-plan { margin-top: auto; display: block; text-decoration: none; padding: 1rem; border-radius: 12px; font-weight: 600; border: 1px solid var(--glass-border); color: white;}
.btn-plan.primary { background: var(--primary-color); border: none; }

.features { padding: 6rem 2rem; background: rgba(30, 41, 59, 0.3); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 3rem; max-width: 1200px; margin: 0 auto; }
.feature-item { text-align: center; padding: 2rem; }
.feature-icon { width: 60px; height: 60px; background: rgba(59, 130, 246, 0.1); color: var(--primary-color); border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 1.5rem; }

.clients { padding: 6rem 2rem; max-width: 1200px; margin: 0 auto; }
.platform-grid, .client-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 3rem; margin-top: 2rem; }
.platform-item, .client-item { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.platform-item img, .client-item img { width: 80px; height: 80px; object-fit: contain; border-radius: 16px; background: var(--bg-card); padding: 10px; border: 1px solid var(--glass-border); }

footer { padding: 4rem 2rem; background: var(--bg-darker); border-top: 1px solid var(--glass-border); }
.footer-content { max-width: 1200px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2rem; }
.footer-links { display: flex; gap: 2rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; }

/* =========================================
   WeChat Popup Modal
   ========================================= */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.85); align-items: center; justify-content: center; }
.popup-card { background: var(--bg-card); border: 1px solid var(--glass-border); padding: 2.5rem 2rem; border-radius: 24px; text-align: center; max-width: 400px; width: 90%; position: relative; }
.close-modal { position: absolute; top: 15px; right: 20px; color: var(--text-muted); font-size: 28px; font-weight: bold; cursor: pointer; }
.qr-container { background: white; padding: 12px; border-radius: 16px; display: inline-block; margin-bottom: 1.5rem; }
.qr-container img { width: 220px; height: 220px; display: block; border-radius: 8px; pointer-events: auto; -webkit-touch-callout: default; }
.wechat-id-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    padding: 0.8rem; /* Slightly reduced padding to give more internal room */
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
    gap: 0.5rem; /* Keeps a safe distance between text and button */
}

.wechat-id-box .id-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    white-space: nowrap; /* CRUCIAL: Forces everything to stay on exactly one line */
}

.wechat-id-box .actual-id {
    /* Upgraded font stack targets native mobile system code fonts */
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.9rem; /* Slightly sized down to guarantee it fits on phones */
    color: #07c160; 
    background-color: #0f172a; /* Deep terminal background */
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.15); /* Crisp outline */
    font-weight: 500;
    margin-left: 0.5rem;
    letter-spacing: 0.5px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6); /* Inner shadow gives it that deep "inset code block" look */
}

/* Add this to your copy button to prevent it from ever being squished */
.copy-btn {
    flex-shrink: 0; 
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}


.btn-chat { display: flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; background: var(--primary-color); color: white; padding: 1rem; border-radius: 12px; font-weight: 600; font-size: 1rem; border: none; cursor: pointer; }


/* =======================================================
   THE BULLETPROOF MOBILE FIX (Overrides Desktop Layout)
   ======================================================= */
@media screen and (max-width: 992px) {
    /* 1. HIDE NAV LINKS TO PREVENT CLUTTER */
    nav ul { 
        display: none !important; 
    }
    
    /* 2. FORCE HERO SECTION TO STACK VERTICALLY */
    .hero { 
        flex-direction: column !important; 
        padding-top: 100px !important; 
        text-align: center !important; 
        gap: 0 !important;
    }
    
    /* 3. PREVENT TEXT OVERFLOW */
    .hero-content { 
        width: 100% !important; 
        max-width: 100% !important; 
    }
    .hero-content h1 { 
        font-size: 2.8rem !important; 
        word-wrap: break-word !important; /* Stops text from getting cut off */
    }
    
    .hero-btns {
        flex-direction: column !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    .btn-primary, .btn-secondary {
        width: 100% !important;
        max-width: 350px !important;
    }

    /* 4. TAME THE 3D ANIMATION */
    .hero-visual { 
        width: 100% !important; 
        margin-top: 2rem !important;
        min-height: 250px !important;
    }
    .loader {
        /* This shrinks the animation down and forces it to the center */
        transform: scale(0.6) !important;
        margin: 0 auto !important;
        left: 0 !important;
    }

    /* 5. FIX THE PLAN CARDS SO THEY DON'T BLEED OFF SCREEN */
    .plans-grid { 
        display: block !important; /* Drops Grid entirely on mobile */
    }
    .plan-card {
        width: 100% !important;
        margin-bottom: 2rem !important;
    }
    .plan-card.featured {
        transform: none !important; /* Removes desktop scale effect */
    }

    /* General padding fixes for tiny screens */
    .plans, .features, .clients { padding: 3rem 1.5rem !important; }
    .section-header h2 { font-size: 2rem !important; }
}
