/* GSIT AI Solutions - Premium Design System */
/* Typography: IBM Plex Sans + Outfit for a tech-forward, approachable feel */

/* Self-hosted fonts for GDPR compliance and better performance */
@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/outfit-400.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/outfit-500.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/outfit-600.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/outfit-700.woff2') format('woff2');
}

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 800;
    font-display: swap;
    src: url('../fonts/outfit-800.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-500.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-600.woff2') format('woff2');
}

:root {
    /* Core Brand Colors - Deep Blue + Electric Cyan */
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --primary-light: #3385FF;
    --primary-dim: rgba(0, 102, 255, 0.08);
    --accent: #00D9FF;
    --accent-dark: #00B8D9;

    /* Neutral Palette */
    --text-dark: #0F172A; /* Deeper, richer dark */
    --text-medium: #334155;
    --text-light: #64748B;
    --text-muted: #94A3B8;

    /* Backgrounds */
    --bg-white: #FFFFFF;
    --bg-light: #F8FAFC;
    --bg-lighter: #F1F5F9;
    --bg-dark: #0F172A;

    /* Borders & Shadows */
    --border: #E2E8F0;
    --border-light: #F1F5F9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 40px rgba(0, 102, 255, 0.15);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0066FF 0%, #00D9FF 100%);
    --gradient-hero: linear-gradient(180deg, #F8FAFC 0%, #FFFFFF 100%);
    --gradient-mesh:
        radial-gradient(at 0% 0%, rgba(0, 102, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(0, 217, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(0, 102, 255, 0.05) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(0, 217, 255, 0.05) 0px, transparent 50%);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-dark);
    line-height: 1.7;
    background: var(--bg-white);
    overflow-x: hidden;
}

.container {
    max-width: 1240px; /* Slightly wider for modern feel */
    margin: 0 auto;
    padding: 0 24px;
}

/* Enhanced Header with Glassmorphism */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    z-index: 1000;
    transition: all var(--transition-base);
}

header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
    height: 70px; /* Compress slightly on scroll */
}

header.scrolled nav {
    height: 70px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    height: 78px;
    transition: height var(--transition-base);
}

.logo {
    width: auto;
    height: 40px;
    object-fit: contain;
    transition: transform var(--transition-base);
}

.logo:hover {
    transform: scale(1.02);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-medium);
    font-size: 15px;
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
    transition: color var(--transition-fast);
    position: relative;
    padding: 4px 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-base);
    border-radius: 2px;
}

.nav-menu a:hover {
    color: var(--primary);
}

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

/* Language Selector Enhancement */
.lang-selector {
    position: relative;
    display: inline-block;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 99px; /* Pill shape */
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: var(--text-medium);
    transition: all var(--transition-base);
}

.lang-current:hover {
    background: var(--bg-light);
    border-color: var(--primary-light);
    color: var(--primary);
}

.lang-current::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transition: transform var(--transition-base);
}

.lang-selector.active .lang-current::after {
    transform: rotate(180deg);
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    max-height: 420px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition-fast);
    z-index: 1000;
    padding: 8px;
}

.lang-selector:hover .lang-dropdown,
.lang-selector.active .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown a {
    display: block;
    padding: 10px 16px;
    color: var(--text-medium);
    text-decoration: none;
    font-size: 14px;
    font-family: 'Outfit', sans-serif;
    transition: all var(--transition-fast);
    border-radius: 8px;
}

.lang-dropdown a:hover {
    background: var(--bg-lighter);
    color: var(--primary);
}

.lang-dropdown a.current {
    background: var(--primary-dim);
    color: var(--primary);
    font-weight: 600;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-dark);
    padding: 8px;
}

/* Hero Section - Modern & Clean */
.hero {
    margin-top: 78px;
    padding: 140px 0 120px;
    background: var(--bg-light);
    background-image: var(--gradient-mesh);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Subtle background pattern */
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(#E2E8F0 1px, transparent 1px), linear-gradient(90deg, #E2E8F0 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
    pointer-events: none;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,0) 100%);
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 68px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    margin-bottom: 24px;
    line-height: 1.1;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-dark) 30%, var(--text-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 0.8s var(--transition-base) both;
}

.hero .subtitle {
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 32px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
    animation: fadeInUp 0.8s var(--transition-base) 0.1s both;
}

.hero p {
    font-size: 20px;
    max-width: 800px;
    margin: 0 auto 48px;
    color: var(--text-light);
    line-height: 1.8;
    animation: fadeInUp 0.8s var(--transition-base) 0.2s both;
}

/* Hero Tags Grid - Replaces the old checklist */
.hero-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.8s var(--transition-base) 0.3s both;
}

.hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-medium);
    transition: all var(--transition-base);
}

.hero-tag:hover {
    transform: translateY(-2px);
    background: #FFFFFF;
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.1);
    border-color: rgba(0, 102, 255, 0.2);
    color: var(--primary);
}

.hero-tag svg {
    width: 20px;
    height: 20px;
    color: #10B981; /* Success Green */
    flex-shrink: 0;
}

/* Section Styling */
.features {
    padding: 120px 0;
    position: relative;
    background: var(--bg-white);
}

.section-title {
    font-size: 42px;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    text-align: center;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--text-dark);
}

.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 19px;
    margin-bottom: 80px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Modern Feature Grid - Refactored for Stability */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Default desktop: 3 columns */
    gap: 40px;
}

.feature-card {
    padding: 32px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 24px;
    transition: all var(--transition-base);
    position: relative;
    min-width: 0;
}

.feature-card:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    transform: translateY(-5px);
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-card-content { /* New wrapper for content */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%; /* Ensure content area takes full width */
}

.feature-icon-wrapper {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-dim);
    border-radius: 16px;
    margin-bottom: 24px;
    color: var(--primary);
    transition: all var(--transition-base);
    flex-shrink: 0;
}

.feature-card:hover .feature-icon-wrapper {
    background: var(--primary);
    color: #FFFFFF;
    transform: scale(1.1) rotate(-5deg);
}

.feature-icon {
    width: 32px;
    height: 32px;
    stroke-width: 2;
}

.feature-card h3 {
    font-size: 22px;
    margin-bottom: 12px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    letter-spacing: -0.01em;
    overflow-wrap: break-word;
    word-wrap: break-word; /* Fallback */
    width: 100%; /* Ensure heading takes full width within its flex container */
}

.feature-card p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.7;
    flex-grow: 1;
    width: 100%; /* Ensure paragraph takes full width */
}

/* Stats Section - Dark Mode Tech Look */
.stats {
    padding: 120px 0;
    background: var(--bg-dark);
    color: #FFFFFF;
    position: relative;
    overflow: hidden;
}

.stats::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0, 102, 255, 0.15), transparent 70%);
}

.stats .section-title {
    color: #FFFFFF;
    margin-bottom: 60px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 40px;
    position: relative;
    z-index: 1;
}

.stat-card {
    text-align: center;
    padding: 32px 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: 0;
}

.stat-card:hover::before {
    opacity: 0.1;
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.stat-card > * {
    position: relative;
    z-index: 1;
}

.stat-number {
    font-size: 64px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    line-height: 1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 16px;
    color: #94A3B8;
    line-height: 1.6;
}

.stat-label strong {
    color: #FFFFFF;
    display: block;
    margin-top: 4px;
    font-weight: 600;
}

/* Contact Form Enhancements */
.contact-section {
    padding: 120px 0;
    background: var(--bg-lighter);
}

.contact-form {
    max-width: 640px;
    margin: 0 auto;
    background: var(--bg-white);
    padding: 48px;
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 28px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    font-family: 'Outfit', sans-serif;
    color: var(--text-dark);
    letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--bg-lighter);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-white);
    box-shadow: 0 0 0 4px rgba(0, 102, 255, 0.1);
}

.form-group textarea {
    min-height: 160px;
    resize: vertical;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 48px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 16px rgba(0, 102, 255, 0.3);
    letter-spacing: -0.01em;
}

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

.btn-primary:active {
    transform: translateY(0);
}

.contact-info {
    text-align: center;
    margin-top: 48px;
    color: var(--text-light);
    font-size: 16px;
}

/* Footer Enhancement */
footer {
    background: var(--bg-dark);
    color: white;
    padding: 56px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

footer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 15px;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero h1 {
        font-size: 56px;
    }
    .feature-grid {
        grid-template-columns: repeat(2, 1fr); /* Tablet: 2 columns */
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 76px;
        flex-direction: column;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        width: 100%;
        max-height: calc(100vh - 76px);
        overflow-y: auto;
        text-align: center;
        transition: left var(--transition-base);
        box-shadow: var(--shadow-lg);
        padding: 40px 0;
        gap: 24px;
    }

    .nav-menu.active {
        left: 0;
    }

    .menu-toggle {
        display: block;
    }

    .lang-selector {
        width: 100%;
        padding: 0 24px;
        position: relative;
    }

    .lang-current {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 16px;
    }

    .lang-dropdown {
        position: absolute;
        top: auto;                       /* 關鍵：取消桌面版的 top 值 */
        bottom: calc(100% + 8px);        /* 向上展開 */
        left: 24px;
        right: 24px;
        width: auto;
        margin-top: 0;
        max-height: 280px;
        overflow-y: auto;
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
        -webkit-overflow-scrolling: touch;
        transform: translateY(12px) scale(0.95);
    }

    .lang-selector:hover .lang-dropdown,
    .lang-selector.active .lang-dropdown {
        transform: translateY(0) scale(1);
    }

    .lang-dropdown a {
        padding: 14px 20px;
        font-size: 15px;
        white-space: nowrap;
    }

    .hero {
        padding: 80px 0 60px;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero .subtitle {
        font-size: 20px;
    }

    .hero p {
        font-size: 17px;
    }

    .section-title {
        font-size: 36px;
    }

    .section-subtitle {
        font-size: 18px;
    }

    .feature-grid {
        grid-template-columns: 1fr; /* Mobile: 1 column */
        gap: 24px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .feature-card {
        padding: 36px 28px;
    }

    .stat-card {
        padding: 36px 24px;
    }

    .stat-number {
        font-size: 52px;
    }

    .contact-form {
        padding: 36px 28px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 60px 0 40px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .hero .subtitle {
        font-size: 18px;
    }

    .section-title {
        font-size: 28px;
    }

    .feature-card,
    .stat-card {
        padding: 28px 20px;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
    }

    .stat-number {
        font-size: 44px;
    }
}

/* Utilities for other pages */
.btn-primary {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 16px 32px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
    text-decoration: none;
}

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