/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary-color: #45EEFF;
    --primary-dark: #00B8D4;
    --text-dark: #f0f0f0;
    --text-light: #b0b0b0;
    --bg-light: #1a1a1a;
    --bg-dark: #000000;
    --white: #ffffff;
    --black: #000000;
    --gray-100: #1a1a1a;
    --gray-200: #2a2a2a;
    --gray-300: #404040;
    --gray-400: #606060;
    --gray-500: #808080;
    --gray-600: #a0a0a0;
    --gray-700: #c0c0c0;
    --gray-800: #e0e0e0;
    
    /* Typography */
    --font-primary: 'Inter', 'Noto Sans JP', sans-serif;
    --font-weight-light: 300;
    --font-weight-regular: 400;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 5rem;
    --spacing-3xl: 8rem;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-primary);
    color: var(--text-dark);
    line-height: 1.6;
    font-weight: var(--font-weight-regular);
    background-color: var(--black);
    overflow-x: hidden;
    max-width: 100vw;
    position: relative;
    /* 動的に計測するヘッダー高を使用（フォールバック80px） */
    padding-top: var(--header-height, 80px);
}

/* FVをヘッダー裏から開始させたいページ用（ページ単位で上パディングを無効化） */
body.hero-under-header {
    padding-top: 0 !important;
}

/* Full screen gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(270deg, 
        #472C00 0%, 
        #6C4600 0.48%, 
        #1C0000 8.75%, 
        #080000 14.48%, 
        #000000 27.4%, 
        #000000 42.8%, 
        #000000 57.2%, 
        #000000 72.6%, 
        #000000 85.52%, 
        #000000 91.25%, 
        #0F082B 94.7%, 
        #0C2C37 100%);
    opacity: 0.92;
    z-index: -2;
    pointer-events: none;
}

/* Wave pattern overlay */
body::after {
    content: '';
    position: absolute; /* ページコンテンツと一緒にスクロール */
    top: 100vh; /* FVの下から開始 */
    left: 50%; /* 中央から配置 */
    transform: translateX(-50%); /* 中央揃え */
    width: 100%; /* ビューポート幅に合わせる */
    max-width: 1920px; /* 最大幅を制限 */
    bottom: 0;
    background: url('../images/wave-pattern.svg') top center no-repeat;
    background-size: 100% auto; /* 幅100%で高さは自動調整 */
    z-index: -1;
    pointer-events: none;
    opacity: 1;
}


a {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-fast);
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-weight-bold);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: var(--font-weight-black);
}

h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
    font-size: clamp(1.5rem, 3vw, 2rem);
}

p {
    margin-bottom: var(--spacing-sm);
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(69, 238, 255, 0.1);
    transition: all var(--transition-normal);
}

/* ヘッダー専用のコンテナ設定 - 全幅対応 */
.site-header .container {
    max-width: 100%;
    padding: 0 60px;
}

/* 常に表示。hidden クラスが付いても移動させない */
.site-header.hidden {
    transform: none !important;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
}

.logo a {
    color: var(--text-dark);
    display: flex;
    align-items: center;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
    align-items: center;
}

.main-nav a {
    font-weight: var(--font-weight-medium);
    position: relative;
    padding: var(--spacing-xs) 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition-normal);
}

.main-nav a:hover::after {
    width: 100%;
}

.contact-btn {
    background: transparent;
    padding: 0;
    border: none;
    border-radius: 0;
    font-weight: var(--font-weight-bold);
    min-width: 120px;
    text-align: center;
    display: inline-block;
    transition: all 0.3s ease;
}

/* PC display only - show image */
@media (min-width: 769px) {
    .contact-btn {
        background-image: url('../images/ボタン系/CONTACT_BUTTON@3x.png');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        width: 120px;
        height: 40px;
        text-indent: -9999px; /* Hide text */
        overflow: hidden;
    }
}

/* Mobile display - keep text */
@media (max-width: 768px) {
    .contact-btn {
        background: transparent;
        color: #000000 !important;
        padding: var(--spacing-xs) var(--spacing-lg);
        border-radius: 4px;
        text-indent: 0;
    }
}

/* Remove blue underline from CONTACT button */
.contact-btn::after {
    display: none !important;
}

.contact-btn:hover {
    transform: translateY(-2px);
}

/* PC display - enhanced hover animation */
@media (min-width: 769px) {
    .contact-btn:hover {
        transform: translateY(-3px);
        filter: brightness(1.1);
        transition: all 0.3s ease;
    }
}

@media (max-width: 768px) {
    .contact-btn:hover {
        background: transparent;
        color: #000000 !important;
    }
}

/* Dropdown Menu */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--gray-100);
    box-shadow: 0 8px 24px rgba(69, 238, 255, 0.2);
    border-radius: 8px;
    padding: 0;
    width: 320px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    margin-top: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    align-items: stretch; /* ensure items use full width */
    gap: 0 !important; /* override .main-nav ul gap */
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    margin-top: var(--spacing-xs);
}

.dropdown-menu li {
    list-style: none;
}

.dropdown-menu li:first-child a {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu li:last-child a {
    border-radius: 0 0 8px 8px;
}

.dropdown-menu a {
    display: block;
    padding: 0;
    width: 100%;
    transition: all var(--transition-fast);
    font-size: 0.95rem;
    text-align: left;
}

.dropdown-menu a:hover {
    background: var(--gray-200);
    color: var(--primary-color);
}

.dropdown-menu .menu-item-title {
    font-weight: var(--font-weight-bold);
    margin-bottom: 0.25rem;
    font-size: 1rem;
    text-align: left;
}

.dropdown-menu .menu-item-desc {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.4;
    text-align: left;
    white-space: normal;
}

/* Dropdown Menu with Logo */
.menu-item-content {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
}

.menu-item-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    justify-self: start;
}

.menu-item-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
}

/* Breadcrumb in header */
.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-light);
}

.header-breadcrumb .separator {
    color: var(--gray-400);
}

.header-breadcrumb a {
    color: var(--text-light);
}

.header-breadcrumb a:hover {
    color: var(--primary-color);
}

.header-breadcrumb .current {
    color: var(--text-dark);
    font-weight: var(--font-weight-medium);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-dark);
    margin: 5px 0;
    transition: all var(--transition-fast);
}

/* Fixed CTA Buttons */
.fixed-cta {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    transition: all var(--transition-normal);
    position: relative;
    padding: 0;
    border: none;
    text-decoration: none;
}

.cta-button img {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
}

/* PC display - larger floating buttons */
@media (min-width: 769px) {
    .cta-button img {
        max-width: 220px;  /* Increased from 180px */
    }
}

.cta-button.office-tour {
    color: #fff;
}

.cta-button.contact {
    color: #fff;
}

.cta-button.entry {
    color: #fff;
}

.cta-button span {
    white-space: nowrap;
    font-size: 1.25rem;
    font-weight: 500;
    color: #fff;
}

.cta-button:hover {
    transform: translateY(-2px);
    color: var(--primary-color);
}

.cta-button.office-tour:hover {
    color: var(--primary-color);
}

.cta-button.contact:hover {
    color: var(--primary-color);
}

.cta-button.entry:hover {
    color: var(--primary-color);
}

/* Page Hero - Common styles for all pages */
.page-hero {
    background: transparent;
    padding: var(--spacing-3xl) 0;
    text-align: center;
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    margin-top: 0;
}

.page-title {
    font-size: clamp(3rem, 6vw, 5rem);
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 1;
}

.page-subtitle {
    font-size: 1.5rem;
    font-weight: var(--font-weight-light);
    position: relative;
    z-index: 1;
}

/* Footer Service Logo Section */
.service-logo-section {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.footer-service-logo {
    height: 30px;
    width: auto;
    object-fit: contain;
}

/* Contact & Recruit Section */
.contact-recruit-section {
    width: 100%;
    margin: 0;
    padding: 0;
}

.cr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 360px;
    margin: 0;
}

.cr-block {
    padding: 60px 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cr-contact {
    background: #1a1a1a;
    color: #fff;
}

.cr-recruit {
    background: #fff;
    color: #000;
}

.cr-block h2 {
    font-size: 36px;
    font-weight: 900;
    margin: 0 0 16px;
}

.cr-block h2 span {
    font-size: 24px;
    font-weight: 700;
    margin-left: 12px;
}

.cr-block p {
    font-size: 16px;
    line-height: 1.8;
    margin: 0 0 32px;
}

.cr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    padding: 14px 24px;
    width: 260px;
    transition: all 0.3s;
}

.cr-contact .cr-btn {
    background: #fff;
    color: #000;
}

.cr-contact .cr-btn:hover {
    background: #f0f0f0;
    transform: translateX(5px);
}

.cr-recruit .cr-btn {
    background: #000;
    color: #fff;
}

.cr-recruit .cr-btn:hover {
    background: #333;
    transform: translateX(5px);
}

.cr-btn::after {
    content: "›";
    font-size: 20px;
}

/* Footer */
.site-footer {
    background: var(--black);
    color: var(--text-dark);
    padding: var(--spacing-3xl) 0 var(--spacing-lg);
    margin-top: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
}

.footer-company h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-lg);
}

.footer-column h4 {
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
}

.footer-column ul {
    list-style: none;
}

.footer-column li {
    margin-bottom: 4px;
}

.footer-column a {
    color: #fff;
    font-size: 0.8rem;
}

.footer-column a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.footer-legal {
    display: flex;
    gap: var(--spacing-lg);
}

.footer-legal a {
    color: var(--gray-400);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: var(--spacing-sm);
    position: relative;
    text-align: center;
    display: block;
}

.section-title::after {
    display: none;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-top: var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: 4px;
    font-weight: var(--font-weight-medium);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--black);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(69, 238, 255, 0.3);
}

.btn-outline {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: var(--black);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: var(--black);
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: var(--spacing-sm) 0;
}

.breadcrumb ul {
    display: flex;
    align-items: center;
    list-style: none;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

.breadcrumb li::after {
    content: '>';
    margin: 0 var(--spacing-xs);
    color: var(--gray-400);
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb li:last-child {
    color: var(--text-dark);
    font-weight: var(--font-weight-medium);
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    body {
        padding-top: var(--header-height, 60px); /* モバイルでも動的計測 */
    }
    
    /* モバイルでは被せずに表示する */
    body.hero-under-header {
        padding-top: var(--header-height, 60px) !important;
    }
    
    /* モバイル時のヘッダーコンテナ */
    .site-header .container {
        padding: 0 15px;
    }
    
    .header-inner {
        padding: 10px 0;
        min-height: 50px;
    }
    
    /* ロゴサイズを小さく */
    .logo img {
        height: 40px !important;
        width: auto;
    }
    
    /* ハンバーガーメニューも小さく */
    .mobile-menu-toggle {
        padding: 5px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        margin: 4px 0;
    }
    
    .main-nav {
        display: none;
    }
    
    /* モバイルメニュー: JS依存を避けて常駐スタイルで確実に表示 */
    .main-nav.active {
        display: block !important;
        position: fixed !important;
        top: 0 !important; /* 変数依存を避ける */
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: #000 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
        z-index: 2000 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding-top: var(--header-height, 60px) !important; /* ヘッダー分だけ中身を下げる */
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
    .main-nav.active ul {
        flex-direction: column !important;
        padding: 1rem 0 2rem !important; /* 下に余白 */
        margin: 0 !important;
        display: flex !important;
    }
    .main-nav.active ul > li { display: block !important; }
    .main-nav.active a { color: #f0f0f0 !important; }
    /* CONTACTボタンだけは黒文字を維持 */
    .main-nav.active .contact-btn { 
        color: #000000 !important;
    }
    .main-nav.active ul li {
        width: 100% !important;
    }
    .main-nav.active .dropdown-menu {
        display: block !important;
        position: static !important; /* オフキャンバス回避 */
        opacity: 1 !important;
        visibility: visible !important;
        background: transparent !important;
        box-shadow: none !important;
        margin-top: 5px !important;
        margin-left: 0 !important;
        width: 100% !important;
        transform: none !important; /* 左にずれるのを防止 */
        padding: 0 !important;
    }
    .main-nav.active .dropdown { position: static !important; }
    .main-nav.active .dropdown-toggle::after { display: none !important; }
    .main-nav.active .dropdown-menu .menu-item-logo,
    .main-nav.active .dropdown-menu .menu-item-desc { display: none !important; }
    .main-nav.active .dropdown-menu .menu-item-title {
        font-size: 0.9rem !important;
        font-weight: 400 !important;
        color: #b0b0b0 !important;
    }
    .main-nav.active .dropdown-menu a {
        color: #b0b0b0 !important;
        padding: 8px 40px !important;
        margin: 0 !important;
    }
    .main-nav.active .dropdown-menu a:hover {
        background: rgba(69, 238, 255, 0.1) !important;
        color: var(--primary-color) !important;
    }
    .main-nav.active .dropdown-menu .menu-item-content { padding: 0 !important; }
    .main-nav.active > ul > li > a {
        color: #f0f0f0 !important;
        display: block !important;
        padding: 15px 20px !important;
        font-size: 1.2rem !important;
        font-weight: 600 !important;
    }
    .main-nav.active .dropdown-toggle {
        font-size: 1.2rem !important;
        font-weight: 600 !important;
    }
    .main-nav.active .contact-btn {
        background: #ffffff !important;
        color: #000000 !important;
        text-indent: 0 !important;  /* テキストを確実に表示 */
        padding: 12px 30px !important;
        border-radius: 50px !important;
        display: inline-block !important;
        margin: 20px 20px 10px !important;
        width: calc(100% - 40px) !important;
        text-align: center !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
    }
    /* CONTACTボタン内のすべての要素を黒文字に */
    .main-nav.active .contact-btn span,
    .main-nav.active .contact-btn * {
        color: #000000 !important;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
    }
    
    .cr-grid {
        grid-template-columns: 1fr;
    }
    
    .cr-block {
        text-align: left;
        padding: 40px 20px;
    }
    
    .cr-block h2 {
        text-align: left;
    }
    
    .cr-block p {
        text-align: left;
    }
    
    .cr-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
    }
    
    .fixed-cta {
        bottom: 10px;
        right: 10px;
        gap: 8px;
    }
    
    .cta-button {
        min-width: 140px;  /* 少し大きく */
        min-height: 45px;  /* 少し大きく */
        padding: 12px 24px;  /* 少し大きく */
    }
    
    .cta-button span {
        font-size: 0.95rem !important;  /* 少し大きく */
        font-weight: 500;
    }
    
    /* Hide gradient on mobile */
    body::before {
        display: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
}

.slide-in {
    animation: slideIn 0.8s ease forwards;
}

.dropdown-menu > li {
    width: 100%;
}

.dropdown-menu > li > a {
    display: block;
    width: 100%;
}

.dropdown-menu > li > a > .menu-item-content {
    width: 100%;
}

/* スマホ用の追加レスポンシブ対応（横スクロール防止） */
@media (max-width: 480px) {
    .fixed-cta {
        right: 8px;
        bottom: 8px;
        gap: 6px;
    }
    
    .cta-button {
        min-width: 120px;  /* 少し大きく */
        min-height: 40px;  /* 少し大きく */
        padding: 10px 18px;  /* 少し大きく */
    }
    
    .cta-button span {
        font-size: 0.85rem !important;  /* 少し大きく */
    }
    
    /* さらに小さいヘッダー */
    .logo img {
        height: 35px !important;
    }
    
    .header-inner {
        padding: 8px 0;
        min-height: 45px;
    }
}