/* =============================================
   CO-ARX - Main Stylesheet
   ============================================= */

body {
    font-family: 'Noto Sans JP', sans-serif;
}

/* ===== Reveal アニメーション ===== */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ===== ヘッダー ===== */
.nav-scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.header-text {
    color: #3a2510;
}
/* トップページ・スクロール前はナビを白文字に */
#main-header:not(.nav-scrolled) .header-text a,
#main-header:not(.nav-scrolled) .header-text {
    color: #ffffff;
}
#main-header:not(.nav-scrolled) .header-text a:hover {
    color: #FE4F00;
}

/* ヘッダーロゴ：スクロール前（暗背景）は白く、スクロール後（白背景）はカラーで表示 */
#main-header:not(.nav-scrolled) #header-logo-img {
    filter: brightness(0) invert(1);
}
#main-header:not(.nav-scrolled) #header-logo-text span {
    color: #ffffff;
}
#main-header.nav-scrolled #header-logo-img {
    filter: none;
}

/* ===== ビュー切り替え ===== */
/* display:none に animation を付けても発火しないため、
   active クラス付与時にアニメーションを適用する設計に変更 */
.view-section {
    display: none;
}
.view-section.active {
    display: block;
    animation: fadeIn 0.8s ease-out both;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== Splash Screen ===== */
#splash-screen {
    position: fixed;
    inset: 0;
    background: #0d0d0d;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.9s ease, visibility 0.9s ease;
    overflow: hidden;
}
#splash-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(254,79,0,0.15) 0%, transparent 65%);
    opacity: 0;
    transition: opacity 1.4s ease;
}
#splash-screen.glow::before {
    opacity: 1;
}
#splash-screen.hide {
    opacity: 0;
    visibility: hidden;
}
/* ロゴラッパー */
#splash-logo-wrap {
    position: relative;
    opacity: 0;
    transform: translateY(18px) scale(0.96);
    transition: opacity 0.9s ease, transform 0.9s ease;
}
#splash-logo-wrap.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
/* ロゴ本体：白→オレンジにfilterトランジション */
#splash-logo-white {
    display: block;
    width: 220px;
    /* 白 */
    filter: brightness(0) invert(1);
    transition: filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
/* colorizeクラスでオレンジ (#FE4F00) に変化 */
#splash-logo-wrap.colorize #splash-logo-white {
    filter: brightness(0) saturate(100%) invert(38%) sepia(96%) saturate(1200%) hue-rotate(5deg) brightness(105%);
}
/* グロースキャン：ロゴ上をオレンジの光が走る */
#splash-scan {
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254,79,0,0.35), transparent);
    pointer-events: none;
    opacity: 0;
}
#splash-logo-wrap.colorize #splash-scan {
    animation: splash-scan-move 0.9s ease 0.1s forwards;
}
@keyframes splash-scan-move {
    0%   { left: -60%; opacity: 1; }
    100% { left: 110%; opacity: 0.5; }
}
/* ラインアクセント */
#splash-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #FE4F00, transparent);
    margin-top: 28px;
    opacity: 0;
    transition: width 1.0s ease 0.5s, opacity 0.6s ease 0.5s;
}
#splash-screen.glow #splash-line {
    width: 140px;
    opacity: 0.7;
}

/* ===== ページヘッダー ===== */
.page-header {
    background-image: linear-gradient(135deg, #FE4F00 0%, #ffe4d6 100%);
    position: relative;
    overflow: hidden;
}
.page-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(#FFFFFF 0.2px, transparent 0.2px);
    background-size: 24px 24px;
    opacity: 0.3;
}

/* ===== ガラスパネル ===== */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ===== ディレイ ===== */
.delay-100 {
    transition-delay: 100ms;
    animation-delay: 100ms;
}
.delay-200 {
    transition-delay: 200ms;
    animation-delay: 200ms;
}

/* ===== その他ユーティリティ ===== */
.clip-path-diagonal {
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}


.arx-pattern {
    background-image: radial-gradient(#FFFFFF 0.2px, transparent 0.2px);
    background-size: 24px 24px;
}

/* ===== カーソルエフェクト ===== */
#custom-cursor {
    width: 12px;
    height: 12px;
    background: #FE4F00;
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}
#custom-cursor-ring {
    width: 40px;
    height: 40px;
    border: 2px solid #FE4F00;
    border-radius: 50%;
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 9998;
    transform: translate(-50%, -50%);
    transition: all 0.15s ease;
    opacity: 0.5;
}

/* ===== ページトランジション ===== */
#page-transition {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #FE4F00;
    z-index: 9000;
    transform: scaleY(0);
    transform-origin: bottom;
    pointer-events: none;
}
#page-transition.is-covering {
    transform-origin: bottom;
    animation: coverPage 0.5s cubic-bezier(0.65,0,0.35,1) forwards;
}
#page-transition.is-uncovering {
    transform-origin: top;
    animation: uncoverPage 0.5s cubic-bezier(0.65,0,0.35,1) 0.1s forwards;
}
@keyframes coverPage {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}
@keyframes uncoverPage {
    from { transform: scaleY(1); }
    to   { transform: scaleY(0); }
}

/* ===== テキストスライドイン ===== */
.text-slide-up {
    overflow: hidden;
    display: inline-block;
}
.text-slide-up span {
    display: inline-block;
    transform: translateY(110%);
    animation: slideUp 0.9s cubic-bezier(0.22,1,0.36,1) forwards;
}
@keyframes slideUp {
    to { transform: translateY(0); }
}
.text-slide-up span:nth-child(2) { animation-delay: 0.1s; }
.text-slide-up span:nth-child(3) { animation-delay: 0.2s; }

/* ===== 横スクロールテキスト ===== */
.marquee-track {
    display: flex;
    white-space: nowrap;
    animation: marquee 25s linear infinite;
}
.marquee-track-reverse {
    display: flex;
    white-space: nowrap;
    animation: marqueeReverse 25s linear infinite;
}
@keyframes marquee {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
@keyframes marqueeReverse {
    from { transform: translateX(-50%); }
    to   { transform: translateX(0); }
}

/* ===== ヒーロー画像ノイズ ===== */
.hero-noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
}

/* ===== 斜めライン背景 ===== */
.diagonal-lines {
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(254,79,0,0.04) 10px,
        rgba(254,79,0,0.04) 11px
    );
}

/* ===== カードホバー磁力エフェクト ===== */
.magnetic-card {
    transition: transform 0.3s cubic-bezier(0.22,1,0.36,1), box-shadow 0.3s ease;
}
.magnetic-card:hover {
    box-shadow: 0 30px 60px rgba(254,79,0,0.15);
}

/* ===== グリッドオーバーレイ ===== */
.grid-overlay {
    background-image:
        linear-gradient(rgba(254,79,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(254,79,0,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ===== ホバースライド効果 ===== */
.hover-slide {
    position: relative;
    overflow: hidden;
}
.hover-slide::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(254,79,0,0.08), transparent);
    transition: left 0.5s ease;
}
.hover-slide:hover::before { left: 100%; }

/* ===== Aboutページ 代表者カード ===== */
.ceo-card {
    background: #ffffff;
}

/* ===== Orbit Service Animation ===== */
.orbit-wrap {
    position: relative;
}
/* スマホ用代替グリッド: デスクトップでは非表示 */
.orbit-mobile-grid {
    display: none;
}
/* 中心：傾いた楕円グラデーション */
.orbit-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 210px;
    height: 130px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FE4F00 0%, rgba(254,79,0,0.55) 50%, rgba(254,130,0,0.18) 100%);
    transform: translate(-50%, -50%) rotate(-30deg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 80px rgba(254,79,0,0.35), 0 0 140px rgba(254,79,0,0.12);
    z-index: 10;
}
.orbit-center img {
    transform: rotate(30deg); /* 楕円の傾きを打ち消してロゴを正立 */
}
/* 衛星：JSで座標計算して配置 */
.orbit-satellite {
    position: absolute;
    width: 100px;
    height: 100px;
    z-index: 20;
}
.satellite-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12), 0 0 0 1px rgba(254,79,0,0.12);
    transition: box-shadow 0.3s, transform 0.3s;
}
.satellite-inner:hover {
    box-shadow: 0 8px 32px rgba(254,79,0,0.3), 0 0 0 1.5px rgba(254,79,0,0.5);
    transform: scale(1.08);
}

/* ===== Service Cards Marquee ===== */
@keyframes service-marquee {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.service-marquee-track {
    display: flex;
    width: max-content;
    animation: service-marquee 28s linear infinite;
}
.service-marquee-track:hover {
    animation-play-state: paused;
}

.service-marquee-set {
    display: flex;
    gap: 24px;
    padding: 0 12px;
}

.service-marquee-card {
    display: flex;
    flex-direction: column;
    width: 280px;
    min-height: 200px;
    background: #ffffff;
    border: 1px solid rgba(254, 79, 0, 0.18);
    border-top: 3px solid #FE4F00;
    border-radius: 0 0 12px 12px;
    padding: 24px 22px 20px;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s, transform 0.3s, border-color 0.3s;
    flex-shrink: 0;
}
.service-marquee-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(254,79,0,0.04) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.service-marquee-card:hover {
    box-shadow: 0 12px 40px rgba(254,79,0,0.18);
    transform: translateY(-4px);
    border-color: #FE4F00;
}
.service-marquee-card:hover::before {
    opacity: 1;
}

.service-marquee-num {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: #FE4F00;
    margin-bottom: 6px;
    display: block;
}
.service-marquee-en {
    font-size: 13px;
    font-weight: 700;
    color: #FE4F00;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    display: block;
}
.service-marquee-ja {
    font-size: 17px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 10px;
    display: block;
    line-height: 1.3;
}
.service-marquee-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.8;
    display: block;
    flex: 1;
}
.service-marquee-arrow {
    display: inline-block;
    margin-top: 14px;
    font-size: 11px;
    font-weight: 700;
    color: #FE4F00;
    letter-spacing: 0.15em;
    transition: letter-spacing 0.3s;
}
.service-marquee-card:hover .service-marquee-arrow {
    letter-spacing: 0.3em;
}

/* ===== スマホ専用モバイル最適化 ===== */
@media (max-width: 767px) {
    /* --- カスタムカーソル非表示 --- */
    #custom-cursor, #custom-cursor-ring { display: none; }

    /* --- サービスマーキー: スマホ対応 --- */
    .service-marquee-card { width: 230px; min-height: 180px; padding: 18px 16px 16px; }
    .service-marquee-track { animation-duration: 20s; }

    /* --- Orbit: スマホでも表示（縮小して収める） --- */
    .orbit-wrap {
        display: block;
        transform: scale(0.62);
        transform-origin: center top;
        margin-top: 0 !important;
        /* scale(0.62)で高さ460→285px、残り175px分を負マージンで相殺 */
        margin-bottom: -175px;
    }
    /* orbit親コンテナの高さをscale後に合わせる */
    .orbit-wrap ~ * { position: relative; }
    .orbit-mobile-grid { display: none; }

    /* --- Hero stats: px縮小 --- */
    #hero-stats .grid { grid-template-columns: repeat(3, 1fr); }
    #hero-stats .py-6 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
    #hero-stats .px-8 { padding-left: 0.5rem; padding-right: 0.5rem; }

    /* --- サービスタブ: px縮小 --- */
    .service-tab { padding: 0.75rem 0.875rem; font-size: 0.75rem; }

    /* --- whitespace-nowrap 解除 --- */
    .mobile-wrap { white-space: normal !important; }

    /* --- Footer border縮小 --- */
    footer { border-top-width: 4px; }

    /* --- ヘッダーメニューボタン タップ領域確保 --- */
    #mobile-menu-btn { padding: 8px; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }

    /* --- フッター: スマホ用シンプルレイアウト --- */
    footer .container > div:first-child {
        /* グリッドを1列に変更 */
        grid-template-columns: 1fr !important;
        gap: 0 !important;
        margin-bottom: 0 !important;
    }
    /* ロゴ・住所エリア: 下線区切り＋余白 */
    footer .container > div:first-child > div:first-child {
        padding-bottom: 20px;
        margin-bottom: 20px;
        border-bottom: 1px solid #e5e7eb;
    }
    /* ABOUT・SERVICE のサブメニュー（入れ子ul）は非表示 */
    footer li > ul { display: none; }
    /* ABOUT・SERVICE・OTHERを2列グリッドで横並び */
    footer .container > div:first-child > div:nth-child(2),
    footer .container > div:first-child > div:nth-child(3),
    footer .container > div:first-child > div:nth-child(4) {
        display: inline-block;
        width: calc(50% - 8px);
        vertical-align: top;
        padding: 16px 0 8px;
    }
    footer .container > div:first-child > div:nth-child(2) { margin-right: 16px; }
    /* CONTACTボタン: 全幅で目立たせる */
    footer .container > div:first-child > div:last-child {
        display: block !important;
        padding: 20px 0 24px;
        border-top: 1px solid #e5e7eb;
        margin-top: 8px;
    }
    footer .container > div:first-child > div:last-child a {
        display: block;
        text-align: center;
        width: 100%;
        padding: 14px;
        font-size: 0.875rem;
    }
    /* コピーライトエリア: 縦積みで中央揃え */
    footer .container > div:last-child {
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px;
        padding-top: 16px;
        text-align: center;
    }
    footer .container > div:last-child > div {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px !important;
        margin-top: 0 !important;
    }
}

/* ===== タブレット幅 orbit 対応 (768px〜1023px) ===== */
@media (min-width: 768px) and (max-width: 1023px) {
    .orbit-wrap {
        transform: scale(0.82);
        transform-origin: center top;
        margin-bottom: -60px;
    }
    .orbit-mobile-grid { display: none; }
}

/* ===== Serviceページ タブ ===== */
.service-tab {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}
.service-tab.active {
    color: #FE4F00;
}
.service-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 3px;
    background: #FE4F00;
}
/* service-panel も active 時にアニメーション */
.service-panel {
    display: none;
}
.service-panel.active {
    display: block;
    animation: fadeIn 0.5s ease both;
}

/* ===== カウントアップ ===== */
.countup { font-variant-numeric: tabular-nums; }

/* ===== ローディングライン ===== */
.loading-line {
    height: 3px;
    background: #FE4F00;
    transform-origin: left;
    animation: loadingBar 2s ease-in-out infinite;
}
@keyframes loadingBar {
    0%   { transform: scaleX(0); }
    50%  { transform: scaleX(1); }
    100% { transform: scaleX(0); transform-origin: right; }
}
