/* ===================================
   乒乓科技官方網站 — 自定義樣式
   設計風格：淺奶茶、溫潤質感
   =================================== */

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

:root {
    --color-bg:         #F5F0E8;
    --color-surface:    #EDE6D6;
    --color-surface-2:  #E4DBC8;
    --color-border:     rgba(90, 65, 35, 0.1);
    --color-border-2:   rgba(90, 65, 35, 0.18);

    --color-text:       #1E1208;
    --color-text-muted: rgba(30, 18, 8, 0.38);
    --color-text-sub:   rgba(30, 18, 8, 0.58);

    --color-accent:     #8B5E3C;
    --color-accent-dim: rgba(139, 94, 60, 0.1);
    --color-accent-2:   #6B4226;

    --font-sans:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-serif:   'Noto Serif TC', serif;

    --nav-height:   72px;
    --section-gap:  120px;
    --container-w:  1200px;
    --radius:       12px;
    --radius-lg:    20px;

    --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3, h4 {
    font-family: var(--font-sans);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

em {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--color-accent);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: all 0.25s var(--ease-out);
    cursor: pointer;
    border: none;
    white-space: nowrap;
}

.btn-primary {
    background: #3b4044;
    color: #fcfaf7;
}
.btn-primary:hover {
    background: #2e3236;
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(59, 64, 68, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border-2);
}
.btn-ghost:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

/* --- Section Label --- */
.section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 20px;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    color: var(--color-text);
    letter-spacing: -0.03em;
}

.section-header {
    text-align: center;
    margin-bottom: 72px;
}
.section-header .section-title {
    margin-bottom: 16px;
}
.section-desc {
    color: var(--color-text-sub);
    font-size: 17px;
    max-width: 500px;
    margin: 0 auto;
}

.section-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 32px;
}

/* ===================================
   NAVIGATION
   =================================== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    transition: background 0.4s ease, border-color 0.4s ease;
    border-bottom: 1px solid transparent;
}

#navbar.scrolled {
    background: rgba(245, 240, 232, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom-color: var(--color-border);
}

.nav-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 32px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    text-decoration: none;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.logo-pp   { color: var(--color-accent); }
.logo-tech { color: var(--color-text); }

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

.nav-link {
    text-decoration: none;
    color: var(--color-text-sub);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.2s;
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 0.3s var(--ease-out);
}
.nav-link:hover { color: var(--color-text); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-cta {
    color: var(--color-text) !important;
    border: 1px solid var(--color-border-2);
    padding: 8px 20px;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}
.nav-cta::after { display: none; }
.nav-cta:hover {
    border-color: var(--color-accent);
    color: var(--color-accent) !important;
    background: var(--color-accent-dim);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    width: 24px;
    height: 1.5px;
    background: var(--color-text);
    transition: all 0.3s;
}

/* ===================================
   HERO
   =================================== */
#hero {
    position: relative;
    height: 100vh;
    min-height: 680px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(90, 65, 35, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(90, 65, 35, 0.07) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, black 30%, transparent 100%);
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 60% 40%, rgba(139, 94, 60, 0.1) 0%, transparent 60%),
        radial-gradient(ellipse 40% 60% at 20% 80%, rgba(139, 94, 60, 0.06) 0%, transparent 50%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: var(--container-w);
    width: 100%;
    margin: 0 auto;
    padding: 0 32px;
    padding-top: var(--nav-height);
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 32px;
}
.hero-badge::before {
    content: '';
    display: block;
    width: 28px;
    height: 1px;
    background: var(--color-accent);
}

.hero-title {
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 400;
    letter-spacing: -0.04em;
    line-height: 1.08;
    margin-bottom: 28px;
    color: var(--color-text);
}

.hero-subtitle {
    font-size: 17px;
    color: var(--color-text-sub);
    margin-bottom: 48px;
    letter-spacing: 0.02em;
}

.hero-actions {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1;
}
.hero-scroll span {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}
.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}
@keyframes scrollPulse {
    0%, 100% { opacity: 1; transform: scaleY(1); }
    50% { opacity: 0.4; transform: scaleY(0.7); }
}

/* ===================================
   ABOUT
   =================================== */
#about {
    padding: var(--section-gap) 0;
    background: var(--color-surface);
    position: relative;
}
#about::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-2), transparent);
}

.about-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 80px;
    align-items: start;
}

.about-left {
    position: sticky;
    top: calc(var(--nav-height) + 40px);
}

.about-text {
    color: var(--color-text-sub);
    margin-bottom: 20px;
    font-size: 16px;
}
.about-text.lead {
    font-size: 19px;
    color: var(--color-text);
    line-height: 1.6;
    font-weight: 300;
    margin-bottom: 28px;
}

.about-stats {
    display: flex;
    gap: 48px;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}
.stat-number {
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--color-accent);
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 6px;
}
.stat-label {
    font-size: 12px;
    color: var(--color-text-muted);
    letter-spacing: 0.04em;
}

/* ===================================
   SERVICES
   =================================== */
#services {
    padding: var(--section-gap) 0;
    background: var(--color-bg);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
    background: var(--color-border);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.service-card {
    background: var(--color-surface);
    padding: 48px 36px;
    position: relative;
    transition: background 0.3s ease;
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    background: var(--color-surface-2);
}

.service-icon {
    width: 48px;
    height: 48px;
    color: var(--color-accent);
    margin-bottom: 32px;
}
.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-number {
    position: absolute;
    top: 32px;
    right: 32px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: var(--color-text-muted);
}

.service-title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.service-desc {
    font-size: 14px;
    color: var(--color-text-sub);
    line-height: 1.75;
    flex: 1;
    margin-bottom: 28px;
}

.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}
.service-tags span {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-accent);
    background: var(--color-accent-dim);
    padding: 4px 10px;
    border-radius: 2px;
}

/* ===================================
   WHY US
   =================================== */
#why-us {
    padding: var(--section-gap) 0;
    background: var(--color-surface);
    position: relative;
}
#why-us::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-border-2), transparent);
}

.why-layout {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 80px;
    align-items: start;
}

.why-content {
    position: sticky;
    top: calc(var(--nav-height) + 40px);
}

.why-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.why-item {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    padding: 36px 0;
    border-bottom: 1px solid var(--color-border);
    transition: padding-left 0.3s var(--ease-out);
}
.why-item:first-child { padding-top: 0; }
.why-item:last-child { border-bottom: none; }
.why-item:hover { padding-left: 8px; }

.why-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    background: var(--color-accent-dim);
    border-radius: 8px;
    margin-top: 2px;
}
.why-icon svg { width: 20px; height: 20px; }

.why-text h4 {
    font-size: 17px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.why-text p {
    font-size: 14px;
    color: var(--color-text-sub);
    line-height: 1.7;
}

/* ===================================
   CONTACT
   =================================== */
#contact {
    padding: var(--section-gap) 0;
    background: var(--color-bg);
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.contact-left .section-title {
    margin-bottom: 24px;
}
.contact-desc {
    color: var(--color-text-sub);
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.75;
}

.contact-email {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 32px;
    font-size: 14px;
    color: var(--color-text-muted);
}
.contact-email svg { width: 18px; height: 18px; flex-shrink: 0; }

.contact-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-visual {
    width: 100%;
}

.contact-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
}

.card-line {
    width: 40px;
    height: 2px;
    background: var(--color-accent);
    margin-bottom: 32px;
}

.card-quote {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 400;
    line-height: 1.65;
    color: var(--color-text);
    letter-spacing: 0.01em;
    font-style: italic;
    margin-bottom: 28px;
}

.card-author {
    font-size: 13px;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* ===================================
   FOOTER
   =================================== */
#footer {
    padding: 48px 0;
    border-top: 1px solid var(--color-border);
}

.footer-container {
    max-width: var(--container-w);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
    flex-wrap: wrap;
}

.footer-logo {
    font-size: 18px;
    font-weight: 600;
}

.footer-links {
    display: flex;
    gap: 32px;
}
.footer-links a {
    text-decoration: none;
    font-size: 13px;
    color: var(--color-text-muted);
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--color-text); }

.footer-copy {
    font-size: 12px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* ===================================
   ANIMATIONS
   =================================== */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
.fade-in:nth-child(2) { transition-delay: 0.1s; }
.fade-in:nth-child(3) { transition-delay: 0.2s; }

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
    :root {
        --section-gap: 96px;
    }
    .about-layout,
    .why-layout { grid-template-columns: 1fr; gap: 48px; }
    .about-left,
    .why-content { position: static; }
    .services-grid { grid-template-columns: 1fr; }
    .contact-layout { grid-template-columns: 1fr; }
    .contact-right { display: none; }
}

@media (max-width: 768px) {
    :root {
        --section-gap: 72px;
        --nav-height: 60px;
    }
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: rgba(245, 240, 232, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: flex-start;
        padding: 32px;
        gap: 24px;
        border-bottom: 1px solid var(--color-border);
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 0.4s var(--ease-out), opacity 0.4s ease;
        z-index: 99;
    }
    .nav-links.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }
    .nav-link { font-size: 18px; }
    .nav-cta { font-size: 18px; border: none; padding: 0; }
    .nav-toggle { display: flex; }

    .hero-title { font-size: clamp(2.4rem, 9vw, 4rem); }
    .about-stats { gap: 32px; }
    .stat-number { font-size: 2rem; }
    .section-container { padding: 0 20px; }
    .footer-container { flex-direction: column; align-items: flex-start; gap: 24px; }
    .footer-links { flex-wrap: wrap; gap: 20px; }
    .service-card { padding: 36px 28px; }
}

@media (max-width: 480px) {
    .hero-actions { flex-direction: column; align-items: flex-start; }
    .about-stats { flex-wrap: wrap; gap: 24px; }
}
