/* --- Global Variables & Reset --- */
:root {
    --brand-yellow: #FFD000;
    --brand-dark: #111111;
    --brand-darker: #0a0a0a;
    --text-light: #F9F9F9;
    --font-main: 'Helvetica Neue', Arial, sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--brand-dark);
    color: var(--text-light);
    line-height: 1.6;
    padding-top: 80px; 
}

/* --- Animations --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-load {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* --- Typography & Buttons --- */
h1 { font-size: 4rem; line-height: 1.1; margin-bottom: 20px; text-transform: uppercase; }
h2 { font-size: 2.5rem; color: var(--brand-yellow); text-align: center; margin-bottom: 40px; }
p { font-size: 1.1rem; color: #ccc; margin-bottom: 20px; }

.btn-primary {
    display: inline-block;
    background-color: var(--brand-yellow);
    color: var(--brand-dark);
    padding: 12px 28px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary:hover {
    background-color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 208, 0, 0.2);
}

/* --- Site Logo --- */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.site-logo {
    height: 250px !important; /* Forces the browser to use this exact size */
    max-height: none !important; /* Removes any maximum size limits */
    width: auto !important;
    display: block;
}

.site-logo:hover {
    transform: scale(1.05);
}
/* Ensure the body offset accounts for the taller header */
body {
    padding-top: 10px; /* Increase if the header overlaps your hero section */
}

/* Adjust header vertical padding if needed */
.site-header {
    padding: 5px 5px; /* Slightly tighter vertical padding for a large logo */
}
/* --- Header / Navigation --- */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    background-color: rgba(17, 17, 17, 0.98);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #333;
}

.logo { font-size: 1.5rem; font-weight: 900; color: var(--brand-yellow); text-decoration: none;}

nav a {
    color: var(--text-light);
    text-decoration: none;
    margin-left: 30px;
    font-weight: 500;
    transition: color 0.3s ease;
}

nav a:hover { color: var(--brand-yellow); }
nav a.btn-primary:hover { color: var(--brand-dark); }

/* --- Hero Section --- */
.hero {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 20px;
}

/* --- Page & Story Containers --- */
.page-section {
    padding: 80px 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.story-container {
    max-width: 760px; /* Restricts line length so eyes don't get tired */
    width: 100%;
    margin: 0 auto; /* Centers the whole block in the middle of the screen */
    text-align: left; /* Left-aligns the actual reading text! */
}
.story-container p {
    font-size: 1.125rem;
    line-height: 1.8; /* Taller line spacing makes it feel airy */
    margin-bottom: 28px; /* Bigger gaps between paragraphs */
    color: #cccccc; 
}
.story-divider {
    border: none;
    height: 1px;
    background: #333333;
    margin: 60px 0; /* Adds massive breathing room above and below the line */
}

.story-container h2 {
    font-size: 2.2rem;
    color: var(--brand-yellow);
    margin-top: 20px; /* Space above heading */
    margin-bottom: 60px; /* Space below heading */
    line-height: 1.2;
}
.story-lead {
    font-size: 1.4rem;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.5;
    border-left: 4px solid var(--brand-yellow);
    padding-left: 24px; /* Space between the yellow line and text */
    margin-bottom: 40px;
}

/* --- Interactive Service Grids --- */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1200px;
    margin-bottom: 60px;
}

.interactive-card {
    background-color: var(--brand-darker);
    padding: 40px;
    border-top: 4px solid var(--brand-yellow);
    text-align: center;
    border-radius: 8px;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.interactive-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.8);
    border-top-color: #fff;
}

.interactive-card h3 { margin-bottom: 15px; font-size: 1.5rem; }

/* --- Forms (For Contact Page) --- */
.contact-form {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 600px;
    gap: 20px;
}

.contact-form input, .contact-form textarea {
    padding: 15px;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    font-family: var(--font-main);
    transition: border-color 0.3s ease;
}

.contact-form input:focus, .contact-form textarea:focus {
    outline: none;
    border-color: var(--brand-yellow);
}

/* --- Lemonade Sip Transition Overlay --- */
.sip-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--brand-dark); 
    z-index: 9999; 
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* The Wrapper Container - Locked to exact cup size with safety guards */
.cup-container {
    position: relative !important;
    width: 80px !important;
    height: 120px !important;
    flex-shrink: 0;
}

/* The White Rounded Cup */
.cartoon-cup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    border: 4px solid #000000;
    border-radius: 12px; 
    overflow: hidden; /* Clips the liquid perfectly inside the rounded corners */
    box-shadow: 6px 6px 0px rgba(0,0,0,0.5); 
}

/* The Straw (Sits safely outside the cup overflow so it never gets cut) */
.straw {
    position: absolute;
    width: 12px; 
    height: 152px; 
    background-color: #ffffff; 
    border: 3px solid #000000; 
    border-radius: 4px; 
    top: -36px; 
    left: 20px;
    transform: rotate(8deg); 
    z-index: 2;
    box-shadow: inset 0 -105px 0 0 #000000; 
}

/* The Lemonade Liquid */
.liquid {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 90%; 
    background-color: var(--brand-yellow);
    z-index: 1;
    border-top: 4px solid #000000; 
    /* Removed bottom border-radius to completely eliminate the end-of-animation flicker */
}

/* The Sipping Animation Keyframes (Liquid) */
@keyframes sipDown {
    0% { height: 90%; }
    100% { height: 0%; } /* Sips completely down cleanly */
}

/* The Sipping Animation Keyframes (Straw) */
@keyframes sipStrawDown {
    0% { box-shadow: inset 0 -105px 0 0 #000000; }
    100% { box-shadow: inset 0 0px 0 0 #000000; } 
}

/* The 3/4 Slotted Lemon Wheel (15% Larger) */
.lemon-slice {
    position: absolute;
    top: -28px;   /* Adjusted to align with the larger scale */
    right: -19px; /* Adjusted to keep the slot on the cup rim */
    width: 53px;  /* Scaled up by 15% (from 46px) */
    height: 53px; /* Scaled up by 15% (from 46px) */
    z-index: 3;
    
    /* Cartoon 3/4 lemon slice with white pith, pulp segments & black outline */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50,50 L50,92 A42,42 0 1,0 8,50 Z' fill='%23FFD000' stroke='%23000000' stroke-width='7' stroke-linejoin='round'/%3E%3Cpath d='M50,50 L50,83 A33,33 0 1,0 17,50 Z' fill='none' stroke='%23ffffff' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M50,50 L20,20 M50,50 L50,17 M50,50 L80,20 M50,50 L83,50 M50,50 L80,80' stroke='%23ffffff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;

    /* Tilted to snugly grip the cup corner */
    transform: rotate(12deg);
    /* Pivot from the notch where it touches the rim */
    transform-origin: 35% 65%;
}

/* Lemon Slice Wiggle Animation */
@keyframes lemonWiggle {
    0%   { transform: rotate(12deg); }
    20%  { transform: rotate(-6deg); }
    40%  { transform: rotate(24deg); }
    60%  { transform: rotate(4deg); }
    80%  { transform: rotate(18deg); }
    100% { transform: rotate(12deg); }
}

/* --- Background Video Section --- */
.video-banner {
    position: relative;
    width: 100%;
    height: 60vh; /* Controls how tall the section is (60% of the screen height) */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000; /* Fallback color before video loads */
}

.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    z-index: 1; 
    object-fit: cover; /* Ensures the video fills the space without stretching */
    opacity: 0.7; /* Dims the video slightly so text is readable. Change to 1 for full brightness */
}

.video-overlay-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #ffffff;
}

/* --- Footer & Footer Logo --- */
.site-footer {
    padding: 60px 20px;
    text-align: center;
    background-color: var(--brand-dark, #111); /* Uses your dark theme variable */
}

.footer-logo {
    height: 200px; /* Adjust this to make the footer logo larger or smaller */
    width: auto;
    margin-bottom: -50px;
}

.site-footer p {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

.ig-post-role {
            font-size: 0.8rem;
            color: var(--brand-yellow, #FFD000); /* Uses your brand yellow */
            margin-top: 2px;
            font-weight: normal;
        }
.ig-post:hover {
            z-index: 10; 
            box-shadow: 0 15px 30px rgba(0,0,0,0.8);
            border-radius: 8px; 
        }

/* Hero 容器要支援絕對定位覆蓋 */
.hero {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #000; /* 影片載入前用黑色托底 */
}

/* 背景影片鋪滿，保持比例裁剪 */
.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
    z-index: 1;
    pointer-events: none; /* 避免擋住點擊 */
}

/* 暗色遮罩層：提升大字對比度 */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45); /* 可按需要調較深淺 0.3 - 0.6 */
    z-index: 2;
}

/* 文字內容浮喺最上層 */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
}

.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    /* 在 translate 後面加上 scale(0.9)，即縮細至 90% */
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    pointer-events: none;
    transition: transform 0.3s ease;
}

/* 預設情況：影片帶有少許暗度，並加入過渡動畫 */
.hero-bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 1;
    pointer-events: none;
    opacity: 0.6; /* 未播/載入時先暗少少 */
    transition: opacity 1.2s ease-in-out; /* 柔和淡入 */
}

/* 黑色遮罩層：播放時一齊 Fade Out */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2;
    opacity: 1;
    transition: opacity 1.2s ease-in-out;
}

/* 文字層：加入 Fade Out 動畫 */
.hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

/* =========================================
   當影片正式播放時生效（觸發 Class）
========================================= */

/* 1. 影片完全 100% 清晰 */
.hero.is-playing .hero-bg-video {
    opacity: 1;
}

/* 2. 遮罩完全隱藏 */
.hero.is-playing .hero-overlay {
    opacity: 0;
}

/* 3. Hero 文字淡出並微微上浮消失 */
.hero.is-playing .hero-content {
    opacity: 0;
    transform: translateY(-15px);
    pointer-events: none; /* 避免隱形後擋住滑鼠 */
}

/* ==========================================
   全站手機版自適應優化 (極簡 Studio Header)
   ========================================== */
@media (max-width: 768px) {

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

    /* 1. Header 改為極簡水平排版 + 毛玻璃質感 */
    .site-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: row !important; /* 強制水平單行 */
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        background: rgba(10, 10, 10, 0.8) !important; /* 半透明黑底 */
        backdrop-filter: blur(12px) !important; /* iOS 磨砂玻璃效果 */
        -webkit-backdrop-filter: blur(12px) !important;
        z-index: 9999 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    /* 2. Logo 緊湊化 */
    .site-header .logo {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
        color: #ffde59 !important;
    }

    /* 3. 導航連結改為緊湊橫排，收窄間距 */
    .site-header nav {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        white-space: nowrap !important;
    }

    .site-header nav a {
        font-size: 0.75rem !important;
        padding: 4px 6px !important;
        color: rgba(255, 255, 255, 0.8) !important;
        margin: 0 !important;
    }

    /* 4. Contact Us 縮細為精緻膠囊按鈕，不再突兀 */
    .site-header nav .btn-primary {
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
        border-radius: 20px !important;
        background: #ffde59 !important;
        color: #000 !important;
        font-weight: 600 !important;
    }

    /* 5. 首頁 Hero 文字縮放，避免撞到 Header */
    .hero-container,
    .hero-content {
        padding-top: 70px !important; /* 預留頂部空間給 Fixed Header */
    }

    .hero-content h1,
    .hero-title {
        font-size: 2.2rem !important;
        line-height: 1.15 !important;
        letter-spacing: 1px !important;
    }

    .hero-content p,
    .hero-subtitle {
        font-size: 0.9rem !important;
        margin-top: 10px !important;
    }

    .hero-content .cta-button,
    .hero-content .btn-primary {
        padding: 8px 22px !important;
        font-size: 0.9rem !important;
        margin-top: 20px !important;
    }

    /* 6. 其他頁面預留 Header 高度 */
    .page-section {
        padding-top: 80px !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* 7. Work 作品頁雙欄 Grid */
    .ig-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }
    .ig-post-title {
        font-size: 0.75rem !important;
        opacity: 1 !important;
        padding: 8px 6px !important;
    }
}
