/* ===================================
   レスポンシブデザイン
   =================================== */

/* タブレット（1024px以下） */
@media screen and (max-width: 1024px) {
    :root {
        --font-size-h1: 40px;
        --font-size-h2: 32px;
        --font-size-h3: 20px;
    }
    
    /* ヒーローセクション */
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-content {
        order: 2;
    }
    
    .hero-visual {
        order: 1;
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* 特徴セクション */
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* 技術仕様セクション */
    .specs-grid {
        grid-template-columns: 1fr;
    }
    
    /* 対象ユーザーセクション */
    .target-list {
        grid-template-columns: 1fr;
    }
}

/* モバイル（768px以下） */
@media screen and (max-width: 768px) {
    :root {
        --font-size-h1: 32px;
        --font-size-h2: 28px;
        --font-size-h3: 18px;
        --header-height: 60px;
    }
    
    /* ヘッダー */
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        background-color: var(--color-background);
        flex-direction: column;
        padding: var(--spacing-lg);
        box-shadow: var(--box-shadow);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all var(--transition-speed);
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
    
    /* 導入セクション */
    .problems-grid {
        grid-template-columns: 1fr;
    }
    
    /* 使い方セクション */
    .steps-container {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .step-content img {
        max-width: 250px;
    }
    
    
    /* ダウンロードセクション */
    .device-mockups {
        flex-direction: column;
    }
    
    .device-mockups img:first-child {
        max-width: 250px;
    }
    
    .device-mockups img:last-child {
        max-width: 350px;
    }
    
    /* フッター */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

/* 小型モバイル（480px以下） */
@media screen and (max-width: 480px) {
    :root {
        --font-size-base: 14px;
        --font-size-h1: 28px;
        --font-size-h2: 24px;
        --font-size-h3: 16px;
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --spacing-xl: 32px;
        --spacing-xxl: 48px;
    }
    
    .container {
        padding: 0 var(--spacing-sm);
    }
    
    .nav-container {
        padding: 0 var(--spacing-sm);
    }
    
    .hero-title {
        font-size: 24px;
    }
    
    .hero-subtitle {
        font-size: var(--font-size-base);
    }
    
    .app-store-button img {
        width: 160px;
        height: 48px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .user-card img {
        width: 120px;
        height: 120px;
    }
}

/* 超小型デバイス（320px以下） */
@media screen and (max-width: 320px) {
    :root {
        --font-size-h1: 24px;
        --font-size-h2: 20px;
    }
    
    .logo img {
        width: 150px;
        height: 30px;
    }
    
    .step-content img {
        max-width: 200px;
    }
}

/* タッチデバイス対応 */
@media (hover: none) and (pointer: coarse) {
    /* タップターゲットを大きく */
    .nav-menu a,
    .cta-button,
    .app-store-button {
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    /* ホバーエフェクトを無効化 */
    .problem-card:hover,
    .feature-card:hover,
    .user-card:hover {
        transform: none;
    }
    
    /* タップ時のハイライトを追加 */
    a, button {
        -webkit-tap-highlight-color: rgba(0, 122, 255, 0.2);
    }
}

/* 高解像度ディスプレイ対応 */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* 高解像度画像の使用 */
    .logo img,
    .app-store-button img {
        image-rendering: crisp-edges;
    }
}

/* 印刷対応 */
@media print {
    /* 不要な要素を非表示 */
    .site-header,
    .mobile-menu-toggle,
    .demo-video,
    .app-store-button,
    .site-footer {
        display: none;
    }
    
    /* ページブレークの制御 */
    section {
        page-break-inside: avoid;
    }
    
    /* カラー調整 */
    * {
        color: black !important;
        background: white !important;
    }
    
    /* リンクのURL表示 */
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* アクセシビリティ：動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* ダークモード対応（将来の実装用） */
@media (prefers-color-scheme: dark) {
    /* ダークモード時のスタイルをここに追加 */
}