/* 
 * 22 Gravity Design System 
 * Theme: Ultra Dark, Modern, Interactive
 */

:root {
    --bg-color: #030303;
    --card-bg: #080808;
    --card-border: #222222;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-accent: #6366f1; /* Purple accent if needed */
    --font-main: 'Inter', sans-serif;
    --font-heading: 'Inter', 'Noto Sans TC', sans-serif;
    --transition-speed: 0.6s;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    line-height: 1.5;
}

.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 800;
}

a {
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    background: rgba(3, 3, 3, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

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

.logo-ph {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    /* overflow: hidden; */ /* Removing overflow hidden to ensure full logo is seen */
    /* background: #fff; */ /* Removing white background */
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
}

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

.nav-link {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

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

.lang-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: var(--text-secondary);
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.3s ease;
    font-family: var(--font-main);
}

.lang-btn:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255,255,255,0.05);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 100px;
    position: relative;
}

.hero-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
}

.hero-title {
    font-size: 100px;
    line-height: 0.95;
    margin-bottom: 32px;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1.4;
    max-width: 600px;
    margin-bottom: 48px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    color: #000;
    padding: 16px 32px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 16px;
    transition: transform 0.3s;
}

.cta-btn:hover {
    transform: translateX(10px);
}

/* Hero Visual */
.hero-visual {
    width: 500px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-visual img {
    /* Gradient Mask: Left side visible (Bright), Right side faded (Grayish due to black bg) */
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,1) 20%, rgba(0,0,0,0.1) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,1) 20%, rgba(0,0,0,0.1) 100%);
    opacity: 0.9;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.scroll-indicator span {
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 500;
}

.scroll-indicator i {
    font-size: 16px;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Ticker */
.ticker-wrap {
    width: 100%;
    overflow: hidden;
    background: #111;
    height: 80px;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--card-border);
    border-bottom: 1px solid var(--card-border);
}

.ticker {
    display: flex;
    white-space: nowrap;
    animation: ticker 20s linear infinite;
}

.ticker-item {
    font-size: 24px;
    font-weight: 700;
    color: #444;
    padding-right: 40px;
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Services */
.services-section {
    padding: 120px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 80px;
}

.section-title {
    font-size: 80px;
    line-height: 0.9;
    color: #666;
}

.section-desc {
    font-size: 18px;
    color: var(--text-secondary);
    text-align: right;
}

.bento-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.grid-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bento-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 40px;
    border-radius: 4px;
    transition: border-color 0.3s, transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-card:hover {
    border-color: #444;
    transform: translateY(-5px);
}

.card-large {
    height: 480px;
}

.card-medium {
    height: 280px;
}

.card-tech {
    height: 176px;
    /* Inherits standard styling (left aligned, dark bg) from .bento-card */
}

.card-tech h3 {
    /* Removing center alignment and distinct color to match other cards */
}

.card-num {
    font-size: 24px;
    color: #333;
}

.card-content h3 {
    font-size: 32px;
    margin-bottom: 16px;
}

.card-content p {
    color: var(--text-secondary);
    font-size: 18px;
}

/* Works */
.works-section {
    padding: 120px 0;
}

.section-label {
    font-size: 80px;
    letter-spacing: 0px;
    color: #333;
    display: block;
    margin-bottom: 80px;
    font-weight: 800;
}

/* Works Grid / Cards */
.work-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
}

.work-card {
    position: relative;
    width: 100%;
    /* min-height removed, height controlled by content */
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column; /* Changed to column to stack header and dropdown */
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.4s ease, transform 0.4s ease;
}

.work-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.work-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease;
    filter: brightness(0.4) blur(0px);
    z-index: 0;
}

.work-card:hover .work-bg {
    transform: scale(1.05);
    filter: brightness(0.3);
}

.work-header {
    position: relative;
    z-index: 2;
    padding: 60px 40px 40px 40px; /* More top padding */
    width: 100%;
    min-height: 300px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
}

.work-dropdown {
    position: relative;
    z-index: 1;
    background: #1a1a1a;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
}

.work-card.expanded .work-dropdown {
    max-height: 500px; /* Adjust based on content */
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Case Grid Styling */
.case-grid {
    padding: 30px 40px;
    display: grid; /* Back to grid */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive grid */
    gap: 20px;
}

.case-block {
    background-color: #222; /* Fallback */
    background-size: cover;
    background-position: center;
    padding: 24px;
    border-radius: 12px; /* Rounded corners for boxes */
    border: 1px solid rgba(255,255,255,0.1);
    width: 100%;
    height: 200px; /* Fixed height limitation */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.case-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0) 60%); /* Stronger gradient at bottom */
    z-index: 1;
    transition: opacity 0.3s;
}

.case-block:hover {
    transform: translateY(-4px);
    border-color: rgba(255,255,255,0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.case-block:hover::before {
    background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.2) 80%);
}

.case-block h4, .case-block p {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    pointer-events: none;
}

.case-block:last-child {
    border-bottom: 1px solid rgba(255,255,255,0.1); /* Reset from list style */
    margin-bottom: 0;
}

.case-block h4 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 8px;
}

.case-block p {
    color: #999;
    font-size: 14px;
    line-height: 1.5;
}

.work-info-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 60%;
}

.work-subdesc {
    color: #bbb;
    font-size: 16px;
    margin-top: 4px;
    font-weight: 400;
    line-height: 1.5;
}

.work-cat-tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    border-radius: 100px;
    font-size: 14px;
    color: #ccc;
    width: fit-content;
    margin-bottom: 8px;
}

.work-card h3 {
    font-size: 36px;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    font-weight: 700;
}

.work-cta-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
}

.work-cta-btn {
    padding: 12px 24px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.work-cta-btn.primary {
    background: #fff;
    color: #000;
    border: none;
}

.work-cta-btn:hover {
    transform: scale(1.05);
    background: rgba(255,255,255,0.2);
}

.work-cta-btn.primary:hover {
    background: #e0e0e0;
}

.case-toggle-btn {
    background: transparent;
    border: none;
    color: #999;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    transition: color 0.3s;
}

.case-toggle-btn:hover {
    color: #fff;
}

.case-toggle-btn i {
    transition: transform 0.3s;
}

.work-card.expanded .case-toggle-btn i {
    transform: rotate(180deg);
    color: #fff;
}

/* Footer */
.footer-section {
    padding: 120px 0 60px;
    background: #000;
}

.footer-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.footer-cta {
    font-size: 120px;
    font-weight: 900;
    margin-bottom: 80px;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
}

.footer-cta:hover {
    color: var(--text-secondary);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
    padding-top: 40px;
}

.footer-mail {
    font-size: 24px;
    color: #fff;
}

.copyright {
    color: #444;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

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

.fade-in-left {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity var(--transition-speed), transform var(--transition-speed);
}

.fade-in-left.active {
    opacity: 1;
    transform: translateX(0);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .hero-content { flex-direction: column; text-align: center; }
    .hero-title { font-size: 48px; }
    .hero-visual { width: 300px; height: 300px; margin-top: 40px; }
    .bento-grid { grid-template-columns: 1fr; }
    .footer-cta { font-size: 60px; }
    .nav-links { display: none; } /* Simplified mobile nav for now */
}