/* ===== CSS Variables (2027~2030 Spatial Dark Theme) ===== */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #050505;
    --bg-surface: rgba(15, 15, 17, 0.4);
    --bg-glass: rgba(255, 255, 255, 0.03);

    --text-primary: #ffffff;
    --text-body: #a0a0ab;
    --text-dim: #66666e;

    --accent: #4f46e5;
    --accent-glow: rgba(79, 70, 229, 0.6);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.6);

    --font-sans: 'Outfit', 'Noto Sans TC', sans-serif;

    /* ===== CSS System Tokens: Spacing Scale ===== */
    --space-xs: 0.25rem;
    /* 4px */
    --space-sm: 0.5rem;
    /* 8px */
    --space-md: 1rem;
    /* 16px */
    --space-lg: 1.5rem;
    /* 24px */
    --space-xl: 2rem;
    /* 32px */
    --space-2xl: 3rem;
    /* 48px */
    --space-3xl: 4rem;
    /* 64px */
    --space-section: clamp(6rem, 12vw, 10rem);
    /* Fluid section padding */

    /* ===== CSS System Tokens: Typography Scale (Fluid) ===== */
    --text-xs: 0.75rem;
    /* 12px */
    --text-sm: 0.875rem;
    /* 14px */
    --text-base: 1rem;
    /* 16px */
    --text-lg: 1.125rem;
    /* 18px */
    --text-xl: 1.5rem;
    /* 24px */
    --text-2xl: 2rem;
    /* 32px */
    --text-3xl: clamp(2.5rem, 5vw, 4rem);
    /* Section Titles */
    --text-mega: clamp(2.5rem, 10vw, 6rem);
    /* Hero Titles */

    --z-cursor: 9999;
    --z-nav: 1000;
    --z-content: 10;
    --z-bg: 0;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: none;
    /* Hide default cursor */
}

html,
body {
    overflow-x: hidden;
    width: 100%;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Use Lenis standard smooth scroll */
html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

ul {
    list-style: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===== Typography ===== */
.mega-text {
    font-size: var(--text-mega);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    overflow-wrap: break-word;
    word-break: break-word;
}

.section-title {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.text-gray {
    color: var(--text-body);
}

.text-white {
    color: var(--text-primary);
}

.text-bold {
    font-weight: 500;
    color: #fff;
}

.text-center {
    text-align: center;
}

.text-lg {
    font-size: var(--text-lg);
}

.highlight-text {
    background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* ===== Custom Cursor ===== */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: var(--z-cursor);
    pointer-events: none;
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background-color: var(--accent-cyan);
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: width 0.3s, height 0.3s, background-color 0.3s, border-color 0.3s;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.cursor-outline.hover-active {
    width: 60px;
    height: 60px;
    background-color: var(--bg-glass);
    border-color: var(--accent-cyan);
}

/* ===== Background Aurora (Generative Feel) ===== */
.aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: var(--z-bg);
    overflow: hidden;
    pointer-events: none;
    background: #050505;
}

.glow {
    position: absolute;
    filter: blur(120px);
    border-radius: 50%;
    opacity: 0.5;
    animation: flow 20s infinite alternate ease-in-out;
}

.glow-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: var(--accent-glow);
}

.glow-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: var(--accent-cyan-glow);
    animation-delay: -5s;
}

.glow-3 {
    top: 40%;
    left: 40%;
    width: 40vw;
    height: 40vw;
    background: rgba(139, 92, 246, 0.3);
    /* Purple */
    animation-duration: 25s;
}

@keyframes flow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10%, 10%) scale(1.1);
    }
}

/* ===== Layout Utilities ===== */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 5%;
    position: relative;
    z-index: var(--z-content);
}

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

/* Margin/Padding Utilities Based on Scale */
.mt-4 {
    margin-top: var(--space-xl);
}

.mt-5 {
    margin-top: var(--space-2xl);
}

.mb-2 {
    margin-bottom: var(--space-md);
}

.mb-3 {
    margin-bottom: var(--space-lg);
}

.mb-4 {
    margin-bottom: var(--space-xl);
}

.mb-5 {
    margin-bottom: var(--space-2xl);
}

.mt-top {
    margin-top: var(--space-xl);
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-lg);
}

.grid-2-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
}

.grid-2-layout > * {
    min-width: 0; /* 防止 CSS Grid 撐破版面的經典解法 (Grid Blowout) */
}

.align-center {
    align-items: center;
}

@media (max-width: 900px) {
    .grid-2-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-image-wrapper {
        height: auto;
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }

    .hero-img-mask {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 5;
    }
}

.relative {
    position: relative;
}

.overflow-hidden {
    overflow: hidden;
}

/* ===== Buttons (Neo-Minimal) ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md) var(--space-xl);
    border-radius: 99px;
    font-weight: 500;
    font-size: var(--text-base);
    letter-spacing: 0.05em;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.btn-glow {
    background: var(--text-primary);
    color: var(--bg-dark);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    background: #e2e8f0;
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-outline:hover {
    border-color: var(--text-primary);
    background: var(--bg-glass);
}

/* ===== Navbar (Glassmorphism) ===== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: var(--z-nav);
    padding: 1.5rem 0;
    transition: padding 0.4s, background 0.4s;
}

.navbar.scrolled {
    padding: 1rem 0;
    background: rgba(5, 5, 5, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
}

.nav-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a:not(.btn) {
    font-size: 0.95rem;
    font-weight: 500;
    color: #a0a0ab;
    position: relative;
}

.nav-links a:not(.btn):hover {
    color: #fff;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    z-index: 1001;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: rgba(5, 5, 5, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        gap: 3rem;
        transition: right 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    .nav-links a:not(.btn) {
        font-size: 2rem;
    }
}

/* ===== Hero Section ===== */
.hero {
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding-top: 10vh;
}


.hero-subtitle {
    color: var(--accent-cyan);
    font-weight: 600;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.hero-desc-wrapper {
    max-width: 600px;
    margin: 2rem 0 3rem;
}

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

.hero-image-wrapper {
    position: relative;
    width: 100%;
    height: 65vh;
    display: flex;
    justify-content: flex-end;
}

.hero-img-mask {
    height: 100%;
    aspect-ratio: 4 / 5;
    border-radius: 2rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-highlight);
    box-shadow: 0 0 30px rgba(6, 182, 212, 0.1);
}

.hero-img {
    width: 100%;
    height: 120%;
    /* for GSAP parallax scroll scrub */
    object-fit: cover;
    display: block;
    transform: translateY(-10%);
    /* Starting point for parallax */
}

/* ===== Glass Card 3.0 ===== */
.glass-card {
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: 1.5rem;
    padding: 2.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.4s, border-color 0.4s;
}

.glass-card:hover {
    border-color: var(--border-highlight);
    transform: translateY(-5px);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.05), transparent 50%);
    pointer-events: none;
}

.card-icon {
    font-size: 2rem;
    color: var(--accent-cyan);
    margin-bottom: 1.5rem;
    width: 60px;
    height: 60px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

/* ===== Horizontal Scroll Services ===== */
.services-horizontal {
    height: 100vh;
    height: 100svh;
    width: 100%;
    overflow: hidden;
    position: relative;
}

.horizontal-scroll-container {
    height: 100%;
    display: flex;
    align-items: center;
}

.horizontal-scroll-wrapper {
    display: flex;
    gap: 5vw;
    padding: 0 10vw;
    height: 80vh;
    align-items: center;
    /* Will be animated by GSAP */
}

.service-panel {
    flex: 0 0 500px;
    /* Width of each card */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.panel-title {
    flex: 0 0 400px;
}

.large-card {
    height: 100%;
    padding: 3rem;
    display: flex;
    flex-direction: column;
}

.service-img-wrapper {
    width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-highlight);
}

.service-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.large-card:hover .service-img,
.hover-target:hover .service-img {
    transform: scale(1.05);
}

.service-badge {
    display: inline-block;
    padding: 0.25rem 1rem;
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 99px;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
}

.check-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    color: #a0a0ab;
}

.check-list li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent-cyan);
    font-weight: bold;
}

@media (max-width: 768px) {
    .service-panel {
        flex: 0 0 85vw;
    }

    .horizontal-scroll-wrapper {
        padding: 0 5vw;
        gap: 5vw;
    }
}

/* ===== Workflow Timeline (Scroll Line SVG) ===== */
.workflow-timeline {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    padding-left: 50px;
}

.timeline-line-bg {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 2px;
    background: var(--border-glass);
}

.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 24px;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent-cyan), var(--accent));
    height: 0%;
    /* GSAP updates this */
}

.timeline-step {
    position: relative;
    margin-bottom: var(--space-3xl);
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.step-dot {
    position: absolute;
    left: -50px;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 2px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--text-lg);
    z-index: 2;
}

.step-content {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    padding: var(--space-xl);
    border-radius: 1rem;
    backdrop-filter: blur(10px);
}

.step-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 1rem;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-glass);
}

.step-img {
    width: 100%;
    height: 120%;
    /* For GSAP scrub */
    object-fit: cover;
    display: block;
    transform: translateY(-10%);
    /* Start position for scrub */
}

.step-content h3 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-sm);
    color: #fff;
}

.step-content p {
    color: var(--text-body);
}

/* ===== Core Value Background ===== */
.core-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    /* Will be animated by GSAP from center out */
    clip-path: inset(0 50%);
}

.core-bg-img {
    width: 100%;
    height: 120%;
    /* For parallax */
    object-fit: cover;
    display: block;
}

.core-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.85);
}

/* ===== Core Value (Bullets) ===== */
.value-list li {
    font-size: var(--text-lg);
    font-weight: 500;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
}

.bullet {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    margin-right: var(--space-lg);
    box-shadow: 0 0 10px var(--accent-cyan-glow);
}

/* ===== About Section ===== */
.about-portrait-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 2rem;
    overflow: hidden;
    border: 1px solid var(--border-highlight);
    position: relative;
}

.about-portrait-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    filter: grayscale(20%) contrast(1.1);
    transition: filter 0.5s ease;
}

.about-portrait-wrapper:hover .about-portrait-img {
    filter: grayscale(0%) contrast(1.1);
}

.grayscale-hover {
    filter: grayscale(80%);
    transition: filter 0.5s ease;
}

.grayscale-hover:hover {
    filter: grayscale(0%);
}

.subtitle {
    font-weight: 600;
    color: var(--accent-cyan);
}

.about-quote {
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--text-primary);
    border-left: 4px solid var(--accent-cyan);
    padding: var(--space-md) 0 var(--space-md) var(--space-lg);
    margin: var(--space-xl) 0;
    line-height: 1.8;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.1) 0%, transparent 100%);
    border-radius: 0 1rem 1rem 0;
}

/* ===== CTA Area ===== */
.glass-cta {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 2rem;
    padding: var(--space-section) var(--space-2xl);
    position: relative;
    overflow: hidden;
    max-width: 900px;
    margin: 0 auto;
}

.cta-bg-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.cta-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Will be scaled up by GSAP */
}

.cta-bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(4px);
}

.cta-glow {
    position: absolute;
    bottom: -50%;
    right: -20%;
    width: 500px;
    height: 500px;
    filter: blur(150px);
    background: rgba(79, 70, 229, 0.4);
    border-radius: 50%;
    z-index: -1;
}

/* ===== Footer ===== */
.footer {
    border-top: 1px solid var(--border-glass);
    padding: var(--space-section) 0 var(--space-xl);
    background: #000;
}

.footer-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    display: block;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: var(--space-2xl);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

.footer-contact ul li {
    margin-bottom: var(--space-sm);
}

.hover-link:hover {
    color: #fff;
    text-decoration: underline;
}

.footer-bottom {
    border-top: 1px solid var(--border-glass);
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    text-align: center;
    font-size: var(--text-sm);
}

/* ===== Utility for JS Animation SplitText Simulation ===== */
.char {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
}

.line {
    overflow: hidden;
}