:root {
    --primary-color: #E60012; /* NovaLab Red */
    --primary-dark: #B7000E;
    --text-dark: #333333;
    --text-light: #666666;
    --bg-light: #F9F9F9;
    --bg-dark: #1A1A1A;
    --white: #FFFFFF;
    --gradient-overlay: linear-gradient(135deg, rgba(26, 26, 26, 0.95) 0%, rgba(230, 0, 18, 0.1) 100%);
    --font-main: 'Inter', sans-serif;
    --font-zh: 'Noto Sans TC', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main), var(--font-zh);
    line-height: 1.6;
    color: var(--text-dark);
    overflow-x: hidden;
}

/* Utilities */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-gradient {
    background: linear-gradient(to right, #E60012, #FF6B6B);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(230, 0, 18, 0.3);
}

.btn-secondary {
    background-color: transparent;
    border: 2px solid var(--white);
    color: var(--white);
    margin-left: 15px;
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 15px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.logo-text .highlight {
    color: var(--primary-color);
}

.nav-links a {
    color: var(--text-dark);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.lang-switch {
    margin-left: 30px;
    display: flex;
    gap: 10px;
}

.lang-btn {
    background: none;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.lang-btn.active, .lang-btn:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-dark);
    overflow: hidden;
    color: var(--white);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-overlay);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    margin-bottom: 20px;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
}

/* Abstract Background Animation */
#hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
    pointer-events: none; /* Ensure clicks pass through to buttons if needed, though z-index 2 handles it */
}

/* About Section */
.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.section-header .line {
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.stats {
    display: flex;
    gap: 40px;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 3D Cube Animation */
.about-image {
    display: flex;
    justify-content: center;
    perspective: 1000px;
}

.tech-cube {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    animation: rotate 20s infinite linear;
}

.face {
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    opacity: 0.8;
}

.front  { transform: rotateY(0deg) translateZ(100px); }
.back   { transform: rotateY(180deg) translateZ(100px); }
.right  { transform: rotateY(90deg) translateZ(100px); }
.left   { transform: rotateY(-90deg) translateZ(100px); }
.top    { transform: rotateX(90deg) translateZ(100px); }
.bottom { transform: rotateX(-90deg) translateZ(100px); }

@keyframes rotate {
    from { transform: rotateX(0deg) rotateY(0deg); }
    to { transform: rotateX(360deg) rotateY(360deg); }
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.service-card {
    background: var(--white);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.icon-box {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 25px;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
}

.service-card p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Clients Logo Grid */
.clients-logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 30px;
    align-items: center;
    justify-items: center;
    margin-top: 40px;
}

.client-logo-item {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.client-logo-item:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

.client-logo-item img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
}

/* Testimonials Section */
.testimonials-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.testimonial-card {
    background: var(--white);
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    border-left: 5px solid var(--primary-color);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.testim-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.testim-logo {
    width: 100px;
    height: 80px;
    border-radius: 5px;
    object-fit: contain;
    margin-right: 20px;
    border: 1px solid #eee;
    background: #fff;
    padding: 5px;
    flex-shrink: 0; /* Prevent logo from shrinking */
}

.testim-author h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    margin-bottom: 3px;
    font-weight: 700;
}

.testim-author span {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 600;
    display: block;
}

.testim-body {
    margin-bottom: 20px;
    min-height: 120px; /* Ensure consistent height for shorter texts */
}

.testim-content {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* Handle CKEditor default styles */
.testim-content p {
    margin-bottom: 10px;
}

.testim-content ul, .testim-content ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.testim-content blockquote {
    border-left: 3px solid var(--primary-color);
    padding-left: 15px;
    font-style: italic;
    color: #555;
    margin: 10px 0;
}

.testim-rating {
    color: #FFD700;
    font-size: 0.9rem;
}


/* Contact Section */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.contact-info {
    padding: 60px;
    background: var(--bg-dark);
    color: var(--white);
}

.contact-info h2 {
    font-size: 2rem;
    margin-bottom: 20px;
}

.contact-info > p {
    margin-bottom: 40px;
    color: rgba(255,255,255,0.7);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 30px;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-right: 20px;
    margin-top: 5px;
}

.info-item h4 {
    margin-bottom: 5px;
    font-size: 1.1rem;
}

.info-item p {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

.contact-form-wrapper {
    padding: 60px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
footer {
    background: #111;
    color: #888;
    padding: 40px 0;
    text-align: center;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
}

.footer-logo span {
    color: var(--primary-color);
}

.social-links {
    margin-bottom: 20px;
}

.social-links a {
    color: var(--white);
    font-size: 1.2rem;
    margin: 0 10px;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--primary-color);
}

.copyright {
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 992px) {
    .about-grid, .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
}

@media (max-width: 768px) {
    .nav-links, .lang-switch {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .section {
        padding: 60px 0;
    }
}
