/* ===================================
   FAIRTEK - Design System & Styles
   Minimalist Sci-Fi Theme
   =================================== */

/* --- CSS Variables (Design Tokens) --- */
:root {
    /* Colors - Dark Sci-Fi Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a24;
    --bg-card: rgba(26, 26, 36, 0.6);
    --bg-glass: rgba(255, 255, 255, 0.03);

    /* Accent Colors - Chinese Red Theme */
    --accent-red: #C41E3A;
    --accent-red-light: #E63946;
    --accent-gold: #D4A574;
    --accent-cyan: #4fd1c5;
    --gradient-primary: linear-gradient(135deg, #C41E3A 0%, #E63946 50%, #D4A574 100%);
    --gradient-glow: linear-gradient(135deg, rgba(196, 30, 58, 0.4), rgba(212, 165, 116, 0.4));

    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.3);

    /* Border Colors */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(196, 30, 58, 0.3);


    /* Typography */
    --font-sans: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3.5rem;
    --font-size-6xl: 4.5rem;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-glow: 0 0 40px rgba(196, 30, 58, 0.15);
    --shadow-glow-strong: 0 0 60px rgba(196, 30, 58, 0.25);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);


    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index Scale */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal: 400;
    --z-tooltip: 500;
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* --- Utility Classes --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

.section {
    padding: var(--space-24) 0;
    position: relative;
}

/* --- Particle Canvas Background --- */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

/* --- Header & Navigation --- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-fixed);
    padding: var(--space-4) 0;
    transition: all var(--transition-base);
}

.header.scrolled {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-8);
}

.nav-logo {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.logo-text {
    font-size: var(--font-size-lg);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-sub {
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.2em;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-8);
}

.nav-link {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    padding: var(--space-2) 0;
}

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

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

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

/* Language Selector Dropdown */
.lang-selector {
    position: relative;
}

.lang-trigger {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    font-size: var(--font-size-base);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lang-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-accent);
}

.lang-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-arrow {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

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

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-2);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: var(--z-dropdown);
    box-shadow: var(--shadow-card);
}

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

.lang-option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background var(--transition-fast);
    text-align: left;
}

.lang-option:hover {
    background: rgba(255, 255, 255, 0.08);
}

.lang-option.active {
    background: var(--gradient-glow);
}

.lang-option-flag {
    font-size: 1.25rem;
    line-height: 1;
}

.lang-option-text {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    font-weight: 500;
}



.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: var(--space-2);
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-24) 0;
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-8);
    animation: fadeInUp 0.8s ease forwards;
}

.badge-dot {
    width: 8px;
    height: 8px;
    background: var(--accent-cyan);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.badge-text {
    font-size: var(--font-size-sm);
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.hero-title {
    margin-bottom: var(--space-6);
    animation: fadeInUp 0.8s ease 0.1s forwards;
    opacity: 0;
}

.title-main {
    display: block;
    font-size: var(--font-size-6xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: var(--space-2);
}

.title-sub {
    display: block;
    font-size: var(--font-size-xl);
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.3em;
}

.hero-slogan {
    font-size: var(--font-size-2xl);
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-4);
    min-height: 1.5em;
    opacity: 0;
}

.hero-slogan.typing,
.hero-description.typing {
    opacity: 1;
}

.hero-slogan.typing-done,
.hero-description.typing-done {
    opacity: 1;
}

/* Typewriter cursor that follows the text */
.typewriter-cursor {
    display: inline;
    color: var(--accent-red);
    font-weight: 300;
    animation: blink-cursor 0.7s step-end infinite;
    margin-left: 2px;
}

.hero-description {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
    margin-bottom: var(--space-10);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    min-height: 1.5em;
    opacity: 0;
}


.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-8);
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--font-size-base);
    color: var(--text-primary);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-glow);
    animation: fadeInUp 0.8s ease 0.4s forwards;
    opacity: 0;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-strong);
}

.cta-arrow {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.hero-cta:hover .cta-arrow {
    transform: translate(3px, -3px);
}

.hero-scroll {
    position: absolute;
    bottom: var(--space-10);
    left: 50%;
    transform: translateX(-50%);
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid var(--border-accent);
    border-radius: var(--radius-full);
    display: flex;
    justify-content: center;
    padding-top: 8px;
}

.scroll-dot {
    width: 4px;
    height: 8px;
    background: var(--accent-red);
    border-radius: var(--radius-full);
    animation: scrollBounce 2s infinite;
}

/* --- Section Styles --- */
.section-header {
    text-align: center;
    margin-bottom: var(--space-16);
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: var(--font-size-lg);
    color: var(--text-secondary);
}

/* --- About Section --- */
.about {
    background: var(--bg-secondary);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
}

.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: var(--space-10);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.about-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.about-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
}

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

.card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-6);
    color: var(--accent-red);
}

.card-icon svg {
    width: 100%;
    height: 100%;
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.card-text {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.8;
}

/* --- Business Section --- */
.business {
    background: var(--bg-primary);
    position: relative;
}

.business::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.business-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-8);
    position: relative;
    z-index: 1;
}

.business-card {
    position: relative;
    border-radius: var(--radius-2xl);
    padding: 2px;
    background: linear-gradient(135deg, var(--border-accent), transparent 50%);
    transition: all var(--transition-base);
}

.business-card:hover {
    background: var(--gradient-primary);
}

.card-glow {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-2xl);
    opacity: 0;
    transition: opacity var(--transition-base);
    background: var(--gradient-primary);
    filter: blur(30px);
    z-index: -1;
}

.business-card:hover .card-glow {
    opacity: 0.3;
}

.card-content {
    background: var(--bg-secondary);
    border-radius: calc(var(--radius-2xl) - 2px);
    padding: var(--space-12);
    height: 100%;
    position: relative;
}

.card-badge {
    display: inline-block;
    padding: var(--space-1) var(--space-3);
    background: var(--gradient-glow);
    border: 1px solid var(--border-accent);
    border-radius: var(--radius-full);
    font-size: var(--font-size-xs);
    font-weight: 500;
    color: var(--accent-red);
    margin-bottom: var(--space-6);
}

.card-icon-lg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--space-6);
    color: var(--accent-gold);
}

.card-icon-lg svg {
    width: 100%;
    height: 100%;
}

.card-title-lg {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.card-text-lg {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    line-height: 1.8;
}

/* --- Contact Section --- */
.contact {
    background: var(--bg-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-6);
}

.contact-card {
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
    padding: var(--space-8);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    transition: all var(--transition-base);
}

.contact-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.contact-icon {
    width: 40px;
    height: 40px;
    color: var(--accent-red);
    flex-shrink: 0;
}

.contact-icon svg {
    width: 100%;
    height: 100%;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.contact-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-weight: 500;
}

.contact-value {
    font-size: var(--font-size-base);
    color: var(--text-primary);
    word-break: break-all;
}

a.contact-value:hover {
    color: var(--accent-red);
}

/* --- Footer --- */
.footer {
    padding: var(--space-12) 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-subtle);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
}

.footer-logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-tagline {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.footer-copyright {
    font-size: var(--font-size-sm);
    color: var(--text-dim);
}

.footer-icp {
    font-size: var(--font-size-xs);
    color: var(--text-dim);
    transition: color var(--transition-fast);
}

.footer-icp:hover {
    color: var(--text-muted);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes scrollBounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(12px);
        opacity: 0.3;
    }
}

@keyframes blink-cursor {

    0%,
    100% {
        border-right-color: var(--accent-red);
    }

    50% {
        border-right-color: transparent;
    }
}


@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {

    .about-grid,
    .business-grid {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --font-size-6xl: 3rem;
        --font-size-4xl: 2rem;
        --font-size-2xl: 1.25rem;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-secondary);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-8);
        padding: var(--space-8);
        transition: right var(--transition-base);
        border-left: 1px solid var(--border-subtle);
    }

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

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .hero {
        padding-top: var(--space-20);
    }

    .hero-slogan {
        font-size: var(--font-size-xl);
    }

    .about-card,
    .card-content {
        padding: var(--space-8);
    }

    .section {
        padding: var(--space-16) 0;
    }

    .section-header {
        margin-bottom: var(--space-10);
    }
}

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

    .hero-badge {
        padding: var(--space-1) var(--space-3);
    }

    .hero-cta {
        padding: var(--space-3) var(--space-6);
    }

    .contact-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* --- Selection & Scrollbar --- */
::selection {
    background: rgba(102, 126, 234, 0.3);
    color: var(--text-primary);
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}