/* Tailwindの.invertクラスを無効化（テーマで別の目的で使用されているため） */
.invert {
    --tw-invert: none !important;
    filter: none !important;
}

:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --blue-accent: #2563eb;
    --sub-bg: #f5f7fa;
    --warm-bg: #faf9f6;
}

/* フロントページ用のスタイル（front-page.php使用時） */
body.home,
body.page-template-front-page {
    font-family: 'Noto Sans JP', sans-serif !important;
    color: var(--text-color) !important;
    background-color: var(--bg-color) !important;
    line-height: 1.85 !important;
    overflow-x: hidden !important;
    -webkit-font-smoothing: antialiased;
    padding: 0 !important;
    margin: 0 !important;
}

body:not(.home) .site .site-content {
    padding: inherit;
}

body:not(.home) .site .site-content .content-area {
    max-width: inherit;
    margin: inherit;
}

body .site {
    display: inherit;
}

body .site .site-header {
    position: fixed;
    z-index: 100;
}

.site-description {
    display: none;
}

.font-en { font-family: 'Montserrat', sans-serif; }
.font-mono { font-family: 'Space Mono', monospace; }

/* font-sizeはTailwindのtext-[clamp(...)]クラスで制御 */
.h-xl { line-height: 1.4; font-weight: 900; letter-spacing: -0.01em; }
.hero-title { text-shadow: 0 2px 8px rgba(255, 255, 255, 0.8), 0 4px 20px rgba(255, 255, 255, 0.5); }
.h-lg { line-height: 1.4; font-weight: 900; letter-spacing: -0.01em; }
.h-md { font-weight: 700; }

.line-mask { overflow: hidden; display: block; padding-bottom: 0.5em; margin-bottom: -0.4em; }

.section-padding { padding: clamp(100px, 15vw, 180px) 6vw; position: relative; z-index: 5; }
.section-padding-narrow { padding: clamp(80px, 10vw, 120px) 6vw; }

.glass-bg-white { background: rgba(255, 255, 255, 0.88); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.glass-bg-sub { background: rgba(245, 247, 250, 0.8); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.max-w-base { max-width: 1440px; width: 100%; margin: 0 auto; }

.hero-title .block { transform: translateY(135%); }
.hero-tag { opacity: 0; transform: translateY(15px); }
.hero-footer { opacity: 0; transform: translateY(20px); }
.hero-section { visibility: visible; }
.reveal-up { opacity: 0; transform: translateY(40px); }

#hero-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.hero-container { 
    position: relative; 
    min-height: 100vh; 
    min-height: 100dvh; /* Dynamic Viewport Height - アドレスバーを考慮 */
    display: flex; 
    align-items: center; 
    padding: 0 6vw; 
    z-index: 10; 
}
.img-box { border-radius: 4px; overflow: hidden; position: relative; background: #f0f0f0; }
.img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.8s ease; }

.split-section { 
    display: flex; align-items: center; width: 100vw; padding: 120px 0;
    background: rgba(250, 249, 246, 0.8); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    position: relative; z-index: 5;
}
.split-image-container { width: 45%; position: relative; overflow: hidden; }
.image-frame { width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; position: relative; }
.slide-track { display: flex; width: max-content; height: 100%; will-change: transform; }
.slide-item { width: 45vw; height: 100%; flex-shrink: 0; }
.slide-item img { width: 100%; height: 100%; object-fit: cover; }
.split-text-area { width: 55%; padding: 0 8vw 0 6vw; }

.service-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; min-height: 520px; }
.service-sub-grid { display: grid; grid-template-rows: 1fr 1fr; gap: 2rem; }
.full-link-card { position: relative; border-radius: 8px; overflow: hidden; background: #000; cursor: pointer; transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1); }
.full-link-card .bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.6; transition: transform 1s ease, opacity 0.4s ease; }
.full-link-card:hover .bg-img { transform: scale(1.1); opacity: 0.75; }
.full-link-card .content { position: relative; z-index: 10; padding: 2.5rem; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }

.works-section { 
    padding-top: 140px; overflow: hidden; border-top: 1px solid rgba(0,0,0,0.05);
    background: rgba(250, 249, 246, 0.8); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
    position: relative; z-index: 5;
}
.works-flex-container { display: flex; align-items: stretch; width: 100%; }
.works-nav-area { width: 32vw; min-width: 380px; padding: 0 4vw 0 6vw; display: flex; flex-direction: column; justify-content: center; flex-shrink: 0; background: transparent; z-index: 20; }
.works-slider-outer { flex-grow: 1; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
.works-slider-outer::-webkit-scrollbar { display: none; }
.works-track { display: flex; gap: 0; padding: 0; width: max-content; }

.works-card { position: relative; width: 440px; aspect-ratio: 3 / 4.5; overflow: hidden; background-color: #000; display: block; text-decoration: none; color: inherit; }
.works-card:hover { cursor: none; }
.works-card .card-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.75; transition: transform 1.2s cubic-bezier(0.23, 1, 0.32, 1); }
.works-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.3) 30%, transparent 100%); z-index: 5; pointer-events: none; }
.works-card .card-content { position: absolute; inset: 0; z-index: 10; padding: 3.5rem; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }

.view-badge { position: absolute; top: 0; left: 0; transform: translate(-50%, -50%) scale(0); width: 96px; height: 96px; background: rgba(0, 0, 0, 0.65); color: #fff; backdrop-filter: blur(8px); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Space Mono', monospace; font-weight: 800; font-size: 0.75rem; letter-spacing: 0.15em; z-index: 100; pointer-events: none; transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1); }
.works-card:hover .view-badge { transform: translate(-50%, -50%) scale(1); }
.slider-btn { width: 72px; height: 72px; border: 2px solid rgba(0,0,0,0.5); border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.slider-btn:hover { background: var(--blue-accent); color: #fff; border-color: var(--blue-accent); }

.news-list { border-top: 1px solid #eee; }
.news-item { display: grid; grid-template-columns: 180px 1fr; gap: 2rem; padding: 2.2rem 0; border-bottom: 1px solid #eee; transition: all 0.3s; cursor: pointer; text-decoration: none; color: inherit; }
.news-item:hover { color: var(--blue-accent); background: rgba(0,0,0,0.01); padding-left: 1.5rem; }
.news-date { font-family: 'Space Mono', monospace; color: #aaa; font-weight: 500; }
.news-title { font-weight: 700; font-size: 1.1rem; }

.closing-section { position: relative; background: #000; padding: clamp(140px, 18vw, 240px) 6vw; text-align: center; overflow: hidden; }
.closing-bg { position: absolute; inset: 0; z-index: 0; opacity: 0.45; pointer-events: none; }
.closing-bg img { width: 100%; height: 100%; object-fit: cover; }
.closing-content { position: relative; z-index: 10; color: #fff; }

.btn-white { background: #fff; color: #000; border-radius: 4px; font-weight: 700; display: inline-block; transition: all 0.3s; }
.btn-white:hover { background: var(--blue-accent); color: #fff; transform: translateY(-2px); }
.btn-primary { background: var(--text-color); color: #fff; padding: 1.2rem 3.5rem; border-radius: 4px; font-weight: 700; display: inline-block; transition: all 0.3s; }
.btn-primary:hover { background: var(--blue-accent); transform: scale(1.02); }

.grain-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 99; opacity: 0.04; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E"); }

.full-wide-message { width: 100vw; height: 65vh; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.parallax-bg { position: absolute; top: -20%; left: 0; width: 100%; height: 140%; background-size: cover; background-position: center; z-index: 0; filter: brightness(0.6); }

.hero-latest-news { position: absolute; bottom: 5vh; right: 6vw; z-index: 20; }
.hero-latest-news a { display: flex; align-items: center; gap: 1.5rem; padding: 1rem 1.5rem; background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 6px; border: 1px solid rgba(0, 0, 0, 0.06); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); text-decoration: none; max-width: 380px; }
.hero-latest-news a:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(37, 99, 235, 0.15); border-color: var(--blue-accent); }
.hero-latest-news .news-badge { flex-shrink: 0; font-family: 'Space Mono', monospace; font-size: 9px; font-weight: 700; letter-spacing: 0.15em; text-transform: uppercase; color: #fff; background: var(--blue-accent); padding: 0.4rem 0.7rem; border-radius: 3px; }
.hero-latest-news .news-inner { display: flex; flex-direction: column; gap: 0.25rem; }
.hero-latest-news .news-date-inline { font-family: 'Space Mono', monospace; font-size: 10px; color: #999; font-weight: 500; }
.hero-latest-news .news-title-inline { font-size: 13px; font-weight: 700; color: var(--text-color); line-height: 1.5; }
.hero-latest-news a:hover .news-title-inline { color: var(--blue-accent); }

footer#colophon {
    position: relative;
    background: rgba(245, 247, 250, 0.8);
    backdrop-filter: blur(5px);
}

/* ============================================
   Tablet (max-width: 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .split-section { flex-direction: column; padding: 0; }
    .split-image-container { width: 100%; padding: 0; }
    .image-frame { border-radius: 0; }
    .slide-item { width: 100vw; }
    .split-text-area { width: 100%; padding: 5rem 8vw; }
    .service-grid { grid-template-columns: 1fr; min-height: auto; }
    .works-flex-container { flex-direction: column; }
    .works-nav-area { width: 100%; min-width: auto; padding: 80px 6vw 0; background: transparent; }
    .works-track { padding: 20px 0 100px; }
    .works-card { width: 85vw; cursor: pointer; }
    .view-badge { display: none; }
    .news-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* ============================================
   Mobile (max-width: 768px)
   ============================================ */
@media (max-width: 768px) {
    .hero-container {
        min-height: 100dvh; /* スマホ時もアドレスバーを考慮 */
        padding-top: env(safe-area-inset-top, 0); /* iOSの安全エリア対応 */
        padding-bottom: env(safe-area-inset-bottom, 0);
    }
    .hero-latest-news { bottom: 3dvh; right: 4vw; left: 4vw; }
    .hero-latest-news a { max-width: 100%; padding: 0.75rem 1rem; gap: 1rem; }
    .hero-latest-news .news-badge { font-size: 8px; padding: 0.3rem 0.5rem; }
    .hero-latest-news .news-date-inline { font-size: 9px; }
    .hero-latest-news .news-title-inline { font-size: 11px; line-height: 1.4; }
    .works-section { padding-top: 80px; }
    .works-card { width: 65vw; aspect-ratio: 3 / 4; }
    .works-card .card-content {
        padding: 2rem;
    }
    
    /* スマホ時のスワイプでカード単位にスナップ */
    .works-slider-outer {
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }
    .works-card {
        scroll-snap-align: center;
        scroll-snap-stop: always;
    }
}
