/* ===== BASE STYLES ===== */
:root {
    --header-height: 80px;
    --header-blur: 8px;
    --header-bg: rgba(255, 255, 255, 0.15);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

html, body {
    font-size: 16px !important;
    margin: 0;
    padding: 0;
}

body {
    font-size: 1rem !important;
    line-height: 1.7 !important;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans JP', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif !important;
    /* 日本語テキストの自然な改行設定 */
    word-break: normal;
    line-break: auto;
    overflow-wrap: break-word;
}

/* Fallback for basic grid layout when Tailwind doesn't load */
.grid {
    display: grid;
}

.grid-cols-1 {
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gap-6 {
    gap: 1.5rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-20 {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.text-center {
    text-align: center;
}

.relative {
    position: relative;
}

/* ===== LAYOUT STYLES ===== */
main {
    margin-top: 0;
}

header {
    height: var(--header-height);
}

/* ===== HEADER STYLES ===== */
.nav-blur {
    backdrop-filter: blur(var(--header-blur));
    background-color: var(--header-bg);
}

/* ヘッダー内のコンテナを中央揃えにするユーティリティ */
header nav {
    height: 100%;
    display: flex;
    align-items: center; /* 縦中央に配置 */
}

/* ロゴと社名のサイズ調整 */
header a img {
    width: 56px; /* ロゴを少し大きく */
    height: 56px;
}
header a span {
    line-height: 1;
    font-size: 1.125rem; /* 少し大きめの社名 */
}

/* ナビリンクの高さを揃える */
.space-x-8 a {
    display: inline-flex;
    align-items: center;
    height: var(--header-height);
    padding-top: 0;
    padding-bottom: 0;
}

/* ===== TYPOGRAPHY & TEXT HANDLING ===== */
/* 日本語テキストの自然な改行設定 */
p, div, span, h1, h2, h3, h4, h5, h6, li {
    word-break: normal;
    line-break: auto;
    overflow-wrap: break-word;
    hanging-punctuation: allow-end;
}

/* ===== UTILITY CLASSES ===== */
.brand-color { color: #0E1C36; }
.text-indigo-600 { color: #0E1C36; }
.text-custom-blue { color: #0E1C36; }
.text-shadow-xl { text-shadow: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06); }

.img-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.img-hover-effect:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

/* ===== BUTTON STYLES ===== */
.service-btn, 
.btn-primary, 
.contact-btn {
    background-color: #0E1C36;
    border-radius: 5px !important;
    padding: 1rem 5.5rem !important;
}

.service-btn:hover, 
.btn-primary:hover, 
.contact-btn:hover {
    background-color: #2C3E50 !important;
}
.contact-btn:hover {
    background-color: #2C3E50 !important;
}

/* ===== ANIMATIONS & EFFECTS ===== */
.video-overlay {
    background: rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.animated-heading {
    display: flex;
    justify-content: center;
    position: relative;
    overflow: visible;
}
.animated-heading span {
    display: inline-block;
    transform: none;
    opacity: 1;
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}
.js-enabled .animated-heading {
    overflow: hidden; /* アニメーション用に隠す */
}
.js-enabled .animated-heading span {
    transform: translateY(100%); /* 初期位置を下へずらす */
    opacity: 0;
}
.js-enabled .animated-heading.visible span {
    transform: translateY(0); /* アニメーション後の位置 */
    opacity: 1;
}

/* h2の背面装飾 - 複数の方法で確実に表示 */
.decorated-bg::before,
div.decorated-bg::before {
    content: attr(data-text) !important;
    position: absolute !important;
    top: -0.5em !important;
    left: 50% !important;
    transform: translateX(-70%) !important;
    font-size: 5rem !important;
    color: #edf2f7 !important;
    opacity: 0.4 !important;
    z-index: -1 !important;
    font-weight: bold !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    font-family: inherit !important;
    display: block !important;
}

/* 代替手段 - データ属性がある要素に直接スタイル */
[data-text]::before {
    content: attr(data-text) !important;
    position: absolute !important;
    top: -0.5em !important;
    left: 50% !important;
    transform: translateX(-70%) !important;
    font-size: 5rem !important;
    color: rgba(237, 242, 247, 0.4) !important;
    z-index: -1 !important;
    font-weight: bold !important;
    pointer-events: none !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    display: block !important;
}

/* レスポンシブ対応 */
@media (min-width: 768px) {
    .decorated-bg::before,
    div.decorated-bg::before,
    [data-text]::before {
        font-size: 7rem !important;
        top: -0.6em !important;
        transform: translateX(-65%) !important;
    }
}



/* 各セクションのふわっと表示アニメーション */
.fade-in-section {
    /* Default visible when JS is disabled */
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: opacity 1s ease-out, transform 1s ease-out;
    display: block !important;
}
/* When JS is enabled, start sections hidden and reveal with .fade-in-visible */
.js-enabled .fade-in-section {
    opacity: 0;
    transform: translateY(20px);
}
.js-enabled .fade-in-section.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* サービスカードのレイアウト - 最優先で表示 */
.service-card,
div.service-card,
section .service-card {
    opacity: 1 !important;
    transform: none !important;
    transition: opacity 1s ease-out, transform 1s ease-out;
    display: flex !important;
    flex-direction: column !important;
    visibility: visible !important;
    position: relative !important;
}

/* JSが無効な場合のフォールバック表示 */
.service-card {
    display: flex !important;
    visibility: visible !important;
    /* opacityはJSが無効時のみ1、JS有効時は後続のルールで制御 */
}

/* JSが無効な場合は確実に表示 */
body:not(.js-enabled) .service-card {
    opacity: 1 !important;
}

/* When JS is enabled, start cards hidden and let IntersectionObserver reveal them - デスクトップのみ */
@media (min-width: 769px) {
    html body.js-enabled .service-card:not(.card-visible) {
        opacity: 0 !important;
        transform: translateY(30px) !important;
        transition: opacity 0.6s ease-out, transform 0.6s ease-out !important;
    }

    html body.js-enabled .service-card.card-visible {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* スマホでは常に表示（アニメーション無効） */
@media (max-width: 768px) {
    .service-card,
    .js-enabled .service-card {
        opacity: 1 !important;
        transform: translateY(0) !important;
        visibility: visible !important;
        display: flex !important;
    }
}

/* Make images inside service cards scale without cropping on small screens */
.service-card img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* ===== SERVICE CARDS ===== */
.service-title {
    line-height: 1.3;
    position: relative;
    padding-left: 16px;
}

.service-title::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: 4px;
    width: 6px;
    height: 26px;
    background: linear-gradient(180deg, #fc4783 0%, #fc478380 100%);
    border-radius: 1px;
}

.service-card img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

/* Service card responsive layout */
@media (max-width: 640px) {
    .service-title {
        font-size: 1.25rem !important;
        margin-bottom: 1rem !important;
    }
    
    .service-card {
        padding: 2rem !important;
        height: auto !important;
    }
    
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-auto-rows: auto !important;
    }
}

@media (min-width: 641px) and (max-width: 767px) {
    .service-title {
        font-size: 1.375rem !important;
    }
    
    .service-card {
        padding: 2.5rem !important;
        height: auto !important;
    }
    
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-auto-rows: auto !important;
    }
}

@media (min-width: 768px) {
    .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-auto-rows: 1fr !important;
    }
    
    .service-card {
        height: 100% !important;
    }
}

/* ヘッダー固定分のオフセットを付与するユーティリティ
   固定ヘッダー（--header-height）分の余白を確保し、
   さらに見た目の余白を加えます。 */
.header-offset {
    padding-top: calc(var(--header-height) + 1rem);
}

/* Privacy box used on contact page */
.privacy-box {
    border: 1px solid #e5e7eb; /* gray-200 */
    background: #ffffff;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0 0 rgba(0,0,0,0);
    /* Desktop: allow the box to grow to fit content (no clipping) */
    height: auto;
    max-height: none;
    overflow: visible;
}
.privacy-box p, .privacy-box li {
    color: #374151; /* gray-700 */
    line-height: 1.4;
    font-size: 0.8rem; /* さらに小さくして全て入るように */
}
.privacy-consent {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}
.hcaptcha-mock {
    display: flex;
    justify-content: center;
    gap: 1rem;
    align-items: center;
    margin-top: 1rem;
}
.hcaptcha-widget {
    /* Remove outer frame/scroll — let the hCaptcha iframe/widget manage its own sizing */
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: none;
    background: transparent;
    font-size: 0.85rem;
}
.hcaptcha-box {
    display:flex;
    align-items:center;
    gap:0.75rem;
    border:1px solid #e5e7eb;
    padding:0.6rem 0.9rem;
    border-radius:0.5rem;
    background:#fafafa;
}
.hcaptcha-checkbox {
    width:28px;
    height:28px;
    border:1px solid #cbd5e1;
    border-radius:4px;
    display:inline-block;
}
.hcaptcha-label {
    font-size:0.95rem;
    color:#374151;
}
.hcaptcha-logo {
    width:86px;
    height:40px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,#06b6d4,#3b82f6);
    color:#fff;
    font-weight:600;
    border-radius:6px;
    font-size:12px;
}

/* ===== RESPONSIVE TYPOGRAPHY ===== */
@media (max-width: 640px) {
    body { line-height: 1.6; }
    
    .text-5xl { font-size: 2.25rem; }
    .md\:text-7xl { font-size: 2.5rem; }
    .text-4xl { font-size: 1.5rem; }
    .text-2xl { font-size: 1.125rem; }
    .text-xl { font-size: 1rem; }
    .text-lg { font-size: 0.9375rem; }
    
    .space-x-8 { gap: 0.75rem; }
    .space-x-8 a { font-size: 0.95rem; }
    
    :root { --header-height: 64px; }
    header { height: var(--header-height); }
    .hamburger { width: 48px; height: 48px; }

    /* On small screens, allow privacy box to scroll internally while keeping its fixed height */
    .privacy-box {
        /* fixed smaller height on mobile with internal scrolling */
        height: 180px;
        max-height: 180px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Ensure hCaptcha widget has no outer frame and does not clip on small screens */
    .hcaptcha-widget {
        height: auto;
        max-height: none;
        overflow: visible;
    }
}

/* Center the hCaptcha widget area and its contents */
.hcaptcha-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.75rem;
}
.hcaptcha-widget {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Placeholder (淡い凡例) styling for inputs and textarea */
input::placeholder,
textarea::placeholder {
    color: #e5e7eb; /* 薄いグレー */
    opacity: 1; /* ブラウザデフォルトで薄くなるのを防ぐ */
}

/* Optional: slightly muted background for inputs like the screenshot */
input[type="text"],
input[type="email"],
input[type="tel"],
textarea {
    background-color: #f3f4f6; /* bg-gray-100 */
}

/* Privacy page specific tweaks */
#privacy-content {
    /* add 50px spacing at the top of the privacy content area */
    padding-top: 50px;
}

#privacy-content h2 {
    /* reduce size of the four section headings */
    font-size: 1rem; /* smaller than text-xl */
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* モバイルナビ（ハンバーガーメニュー） */
.hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px; /* サイズを小さく */
    height: 44px; /* サイズを小さく */
    border-radius: 8px; /* 角丸も少し小さく */
    background: rgba(255,255,255,0.95); /* 白背景に変更 */
    backdrop-filter: blur(6px);
    border: 1px solid rgba(14,28,54,0.1); /* 薄い境界線追加 */
    position: relative; /* 元の相対位置に戻す */
    z-index: 9999;
    color: #0E1C36; /* 黒系のアイコン色 */
    transition: background-color 180ms ease, transform 160ms ease, box-shadow 180ms ease;
}

.hamburger:hover {
    transform: translateY(-1px);
    background: rgba(255,255,255,1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ハンバーガーアイコンの変形アニメーション */
.hamburger {
    overflow: hidden;
}

.hamburger svg {
    position: absolute;
    top: 50%;
    left: 50%;
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                visibility 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hamburger #hamburger-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

.hamburger #hamburger-close {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) rotate(-90deg) scale(0.8);
}

/* メニューが開いている時の状態 */
.hamburger.menu-open #hamburger-open {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) rotate(45deg) scale(0.8);
}

.hamburger.menu-open #hamburger-close {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) rotate(0deg) scale(1);
}

/* 左から線が入るホバーアニメ（グロナビ用） */
.space-x-8 a, .hamburger {
    position: relative;
}
.space-x-8 a::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: calc(50% - 0.8em);
    height: 0.5px;
    width: 0;
    background: #0E1C36;
    transition: width 600ms ease;
}
.space-x-8 a:hover::before {
    width: 100%;
}
/* モバイルメニュー（オーバーレイ） */
.mobile-nav {
    position: fixed;
    top: var(--header-height); /* header 下から表示 */
    right: 0; /* 右揃えに変更 */
    width: 280px; /* 幅を固定してコンパクトに */
    max-width: 85vw; /* 画面幅の85%まで */
    background: rgba(255,255,255,0.1); /* さらに透明に */
    backdrop-filter: blur(25px); /* 強いブラー維持 */
    box-shadow: 
        -8px 15px 40px rgba(0,0,0,0.12),
        -2px 5px 15px rgba(0,0,0,0.08);
    border-radius: 5px 0 0 5px; /* シンプルな角丸 */
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateX(100%); /* 右から入るアニメーション */
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 600ms ease, transform 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.mobile-nav.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(0); /* スライドイン */
}
.mobile-nav a {
    display: block;
    padding: 16px 24px;
    margin: 4px 8px; /* スライド内に収めるマージン */
    color: #000;
    font-size: 18px;
    font-weight: 500;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    transition: background-color 600ms ease, color 600ms ease, transform 600ms ease;
}
.mobile-nav a:hover,
.mobile-nav a:active {
    background: 
        linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%),
        rgba(14,28,54,0.03);
    backdrop-filter: blur(10px);
    border-radius: 5px;
    color: #0E1C36;
    transform: translateX(0); /* 移動なしでスライド内に収める */
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); /* 内側に収まる影 */
}
.mobile-nav a:last-child {
    border-bottom: none; /* 最後の項目は区切り線なし */
}

/* 背景のオーバーレイ（メニュー外をタップで閉じる） */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: opacity 600ms cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 600ms ease;
}
.mobile-overlay.open {
    opacity: 1;
    visibility: visible;
}

/* ヘッダーが開いているときの視覚強化 */
.nav-open {
    box-shadow: 0 20px 40px rgba(0,0,0,0.15) !important;
}

/* トップ動画をレスポンシブに小さく表示（画面サイズに合わせる） */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}
.video-background iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
    min-height: 120px;
}

/* 小さい画面では動画セクションの高さを抑える */
@media (max-width: 640px) {
    section.relative.w-full.h-\[100vh\] {
        height: 70vh;
    }
    .video-background iframe {
        min-height: 140px;
    }
}

/* レスポンシブな動画コンテナ（アスペクト比を保つ） */
.responsive-video {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 アスペクト比 */
    overflow: hidden;
}
.responsive-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    pointer-events: none; /* ダブルクリック等のポインターイベントを無効化 */
}

/* heroセクションの高さをデバイスに応じて調整 */
.hero-section {
    min-height: 60vh;
}
@media (max-width: 640px) {
    .hero-section {
        min-height: 40vh;
    }
    .responsive-video {
        padding-top: 56.25%;
    }
}

/* 共通コンテナのテキスト改行設定 */
.container p {
    word-break: normal;
    line-break: auto;
    overflow-wrap: break-word;
}

@media (min-width: 641px) {
    .text-5xl { font-size: 3rem; }
    .text-2xl { font-size: 1.75rem; }
    .text-xl { font-size: 1.25rem; }
    .text-lg { font-size: 1.125rem; }
}

@media (min-width: 768px) {
    .md\:text-7xl { font-size: 4rem; }
}

/* animated-heading は個別調整が必要ならここでオーバーライドできます */

/* リスト項目のバレットポイントを中央揃えにする */
ul li.relative span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    line-height: 1;
}

