:root {
    /* Color Palette V2 */
    --color-primary: #E2001A;
    --color-tech-blue: #0055FF;
    --color-dark: #545454;
    --color-bg: #FFFFFF;
    --color-frost: #FAFAFA;
    --color-sub: #b5b6b7;
    --color-accent: #7e7f80;
    --color-gold: #C9A84C;

    /* Glows */
    --glow-red: rgba(226, 0, 26, 0.4);
    --glow-blue: rgba(0, 85, 255, 0.4);

    /* Typography */
    --font-ja: 'Noto Sans JP', sans-serif;
    --font-en: 'Inter', 'Roboto Mono', sans-serif;

    /* Spacing & Utilities */
    --section-spacing: 120px;
    --transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Faster, direct base */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    /* 固定ヘッダーの高さ分を考慮 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-frost);
    color: var(--color-dark);
    font-family: var(--font-ja);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Glassmorphism Utility */
.glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(74, 85, 104, 0.05);
}

/* Engineering Grid Background */
.grid-bg {
    background-image:
        linear-gradient(to right, rgba(74, 85, 104, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(74, 85, 104, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    background-color: var(--color-frost);
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: 0.05em;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

/* Scroll Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 15px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: transparent;
    /* 初期は背景なし */
    backdrop-filter: none;
    border-bottom: 1px solid transparent;
    transition: all 0.5s ease;
    /* スムーズに切り替え */
}

header.scrolled {
    background: rgba(255, 255, 255, 0.85);
    /* 透過度を少し高めに設定（透かして見えるように） */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(74, 85, 104, 0.1);
    padding: 10px 50px;
    /* スクロール時に少し高さを抑える */
}

.logo {
    height: 40px;
    width: auto;
    display: block;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-left: auto;
    margin-right: 40px;
}

.nav-links a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    position: relative;
}

.nav-links a .en {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    /* 初期は白（ヒーロー画像用） */
    font-family: var(--font-en);
    letter-spacing: 0.05em;
    transition: var(--transition);
    margin-top: 10px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    /* 画像上での視認性向上 */
    /* ヒーロー画像が色付くタイミングで元の色に戻す */
    animation: navEnToDark 1.5s forwards;
    animation-delay: 3.2s;
}

@keyframes navEnToDark {
    0% {
        color: #fff;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    }

    100% {
        color: var(--color-dark);
        text-shadow: none;
    }
}

.nav-links a:hover .en {
    color: var(--color-primary) !important;
}

.nav-links a .ja {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    /* 初期は薄い白 */
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-top: 0px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    /* ヒーロー画像が色付くタイミングで元の色に戻す */
    animation: navJaToDark 1.5s forwards;
    animation-delay: 3.2s;
}

@keyframes navJaToDark {
    0% {
        color: rgba(255, 255, 255, 0.8);
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    }

    100% {
        color: var(--color-accent);
        text-shadow: none;
    }
}

/* スクロール時の色変更 */
header.scrolled .nav-links a .en {
    color: var(--color-dark);
    text-shadow: none;
}

header.scrolled .nav-links a .ja {
    color: var(--color-accent);
    text-shadow: none;
}

/* Hamburger Toggle */
.hamburger-toggle {
    display: none;
    /* 初期は非表示 */
    width: 60px;
    height: 60px;
    cursor: pointer;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.hamburger-circle {
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.hamburger-circle span {
    width: 22px;
    height: 2px;
    background-color: var(--color-primary);
    /* 赤い線 */
    display: block;
    transition: var(--transition);
}

/* スクロールしていない時（ヒーロー画像上）の円のスタイル調整 */
header:not(.scrolled) .hamburger-circle {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

header:not(.scrolled) .hamburger-circle span {
    background-color: #fff;
    /* ハンバーガーの線も白に */
    animation: hamburgerToPrimary 1.5s forwards;
    animation-delay: 3.2s;
}

@keyframes hamburgerToPrimary {
    0% {
        background-color: #fff;
    }

    100% {
        background-color: var(--color-primary);
    }
}

/* Toggle Animation */
.hamburger-toggle.active .hamburger-circle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-toggle.active .hamburger-circle span:nth-child(2) {
    opacity: 0;
}

.hamburger-toggle.active .hamburger-circle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Nav Overlay (Backdrop) */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    /* 暗い背景 */
    backdrop-filter: blur(4px);
    z-index: 1500;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Nav Drawer */
.mobile-nav-drawer {
    position: absolute;
    top: 0;
    right: -80%;
    /* 最初は画面外（右） */
    width: 80%;
    /* 幅を80%に設定（半分くらいの印象） */
    height: 100%;
    background: #fff;
    padding: 80px 40px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

.mobile-nav-overlay.active .mobile-nav-drawer {
    right: 0;
    /* アクティブ時にスライドイン */
}

.mobile-nav-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 3rem;
    color: var(--color-primary);
    cursor: pointer;
    line-height: 1;
    padding: 10px;
}

.mobile-nav-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
}

.mobile-nav-link {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 15px;
}

.mobile-nav-link .ja {
    display: block;
    font-size: 0.8rem;
    color: var(--color-accent);
    font-weight: 500;
    margin-top: 5px;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    /* 右寄せに戻す */
    position: relative;
    padding: 0 5% 0 10%;
    /* 右側の余白を調整 */
    background-color: transparent;
    color: var(--color-bg);
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('/jrce_idx/image/draft_idx_fv.png') no-repeat center center;
    background-size: cover;
    z-index: -1;
    /* 初期は深めのモノクロ/コントラストで待機 */
    filter: grayscale(100%) brightness(0.4) contrast(1.2);
    animation: monochromeToColor 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-delay: 3.2s;
    /* テキスト後半の浮き上がりに合わせて開始 */
}

@keyframes monochromeToColor {
    0% {
        filter: grayscale(100%) brightness(0.4) contrast(1.2);
    }

    100% {
        filter: grayscale(0%) brightness(1) contrast(1);
    }
}

.hero-content {
    width: 80%;
    max-width: 500px;
    /* 元の幅に戻す */
    text-align: left;
    /* 左揃えに戻す */
    margin-top: 8%;
    /* 以前（25%）より大幅に上に配置 */
    z-index: 10;
}

.hero .btn {
    padding: 12px 28px;
    /* 少し小さめに */
    font-size: 0.9rem;
    min-width: 200px;
}

/* Hero Sequential Reveal Animation */
.hero-reveal {
    opacity: 0;
    transform: translateY(20px);
    animation: heroFadeUp 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    /* さらに低速化 */
    animation-delay: var(--d, 0s);
}

@keyframes heroFadeUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
        color: #111111;
    }

    40% {
        opacity: 1;
        transform: translateY(0);
        color: #111111;
    }

    100% {
        opacity: 1;
        transform: translateY(0);
        color: var(--color-primary);
    }
}

/* 他のテキストはアニメーションで色が変身しないように、初期状態をそれぞれの色に固定 */
.sub-catch.hero-reveal,
.desc.hero-reveal,
.cta-group.hero-reveal {
    animation-name: heroFadeUpStandard;
}

@keyframes heroFadeUpStandard {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 20px;
    color: #111111;
    /* 初期色を黒に */
    font-family: var(--font-en);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.9), 0 0 5px rgba(255, 255, 255, 1);
}

.hero p.sub-catch {
    font-size: 1.5rem;
    color: var(--color-dark);
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.95), 0 0 4px rgba(255, 255, 255, 1);
}

.hero p.desc {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-dark);
    font-weight: 500;
    margin-bottom: 40px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 3px rgba(255, 255, 255, 1);
}

.cta-group {
    display: flex;
    gap: 20px;
    justify-content: flex-start;
    /* 左寄せ */
}

.btn {
    padding: 16px 32px;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.05em;
    font-family: var(--font-en);
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg);
    border: 1px solid var(--color-primary);
    box-shadow: 0 4px 15px rgba(226, 0, 26, 0.2);
}

.btn-primary:hover {
    background-color: #5c5c5c;
    /* 濃いグレーに変更 */
    border-color: #4a4a4a;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-outline {
    border: 1px solid var(--color-dark);
    color: var(--color-dark);
    background: transparent;
}

.btn-outline:hover {
    background: var(--color-dark);
    color: var(--color-bg);
}

.btn-cta {
    background-color: #fff;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    box-shadow: 0 4px 15px rgba(226, 0, 26, 0.1);
}

.btn-cta:hover {
    background-color: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(226, 0, 26, 0.2);
}

/* Sections */
section {
    padding: var(--section-spacing) 10%;
}

/* Section Title styles moved below for color transition */

.section-subtitle {
    font-size: 0.95rem;
    color: var(--color-accent);
    font-weight: 500;
    letter-spacing: 0.1em;
    margin-bottom: 40px;
    /* 50pxから少し調整 */
}

.section-headline {
    font-size: 2.2rem;
    /* 少し大きく */
    margin-bottom: 25px;
    color: #111111;
    /* より深い黒寄りのグレー */
    font-weight: 700;
    line-height: 1.4;
    text-align: left;
}

.section-desc {
    font-size: 1.15rem;
    margin-bottom: 40px;
    line-height: 1.8;
    color: var(--color-accent);
    /* 一段落としたグレー */
    text-align: left;
}

/* Problem Section */
.problem {
    background: transparent;
    color: var(--color-dark);
}

.issue-intro {
    max-width: 1000px;
    margin-bottom: 40px;
}

.issue-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 60px;
}

.issue-conclusion {
    text-align: left;
    max-width: 1000px;
    /* 見出しの幅に合わせる */
    margin: 80px 0 0;
    padding: 0;
}

.issue-conclusion .section-desc {
    margin-bottom: 0;
}

.issue-card {
    background: var(--color-bg);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

    /* 【1. マウスを離した時（戻る時）】専用の設定 */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);

    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 【2. 最初にふわっと順番に出る時】専用の設定 */
/* activeが付いた瞬間だけ、ベース(0.4s)を上書きしてゆったり表示させます */
.issue-card.reveal.active {
    transition: all 1.0s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.issue-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(226, 0, 26, 0.3);

    /* 【3. マウスを乗せた時】専用の設定 */
    transition: all 0.3s ease;
    transition-delay: 0s !important;
    /* ラグ解消 */
}

.issue-card-content {
    padding: 20px;
    /* 25pxから少し縮小して内側の幅を確保 */
}

.issue-number {
    font-family: 'Roboto Mono', var(--font-en);
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--color-accent);
    letter-spacing: 0.1em;
    margin-bottom: 10px;
    display: block;
}

.issue-card h4 {
    font-size: 0.95rem;
    /* 1.0remから少し縮小 */
    line-height: 1.6;
    color: var(--color-dark);
}

/* Solution Phases */
.phases {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.phase-card {
    background: var(--color-bg);
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);

    /* 【1. マウスを離した時（戻る時）】 */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 【2. 最初にふわっと順番に出る時】 */
.phase-card.reveal.active {
    transition: all 1.0s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.phase-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(226, 0, 26, 0.3);

    /* 【3. マウスを乗せた時】 */
    transition: all 0.3s ease;
    transition-delay: 0s !important;
}

.phase-card-content {
    padding: 30px;
}

.phase-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    margin-bottom: 0;
    border-radius: 0;
}

/* 重複した古いホバー設定を削除しました */

.phase-number {
    font-family: 'Roboto Mono', var(--font-en);
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--color-accent);
    letter-spacing: 0.1em;
    margin-bottom: 15px;
    display: block;
}

/* Strengths (Philosophy & Process) */
.strengths {
    background-color: #fbfaf8;
    background-image:
        linear-gradient(to right, rgba(74, 85, 104, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(74, 85, 104, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    padding: var(--section-spacing) 10%;
    position: relative;
    transition: background-color 1s ease;
    /* 背景色変化をスムーズに */
}

.strengths.active {
    background-color: #f4f1ea;
    /* 指定の色に変更 */
}

.philosophy-header {
    margin-bottom: 100px;
    display: flex;
    justify-content: flex-start;
    /* 左寄せに変更 */
}

.philosophy-content {
    max-width: 600px;
}

.philosophy-title {
    font-size: 2.2rem;
    /* セクション見出しとサイズを統一 */
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 30px;
    color: #111111;
    /* 他のセクションと統一した濃いグレー */
}

.philosophy-label {
    font-family: var(--font-en);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--color-accent);
    text-transform: uppercase;
    margin-bottom: 20px;
}

.philosophy-desc {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-accent);
    /* 他の説明文と統一 */
}

/* Process Diagram */
.process-diagram-container {
    position: relative;
    padding: 100px 0;
    max-width: 1000px;
    margin: 0 auto;
}

.s-line-marker {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background-color: var(--color-primary);
    border-radius: 50%;
    z-index: 2;
}

.process-s-line {
    position: absolute;
    top: 50px;
    left: 0;
    width: 100%;
    height: calc(100% - 100px);
    pointer-events: none;
    z-index: 1;
    overflow: visible;
    /* マーカーが切れないように */
}

.process-steps {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 150px;
}

.process-step {
    display: flex;
    align-items: center;
    width: 100%;
}

.step-left {
    flex-direction: row;
}

.step-right {
    flex-direction: row-reverse;
}

.step-visual {
    flex: 1;
    display: flex;
    justify-content: center;
}

.step-left .step-visual {
    justify-content: flex-end;
    padding-right: 60px;
}

.step-right .step-visual {
    justify-content: flex-start;
    padding-left: 60px;
}

.step-circle {
    width: 240px;
    height: 240px;
    background: var(--color-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 30px 60px rgba(204, 51, 51, 0.3);
    position: relative;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: default;
    flex-shrink: 0;
    /* flexbox内で縮小されないようにして、正円を保つ */
}

.step-circle:hover {
    transform: scale(1.05);
}

.step-circle::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent);
}

.step-icon {
    width: 100px;
    height: 100px;
    opacity: 0.9;
    z-index: 1;
}

.step-info {
    flex: 1;
}

.step-left .step-info {
    padding-left: 60px;
    text-align: left;
}

.step-right .step-info {
    padding-right: 60px;
    text-align: right;
}

.step-header {
    display: flex;
    align-items: baseline;
    gap: 20px;
    margin-bottom: 20px;
}

.step-right .step-header {
    justify-content: flex-end;
}

.step-number {
    font-size: 2rem;
    font-weight: 900;
    font-style: italic;
    color: #111111;
    border-bottom: 2px solid #111111;
    display: inline-block;
    padding-right: 15px;
    /* 斜め文字の見切れ防止 */
    transition: color 0.5s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.step-number.active {
    color: var(--color-primary) !important;
    border-color: var(--color-primary);
}

.step-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111111;
    /* 他の見出しと統一 */
}

.step-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--color-dark);
    max-width: 400px;
}

.step-right .step-text {
    margin-left: auto;
    text-align: left;
}

.process-footer {
    display: none;
    /* コンテンツ削除 */
}

.overflow-visible {
    overflow: visible !important;
}

@media (max-width: 768px) {
    .philosophy-header {
        justify-content: center;
        text-align: center;
    }

    .philosophy-desc {
        border-left: none;
        border-top: 3px solid var(--color-primary);
        padding: 20px 0 0;
    }

    .process-steps {
        gap: 80px;
    }

    .process-step {
        flex-direction: column !important;
        text-align: center !important;
    }

    .step-visual {
        padding: 0 !important;
        margin-bottom: 30px;
    }

    .step-info {
        padding: 0 !important;
    }

    .step-header {
        justify-content: center !important;
    }

    .step-text {
        margin: 0 auto !important;
    }

    .step-circle {
        width: 200px;
        height: 200px;
    }

    .step-icon {
        width: 80px;
        height: 80px;
    }

    .process-s-line,
    .s-line-marker {
        display: none;
    }
}

/* Case Study Grid (RESTORED) */
.case-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

/* Message Section with Inversion */
/* Message Section Styles */
.message {
    padding: 150px 10%;
    transition: background-color 0.8s ease, color 0.4s ease;
    background-color: transparent;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

/* Background Image Layer */
.message::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/jrce_idx/image/contact_image.png');
    background-size: cover;
    background-position: center;
    opacity: 0.35;
    /* 透過度 */
    z-index: -1;
    /* 最背面 */
    pointer-events: none;
}

/* Message Section Defaults */
.message h2,
.message strong {
    color: var(--color-primary);
}

.message p {
    color: var(--color-dark);
}

.cta-box h4 {
    color: var(--color-dark);
}

.cta-box p {
    color: #4A5568 !important;
    /* 明示的にグレーに設定 */
}

.cta-box li {
    color: var(--color-dark) !important;
}

/* Highlight Trigger Styles */
.highlight-text.to-red {
    display: inline-block;
    color: #111111;
    transition: color 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    transition-delay: 0.6s;
    vertical-align: bottom;
}

.highlight-text.to-red.active {
    color: var(--color-primary) !important;
}

/* Underline Highlight Animation */
.underline-highlight {
    position: relative;
    display: inline-block;
}

.underline-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1.5px;
    background: var(--color-primary);
    transition: width 0.4s ease;
}

.underline-highlight.active::after {
    width: 100%;
}

/* セクションタイトルのアニメーション設定（赤文字固定） */
.section-title {
    font-family: var(--font-en);
    font-size: 2.5rem;
    margin-bottom: 25px;
    position: relative;
    display: inline-block;
    color: var(--color-primary);
    /* 最初から赤に変更 */
    transition: color 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
    /* Changed to color transition */
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--color-primary);
}

.cta-check {
    color: var(--color-primary);
    margin-right: 10px;
}

/* CTA Box Base (White background always) */
.cta-box {
    background: #fff !important;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    color: var(--color-dark) !important;
    padding: 50px;
}

.cta-box h4 {
    color: var(--color-primary) !important;
    /* 常に赤に強制 */
}

.cta-box p,
.cta-box li {
    color: var(--color-dark) !important;
    /* 常にダークにして視認性を確保 */
}

/* Underline Animation (Standard) */
.underline-target {
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
}

.underline-target::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1.5px;
    /* 3pxから1.5pxへ */
    background: #fff;
    transition: width 0.6s ease;
}

/* Inversion Styles Override */
.message.inverted {
    background-color: var(--color-primary);
    color: #fff;
}

.message.inverted h2,
.message.inverted .underline-target,
.message.inverted strong,
.message.inverted p {
    color: #fff !important;
}

.message.inverted .underline-target::after {
    width: 100%;
    /* 反転セクション内で下線を引く */
}

.message.inverted .glass-card {
    background: #fff;
    border: none;
}

.message.inverted .cta-box p,
.message.inverted .cta-box li {
    color: var(--color-dark) !important;
}

.message.inverted .cta-box h4 {
    color: var(--color-primary) !important;
    /* インバート時も赤を維持 */
}

.message.inverted .cta-check {
    color: var(--color-primary) !important;
}

.message.inverted .btn-primary {
    background: var(--color-primary) !important;
    color: #fff !important;
    border-color: #fff !important;
}

.message.inverted .btn-primary:hover {
    background: #333 !important;
    border-color: #333 !important;
}

.case-card {
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    overflow: hidden;

    /* 【1. マウスを離した時（戻る時）】 */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* 【2. 最初にふわっと順番に出る時】 */
.case-card.reveal.active {
    transition: all 1.0s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.case-card:hover {
    transform: translateY(-10px);
    border-color: var(--color-primary);
    box-shadow: 0 20px 40px rgba(226, 0, 26, 0.3);

    /* 【3. マウスを乗せた時】 */
    transition: all 0.3s ease;
    transition-delay: 0s !important;
}

.case-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.case-card-content {
    padding: 30px;
}

/* 重複した古いホバー設定を削除しました */

/* Footer */
/* Footer Layout (Mega Menu) */
footer.site-footer {
    background: #0d0d0d;
    color: #fff;
    padding: 80px 5%;
    font-family: var(--font-ja);
    border-top: none;
    /* セクションの境界線を削除 */
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4列等間隔に配置 */
    grid-template-areas:
        "logo logo logo logo"
        "menu open link contact";
    gap: 60px 40px;
    /* ロゴとメニューの間隔を60px、列間を40px */
    max-width: 1400px;
    margin: 0 auto;
}

.footer-col {
    display: flex;
    flex-direction: column;
}

.footer-logo-wrapper {
    grid-area: logo;
}

.footer-col-menu {
    grid-area: menu;
}

.footer-col-open {
    grid-area: open;
}

.footer-col-link {
    grid-area: link;
}

.footer-col-contact {
    grid-area: contact;
}

.footer-logo {
    width: 100%;
    max-width: 180px;
    /* 引き伸ばされないよう最大幅を指定 */
    height: auto;
    margin-bottom: 0;
    /* gridのrow-gapで間隔を取るため0に */
    display: block;
    filter: brightness(0) invert(1);
}

.footer-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    /* 10pxから大幅に短縮 */
    margin-bottom: 20px;
    /* 余白を調整 */
    position: relative;
}

/* 下線要素（::after）を削除しました */

.footer-heading .en {
    font-size: 1.25rem;
    /* 少し大きく */
    font-weight: 700;
    color: #ffffff;
    /* 白に固定 */
    font-family: var(--font-en);
    letter-spacing: 0.05em;
}

.footer-heading .ja {
    font-size: 0.75rem;
    color: #888;
    font-weight: 500;
    letter-spacing: 0.05em;
    margin-bottom: 0;
    /* 余分なマージンを解除 */
}

.footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-list li {
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.5;
}

.footer-list a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-list a:hover {
    color: #fff;
}

.footer-list .sub-link {
    color: #888;
}

.footer-list .contact-text {
    color: #ccc;
}

.mt-40 {
    margin-top: 40px;
}

.footer-bottom {
    margin-top: 60px;
    padding-top: 30px;
    border-top: none;
    /* コピーライト上の線を削除 */
    text-align: center;
}

.footer-bottom-inner {
    max-width: 1400px;
    margin: 0 auto;
}

.copyright {
    font-size: 0.8rem;
    color: #888;
    letter-spacing: 0.05em;
}

@media (max-width: 1024px) {

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-areas:
            "logo logo"
            "menu open"
            "link contact";
        gap: 40px;
    }

    .nav-links,
    .header-btn-area {
        display: none;
    }

    .hamburger-toggle {
        display: flex;
    }

    header {
        padding: 15px 30px;
    }
}

@media (max-width: 768px) {
    .hero {
        justify-content: center;
        padding: 100px 20px 0;
        height: auto;
        min-height: 100vh;
    }

    .hero::before {
        background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
            url('/jrce_idx/image/draft_idx_fv.png') no-repeat center center;
        background-size: cover;
        filter: grayscale(100%) brightness(0.4) contrast(1.2);
        animation: monochromeToColorMobile 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        animation-delay: 3.4s;
    }

    @keyframes monochromeToColorMobile {
        0% {
            filter: grayscale(100%) brightness(0.4) contrast(1.2);
        }

        100% {
            filter: grayscale(0%) brightness(1) contrast(1);
        }
    }

    .hero-content {
        text-align: center;
        width: 100%;
        max-width: 100%;
        margin-top: 20px;
    }

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 25px;
        /* Sharp 0.5px outline + original soft blur */
        text-shadow:
            0.5px 0.5px 0 #fff, -0.5px -0.5px 0 #fff,
            0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff,
            0 0 15px rgba(255, 255, 255, 0.9), 0 0 5px rgba(255, 255, 255, 1);
    }

    .hero .sub-catch {
        /* Sharp 0.5px outline + restored soft blur */
        text-shadow:
            0.5px 0.5px 0 #fff, -0.5px -0.5px 0 #fff,
            0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff,
            0 0 12px rgba(255, 255, 255, 0.9), 0 0 4px rgba(255, 255, 255, 1) !important;
    }

    .hero .desc {
        text-align: center;
        font-size: 1rem;
        /* Sharp 0.5px outline + restored soft blur */
        text-shadow:
            0.5px 0.5px 0 #fff, -0.5px -0.5px 0 #fff,
            0.5px -0.5px 0 #fff, -0.5px 0.5px 0 #fff,
            0 0 10px rgba(255, 255, 255, 0.8), 0 0 3px rgba(255, 255, 255, 1) !important;
    }

    .btn-outline {
        background: #fff !important;
        /* Solid white instead of transparent */
        color: var(--color-dark) !important;
        border: 1px solid var(--color-dark);
    }

    .cta-group {
        justify-content: center;
        flex-direction: column;
        gap: 15px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .problem-grid {
        flex-direction: column;
        padding: 40px 20px;
    }

    .problem-text {
        width: 100%;
        padding: 0;
    }

    .problem-visual {
        width: 100%;
        margin-top: 20px;
    }

    .issue-conclusion {
        padding: 30px 20px;
        margin-top: 40px;
    }

    .issue-grid,
    .phases,
    .case-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "contact"
            "menu"
            "open"
            "link";
        gap: 40px;
    }

    header {
        padding: 20px;
    }
}
