/* --- リセットCSS & 基本設定 --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-en-serif: 'Cormorant Garamond', serif;
    --font-en-sans: 'Lato', sans-serif;
    --font-jp-serif: 'Shippori Mincho', serif;
    --font-jp-sans: 'Noto Sans JP', sans-serif;
    
    --color-text: #313131;
    --color-bg: #F5EFE7; /* Sand beige */
    --color-accent: #888;
    --color-white: #ffffff;
}

body {
    font-family: var(--font-jp-serif);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 2.0; /* ゆったりとした行間 */
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

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

a:hover {
    opacity: 0.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 共通クラス */
.container {
    max-width: 1400px; /* 少し広めに */
    margin: 0 auto;
    padding: 0 60px;
}

.section {
    padding: 120px 0; /* 余白を大きく */
}

.en-title {
    font-family: var(--font-en-sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 20px;
    display: block;
    font-weight: 400;
}

.section-title {
    font-family: var(--font-en-serif);
    font-size: 3rem; /* 大きくエレガントに */
    font-weight: 400;
    margin-bottom: 40px;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.text-body {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 30px;
    text-align: justify;
    font-weight: 400;
}

/* --- ヘッダー --- */
header {
    padding: 15px 60px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(239, 236, 228, 0.1); /* Ultra transparent */
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    opacity: 0;
    animation: fadeInHeader 1.2s ease-out 0.8s forwards;
    /* Add transition for smooth color change in both directions */
    transition: background-color 1s ease, border-bottom 1s ease;
}

/* Ensure logo is white by default (for transparent header) */
.logo {
    color: #ffffff;
    font-family: var(--font-en-serif);
    font-size: 1.2rem;
    letter-spacing: 0.05em;
    font-weight: 500;
    transition: color 1s ease, text-shadow 1s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Subpage Hero (Banner) - Journal and Gallery */
/* 修正: 横長バナーとして表示 */
.subpage-hero {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1903 / 400; /* バナー画像のアスペクト比 */
    background-image: url('../images/banner.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: #1a2b40;
    margin-bottom: 0;
    overflow: hidden;
}

/* オーバーレイ削除済み */

.subpage-hero h1 {
    display: none;
}

/* Static header for subpages (no fade-in) - REMOVED or MODIFIED */
/* We want transparent initially, so we don't use header-static for pages with banner */
/* But we might need it for post.html if it doesn't have a banner? User said Journal and Gallery. */
/* Keeping the class definition but will remove it from HTML of Journal/Gallery */
header.header-static {
    opacity: 1;
    animation: none;
    background-color: rgba(245, 239, 231, 0.95); /* Always sand beige */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

header.header-static .logo,
header.header-static nav a,
header.header-static .header-sound-icon {
    color: #313131;
}

header.header-static .hamburger-menu .bar {
    background-color: #313131;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1001;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 16px;
    cursor: pointer;
    z-index: 1001;
}

.hamburger-menu .bar {
    width: 100%;
    height: 1.5px;
    background-color: #e6e6e6;
    transition: all 0.3s ease;
}

/* Scrolled state for hamburger */
header.scrolled .hamburger-menu .bar {
    background-color: #313131;
}

/* Active state (X shape) */
.hamburger-menu.active .bar:nth-child(1) {
    transform: translateY(7.25px) rotate(45deg);
}

.hamburger-menu.active .bar:nth-child(2) {
    opacity: 0;
}
.header-sound-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    opacity: 0;
    animation: fadeInHeaderIcon 1.2s ease-out 3.9s forwards;
    height: 18px;
}

.header-sound-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e6e6e6;
    height: 100%;
}

.header-sound-content {
    position: relative;
    width: 70px;
    height: 100%;
    display: flex;
    align-items: center;
}

.header-sound-label {
    font-family: var(--font-en-sans);
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    color: rgba(230, 230, 230, 0.8);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    transition: opacity 0.5s ease;
    opacity: 1;
    white-space: nowrap;
    line-height: 1;
}

.header-volume-control {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    width: 100%;
    height: 100%;
}

.header-sound-container.active .header-sound-label {
    opacity: 0;
}

.header-sound-container.active .header-volume-control {
    opacity: 1;
    pointer-events: auto;
}

.header-sound-container.muted .header-sound-icon {
    opacity: 0.5;
}

.header-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 3px;
    background: rgba(230, 230, 230, 0.3);
    border-radius: 2px;
    outline: none;
}

.header-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #e6e6e6;
    border-radius: 50%;
    cursor: pointer;
}

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

@keyframes fadeInHeaderIcon {
    from {
        opacity: 0;
        transform: translateX(-5px);
    }
    to {
        opacity: 0.7;
        transform: translateX(0);
    }
}

/* Scrolled state - dark text for sand beige background */
header.scrolled {
    background-color: rgba(245, 239, 231, 0.95); /* Sand beige with slight transparency */
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background-color 1s ease, border-bottom 1s ease;
}

header.scrolled .logo,
header.scrolled nav a,
header.scrolled .header-sound-icon {
    color: #313131; /* Dark text */
    text-shadow: none; /* 明るい背景では影を消す */
}

header.scrolled .header-sound-label {
    color: rgba(49, 49, 49, 0.8);
}

header.scrolled .header-volume-slider {
    background: rgba(49, 49, 49, 0.2);
}

header.scrolled .header-volume-slider::-webkit-slider-thumb {
    background: #313131;
}

/* Add smooth transitions to elements that change color */
header .logo,
header nav a,
header .header-sound-icon,
header .header-sound-label,
header .header-volume-slider,
header .header-volume-slider::-webkit-slider-thumb {
    transition: color 1s ease, background 1s ease, background-color 1s ease, text-shadow 1s ease;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 40px;
}

nav a {
    font-family: var(--font-en-serif); /* Match other English fonts */
    font-size: 0.9rem; /* Slightly larger for serif */
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #e6e6e6; /* Slightly gray white */
    font-weight: 500;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    transition: color 1s ease, text-shadow 1s ease;
}

/* --- ヒーローセクション（メインビジュアル） --- */
.hero {
    position: relative;
    width: 100%;
    height: 100vh; /* 全画面表示 */
    background-color: #1a2b40;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0; /* 余白なし */
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* アニメーションでゆっくりズームさせるとより高級感が出る */
    transition: transform 10s ease;
    background-image: url('../images/hero-home.png'); 
    background-size: cover; /* 画面いっぱいに広げる */
    background-repeat: no-repeat;
    background-position: center bottom; /* 下（地平線）を基準にする */
    /* フィルター削除済み - 画像自体で調整 */
}

.hero-overlay {
    /* オーバーレイ削除済み - 画像自体で調整 */
    display: none;
}

.hero-text {
    position: absolute;
    left: 80px;
    top: 55%; /* 中央より少し下 */
    z-index: 3;
    color: #ffffff;
    max-width: 800px; /* 折り返しを防ぐために幅を広げる */
}

/* 文字ごとのアニメーション用スタイル */
.hero-text-en span,
.hero-text-jp span {
    opacity: 0;
    display: inline-block; /* スペースも文字として扱うため */
    animation: fadeInChar 1.2s ease-out forwards; /* ヘッダーと同じ1.2s */
}

/* スペースが潰れないようにする */
.hero-text-en span:empty::before {
    content: "\00a0";
}

@keyframes fadeInChar {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.hero-text-en {
    font-family: var(--font-en-serif);
    font-size: 2.8rem;
    font-weight: 300;
    letter-spacing: 0.05em;
    margin-bottom: 20px;
    line-height: 1.2;
    opacity: 0; /* Hide initially to prevent FOUC */
}

.hero-text-jp {
    font-family: var(--font-jp-serif);
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.15em;
    line-height: 1.8;
    line-height: 1.8;
    opacity: 0; /* Hide initially to prevent FOUC */
    white-space: nowrap; /* 一行で表示 */
    margin-bottom: 20px;
}

.hero-sound-row {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 右揃え */
    width: 100%;
}

.bgm-container {
    display: flex;
    align-items: center; /* 垂直方向の中央揃え */
    gap: 8px;
    cursor: pointer;
    opacity: 0;
    /* Text perceived complete around 3.5s. +0.4s delay = 3.9s */
    animation: fadeInIcon 1.2s ease-out 3.9s forwards;
    height: 24px; /* アイコンの高さに合わせる */
}

.bgm-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.bgm-content-area {
    position: relative;
    width: 80px;
    height: 100%; /* 親の高さ(24px)に合わせる */
    display: flex;
    align-items: center;
}

.bgm-label {
    font-family: var(--font-en-sans);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.8);
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%); /* 完全に中央へ */
    transition: opacity 0.5s ease;
    opacity: 1;
    white-space: nowrap;
    line-height: 1; /* 行高によるズレを防ぐ */
    padding-top: 1px; /* 微調整: フォントのベースライン補正 */
}

.volume-control {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%); /* 完全に中央へ */
    display: flex;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
    width: 100%;
    height: 100%; /* 高さ確保 */
}

/* Active State: Label hidden, Volume visible */
.bgm-container.active .bgm-label {
    opacity: 0;
}

.bgm-container.active .volume-control {
    opacity: 1;
    pointer-events: auto;
}

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

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none; /* Standard property for compatibility */
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    cursor: pointer;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.hero-cta-container {
    display: flex;
    justify-content: flex-end;
    margin-top: 15px;
}

.hero-cta {
    font-family: var(--font-en-serif);
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: 0.1em;
    opacity: 0;
    animation: fadeInCta 1.2s ease-out 3.9s forwards; /* Same timing as sound icon */
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 5px;
    text-decoration: none;
}

.hero-cta:hover {
    opacity: 0.8;
    border-bottom-color: rgba(255, 255, 255, 1);
}

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

/* --- Philosophy --- */
.philosophy {
    text-align: left; /* 左揃え */
    padding-top: 150px;
    padding-bottom: 150px;
}

.philosophy p {
    max-width: 700px;
    margin: 0; /* 左揃えなのでautoを外す */
    font-size: 1.1rem;
    line-height: 2.2;
}

/* --- 2カラムセクション (Words & Design) --- */
.two-columns {
    display: grid;
    grid-template-columns: 1.5fr 1fr; /* 6:4 ratio */
    gap: 40px; /* 少し隙間をあける */
    margin-bottom: 0;
    align-items: start; /* 上揃え */
}

.column-item {
    position: relative;
    padding: 0;
    margin-bottom: 100px;
}

.column-item img {
    width: 100%;
    height: 500px; /* 高さを揃える */
    object-fit: cover;
    background-color: #ccc;
    margin-bottom: 40px;
}

.column-title {
    font-family: var(--font-en-serif);
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: 400;
}

/* 互い違いにするレイアウト（解除） */
.two-columns .column-item:nth-child(2) {
    margin-top: 0; 
}


/* --- Services (AI Solutions) --- */
.services {
    background-color: #f5f5f5; /* 少し背景を変える */
    padding: 150px 0;
}

.services-header {
    text-align: center;
    margin-bottom: 100px;
}
        
.services-header .section-title {
    font-size: 3rem;
}

.services-header p {
    font-size: 1rem;
    text-align: left;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.three-columns {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 0;
}

.service-item img {
    width: 100%;
    height: 400px; /* 縦長 */
    object-fit: cover;
    background-color: #ccc;
    margin-bottom: 30px;
}

.service-cat {
    font-family: var(--font-en-sans);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    color: #888;
    margin-bottom: 10px;
    display: block;
    text-transform: uppercase;
}

.service-title {
    font-family: var(--font-en-serif);
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.view-details {
    display: none; /* Temporarily hidden */
    font-family: var(--font-en-sans);
    font-size: 0.75rem;
    color: var(--color-text);
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    margin-top: 20px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- フッター --- */
footer {
    text-align: center;
    padding: 80px 0;
    font-size: 0.7rem;
    color: #888;
    font-family: var(--font-en-sans);
    letter-spacing: 0.1em;
    border-top: none;
    background-color: var(--color-bg);
}

/* --- レスポンシブ対応 (スマホ向け) --- */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .hero-main-copy {
        font-size: 2.5rem;
    }
    
    .two-columns, .three-columns {
        grid-template-columns: 1fr;
        gap: 60px;
    }
    
    .two-columns .column-item:nth-child(2) {
        margin-top: 0; /* ずらし解除 */
    }

    .column-item {
        padding: 0;
        margin-bottom: 60px;
    }

    .service-item img {
        height: auto;
    }

    header {
        justify-content: space-between; /* Ensure logo and hamburger are apart */
        padding: 15px 20px;
        background-color: rgba(239, 236, 228, 0.1); /* Keep transparent initially */
        backdrop-filter: blur(4px);
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 20px;
    }

    header.scrolled {
        background-color: rgba(245, 239, 231, 0.95);
    }

    .hamburger-menu {
        display: flex;
    }
    
    nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: transparent;
        display: flex;
        justify-content: flex-end;
        align-items: flex-start;
        padding-right: 20px;
        padding-top: 80px;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
        pointer-events: none;
    }

    nav.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    nav ul {
        flex-direction: column;
        gap: 8px;
        text-align: right;
    }

    nav a {
        font-size: 1.0rem;
        color: #e6e6e6;
    }
    
    
    /* Header adjustments for mobile */
    header {
        padding: 15px 20px;
        justify-content: space-between;
        gap: 10px; /* Reduce gap to fit content */
    }

    .header-left {
        gap: 8px; /* Reduce gap between logo and sound icon */
        flex-shrink: 1; /* Allow shrinking if needed */
        min-width: 0; /* Enable flex item shrinking */
    }

    .logo {
        font-size: 0.9rem; /* Reduce font size */
        white-space: nowrap; /* Prevent wrapping */
        text-shadow: 0 0 10px rgba(0,0,0,0.5); /* Add shadow for visibility */
    }

    .header-sound-container {
        transform: scale(0.9); /* Slightly smaller sound icon */
        transform-origin: left center;
    }
    
    .header-sound-icon {
        color: #fff; /* Ensure visible */
        text-shadow: 0 0 10px rgba(0,0,0,0.5);
    }

    .hamburger-menu .bar {
        box-shadow: 0 0 5px rgba(0,0,0,0.5); /* Shadow for hamburger lines */
    }

    /* Hero adjustments for mobile */
    .hero {
        height: 100vh; /* Full screen height */
    }

    .hero-bg {
        background-size: auto 100%; /* Height 100%, width auto - maintains aspect ratio, crops sides */
        background-position: center center; /* Center horizontally for equal cropping */
    }

    .hero-text {
        left: 20px;
        top: 50%;
        max-width: calc(100% - 40px);
        transform: translateY(-50%); /* Center vertically */
    }

    .hero-text-en {
        font-size: 1.8rem; /* Slightly smaller than desktop but elegant */
        line-height: 1.2;
        margin-bottom: 15px;
    }

    .hero-text-jp {
        font-size: 0.85rem;
        white-space: normal; /* Allow text to wrap on mobile */
        line-height: 2.0; /* Increase line height for better readability */
        margin-bottom: 25px; /* More space before sound/cta */
    }

    .hero-text-jp-indent {
        display: block; /* Force new line behavior if needed, though <br> does it */
        margin-left: 9.2em; /* Indent the second line to align "聴" between "の" and "さ" */
    }

    .hero-sound-row {
        margin-top: 10px;
        justify-content: flex-start; /* Align left on mobile */
        gap: 20px; /* Space between sound and CTA */
    }

    .bgm-container {
        height: 20px; /* Slightly smaller */
    }

    .hero-cta-container {
        margin-top: 0; /* Align with sound row */
    }

    .hero-cta {
        font-size: 0.9rem;
    }

    /* Subpage hero responsive - 横長バナーを維持 */
    .subpage-hero {
        aspect-ratio: 1903 / 400; /* 同じアスペクト比を維持 */
        background-size: cover;
        background-position: center center;
    }
}

/* --- Journal --- */
.journal {
    background-color: var(--color-bg);
    border-top: none;
    padding-top: 100px;
}

.journal-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    margin-bottom: 20px;
    transition: opacity 0.3s;
}

.journal-item a:hover img {
    opacity: 0.8;
}

.journal-date {
    font-family: var(--font-en-sans);
    font-size: 0.8rem;
    color: #888;
    display: block;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.journal-title {
    font-family: var(--font-jp-serif);
    font-size: 1.1rem;
    font-weight: 500;
    line-height: 1.6;
    color: var(--color-text);
}

/* Public Gallery */
.gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.public-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.public-gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.public-gallery-item:hover {
    transform: translateY(-5px);
}

.public-gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
}

@media (max-width: 768px) {
    .public-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .public-gallery-item img {
        height: 150px;
    }
}

/* --- Contact Form --- */
.contact-section {
    padding: 80px 0 120px;
    max-width: 600px;
    margin: 0 auto;
}

.contact-header {
    text-align: center;
    margin-bottom: 60px;
}

.contact-header p {
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
}

.contact-intro {
    font-size: 1rem;
    color: var(--color-text);
    margin-bottom: 40px;
    text-align: center;
    line-height: 2.0;
}

.contact-email {
    text-align: center;
    margin-top: 20px;
}

.contact-email a {
    font-family: var(--font-en-sans);
    font-size: 1.3rem;
    color: var(--color-text);
    letter-spacing: 0.05em;
    border-bottom: 1px solid #ccc;
    padding-bottom: 5px;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.contact-email a:hover {
    border-color: var(--color-text);
    opacity: 0.7;
}

/* Contact responsive */
@media (max-width: 768px) {
    .contact-section {
        padding: 60px 0 80px;
    }

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

    .contact-email a {
        font-size: 1rem;
    }
}
