/* 
 * 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: 'Jost', sans-serif;
    --font-heading: 'Jost', 'Noto Sans TC', sans-serif;
    --transition-speed: 0.6s;
}

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

html {
    scroll-behavior: auto; /* Handled by smooth-scrollbox transition on desktop */
}

/* Smooth damped scroll – desktop only */
@media (min-width: 769px) {
    .smooth-viewbox {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        overflow: hidden;
    }
    .smooth-scrollbox {
        will-change: transform;
        transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 10px;
    border: 4px solid var(--bg-color);
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.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);
    transform: translateY(-100%);
    transition: transform 0.4s ease, background 0.3s ease, height 0.3s ease;
}

.navbar.scrolled {
    transform: translateY(0);
}

.nav-container {
    width: 100%;
    max-width: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
}

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

.nav-brand-text {
    display: none; /* Hidden on desktop; shown on mobile */
    flex-direction: column;
    gap: 2px;
}

.nav-brand-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.nav-brand-sub {
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

.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);
}

/* Hamburger Menu Button */
.hamburger {
    display: none; /* Hidden on desktop */
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 10000; /* Above nav-links */
    position: relative;
}

.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Hamburger Animation when active */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

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

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


/* Hero Section */
.hero-section {
    height: 100vh;
    position: relative;
    overflow: hidden; /* Prevent horizontal scroll from large logo */
}

.hero-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 40px 40px 40px; /* Adjust padding for the desired left/right space */
}

.hero-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hero-brand {
    position: absolute;
    top: 40px;
    left: 40px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hero-left {
    position: relative;
    z-index: 1;
}

.hero-brand-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    color: var(--text-primary);
}

.hero-brand-sub {
    font-family: 'Jost', sans-serif;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 3px;
    color: var(--text-secondary);
}

.hero-right {
    position: relative;
    z-index: 1;
    text-align: right;
}

.hero-title {
    font-size: 50px;
    line-height: 1;
    white-space: nowrap;
    background: linear-gradient(to right, #fff, #888);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-top: 12px;
    white-space: nowrap;
}

/* Hero New Elements */
.hero-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.hero-center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 400px;
    z-index: 2;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
}

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

/* Side Navigation */
.hero-side-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-100%);
    z-index: 5;
    display: flex;
    flex-direction: column;
}

.hero-side-nav.left-nav {
    left: 40px;
    gap: 32px;
}

.side-nav-link {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    position: relative;
    padding-left: 40px;
    transition: color 0.3s, transform 0.3s;
    transform-origin: left center;
    display: inline-block;
}

.side-nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 2px;
    background: #888; /* Red lines from sketch */
    transition: width 0.3s;
}

.side-nav-link:hover {
    color: var(--text-primary);
    transform: scale(1.15);
}

.side-nav-link:hover::before {
    width: 30px;
}

/* Top Right Language */
.hero-top-right {
    position: absolute;
    top: 40px;
    right: 40px;
    z-index: 10;
}

.side-lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    margin-left: 40px;
    transition: color 0.3s;
}

.side-lang-btn:hover {
    color: #fff;
}

/* Right Folder Tab - fixed to viewport */
.hero-side-nav.right-nav {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
}

.folder-tab {
    background: #fff;
    border: none;
    padding: 30px 15px;
    border-radius: 12px 0 0 12px;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: -5px 0 20px rgba(0,0,0,0.4);
}

.folder-tab:hover {
    background: #e8e8e8;
    transform: translateX(-5px);
}

.folder-tab span {
    color: #000;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 4px;
    transform: rotate(180deg);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 1);
    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:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(160,160,160,0.4) 0%, rgba(30,30,30,0.05) 45%, rgba(100,100,100,0.25) 100%) border-box;
    border: 1px solid transparent;
    padding: 40px;
    border-radius: 4px;
    transition: transform 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.bento-card:hover {
    background:
        linear-gradient(var(--card-bg), var(--card-bg)) padding-box,
        linear-gradient(135deg, rgba(210,210,210,0.6) 0%, rgba(60,60,60,0.1) 45%, rgba(160,160,160,0.45) 100%) border-box;
    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-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;
}

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

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

/* Works Horizontal Scroll */
.work-list {
    display: flex;
    flex-direction: row;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 40px 50px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
    width: 100%;
}

.work-list::-webkit-scrollbar {
    height: 4px;
}

.work-list::-webkit-scrollbar-track {
    background: transparent;
}

.work-list::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.work-card {
    position: relative;
    flex: 0 0 360px;
    height: 640px;
    scroll-snap-align: start;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(#111, #111) padding-box,
        linear-gradient(135deg, rgba(160,160,160,0.4) 0%, rgba(30,30,30,0.05) 45%, rgba(100,100,100,0.25) 100%) border-box;
    border: 1px solid transparent;
    transition: transform 0.4s ease;
}

.work-card:hover {
    background:
        linear-gradient(#111, #111) padding-box,
        linear-gradient(135deg, rgba(210,210,210,0.6) 0%, rgba(60,60,60,0.1) 45%, rgba(160,160,160,0.45) 100%) border-box;
}

.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.6) blur(0px);
    z-index: 0;
}

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

.work-header {
    position: relative;
    z-index: 2;
    padding: 40px 28px 28px;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.1) 55%, transparent 100%);
}

.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: 100%;
    width: 100%;
}

.work-subdesc {
    color: #bbb;
    font-size: 14px;
    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: 12px;
    color: #ccc;
    width: fit-content;
    margin-bottom: 6px;
}

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

.work-cta-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

/* 詳細資訊按鈕固定在卡片右下角 */
.work-card .case-toggle-btn {
    position: absolute;
    bottom: 28px;
    right: 28px;
    z-index: 3;
    margin: 0;
    padding: 6px 0;
}

.work-cta-btn {
    padding: 9px 18px;
    background: #fff;
    color: #000;
    font-size: 12px;
    font-weight: 600;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.work-cta-btn:hover {
    transform: scale(1.05);
    background: #e0e0e0;
}

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

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

.case-toggle-btn i {
    transition: transform 0.3s;
    font-size: 11px;
}

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

/* CTA Section */
.cta-section {
    padding: 120px 0 100px;
    background: #000;
}

.footer-subtitle {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #888;
}

.footer-cta {
    font-size: 60px;
    font-weight: 900;
    color: #fff;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

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

/* Footer */
.footer-section {
    background: #0a0a0a;
    border-top: 1px solid #1c1c1c;
}

.footer-main {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 80px;
    padding: 64px 0 56px;
    align-items: start;
}

/* Brand column */
.footer-brand-col {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-logo {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
}

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

.footer-brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.footer-brand-name {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

.footer-brand-sub {
    font-size: 11px;
    color: #666;
    letter-spacing: 3px;
    font-weight: 400;
}

/* Column label */
.footer-col-label {
    display: block;
    font-size: 10px;
    letter-spacing: 2.5px;
    color: #666;
    margin-bottom: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

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

.footer-nav-link {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #666;
    text-transform: uppercase;
    transition: color 0.3s;
}

.footer-nav-link:hover {
    color: #fff;
}

/* Socials */
.footer-socials {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.footer-social-link {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #666;
    text-transform: uppercase;
    transition: color 0.3s;
}

.footer-social-link i {
    font-size: 14px;
    width: 16px;
}

.footer-social-link:hover {
    color: #fff;
}

/* Bottom bar */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #1c1c1c;
    padding: 24px 0;
}

.copyright {
    color: #555;
    font-size: 11px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* 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);
}

/* Fix: side nav uses translateY(-50%) for centering — must preserve it during fade animation */
.hero-side-nav.fade-in-left {
    transform: translateY(-50%) translateX(30px);
}

.hero-side-nav.fade-in-left.active {
    transform: translateY(-50%) translateX(0);
}

/* Fix: center logo uses translate(-50%, -50%) for centering — must preserve X during fade animation */
.hero-center-logo.fade-in-up {
    transform: translate(-50%, calc(-50% + 30px));
}

.hero-center-logo.fade-in-up.active {
    transform: translate(-50%, -50%);
}

.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; align-items: flex-start; gap: 4px; }
    .hero-title { font-size: 36px; white-space: normal; text-align: left; }
    .hero-subtitle { font-size: 13px; white-space: normal; text-align: left; }
    .hero-right { text-align: left; }
    .bento-grid { grid-template-columns: 1fr; }
    .footer-cta { font-size: 60px; }
}

/* Contact Drawer Styles */
.contact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(2px);
}

.contact-overlay.active {
    opacity: 1;
    visibility: visible;
}

.contact-drawer {
    position: fixed;
    top: 0;
    right: -600px; /* Start off-screen */
    width: 100%;
    max-width: 600px;
    height: 100%;
    background: #fff;
    z-index: 2001;
    display: flex;
    flex-direction: column;
    padding: 40px;
    box-shadow: -10px 0 30px rgba(0,0,0,0.2);
    transition: right 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.contact-drawer.open {
    right: 0;
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.drawer-header h2 {
    font-size: 32px;
    color: #1a1a1a;
    font-weight: 500;
    letter-spacing: -1px;
}

.close-drawer-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #1a1a1a;
    cursor: pointer;
    line-height: 1;
}

/* Form Styles */
.contact-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* Allow scroll if too tall */
    padding-right: 5px; /* Scrollbar space */
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    position: relative;
    margin-bottom: 24px;
    width: 100%;
}

.form-group.half {
    width: 50%;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 24px 16px 8px; /* High padding for floating label */
    font-size: 16px;
    color: #1a1a1a;
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
}

.form-group textarea {
    resize: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #000;
    background: #fff;
}

.form-group label {
    position: absolute;
    left: 16px;
    top: 18px;
    font-size: 16px;
    color: #888;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Floating Label Animation */
.form-group input:focus ~ label,
.form-group input:not(:placeholder-shown) ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:not(:placeholder-shown) ~ label {
    top: 6px;
    font-size: 12px;
    color: #000;
}

/* Phone Group specific */
.phone-group {
    display: flex !important; /* Force display */
    flex-direction: row;
    align-items: stretch;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    width: 100%;
    min-height: 52px; /* Slight increase */
    position: relative; /* Ensure positioning context */
    background: #fff; /* Ensure visible background */
    opacity: 1; /* Force opacity */
    z-index: 1;
}

.phone-group input {
    border: none;
    padding: 16px !important; /* Force override form-group padding */
    flex: 1;
    min-width: 0;
    width: auto !important; /* Override width: 100% from .form-group input */
    background: #fff; /* Ensure visible background */
    -webkit-appearance: none; /* Remove iOS default styles */
    appearance: none;
    border-radius: 0; /* Remove iOS rounded corners */
    height: auto; /* Allow height to adapt */
}

.country-code {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    background: rgba(0,0,0,0.03);
    border-right: 1px solid rgba(0,0,0,0.1);
    color: #555;
    font-size: 14px;
    flex-shrink: 0; /* Don't shrink */
    white-space: nowrap; /* Keep on one line */
}

.drawer-footer {
    margin-top: auto;
    padding-top: 20px;
}

.submit-btn {
    width: 100%;
    background: #111;
    color: #fff;
    border: none;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-btn:hover {
    background: #333;
}

/* Form Messages */
.form-message {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    opacity: 1;
    transition: opacity 0.3s ease;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@media (max-width: 768px) {
    .contact-drawer {
        width: 100%;
        max-width: 100%;
        padding: 24px;
    }
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-group.half {
        width: 100%;
    }
}

/* Custom Select Styles */
.custom-select-group {
    position: relative;
    cursor: pointer;
}

.custom-select-trigger {
    width: 100%;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 24px 16px 8px; /* Match input padding */
    font-size: 16px;
    color: #1a1a1a;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 58px; /* Approximate height of input */
    outline: none;
    transition: all 0.3s;
}

.custom-select-trigger:focus,
.custom-select-group.open .custom-select-trigger {
    border-color: #000;
    background: #fff;
}

.custom-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 4px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.custom-select-group.open .custom-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 12px 16px;
    font-size: 15px;
    color: #333;
    transition: background 0.2s;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.custom-option:last-child {
    border-bottom: none;
}

.custom-option:hover {
    background: #f5f5f5;
}

.custom-label {
    position: absolute;
    left: 16px;
    top: 18px;
    font-size: 16px;
    color: #888;
    pointer-events: none;
    transition: all 0.3s ease;
}

/* Floating Label State for Custom Select */
.custom-select-group.has-value .custom-label,
.custom-select-group.open .custom-label {
    top: 6px;
    font-size: 12px;
    color: #000;
}

.custom-select-trigger i {
    font-size: 12px;
    color: #888;
    transition: transform 0.3s;
}

.custom-select-group.open .custom-select-trigger i {
    transform: rotate(180deg);
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE FIRST
   ======================================== */

/* Tablet & Below (768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }

    /* Navigation */
    nav .container {
        padding: 0 20px;
    }

    /* Reduce branding size on mobile */
    .brand-name {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .logo-ph {
        width: 50px;
        height: 50px;
    }

    .navbar {
        height: 64px;
        transform: translateY(0); /* Always visible on mobile */
    }

    /* Replace logo image with brand text in navbar on mobile */
    .navbar .logo-ph {
        display: none;
    }

    .nav-brand-text {
        display: flex;
    }

    /* Show hamburger button on mobile */
    .hamburger {
        display: flex;
    }

    /* Mobile menu overlay */
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: rgba(3, 3, 3, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.4s ease;
        padding: 40px 20px;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 9999; /* Above everything */
    }

    /* Show menu when active */
    .nav-links.active {
        right: 0;
    }

    .nav-link {
        font-size: 18px;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    /* Animate links when menu is active */
    .nav-links.active .nav-link {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.active .nav-link:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.active .nav-link:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.active .nav-link:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.active .lang-btn {
        opacity: 1;
        transform: translateX(0);
        transition-delay: 0.4s;
    }

    .lang-btn {
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.3s ease;
    }

    /* Hero Section */
    .hero-section {
        min-height: 70vh;
        padding: 100px 0 60px;
    }

    /* Hide hero top-right on mobile (lang toggle accessible via hamburger menu) */
    .hero-top-right {
        display: none;
    }

    /* Brand is now in navbar on mobile — hide the hero brand */
    .hero-brand {
        display: none;
    }

    /* CONTACT tab — smaller on mobile */
    .folder-tab {
        padding: 18px 9px;
        border-radius: 8px 0 0 8px;
    }

    .folder-tab span {
        font-size: 11px;
        letter-spacing: 3px;
    }

    /* Center logo — scale with screen */
    .hero-center-logo {
        width: 72vw;
        height: 72vw;
    }

    /* Hide left side nav on mobile */
    .hero-side-nav.left-nav {
        display: none;
    }

    .hero-container {
        padding: 0 20px 40px;
    }

    .hero-content {
        flex-direction: column;
        gap: 4px;
    }

    .hero-left {
        max-width: 100%;
    }

    .hero-title {
        font-size: 48px;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 16px;
        margin: 0;
    }

    .cta-btn {
        font-size: 14px;
        padding: 14px 28px;
    }

    .hero-visual {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    /* Ticker */
    .ticker-item {
        font-size: 16px;
    }

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

    .section-title {
        font-size: 48px;
    }

    .section-desc {
        font-size: 16px;
    }

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

    .grid-col {
        gap: 16px;
    }

    .bento-card {
        padding: 30px 24px;
    }

    .card-num {
        font-size: 60px;
    }

    .bento-card h3 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .bento-card p {
        font-size: 14px;
    }

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

    .works-header {
        margin-bottom: 40px;
    }

    .work-list {
        padding: 10px 20px 40px;
        gap: 16px;
    }

    .work-card {
        flex: 0 0 280px;
        height: 440px;
    }

    .work-header {
        padding: 28px 20px 20px;
    }

    .work-cat-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .work-card h3 {
        font-size: 22px;
        margin: 8px 0;
    }

    .work-subdesc {
        font-size: 13px;
        line-height: 1.5;
    }

    .work-cta-btn {
        font-size: 13px;
        padding: 10px 16px;
    }

    .case-toggle-btn {
        font-size: 13px;
        padding: 10px 0;
    }

    .case-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .case-block {
        height: 200px;
    }

    /* CTA + Footer */
    .cta-section {
        padding: 80px 0 60px;
    }

    .footer-cta {
        font-size: 40px;
    }

    .footer-subtitle {
        font-size: 18px;
    }

    .footer-main {
        grid-template-columns: 1fr 1fr;
        gap: 32px 24px;
        padding: 48px 0 40px;
    }

    .footer-brand-col {
        grid-column: 1 / -1; /* Full width on top */
    }

    .footer-bottom {
        padding: 20px 0;
    }

    /* Contact Drawer */
    .contact-drawer {
        width: 100%;
        padding: 30px 20px;
    }

    .drawer-content h2 {
        font-size: 32px;
        margin-bottom: 30px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .form-group input,
    .form-group textarea,
    .custom-select-trigger {
        font-size: 15px;
    }

    .submit-btn {
        width: 100%;
        font-size: 15px;
        padding: 16px;
    }
}

/* Mobile (480px and below) */
@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-center-logo {
        width: 78vw;
        height: 78vw;
    }

    /* Navigation */
    nav {
        padding: 16px 0;
    }

    nav .container {
        padding: 0 16px;
    }

    .logo {
        font-size: 18px;
    }

    /* Hero Section */
    .hero-section {
        min-height: 60vh;
        padding: 80px 0 40px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 14px;
        margin: 16px 0 24px;
    }

    .cta-btn {
        font-size: 13px;
        padding: 12px 24px;
    }

    .hero-visual {
        max-width: 200px;
    }

    /* Ticker */
    .ticker-item {
        font-size: 14px;
    }

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

    .section-title {
        font-size: 36px;
    }

    .section-desc {
        font-size: 14px;
    }

    .bento-card {
        padding: 24px 20px;
    }

    .card-num {
        font-size: 48px;
    }

    .bento-card h3 {
        font-size: 20px;
    }

    .bento-card p {
        font-size: 13px;
    }

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

    .work-card {
        flex: 0 0 250px;
        height: 400px;
    }

    .work-card h3 {
        font-size: 20px;
    }

    .work-subdesc {
        font-size: 13px;
    }

    .work-cta-btn,
    .case-toggle-btn {
        font-size: 12px;
        padding: 9px 14px;
    }

    /* CTA + Footer */
    .cta-section {
        padding: 60px 0 40px;
    }

    .footer-cta {
        font-size: 34px;
    }

    .footer-subtitle {
        font-size: 16px;
        margin-bottom: 10px;
    }

    /* Contact Drawer */
    .drawer-content h2 {
        font-size: 28px;
        margin-bottom: 24px;
    }

    .close-drawer {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
}