/* ================================================
   株式会社Metis - レスポンシブスタイルシート（修正版）
   ================================================ */

/* タブレット向け (768px以下) */
@media (max-width: 768px) {
    
    /* ハンバーガーメニュー */
    .hamburger {
        display: flex !important;
    }

    .nav-menu {
        position: fixed;
        top: 80px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 2rem 0;
        transition: right 0.3s ease;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        z-index: 999;
        display: flex;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu li {
        margin: 1rem 0;
    }

    .nav-menu a {
        font-size: 1.2rem;
        padding: 1rem 2rem;
        display: block;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .nav-menu a:hover {
        background: rgba(30, 136, 229, 0.1);
    }

    /* ヒーローセクション */
    .hero-section {
        padding: 6rem 2rem 4rem;
    }

    .hero-text h1 {
        font-size: 3rem;
    }

    .hero-text .lead {
        font-size: 1rem;
    }

    .hero-text .sub-en {
        font-size: 0.9rem;
    }

    .hero2-section {
        padding: 6rem 2rem 4rem;
    }

    .hero2-text h1 {
        font-size: 2.5rem;
    }

    .hero2-text .lead {
        font-size: 1rem;
    }

    .hero2-text .sub-en {
        font-size: 0.9rem;
    }

    /* グリッドレイアウト調整 */
    .team-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* about-gridは768px以下でも2カラムを維持 */
    .about-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }

    .about-image img {
        height: 300px;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .vision-grid,
    .achievements-grid {
        grid-template-columns: 1fr;
    }

    /* ボタン配置 */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    /* セクションヘッダー */
    .section-header {
        margin-bottom: 3rem;
    }

    .team-image-grid {
        grid-template-columns: 1fr;
    }

    .office-sub-images {
        grid-template-columns: 1fr;
    }

    .office-main-image img {
        height: 250px;
    }

    .office-sub-image img {
        height: 200px;
    }

    /* モバイル版ロゴ調整 */
    .logo-title img {
        height: 50px;
    }

    .logo-main-text {
        font-size: 25px;
    }

    .logo-sub-text {
        font-size: 12px;
    }

    .logo-text-container {
        margin-left: 6px;
    }

    /* CTAセクション */
    .cta-section h1,
    .cta-section h2 {
        font-size: 2.2rem !important;
        color: #222 !important;
    }

    .cta-section .lead {
        font-size: 1rem !important;
        color: #444 !important;
    }

    /* フッター */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* スクロールボタン */
    .scroll-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* スマートフォン向け (480px以下) */
@media (max-width: 480px) {
    
    .container {
        padding: 0 1rem;
    }

    /* ヘッダー */
    .nav {
        padding: 0rem 1rem;
        margin: 0rem 0rem;
        height: 65px;
    }

    /* ヒーローセクション */
    .hero-section {
        padding: 5rem 1rem 3rem;
        min-height: 90vh;
    }

    .hero-text h1 {
        font-size: 1.8rem;
        margin-top: 110px;
        margin-bottom: 15px;
    }

    .hero-text .sub-en {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    .hero-text .lead {
        font-size: 0.8rem;
        margin-bottom: 25px;
    }

    .hero2-section {
        padding: 5rem 1rem 2rem;
        
    }

    .hero2-text h1 {
        font-size: 1.9rem;
        margin-bottom: 15px;
    }

    .hero2-text .sub-en {
        font-size: 0.8rem;
        margin-bottom: 15px;
    }

    .hero2-text .lead {
        font-size: 0.9rem;
        margin-bottom: 25px;
    }

    /* ボタン */
    .btn {
        padding: 0.8rem 2rem;
        font-size: 0.9rem;
    }

    .cta-buttons {
        gap: 1rem;
    }

    /* セクション */
    .vision,
    .about,
    .services {
        padding: 5rem 0;
    }

    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    /* ビジョンカード */
    .vision-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .vision-content {
        padding: 1.2rem;
    }

    .vision-card h3 {
        font-size: 1.3rem;
    }

    /* アバウト画像 - スマホでは1カラム */
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-images {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .about-image.large {
        grid-row: span 1;
    }

    .about-image img {
        height: 200px;
    }

    /* サービスカード */
    .service-header {
        padding: 1.5rem 1.5rem 0.5rem;
    }

    .service-content {
        padding: 1rem 1.5rem 1.5rem;
    }

    .service-card h3 {
        font-size: 1.2rem;
    }

    .service-content p {
        font-size: 0.9rem;
    }

    /* CTAセクション */
    .cta-section {
        padding: 60px 15px;
    }

    .cta-section h1,
    .cta-section h2 {
        font-size: 1.8rem !important;
        line-height: 1.3;
        color: #222 !important;
    }

    .cta-section .lead {
        font-size: 0.9rem !important;
        margin-bottom: 25px;
        color: #444 !important;
    }

    .cta-section strong {
        color: #222 !important;
    }

    /* フッター */
    .footer {
        padding: 3rem 0 1.5rem;
    }

    .footer-section h4 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .footer-section p,
    .footer-section a {
        font-size: 0.8rem;
    }

    /* ロゴさらに小さく */
    .logo-title img {
        height: 40px;
    }

    .logo-main-text {
        font-size: 22px;
    }

    .logo-sub-text {
        font-size: 11px;
    }
}

/* 大画面向け (1200px以上) */
@media (min-width: 1200px) {
    
    .container {
        max-width: 1400px;
    }

    .hero-text h1 {
        font-size: 3.5rem;
    }

    .hero-text .lead {
        font-size: 1.3rem;
    }

    .section-title {
        font-size: 3.8rem;
    }

    .about-grid {
        gap: 6rem;
    }

    .vision-grid {
        grid-template-columns: repeat(3, 1fr);
    }

  
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    
    .hero-section {
        background-image: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('../images/hero/hero-bg@2x.png');
    }
    
    .logo-title img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* プリント用スタイル */
@media print {
    
    .header,
    .scroll-to-top,
    .cta-buttons {
        display: none;
    }

    .hero-section {
        background: none;
        color: #000;
        padding: 2rem 0;
        min-height: auto;
    }

    .hero-text h1 {
        color: #000;
        animation: none;
        opacity: 1;
    }

    .fade-in {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .service-overlay {
        display: none;
    }

    * {
        box-shadow: none !important;
    }
}

/* アクセシビリティ: 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
    
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }

    .hero-text h1,
    .hero-text .sub-en,
    .hero-text .lead,
    .cta-buttons {
        opacity: 1;
        animation: none;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    
    :root {
        --text-primary: #ffffff;
        --text-secondary: #3f3f3f;
        --text-light: #b0b0b0;
        --bg-light: #1a1a1a;
        --white: #2a2a2a;
        --border-light: rgba(255, 255, 255, 0.1);
    }

    body {
        background: #121212;
        color: #ffffff;
    }

    .header {
        background: rgba(30, 30, 30, 0.95);
    }

    /* 明るい背景を強制するセクション */
    .vision,
    section.vision,
    .vision.fade-in {
        background: #F8FAFC !important;
        background-color: #F8FAFC !important;
        color: #3f3f3f !important;
    }

    .vision-card {
        background: #ffffff !important;
        color: #3f3f3f !important;
    }

    .vision-card h3,
    .vision-card p {
        color: #3f3f3f !important;
    }

    .section-title,
    .section-subtitle {
        color: #3f3f3f !important;
    }

    .about {
        background: #ffffff !important;
        color: #3f3f3f !important;
    }

    .about-content h2,
    .about-content .tagline,
    .about-content p {
        color: #3f3f3f !important;
    }

    .about-content .tagline {
        color: #3f3f3f !important;
    }

    .services {
        background: #F8FAFC !important;
        color: #3f3f3f !important;
    }

    .service-card {
        background: #ffffff !important;
        color: #3f3f3f !important;
    }

    .service-card h3,
    .service-content p {
        color: #3f3f3f !important;
    }

    .service-link {
        color: #1E88E5 !important;
    }

    /* CTAセクション - 明るいグラデーション背景を維持 */
    .cta-section {
        background: linear-gradient(to right, #d4ecff, #eaf6ff) !important;
        color: #3f3f3f !important;
    }

    .cta-section h1,
    .cta-section h2 {
        color: #3f3f3f !important;
    }

    .cta-section .lead,
    .cta-section p {
        color: #444 !important;
    }

    .cta-section strong {
        color: #3f3f3f !important;
    }

    /* フッター - 暗い背景を維持 */
    .footer {
        background: #1a1a1a !important;
        color: white !important;
    }

    .footer-section h4 {
        color: white !important;
    }

    .footer-section p,
    .footer-section a {
        color: #cccccc !important;
    }

    .footer-section a:hover {
        color: #42A5F5 !important;
    }

    .footer-bottom {
        color: #999 !important;
    }
}