/* ============================================
   甫東科技 FullDot Technology — Style System
   ============================================ */

:root {
    --primary: #2563eb;
    --accent: #d15b27;
    --accent-light: #fb923c;
    --bg-white: #fafaf9;
    --bg-dark: #0a0a0a;
    --text-dark: #1c1917;
    --text-muted: #78716c;
    --text-light: #a8a29e;
    --border: rgba(0, 0, 0, 0.08);
    --border-light: rgba(255, 255, 255, 0.1);
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Outfit', 'Noto Sans TC', sans-serif;
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

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

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

/* ---- Skip Link (Accessibility) ---- */
.skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    z-index: 100001;
    padding: 12px 24px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    border-radius: 0 0 8px 8px;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

/* ---- Focus Styles (Accessibility) ---- */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---- WebGL 水墨流動系統 ---- */
#webgl-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    z-index: 2;
    pointer-events: none;
    transition: opacity 0.6s ease;
    mix-blend-mode: screen;
    opacity: 0.10;
}

#webgl-container.webgl-dark {
    mix-blend-mode: screen;
}

#webgl-container.webgl-light {
    mix-blend-mode: multiply;
}

/* ---- Loading Screen ---- */
#loader {
    position: fixed;
    inset: 0;
    background: var(--bg-dark);
    z-index: 100000;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    flex-direction: column;
    will-change: transform;
}

.loading body {
    overflow: hidden;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.loader-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.loader-en {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    font-style: italic;
    letter-spacing: 3px;
    opacity: 0;
    transform: translateY(20px);
    animation: loaderFadeUp 0.8s 0.2s var(--ease-out) forwards;
}

.loader-divider {
    display: block;
    width: 40px;
    height: 1px;
    background: #2a9dd6;
    opacity: 0;
    transform: scaleX(0);
    animation: loaderLineGrow 0.6s 0.6s var(--ease-out) forwards;
}

.loader-zh {
    font-family: var(--font-sans);
    font-size: clamp(0.85rem, 2vw, 1.1rem);
    font-weight: 300;
    letter-spacing: 8px;
    color: rgba(255, 255, 255, 0.5);
    opacity: 0;
    transform: translateY(12px);
    animation: loaderFadeUp 0.7s 0.8s var(--ease-out) forwards;
}

.loader-bar {
    width: 120px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
    opacity: 0;
    animation: loaderFadeUp 0.4s 1s var(--ease-out) forwards;
}

.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: #d15b27;
    border-radius: 1px;
    animation: loaderProgress 1.2s 1.1s var(--ease-in-out) forwards;
}

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

@keyframes loaderLineGrow {
    to {
        opacity: 1;
        transform: scaleX(1);
    }
}

@keyframes loaderProgress {
    0%   { width: 0%; }
    60%  { width: 70%; }
    100% { width: 100%; }
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 24px 48px;
    z-index: 1000;
    background: rgba(250, 250, 249, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: padding 0.3s, box-shadow 0.3s;
}

.navbar.scrolled {
    padding: 16px 48px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

.nav-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.logo-img {
    height: 36px;
    width: auto;
}

.nav-links {
    display: flex;
    gap: 36px;
    align-items: center;
}

.nav-link {
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    font-weight: 500;
    position: relative;
    transition: color 0.3s;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out);
}

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

.btn-contact {
    border: 1.5px solid var(--text-dark);
    padding: 8px 24px;
    border-radius: 30px;
    transition: background 0.3s, color 0.3s;
}

.btn-contact:hover,
.btn-contact:focus-visible {
    background: var(--text-dark);
    color: #fff;
}

.btn-contact::after {
    display: none;
}

/* Menu Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    width: 28px;
    height: 20px;
    position: relative;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-dark);
    position: absolute;
    left: 0;
    transition: all 0.4s var(--ease-out);
    border-radius: 2px;
}

.menu-toggle span:first-child { top: 2px; }
.menu-toggle span:last-child { bottom: 2px; }

/* Active: X shape — keep dark for warm bg */
.menu-toggle.active span {
    background: var(--text-dark);
}

.menu-toggle.active span:first-child {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.active span:last-child {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* ============================================
   MOBILE MENU — 文創風格 Warm Cultural
   ============================================ */
.mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: #f6f1eb;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--ease-out);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Subtle paper texture overlay */
.mobile-menu::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(209, 91, 39, 0.06), transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(37, 99, 235, 0.04), transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.mobile-menu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-menu-inner {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 100px 28px 40px;
    gap: 36px;
    position: relative;
    z-index: 1;
}

/* Brand */
.mm-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(28, 25, 23, 0.08);
}

.mm-brand-en {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 400;
    font-style: italic;
    color: var(--text-dark);
    letter-spacing: 0.5px;
}

.mm-brand-zh {
    font-family: var(--font-sans);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 3px;
    color: var(--text-muted);
}

/* Nav */
.mm-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mm-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 14px;
    border-radius: 12px;
    transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out);
    color: var(--text-dark);
    opacity: 0;
    transform: translateX(-16px);
}

.mobile-menu.active .mm-link {
    opacity: 1;
    transform: translateX(0);
}

.mm-link:hover,
.mm-link:focus-visible {
    background: rgba(28, 25, 23, 0.04);
}

.mm-link:active {
    transform: scale(0.98);
}

.mm-link-active {
    background: rgba(209, 91, 39, 0.07);
}

.mm-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--accent);
    opacity: 0.7;
}

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

.mm-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.mm-label {
    font-family: var(--font-serif);
    font-size: 0.65rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--text-light);
}

.mm-title {
    font-family: var(--font-sans);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: var(--text-dark);
}

.mm-arrow {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-light);
    opacity: 0.4;
    transition: color 0.25s, transform 0.25s, opacity 0.25s;
}

.mm-link:hover .mm-arrow {
    color: var(--accent);
    opacity: 1;
    transform: translateX(3px);
}

/* CTA */
.mm-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 28px;
    background: var(--text-dark);
    color: #fff;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.3s var(--ease-out);
    opacity: 0;
    transform: translateY(8px);
}

.mobile-menu.active .mm-cta {
    opacity: 1;
    transform: translateY(0);
}

.mm-cta:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(209, 91, 39, 0.2);
}

.mm-cta-icon {
    width: 18px;
    height: 18px;
}

/* Footer */
.mm-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid rgba(28, 25, 23, 0.06);
    opacity: 0;
}

.mobile-menu.active .mm-footer {
    opacity: 1;
}

.mm-footer a,
.mm-footer span {
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.5px;
    transition: color 0.25s;
}

.mm-footer a:hover {
    color: var(--accent);
}

.mm-footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--text-light);
    opacity: 0.3;
    display: inline-block;
}

/* ============================================
   HERO — Full-bleed Banner
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 48px 80px;
    position: relative;
    overflow: hidden;
    z-index: 1;
    color: #fff;
}

/* Background image */
.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    transition: transform 12s linear;
    will-change: transform;
}

/* Ken Burns — slow zoom on load */
.hero-bg-img {
    animation: heroPan 20s ease-in-out infinite alternate;
}

@keyframes heroPan {
    0%   { transform: scale(1)   translate(0, 0); }
    100% { transform: scale(1.08) translate(-1%, -1%); }
}

/* Overlay — 粉藍 × 粉菊 文創色調 12% 輕透 */
.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* Base: 12% pastel wash — barely there, like watercolor on glass */
.hero-overlay::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(160, 195, 225, 0.12) 0%,        /* 粉藍 12% */
            rgba(210, 190, 165, 0.08) 40%,        /* 中間暖過渡 */
            rgba(230, 170, 120, 0.12) 100%         /* 粉菊 12% */
        );
    mix-blend-mode: multiply;
}

/* Text-protection: soft dark vignette for readability */
.hero-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        /* Bottom — protect footer/stats text */
        linear-gradient(to top, rgba(15, 12, 10, 0.65) 0%, transparent 38%),
        /* Left — protect main title */
        linear-gradient(to right, rgba(15, 12, 10, 0.45) 0%, transparent 55%),
        /* Top — subtle nav protection */
        linear-gradient(to bottom, rgba(15, 12, 10, 0.20) 0%, transparent 18%);
}

.hero-content {
    max-width: 1280px;
    width: 100%;
    position: relative;
    z-index: 3;
}

.reveal-text {
    overflow: hidden;
}

.label {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 24px;
    font-weight: 400;
}

.serif-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.2;
    font-weight: 400;
}

.italic {
    font-style: italic;
}

.main-title {
    font-size: clamp(3rem, 8vw, 7rem);
    font-weight: 900;
    line-height: 0.95;
    letter-spacing: -2px;
    margin-top: 12px;
    color: #fff;
}

.reveal-text .serif-title,
.reveal-text .main-title,
.hero-footer {
    opacity: 0;
    transform: translateY(40px);
}

.char {
    display: inline-block;
    will-change: transform, opacity;
}

.hero-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 64px;
    gap: 40px;
}

.hero-desc {
    max-width: 420px;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.8;
}

.hero-stats {
    display: flex;
    gap: 48px;
}

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

.stat-number {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1;
    display: inline;
    color: #fff;
}

.stat-plus {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-light);
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.scroll-reveal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.scroll-line {
    height: 60px;
    width: 1px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent-light);
    animation: scroll-anim 2s infinite var(--ease-in-out);
}

@keyframes scroll-anim {
    0% { top: -100%; }
    50% { top: 0; }
    100% { top: 100%; }
}

.scroll-reveal span {
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.35);
}

/* ============================================
   SHARED SECTION STYLES
   ============================================ */
.section-intro {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 48px;
    margin-bottom: 64px;
}

.counter {
    font-size: 0.7rem;
    font-weight: 300;
    letter-spacing: 5px;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.counter::before {
    content: '';
    width: 32px;
    height: 1px;
    background: var(--accent);
}

.section-title {
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    font-weight: 200;
}

.section-title .en {
    display: block;
    font-family: var(--font-serif);
    font-size: 0.6rem;
    letter-spacing: 6px;
    text-transform: uppercase;
    margin-top: 4px;
    opacity: 0.4;
}

.section-desc {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 16px;
    max-width: 500px;
}

/* ============================================
   SERVICES — HORIZONTAL SCROLL PANELS (Desktop)
   ============================================ */
.services-horizontal {
    position: relative;
    background: #000;
}

/* Desktop: horizontal scroll */
.services-pin-wrapper {
    display: block;
    height: 100vh;
    overflow: hidden;
}

.services-sticky-header {
    position: fixed;
    top: 50px;
    left: 48px;
    z-index: 20;
    pointer-events: none;
    mix-blend-mode: difference;
    color: #fff;
    opacity: 0;
    transition: opacity 0.3s;
}

.services-sticky-header.visible {
    opacity: 1;
}

.services-sticky-header .counter {
    color: var(--accent-light);
}

.services-sticky-header .counter::before {
    background: var(--accent-light);
}

.services-track {
    display: flex;
    width: max-content;
    height: 100vh;
    will-change: transform;
}

/* Individual Panel */
.service-panel {
    width: 100vw;
    height: 100vh;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.panel-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.panel-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.30;
    /* Start zoomed in — GSAP parallax will animate this */
    transform: scale(1.25);
    transition: opacity 1s var(--ease-out), filter 1s var(--ease-out);
    will-change: transform, opacity;
    filter: brightness(0.8) contrast(1.1);
}

/* Cinematic vignette over image */
.panel-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at center, transparent 30%, rgba(0,0,0,0.5) 100%),
        linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    pointer-events: none;
    transition: opacity 0.8s var(--ease-out);
}

/* Hover: image brightens + zooms slightly more */
.service-panel:hover .panel-bg img {
    opacity: 0.45;
    filter: brightness(0.9) contrast(1.05);
}

.service-panel:hover .panel-bg::after {
    opacity: 0.7;
}

.panel-content {
    position: relative;
    z-index: 10;
    width: 100%;
    padding: 80px 120px;
    display: flex;
    align-items: flex-end;
}

.panel-number {
    font-family: var(--font-serif);
    font-size: clamp(6rem, 12vw, 10rem);
    font-weight: 900;
    font-style: italic;
    opacity: 0.08;
    position: absolute;
    top: 50%;
    left: 80px;
    transform: translateY(-50%);
    z-index: -1;
    color: #fff;
    pointer-events: none;
    line-height: 1;
}

.panel-text {
    max-width: 700px;
}

.panel-tag {
    font-size: 0.7rem;
    letter-spacing: 3px;
    font-weight: 700;
    color: var(--accent-light);
    display: block;
    margin-bottom: 16px;
}

.panel-content h3 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 1.1;
    color: #fff;
}

.panel-en {
    display: block;
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--accent-light);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.panel-line {
    width: 60px;
    height: 2px;
    background: rgba(255, 255, 255, 0.4);
    margin: 32px 0;
}

.panel-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    max-width: 450px;
    color: rgba(255, 255, 255, 0.65);
    letter-spacing: 0.03em;
}

/* Panel Link — wraps entire panel content */
.panel-link {
    display: block;
    position: absolute;
    inset: 0;
    color: inherit;
    text-decoration: none;
}

.panel-link .panel-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 80px 120px;
    display: flex;
    align-items: flex-end;
}

/* Panel CTA label */
.panel-cta {
    position: absolute;
    bottom: 80px;
    right: 120px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--accent-light);
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.service-panel:hover .panel-cta {
    opacity: 1;
    transform: translateX(0);
}

/* Panel title & desc entrance animations */
.panel-title-anim,
.panel-desc-anim {
    opacity: 0;
    transform: translateY(30px);
    transition: none; /* controlled by GSAP */
}

/* Mobile: stacked cards */
.services-mobile-stack {
    display: none;
    padding: 80px 0;
    background: var(--bg-white);
}

.mobile-cards {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.mobile-service-card {
    padding: 32px 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}

.mobile-service-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.mobile-service-card .card-tag {
    font-size: 0.65rem;
    letter-spacing: 3px;
    font-weight: 700;
    color: var(--accent);
    display: block;
    margin-bottom: 10px;
}

.mobile-service-card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.mobile-service-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================================
   PORTFOLIO — HORIZONTAL DRAG SCROLL
   ============================================ */
.portfolio-section {
    padding: 120px 0 80px;
    background: #0f1923;
    color: #fff;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.portfolio-section .counter {
    color: var(--accent-light);
}

.portfolio-section .counter::before {
    background: var(--accent-light);
}

.portfolio-section .section-title {
    color: #fff;
}

.portfolio-section .section-desc {
    color: rgba(180, 200, 220, 0.5);
}

/* Portfolio Carousel */
.portfolio-carousel {
    position: relative;
    padding: 0 48px 40px;
}

.portfolio-carousel-viewport {
    overflow: hidden;
    border-radius: 8px;
}

.portfolio-carousel-track {
    display: flex;
    transition: transform 0.6s cubic-bezier(.16, 1, .3, 1);
    will-change: transform;
}

.portfolio-slide {
    flex: 0 0 33.333%;
    padding: 0 16px;
    transition: opacity 0.4s var(--ease-out);
}

.portfolio-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 32px;
}

.carousel-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.05);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.carousel-btn:hover {
    border-color: var(--accent-light);
    background: rgba(209, 91, 39, 0.15);
    transform: scale(1.08);
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    padding: 0;
}

.carousel-dot.active {
    background: var(--accent-light);
    transform: scale(1.3);
}

.carousel-dot:hover:not(.active) {
    background: rgba(255,255,255,0.4);
}

/* Legacy compat */
.portfolio-scroll-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 48px 40px;
    scroll-snap-type: x mandatory;
    cursor: grab;
}

.portfolio-scroll-wrapper:active {
    cursor: grabbing;
}

.portfolio-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.portfolio-track {
    display: flex;
    gap: 32px;
    width: max-content;
}

.portfolio-item, .portfolio-slide {
    width: 420px;
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: transform 0.4s var(--ease-out);
}

.portfolio-item:hover, .portfolio-slide:hover {
    transform: translateY(-8px);
}

.portfolio-img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 8px;
    overflow: hidden;
    background: #141f2b;
}

.portfolio-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
}

.portfolio-item:hover .portfolio-img-wrapper img {
    transform: scale(1.05);
}

.portfolio-info {
    padding: 20px 0;
}

.portfolio-category {
    font-size: 0.7rem;
    letter-spacing: 2px;
    color: var(--accent-light);
    font-weight: 700;
    text-transform: uppercase;
}

.portfolio-info h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 8px;
    color: #fff;
}

.portfolio-info p {
    font-size: 0.9rem;
    color: rgba(160, 195, 225, 0.45);
    margin-top: 4px;
}

/* ============================================
   ABOUT
   ============================================ */
.about {
    padding: 120px 48px;
    background: #fff;
    position: relative;
    z-index: 2;
}

.about-container {
    max-width: 800px;
    margin: 0 auto;
}

.about-text-content .serif-title {
    margin-top: 8px;
}

.large-para {
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    font-weight: 300;
    line-height: 1.6;
    margin-top: 32px;
    color: var(--text-dark);
}

.about-detail {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 24px;
    line-height: 1.8;
    max-width: 600px;
}

.about-highlights {
    display: flex;
    gap: 48px;
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid var(--border);
}

.highlight-item {
    text-align: left;
}

.highlight-number {
    font-size: 2.5rem;
    font-weight: 900;
    line-height: 1;
    display: block;
}

.highlight-number .plus {
    color: var(--accent);
}

.highlight-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* ============================================
   PROCESS — 服務流程
   ============================================ */
.process-section {
    padding: 120px 0;
    background: #f5f5f4;
    position: relative;
    z-index: 2;
}

.process-container {
    max-width: 1280px;
    margin: 0 auto;
}

.process-intro {
    margin-bottom: 80px;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 0 48px;
    position: relative;
}

.process-step {
    position: relative;
    padding: 0 32px;
}

.step-number {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 900;
    font-style: italic;
    color: var(--accent);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: 20px;
}

.step-content h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-content p {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.step-line {
    position: absolute;
    top: 28px;
    right: 0;
    width: 1px;
    height: 60px;
    background: var(--border);
}

.process-step:last-child .step-line {
    display: none;
}

/* ============================================
   TRUST — 客戶信賴
   ============================================ */
.trust-section {
    padding: 120px 48px;
    background: #f0ebe4;
    color: var(--text-dark);
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* Warm radial glow — 文創光暈 */
.trust-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 25% 30%, rgba(230, 170, 120, 0.12), transparent 55%),
        radial-gradient(ellipse at 75% 70%, rgba(160, 195, 225, 0.10), transparent 55%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 255, 255, 0.4), transparent 70%);
}

.trust-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.trust-header {
    margin-bottom: 16px;
}

.trust-counter {
    color: var(--accent);
}

.trust-counter::before {
    background: var(--accent);
}

.trust-section .section-title {
    color: var(--text-dark);
}

.trust-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    line-height: 1.8;
    margin-bottom: 56px;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.trust-logo-card {
    position: relative;
    padding: 0;
    border: 1px solid rgba(28, 25, 23, 0.06);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s var(--ease-out);
    text-align: center;
    aspect-ratio: 4 / 3;
}

.trust-card-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.6s var(--ease-out);
}

.trust-card-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    transition: background 0.3s var(--ease-out);
}

.trust-card-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 24px;
}

.trust-logo-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(209, 91, 39, 0.12);
}

.trust-logo-card:hover .trust-card-bg {
    transform: scale(1.05);
}

.trust-logo-card:hover .trust-card-overlay {
    background: rgba(255, 255, 255, 0.25);
}

.trust-name {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    text-shadow: 0 1px 4px rgba(255,255,255,0.6);
}

.trust-industry {
    font-size: 0.8rem;
    letter-spacing: 2px;
    color: var(--accent);
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(255,255,255,0.5);
}

.trust-quote {
    margin-top: 56px;
    padding-top: 48px;
    border-top: 1px solid rgba(28, 25, 23, 0.08);
    text-align: center;
}

.trust-quote blockquote {
    max-width: 700px;
    margin: 0 auto;
}

.trust-quote p {
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2vw, 1.5rem);
    font-style: italic;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ============================================
   CTA
   ============================================ */
.cta {
    text-align: center;
    padding: 120px 48px;
    background: var(--bg-white);
    position: relative;
    z-index: 1;
}

.cta .serif-title {
    font-size: clamp(1.8rem, 4vw, 3rem);
}

.cta-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.magnetic-btn {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 18px 40px;
    background: var(--text-dark);
    color: #fff;
    border-radius: 50px;
    margin-top: 40px;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s var(--ease-out);
    border: 2px solid var(--text-dark);
}

.magnetic-btn:hover,
.magnetic-btn:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(209, 91, 39, 0.3);
}

.magnetic-btn svg {
    width: 20px;
    fill: #fff;
    transition: transform 0.3s;
}

.magnetic-btn:hover svg {
    transform: translateX(4px);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-section {
    padding: 120px 48px;
    background: #f5f5f4;
    position: relative;
    z-index: 2;
}

.contact-container {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: start;
}

.contact-intro {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-top: 24px;
    line-height: 1.8;
}

.contact-details {
    font-style: normal;
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-light);
    font-weight: 700;
    text-transform: uppercase;
}

.contact-item a,
.contact-item p {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Contact Form */
.contact-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-full {
    grid-column: 1 / -1;
}

.contact-form label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-dark);
}

.required {
    color: var(--accent);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 14px 16px;
    border: 1px solid #d6d3d1;
    border-radius: 8px;
    font-family: var(--font-sans);
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.3s, box-shadow 0.3s;
    color: var(--text-dark);
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(209, 91, 39, 0.15);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
}

.submit-btn {
    grid-column: 1 / -1;
    padding: 16px 40px;
    background: var(--text-dark);
    color: #fff;
    border: 2px solid var(--text-dark);
    border-radius: 50px;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
    justify-self: start;
}

.submit-btn:hover,
.submit-btn:focus-visible {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(209, 91, 39, 0.25);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    padding: 80px 48px 40px;
    background: var(--bg-dark);
    color: #fff;
    position: relative;
    z-index: 2;
}

.footer-main {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-logo {
    font-size: clamp(4rem, 14vw, 12rem);
    font-weight: 900;
    letter-spacing: -3px;
    line-height: 0.85;
    text-align: center;
    margin-bottom: 60px;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
    position: relative;
    cursor: default;
    display: flex;
    justify-content: center;
    gap: 0;
}

/* Each character */
.fl-char {
    display: inline-block;
    position: relative;
    color: transparent;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.06);
    transition: color 0.5s ease, -webkit-text-stroke 0.5s ease,
                text-shadow 0.5s ease, transform 0.4s var(--ease-out);
    will-change: transform, color;
}

/* Hover: character lights up */
.fl-char:hover {
    color: rgba(255, 255, 255, 0.15);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.25);
    text-shadow:
        0 0 40px rgba(230, 170, 120, 0.25),
        0 0 80px rgba(160, 195, 225, 0.15),
        0 0 120px rgba(230, 170, 120, 0.08);
    transform: translateY(-4px);
}

/* JS-driven glow class: proximity-based lighting */
.fl-char.fl-glow-1 {
    color: rgba(255, 255, 255, 0.06);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.12);
    text-shadow: 0 0 30px rgba(230, 170, 120, 0.08);
}

.fl-char.fl-glow-2 {
    color: rgba(255, 255, 255, 0.12);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.20);
    text-shadow:
        0 0 30px rgba(230, 170, 120, 0.15),
        0 0 60px rgba(160, 195, 225, 0.08);
}

.fl-char.fl-glow-3 {
    color: rgba(255, 255, 255, 0.20);
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.30);
    text-shadow:
        0 0 40px rgba(230, 170, 120, 0.30),
        0 0 80px rgba(160, 195, 225, 0.15),
        0 0 120px rgba(230, 170, 120, 0.08);
    transform: translateY(-3px);
}

/* Scroll-triggered entrance animation */
.fl-char {
    opacity: 0;
    transform: translateY(30px);
}

.footer-logo.fl-visible .fl-char {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay per character */
.footer-logo.fl-visible .fl-char:nth-child(1) { transition-delay: 0.0s; }
.footer-logo.fl-visible .fl-char:nth-child(2) { transition-delay: 0.06s; }
.footer-logo.fl-visible .fl-char:nth-child(3) { transition-delay: 0.12s; }
.footer-logo.fl-visible .fl-char:nth-child(4) { transition-delay: 0.18s; }
.footer-logo.fl-visible .fl-char:nth-child(5) { transition-delay: 0.24s; }
.footer-logo.fl-visible .fl-char:nth-child(6) { transition-delay: 0.30s; }
.footer-logo.fl-visible .fl-char:nth-child(7) { transition-delay: 0.36s; }

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border-light);
}

.footer-col h4 {
    font-size: 0.8rem;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
}

.footer-col address {
    font-style: normal;
}

.footer-col p,
.footer-col a {
    display: block;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    transition: color 0.3s;
}

.footer-col a:hover {
    color: var(--accent-light);
}

.footer-col nav {
    display: flex;
    flex-direction: column;
}

.socials {
    display: flex;
    flex-direction: column;
}

.footer-bottom {
    padding-top: 32px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 1px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   REDUCED MOTION (Accessibility)
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal-text .serif-title,
    .reveal-text .main-title,
    .hero-footer {
        opacity: 1;
        transform: none;
    }

    .char {
        opacity: 1 !important;
        transform: none !important;
    }

    #webgl-container {
        display: none;
    }
}

/* ============================================
   RESPONSIVE — TABLET (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .navbar {
        padding: 16px 24px;
    }

    .navbar.scrolled {
        padding: 12px 24px;
    }

    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .hero {
        padding: 100px 24px 60px;
    }

    .main-title {
        font-size: clamp(2.5rem, 7vw, 5rem);
    }

    .hero-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 32px;
    }

    .scroll-reveal {
        display: none;
    }

    /* Services: hide horizontal, show stacked cards */
    .services-pin-wrapper {
        display: none !important;
    }

    .services-sticky-header {
        display: none !important;
    }

    .services-mobile-stack {
        display: block;
    }

    .services-horizontal {
        background: var(--bg-white);
    }

    .section-intro {
        padding: 0 24px;
    }

    .portfolio-section {
        padding: 80px 0 60px;
    }

    .portfolio-carousel {
        padding: 0 24px 32px;
    }

    .portfolio-slide {
        flex: 0 0 50% !important;
    }

    .portfolio-scroll-wrapper {
        padding: 0 24px 32px;
    }

    .portfolio-item {
        width: 340px;
    }

    .about {
        padding: 80px 24px;
    }

    /* Process */
    .process-section { padding: 80px 0; }
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 40px 0;
        padding: 0 24px;
    }
    .step-line { display: none; }

    /* Trust */
    .trust-section { padding: 80px 24px; }
    .trust-grid { grid-template-columns: repeat(2, 1fr); }

    .cta {
        padding: 80px 24px;
    }

    .contact-section {
        padding: 80px 24px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }

    .footer {
        padding: 60px 24px 32px;
    }

    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    #webgl-container {
        display: none;
    }
}

/* ============================================
   RESPONSIVE — MOBILE (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {
    .hero {
        padding: 100px 16px 48px;
        min-height: 100svh;
    }

    .label {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }

    .serif-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .main-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
        letter-spacing: -1px;
    }

    .hero-footer {
        margin-top: 40px;
    }

    .hero-desc {
        font-size: 0.95rem;
    }

    .hero-stats {
        gap: 32px;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .section-intro {
        padding: 0 16px;
        margin-bottom: 40px;
    }

    .services-mobile-stack {
        padding: 60px 0;
    }

    .portfolio-section {
        padding: 60px 0 40px;
    }

    .portfolio-carousel {
        padding: 0 16px 24px;
    }

    .portfolio-slide {
        flex: 0 0 100% !important;
        padding: 0 8px;
    }

    .carousel-btn {
        width: 40px;
        height: 40px;
    }

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

    .portfolio-scroll-wrapper {
        padding: 0 16px 24px;
    }

    .portfolio-item {
        width: 300px;
    }

    .portfolio-info h3 {
        font-size: 1.2rem;
    }

    .about {
        padding: 60px 16px;
    }

    .large-para {
        font-size: 1.15rem;
    }

    .about-detail {
        font-size: 0.95rem;
    }

    .about-highlights {
        flex-direction: column;
        gap: 24px;
    }

    .highlight-number {
        font-size: 2rem;
    }

    /* Process mobile */
    .process-section { padding: 60px 0; }
    .process-steps {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 0 16px;
    }
    .step-number { font-size: 2.5rem; }

    /* Trust mobile */
    .trust-section { padding: 60px 16px; }
    .trust-grid { grid-template-columns: 1fr; }
    .trust-logo-card { padding: 24px 20px; }
    .trust-lead { font-size: 0.95rem; margin-bottom: 40px; }

    .cta {
        padding: 60px 16px;
    }

    .cta .serif-title {
        font-size: clamp(1.4rem, 5vw, 2rem);
    }

    .magnetic-btn {
        padding: 16px 32px;
        font-size: 0.9rem;
    }

    .contact-section {
        padding: 60px 16px;
    }

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

    .form-group,
    .form-full {
        grid-column: 1;
    }

    .footer {
        padding: 48px 16px 24px;
    }

    .footer-logo {
        font-size: 2.5rem;
        margin-bottom: 32px;
        letter-spacing: -1px;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* ============================================
   HIGH CONTRAST MODE (Accessibility)
   ============================================ */
@media (forced-colors: active) {
    .service-panel,
    .mobile-service-card {
        border: 2px solid;
    }

    .btn-contact,
    .magnetic-btn,
    .submit-btn {
        border: 2px solid;
    }
}
