@charset "UTF-8";

/* =============================================================================
   HERO + Philosophy セクション
   iOS Chrome/Safari の横ブレ修正版（position:fixed → absolute 方式）
   ============================================================================= */

/* ブレ防止ラッパー: backface-visibility:hidden で GPU レンダリング安定化 */
.hero-slide-area {
    position: relative;
    z-index: 1;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.hero-section {
    position: relative;
    width: 100%;
}

/* カルーセル背景レイヤー: absolute で HERO + Philosophy 全体をカバー */
.hero-carousel {
    position: absolute;
    z-index: 1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* カルーセルグリッド: 斜め回転 + 拡大 */
.carousel-grid {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    transform: rotate(-15deg) scale(1.4);
    transform-origin: center center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* スクロール連動オーバーレイ（JS で opacity を制御） */
.carousel-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
    will-change: opacity;
}

/* カルーセル列 */
.carousel-column {
    width: 110px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    user-select: none;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.carousel-column-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carousel-column-inner ul {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* カルーセルアニメーション: 上方向（デフォルト） */
/* SP: 800s（画像が小さいため速めに） / MD+: 2000s */
.carousel-column-inner ul:first-child {
    animation: heroRailUp1 800s -400s linear infinite;
}
.carousel-column-inner ul:last-child {
    animation: heroRailUp2 800s linear infinite;
}

/* 偶数列のみ下方向 */
.carousel-column:nth-child(even) .carousel-column-inner ul:first-child {
    animation: heroRailDown1 800s -400s linear infinite;
}
.carousel-column:nth-child(even) .carousel-column-inner ul:last-child {
    animation: heroRailDown2 800s linear infinite;
}

/* タイル */
.carousel-tile img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    filter: sepia(0.2) brightness(0.55);
}

/* テキスト層: HERO（1画面目 / sticky） */
.hero-content-layer {
    position: sticky;
    top: 0;
    height: 100vh;
    height: calc(var(--vh, 1vh) * 100);
    z-index: 2;
    display: flex;
    align-items: center;
}

/* テキスト層: Philosophy（2画面目） */
.hero-philosophy-layer {
    position: relative;
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* カルーセル @keyframes */
@keyframes heroRailUp1 {
    0%   { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
}
@keyframes heroRailUp2 {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-200%); }
}
@keyframes heroRailDown1 {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}
@keyframes heroRailDown2 {
    0%   { transform: translateY(-200%); }
    100% { transform: translateY(0%); }
}

/* ===== Text Animations ===== */
[data-animate] {
    opacity: 0;
}
@keyframes fade-in-up {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}
.animate-fade-in-up {
    animation: fade-in-up 1s ease-out forwards;
}
.animate-fade-in-up-delay-1 {
    opacity: 0;
    animation: fade-in-up 1s ease-out 0.5s forwards;
}
.animate-fade-in-up-delay-2 {
    opacity: 0;
    animation: fade-in-up 1s ease-out 1.0s forwards;
}
.animate-fade-in-up-delay-3 {
    opacity: 0;
    animation: fade-in-up 1s ease-out 1.5s forwards;
}

/* ===== Scroll Indicator ===== */
@keyframes scroll-line {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(200%); }
}
.animate-scroll-line {
    animation: scroll-line 1.5s ease-in-out infinite;
}
.writing-vertical-rl {
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ===== HERO レスポンシブ ===== */
/* TB (768px+) */
@media (min-width: 768px) {
    .carousel-grid         { gap: 24px; }
    .carousel-column       { width: 220px; }
    .carousel-tile img     { height: 300px; }
    .carousel-column-inner { gap: 16px; }
    .carousel-column-inner ul { gap: 16px; }
    /* アニメーション速度を元に戻す */
    .carousel-column-inner ul:first-child { animation-duration: 2000s; animation-delay: -1000s; }
    .carousel-column-inner ul:last-child  { animation-duration: 2000s; animation-delay: 0s; }
}
/* PC (1024px+) */
@media (min-width: 1024px) {
    .carousel-grid     { transform: rotate(-15deg) scale(1.5); }
    .carousel-column   { width: 320px; }
    .carousel-tile img { height: 380px; }
}

/* ===== Section Title Animation ===== */
.section-title-wrapper {
    position: relative;
}
.section-title-content {
    position: relative;
    z-index: 1;
}

/* Scroll Animation */
.scroll-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}
/* スマホ・タブレット: 上から順番に表示 */
.scroll-animate-delay-1 {
    transition-delay: 0.1s;
}
.scroll-animate-delay-2 {
    transition-delay: 0.2s;
}
.scroll-animate-delay-3 {
    transition-delay: 0.3s;
}
.scroll-animate-delay-4 {
    transition-delay: 0.4s;
}
.scroll-animate-delay-5 {
    transition-delay: 0.5s;
}
/* PC: 行ごとに同時表示 */
@media (min-width: 768px) {
    .scroll-animate-delay-1 {
        transition-delay: 0s;
    }
    .scroll-animate-delay-2,
    .scroll-animate-delay-3 {
        transition-delay: 0.15s;
    }
    .scroll-animate-delay-4,
    .scroll-animate-delay-5 {
        transition-delay: 0.3s;
    }
}

/* PRIDE × CRAFT - ゆっくりアニメーション */
.pride-craft-section {
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}
.pride-craft-section .tagline-text {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 1.2s ease-out, transform 1.2s ease-out;
}
.pride-craft-section.visible .tagline-text {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.2s;
}

/* Title line animation */
.title-line {
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #2d7a3e, #4a9d5f);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s;
}
.scroll-animate.visible .title-line {
    width: 60px;
}

/* ===== Projects Grid ===== */
.projects-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}
.project-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    text-decoration: none;
    transition: opacity 1.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 1.8s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s;
}
.project-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}
.project-card-image {
    height: 200px;
    overflow: hidden;
}
.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.project-card:hover .project-card-image img {
    transform: scale(1.05);
}
.project-card-noimage {
    width: 100%;
    height: 100%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
}
.project-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.project-card-category {
    display: inline-block;
    width: fit-content;
    background: #e8f5e9;
    color: #2d7a3e;
    padding: 0.375rem 1.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.project-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.5;
    color: #1a1a1a;
    margin-bottom: 0.75rem;
    min-height: 3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.project-card-desc {
    font-size: 0.875rem;
    line-height: 2;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* PC/タブレット: 768px以上 */
@media (min-width: 768px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    /* カード1-2: 横長（2列ぶち抜き、横並び） */
    .project-card-1,
    .project-card-2 {
        grid-column: span 2;
        flex-direction: row;
    }
    .project-card-1 .project-card-image,
    .project-card-2 .project-card-image {
        width: 60%;
        height: 400px;
        aspect-ratio: auto;
        flex-shrink: 0;
    }
    .project-card-1 .project-card-body,
    .project-card-2 .project-card-body {
        width: 40%;
        padding: 2rem 2.5rem;
        justify-content: center;
    }
    .project-card-1 .project-card-title,
    .project-card-2 .project-card-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    .project-card-desc {
        font-size: 1rem;
    }
    /* カード2: 画像右（逆順） */
    .project-card-2 {
        flex-direction: row-reverse;
    }
    /* カード3-4: 横長ミニ（各1列、画像左+テキスト右） */
    .project-card-3,
    .project-card-4 {
        flex-direction: row;
    }
    .project-card-3 .project-card-image,
    .project-card-4 .project-card-image {
        width: 45%;
        height: 400px;
        aspect-ratio: auto;
        flex-shrink: 0;
    }
    .project-card-3 .project-card-body,
    .project-card-4 .project-card-body {
        width: 55%;
        padding: 1.5rem 2rem;
        justify-content: center;
    }
    .project-card-3 .project-card-title,
    .project-card-4 .project-card-title {
        font-size: 1.25rem;
        margin-bottom: 0.75rem;
    }
}

/* ===== HISTORY Decade Navigation ===== */
.history-decade-nav-wrap {
    position: relative;
}
.history-decade-nav-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 20px;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, rgba(245,245,240,0), rgba(245,245,240,1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}
.history-decade-nav-wrap.has-overflow::after {
    opacity: 1;
}
@media (min-width: 768px) {
    .history-decade-nav-wrap::after {
        right: 32px;
        width: 50px;
    }
}
@media (min-width: 1024px) {
    .history-decade-nav-wrap::after {
        right: 60px;
        width: 60px;
    }
}
.history-decade-nav {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 1px solid #e0e0db;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}
.history-decade-nav:active {
    cursor: grabbing;
}
.history-decade-nav::-webkit-scrollbar {
    display: none;
}
.history-decade-btn {
    font-family: 'Oswald', sans-serif;
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 1px;
    color: #aaa;
    background: none;
    border: none;
    padding: 10px 12px 16px;
    cursor: pointer;
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
}
.history-decade-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: #2d7a3e;
    transition: width 0.3s ease;
}
.history-decade-btn:hover {
    color: #2d7a3e;
}
.history-decade-btn:hover::after {
    width: 100%;
}
.history-decade-btn.is-active {
    color: #2d7a3e;
    font-weight: 500;
}
.history-decade-btn.is-active::after {
    width: 100%;
}

@media (min-width: 768px) {
    .history-decade-btn {
        font-size: 13px;
        padding: 12px 16px;
        letter-spacing: 1.5px;
    }
}
@media (min-width: 1024px) {
    .history-decade-btn {
        font-size: 14px;
        padding: 14px 20px;
        letter-spacing: 2px;
    }
}

/* ===== HISTORY Horizontal Scroll Cards ===== */
.history-cards-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    cursor: grab;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.history-cards-wrapper::-webkit-scrollbar {
    display: none;
}
.history-cards-wrapper:active {
    cursor: grabbing;
}
.history-cards-track {
    display: flex;
    align-items: stretch;
    min-width: max-content;
    padding-left: 20px;
    padding-right: 20px;
}
.history-card {
    flex-shrink: 0;
    width: 280px;
    border-left: 1px solid #d5d5d0;
}
.history-card-first {
    border-left: none;
    margin-left: 0;
}
.history-card-last {
    border-right: 1px solid #d5d5d0;
}
.history-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0 28px;
}
.history-card-year-block {
    margin-bottom: 24px;
}
.history-card-year {
    display: block;
    font-family: 'Oswald', sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: 1px;
    line-height: 1.1;
}
.history-card-month {
    display: block;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    margin-top: 4px;
}
.history-card-text {
    font-size: 14px;
    line-height: 1.9;
    color: #444;
    margin: 0;
}
.history-card-image {
    margin-top: auto;
    padding-top: 44px;
}
.history-card-image img {
    width: 224px;
    height: auto;
    aspect-ratio: 3/2;
    object-fit: cover;
    display: block;
}

/* ===== HISTORY Navigation ===== */
.history-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 32px;
}
.history-nav-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.history-nav-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid #1a1a1a;
    background: transparent;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}
.history-nav-btn:hover:not(:disabled) {
    background: #1a1a1a;
    color: #fff;
}
.history-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ===== HISTORY Tablet ===== */
@media (min-width: 768px) {
    .history-cards-track {
        padding-left: 32px;
        padding-right: 32px;
    }
    .history-card-first {
        margin-left: 0;
    }
    .history-card {
        width: 320px;
    }
    .history-card-inner {
        padding: 0 36px;
    }
    .history-card-year {
        font-size: 30px;
    }
    .history-card-month {
        font-size: 17px;
    }
    .history-card-text {
        font-size: 15px;
    }
    .history-card-image img {
        width: 248px;
    }
    .history-nav {
        margin-top: 36px;
    }
    .history-nav-btn {
        width: 50px;
        height: 50px;
    }
}

/* ===== HISTORY PC ===== */
@media (min-width: 1024px) {
    .history-cards-track {
        padding-left: max(60px, calc((100vw - 1920px) / 2 + 60px));
        padding-right: 60px;
    }
    .history-card-first {
        margin-left: 0;
    }
    .history-card {
        width: 360px;
    }
    .history-card-inner {
        padding: 0 44px;
    }
    .history-card-year {
        font-size: 38px;
    }
    .history-card-month {
        font-size: 16px;
    }
    .history-card-text {
        font-size: 15px;
        line-height: 2;
    }
    .history-card-image img {
        width: 272px;
    }
    .history-nav {
        margin-top: 40px;
    }
    .history-nav-btn {
        width: 54px;
        height: 54px;
    }
    .history-nav-btn svg {
        width: 22px;
        height: 22px;
    }
}
