/* ==========================================================================
   Yamabiko Loop - 共通スタイルシート
   ========================================================================== */

/* デザイン設定（色・フォント） */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --accent-gray: #f2f2f2;
    --line-color: #e0e0e0;
    --secondary-text: #888;
    --tertiary-text: #999;
    --hover-bg: #fafafa;
    --nav-bg: rgba(255,255,255,0.95);
    --lang-switch-bg: rgba(255,255,255,0.9);
    --button-bg: #1a1a1a;
    --button-text: #ffffff;
    --error-color: #c00;
    --success-bg: #e8f5e9;
    --success-text: #2e7d32;
    --error-bg: #F8D7DA;
    --error-text: #c62828;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --accent-gray: #1e1e1e;
        --line-color: #333333;
        --secondary-text: #a0a0a0;
        --tertiary-text: #888888;
        --hover-bg: #2a2a2a;
        --nav-bg: rgba(18,18,18,0.95);
        --lang-switch-bg: rgba(30,30,30,0.95);
        --button-bg: #e0e0e0;
        --button-text: #121212;
        --error-color: #ff6b6b;
        --success-bg: #1b3d1b;
        --success-text: #ffffff;
        --error-bg: #3B1F22;
        --error-text: #ffffff;
    }
    .hero-logo img,
    .nav-logo img {
        filter: invert(1);
    }
}

/* 基本設定 */
body {
    margin: 0; padding: 0;
    font-family: 'Lato', 'Shippori Mincho', serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 2;
}
h1, h2, h3 { font-weight: 400; margin: 0; line-height: 1.2; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 5%; }

/* Language Switcher */
.lang-switch {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 8px;
    background: var(--lang-switch-bg);
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: opacity 0.3s ease;
}
.lang-switch a {
    text-decoration: none;
    color: var(--secondary-text);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s;
}
.lang-switch a:hover {
    color: var(--text-color);
}
.lang-switch a.active {
    background: var(--button-bg);
    color: var(--button-text);
}

/* ナビゲーションバー（スクロール時に表示） */
.nav-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.08);
    padding: 0.75rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}
.nav-bar.visible {
    transform: translateY(0);
}
.nav-logo {
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    color: var(--text-color);
    text-decoration: none;
}
.nav-logo img {
    height: 28px;
    width: auto;
    vertical-align: middle;
}
.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}
.nav-links a {
    color: var(--secondary-text);
    text-decoration: none;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    transition: color 0.3s;
}
.nav-links a:hover {
    color: var(--text-color);
}
.nav-lang {
    display: flex;
    gap: 0.5rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--line-color);
}
.nav-lang a {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}
.nav-lang a.active {
    background: var(--button-bg);
    color: var(--button-text);
}
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }
    .nav-links a {
        font-size: 0.75rem;
    }
    .nav-lang {
        margin-left: 0.5rem;
        padding-left: 0.5rem;
    }
}

/* ヒーローエリア */
header {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}
.hero-title {
    font-size: 4rem;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-sub {
    font-size: 1rem;
    color: var(--secondary-text);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.3s;
}

/* CTAボタン */
.hero-cta {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.9rem 2.5rem;
    background: var(--text-color);
    color: var(--bg-color);
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    border-radius: 50px;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.6s;
    transition: opacity 0.3s, transform 0.3s;
}
.hero-cta:hover {
    opacity: 0.8;
}

/* スクロールダウン表示 */
.scroll-indicator {
    position: absolute; bottom: 50px; left: 50%; transform: translateX(-50%);
    height: 60px; width: 1px; background: var(--line-color); overflow: hidden;
}
.scroll-indicator::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 50%;
    background: var(--text-color); animation: scrollDown 2s infinite;
}
@keyframes scrollDown { 0% { top: -100%; } 100% { top: 100%; } }

/* コンテンツエリア */
.section { padding: 10rem 0; }
.section-gray { background-color: var(--accent-gray); }

.about-wrap {
    max-width: 800px; margin: 0 auto; text-align: center;
}
.about-title {
    font-size: 2rem; margin-bottom: 3rem;
    position: relative; display: inline-block;
}
.about-title::after {
    content: ''; position: absolute; bottom: -10px; left: 0; width: 100%; height: 1px; background: var(--text-color);
}
.about-text { text-align: left; text-align-last: left; font-size: 1.1rem; }

/* ワークス（リスト表示） */
.work-list { border-top: 1px solid var(--line-color); }
.work-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 3rem 0;
    border-bottom: none;
    cursor: pointer;
    transition: background 0.3s;
    position: relative;
    overflow: hidden;
}
.work-item:hover { background: var(--hover-bg); }

.work-meta { flex: 1; }
.work-year { font-size: 0.9rem; color: var(--tertiary-text); margin-bottom: 0.5rem; display: block; }
.work-title { font-size: 1.5rem; font-family: 'Shippori Mincho', serif; transition: 0.3s; }
.work-item:hover .work-title { padding-left: 20px; }

.work-cat {
    font-size: 0.9rem; border: 1px solid var(--line-color); padding: 0.5rem 1.5rem; border-radius: 50px;
    transition: 0.3s;
}
.work-item:hover .work-cat { background: var(--button-bg); color: var(--button-text); border-color: var(--button-bg); }

/* アコーディオン */
.work-item-wrapper { border-bottom: 1px solid var(--line-color); }
.work-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0 0;
    background: var(--hover-bg);
}
.work-item-wrapper.open .work-detail {
    max-height: 800px;
    padding: 2rem 0;
}
.work-detail-inner {
    padding: 0 2rem;
    line-height: 2;
}
.work-detail-img {
    width: 100%;
    max-width: 400px;
    height: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.work-item-wrapper.open .work-cat { background: var(--button-bg); color: var(--button-text); border-color: var(--button-bg); }

/* 会社概要エリア */
.company-dl {
    max-width: 800px; margin: 0 auto;
    display: flex; flex-wrap: wrap;
    border-top: 1px solid var(--line-color);
}
.company-dl dt {
    width: 30%; padding: 2rem 0;
    border-bottom: 1px solid var(--line-color);
    font-weight: bold;
}
.company-dl dd {
    width: 70%; margin: 0; padding: 2rem 0;
    border-bottom: 1px solid var(--line-color);
}
@media (max-width: 768px) {
    .company-dl dt, .company-dl dd { width: 100%; padding: 1rem 0; border: none; }
    .company-dl dt { margin-top: 1rem; border-top: 1px solid var(--line-color); }
    .company-dl dd { border-bottom: 1px solid var(--line-color); }
}

/* 要素の出現アニメーション用クラス */
.fade-in-up {
    opacity: 0; transform: translateY(40px);
    transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}
.fade-in-up.active { opacity: 1; transform: translateY(0); }

/* コンタクトフォーム */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}
.form-group {
    margin-bottom: 2rem;
}
.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.95rem;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--line-color);
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-color);
    background: var(--bg-color);
    transition: border-color 0.3s;
    box-sizing: border-box;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--text-color);
}
.form-group textarea {
    min-height: 150px;
    resize: vertical;
}
.submit-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: var(--text-color);
    color: var(--bg-color);
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.3s;
}
.submit-btn:hover {
    opacity: 0.8;
}

/* フッター */
footer { padding: 5rem 0; text-align: center; font-size: 0.9rem; color: var(--tertiary-text); }
.footer-nav { margin-bottom: 2rem; }
.footer-nav a { color: var(--text-color); text-decoration: none; margin: 0 1rem; }
.footer-privacy {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.35rem 1rem;
    border: 1px solid var(--line-color);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--secondary-text);
    text-decoration: none;
    letter-spacing: 0.05em;
}
.footer-privacy:hover {
    border-color: var(--tertiary-text);
    color: var(--text-color);
}

/* スマホ対応 */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .work-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .work-cat { align-self: flex-start; }
}

@keyframes fadeIn { to { opacity: 1; transform: translateY(0); } }

/* アクセシビリティ: アニメーション軽減設定 */
@media (prefers-reduced-motion: reduce) {
    .hero-title,
    .hero-sub,
    .hero-logo,
    .scroll-indicator,
    .scroll-indicator::after,
    .fade-in-up {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .scroll-indicator { display: none; }
}
