/* ====================
   RESET & VARIABLES
   ==================== */
:root {
    --bg-color: #F9F8F6;
    --text-main: #2B2B2B;
    --text-sub: #6E6E6E;
    --accent-color: #C5A065;
    --line-color: #E0E0E0;
    
    --font-jp: "Yu Mincho", "Hiragino Mincho ProN", "HGS Mincho E", serif;
    --font-en: "Helvetica Neue", Arial, sans-serif;
    
    --spacing-section: 120px;
    --spacing-mobile: 80px;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-jp);
    line-height: 2.0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html[data-lang="en"] body { font-family: var(--font-en); letter-spacing: 0.05em; }

a { text-decoration: none; color: inherit; transition: opacity 0.3s; }
a:hover { opacity: 0.6; }
ul { list-style: none; }
img { max-width: 100%; height: auto; display: block; object-fit: cover; }

/* ====================
   HEADER
   ==================== */
header {
    position: fixed; top: 0; left: 0; width: 100%; height: 80px;
    padding: 0 5%; display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; background: rgba(249, 248, 246, 0.95); 
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.logo a { font-family: var(--font-en); font-size: 1.5rem; letter-spacing: 0.2em; color: var(--text-main); }

.desktop-nav { display: flex; gap: 2rem; align-items: center; }
.desktop-nav a { 
    font-family: var(--font-en); font-size: 0.8rem; letter-spacing: 0.1em; 
    text-transform: uppercase; position: relative; 
}
.desktop-nav a.active { border-bottom: 1px solid var(--accent-color); }
.nav-store { color: var(--accent-color); margin-left: 10px; }

.hamburger { display: none; cursor: pointer; }

/* ====================
   HERO SECTION (Refined & Responsive)
   ==================== */
#hero { 
    position: relative; 
    height: 90vh; /* 保持首屏高度 */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden; 
}

.hero-slideshow { position: absolute; top:0; left:0; width:100%; height:100%; z-index:0; background: #e0e0e0; }
.hero-overlay { position: absolute; top:0; left:0; width:100%; height:100%; z-index:1; background: rgba(0,0,0,0.25); } /* 稍微加深遮罩，提高小字的可读性 */

.hero-content { 
    position: relative; 
    z-index: 2; 
    color: #fff;
    
    /* 弹性布局容器 */
    display: flex; 
    flex-direction: row-reverse; /* 日文在右，英文在左 */
    align-items: center; 
    justify-content: center;
    
    /* 关键：限制内容区域最大尺寸，防止溢出，留出呼吸感 */
    width: 90%;
    height: 80%; 
    max-width: 1200px;
    
    /* 动态间距：根据屏幕宽度自动调整中英之间的距离 */
    gap: clamp(2rem, 5vw, 6rem); 
}

/* --- 日文标题 (竖排) --- */
.hero-title { 
    margin: 0;
    line-height: 1;
    font-weight: 500;
    
    /* 开启竖排 */
    writing-mode: vertical-rl; 
    text-orientation: upright;
    
    display: flex; 
    flex-direction: column; /* 竖排时的 column 其实是横向并列 */
    
    /* 关键优化：使用 em 作为间距单位，随字体大小缩放 */
    gap: 1.5em; 
}

.hero-line {
    display: block;
    white-space: nowrap; /* 强制不换行，保证语义完整 */
    letter-spacing: 0.25em; /* 增加字间距，增加“呼吸感” */
    
    /* 
       ★ 核心修正：字体大小控制 
       Min: 15px (保证最小可读性)
       Ideal: 3.5vh (根据屏幕高度动态调整，约占屏幕高度的3.5%)
       Max: 36px (约 2.25rem，防止在大屏上过大，保持精致感)
    */
    font-size: clamp(15px, 3.5vh, 36px); 
    
    text-shadow: 0 2px 15px rgba(0,0,0,0.3); /* 增加阴影，提升背景上的清晰度 */
}

/* --- 英文副标 (竖排装饰) --- */
.hero-subtitle { 
    font-family: var(--font-en); 
    opacity: 0.85;
    writing-mode: vertical-rl;
    
    /* 装饰线 */
    border-left: 1px solid rgba(255,255,255,0.6); 
    padding-left: 1.2rem;
    
    text-align: right;
    letter-spacing: 0.2em;
    font-weight: 300;
    
    /* 英文大小也需要限制，约为日文的一半 */
    font-size: clamp(10px, 1.5vh, 14px); 
    
    /* 限制英文线条的高度，不要太长 */
    max-height: 40vh; 
}

.slide-img { position: absolute; width:100%; height:100%; object-fit: cover; opacity:0; transition: opacity 2s ease; }
.slide-img.active { opacity:1; }

/* --- 语言适配 (英文环境切回横排) --- */
html[data-lang="en"] .hero-content { 
    flex-direction: column; 
    gap: 1.5rem; 
}
html[data-lang="en"] .hero-title { 
    writing-mode: horizontal-tb; 
    flex-direction: column; 
    gap: 0.8rem; 
    text-align: center;
}
html[data-lang="en"] .hero-line {
    /* 英文横排时的字体策略 */
    font-size: clamp(1.5rem, 4vw, 3rem); 
    letter-spacing: 0.1em;
}
html[data-lang="en"] .hero-subtitle { 
    writing-mode: horizontal-tb; 
    border-left: none; 
    border-top: 1px solid rgba(255,255,255,0.6); 
    padding-left: 0; 
    padding-top: 1rem; 
    max-height: none;
    font-size: 0.9rem;
}

/* ====================
   GALLERY (Overlap Style)
   ==================== */
.section-wrapper { padding: var(--spacing-section) 5%; }
.bg-white { background: #fff; }
.en-label { font-family: var(--font-en); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--accent-color); display: block; margin-bottom: 1rem; }
.section-title { font-size: 2rem; margin-bottom: 1rem; font-weight: normal; letter-spacing: 0.1em; }
.section-desc { color: var(--text-sub); margin-bottom: 3rem; text-align: justify; max-width: 600px; }

.gallery-container-overlap {
    display: flex; justify-content: center; align-items: center;
    width: 100%; max-width: 1200px; margin: 0 auto; padding: 2rem 0;
}
.gallery-card {
    position: relative; width: 25%; height: 400px; background-color: #f0f0f0;
    overflow: hidden; transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1); cursor: pointer;
    margin-right: -40px; 
    box-shadow: -5px 0 15px rgba(0,0,0,0.05);
    filter: grayscale(100%) brightness(0.95);
}
.gallery-card:last-child { margin-right: 0; }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-card:hover {
    width: 35%; margin-right: 0; z-index: 10;
    filter: grayscale(0%) brightness(1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}
.gallery-card:hover img { transform: scale(1.1); }
.card-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: #fff; opacity: 0; transform: translateY(20px); transition: 0.4s ease;
}
.gallery-card:hover .card-overlay { opacity: 1; transform: translateY(0); }
.card-cat { font-family: var(--font-en); font-size: 0.7rem; letter-spacing: 0.1em; display: block; margin-bottom: 5px; color: var(--accent-color); }
.card-title { font-size: 1.1rem; letter-spacing: 0.05em; font-weight: normal; }

/* Grid for Works Page */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 3rem 2rem; }
.gallery-item { cursor: pointer; }
.gallery-img-container { width: 100%; aspect-ratio: 1/1; background: #eee; overflow: hidden; margin-bottom: 1rem; position: relative; }
.gallery-img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-item:hover .gallery-img-container img { transform: scale(1.05); }
.gallery-info { margin-top: 10px; }
.gallery-category-text { font-family: var(--font-en); font-size: 0.7rem; color: var(--accent-color); letter-spacing: 0.1em; display: block; margin-bottom: 0.3rem;}
.gallery-title { font-size: 1.1rem; color: var(--text-main); }
.gallery-desc { font-size: 0.8rem; color: #999; margin-top: 5px; line-height: 1.5; }

/* UI Elements */
.btn-outline { display: inline-block; padding: 1rem 3rem; border: 1px solid var(--text-main); font-family: var(--font-en); font-size: 0.8rem; letter-spacing: 0.1em; cursor: pointer; background: transparent; transition: 0.3s; }
.btn-outline:hover { background: var(--text-main); color: #fff; }
.more-btn-container { text-align: center; margin-top: 4rem; opacity: 0; animation: fadeIn 1s forwards; }
@keyframes fadeIn { to { opacity: 1; } }

.form-area { max-width: 600px; margin: 0 auto; }
input, textarea { width: 100%; padding: 10px; margin-bottom: 20px; border: 1px solid #ccc; background: transparent; font-family: inherit; }
.submit-btn { padding: 10px 40px; background: var(--text-main); color: #fff; border: none; cursor: pointer; }

footer { text-align: center; padding: 4rem 0; font-family: var(--font-en); font-size: 0.7rem; color: #999; border-top: 1px solid var(--line-color); }

/* Language Switcher */
.lang-container { position: relative; cursor: pointer; font-family: var(--font-en); font-size: 0.8rem; margin-left: 1rem; }
.lang-dropdown { position: absolute; top: 100%; right: 0; background: #fff; border: 1px solid #ccc; display: none; min-width: 120px; z-index: 1001; }
.lang-container.active .lang-dropdown { display: block; }
.lang-option { display: block; padding: 8px 12px; transition: 0.2s; }
.lang-option:hover { background: #f9f9f9; }
.lang-option.active { color: var(--accent-color); font-weight: bold; }

.fade-in-up { opacity: 0; transform: translateY(30px); transition: 1s ease; }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* Mobile */
@media (max-width: 768px) {
    .desktop-nav { display: none; }
    .hamburger { display: block; z-index: 1002; }
    .bar { width: 25px; height: 1px; background: var(--text-main); margin: 6px 0; transition: 0.4s; }
    .desktop-nav.open { display: flex; flex-direction: column; position: fixed; top: 0; right: 0; width: 70%; height: 100vh; background: #fff; justify-content: center; box-shadow: -2px 0 10px rgba(0,0,0,0.1); z-index: 1001; }
    
    /* --- Mobile Hero Fix --- */
    #hero {
        height: 85vh; /* 手机上稍微留出更多空间给地址栏 */
    }
    
    .hero-content {
        gap: 2rem; /* 缩小中英文之间的距离 */
    }

    .hero-title {
        gap: 1.2em; /* 缩小两行日文之间的距离 */
    }

    .hero-line {
        /* 
           手机端策略：
           字体更小，保证绝对不超出屏幕。
           Max: 24px (1.5rem) 
        */
        font-size: clamp(13px, 3.2vh, 24px); 
        letter-spacing: 0.2em;
    }

    .hero-subtitle {
        padding-left: 0.8rem;
        font-size: 10px; /* 极简风格 */
        max-height: 30vh; /* 缩短英文装饰线 */
    }
    
    /* Mobile Gallery Fix */
    .gallery-container-overlap { flex-direction: column; height: auto; }
    .gallery-card { width: 100%; height: 250px; margin-right: 0; margin-bottom: -40px; filter: grayscale(0%); }
    .gallery-card:hover { width: 100%; margin-bottom: 0; }
}

/* 超小屏幕 (如 iPhone SE) 额外保护 */
@media (max-height: 600px) {
    .hero-line {
        font-size: 16px; /* 强制固定大小，防止计算出错 */
    }
    .hero-content {
        gap: 1.5rem;
    }
}