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

/* タブレット (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 2rem;
    }

    /* ヒーロー動画 */
    .hero-video-bg {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #000;
    }

    .hero-video-bg video {
        width: 100%;
        height: 100%;
        object-fit: contain;
        object-position: center center;
    }

    .hero-title {
        font-size: clamp(2rem, 6vw, 4rem);
    }

    .statement-block {
        grid-template-columns: 1fr;
    }

    .statement-content {
        padding: 3rem;
    }

    .statement-visual {
        min-height: 400px;
    }

    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .footer-nav {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* モバイル (768px以下) */
@media screen and (max-width: 768px) {
    /* モバイルのみ表示 */
    .mobile-only {
        display: block !important;
    }

    /* ヒーロー動画 */
    .hero {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        position: relative;
    }

    .hero-video-bg {
        width: 100%;
        height: 100vh;
        position: absolute;
        top: 0;
        left: 0;
        overflow: hidden;
    }

    .hero-video-bg video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center center;
    }

    /* モバイル用ヒーローコンテンツ */
    .hero-overlay.mobile-only {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            135deg,
            rgba(26, 26, 46, 0.6) 0%,
            rgba(14, 165, 233, 0.2) 100%
        );
        z-index: 1;
    }

    .hero-logo-mobile {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        z-index: 2;
        padding: 0 2rem;
        width: 100%;
        max-width: 400px;
    }

    .hero-logo-mobile img {
        width: 80%;
        max-width: 300px;
        height: auto;
        margin: 0 auto 1.5rem;
        display: block;
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
    }

    .hero-logo-mobile .hero-subtitle {
        font-size: 1.1rem;
        color: white;
        opacity: 0.95;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
        letter-spacing: 0.05em;
    }

    /* ヘッダー */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    main, section, div {
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 400px;
        height: 100vh;
        background: white;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: right 0.3s ease;
        z-index: 999;
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-menu ul {
        flex-direction: column;
        padding: 80px 30px;
        gap: 1.5rem;
    }

    .nav-menu ul {
        background: white;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 0.8rem 0;
        display: block;
        border-bottom: 1px solid rgba(0,0,0,0.1);
        color: #333333 !important;
        background: white;
    }

    .nav-link:hover {
        color: var(--primary-color) !important;
        background: rgba(0, 212, 212, 0.05);
    }

    .hamburger {
        display: flex;
        z-index: 1001;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(8px, 8px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(8px, -8px);
    }

    /* ヒーローセクション */
    .hero {
        min-height: 100vh;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .btn-primary, .btn-secondary {
        width: 200px;
        text-align: center;
    }

    /* セクション共通 */
    section {
        padding: 3rem 1rem;
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .container {
        padding: 0 1rem;
        max-width: 100% !important;
        width: 100% !important;
        box-sizing: border-box;
        overflow-x: hidden !important;
    }

    .section-header {
        margin-bottom: 2.5rem;
        text-align: center;
    }

    .section-title {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
        line-height: 1.2;
        word-break: keep-all;
    }

    .section-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    /* 企業理念カード */
    .philosophy-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .philosophy-card {
        padding: 2rem 1.5rem;
        margin: 0;
        border-radius: 10px;
    }

    .philosophy-card h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .philosophy-card p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    /* ステートメント */
    .statement {
        overflow-x: hidden !important;
        width: 100% !important;
    }

    .statement-block {
        padding: 0 1rem;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        grid-template-columns: 1fr !important;
    }

    .statement-visual {
        width: 100% !important;
        max-width: 100% !important;
    }

    .statement-visual img {
        width: 100% !important;
        height: auto !important;
    }

    .statement-content {
        padding: 2rem 1.5rem;
        text-align: center;
    }

    .statement-content h2 {
        font-size: 1.25rem;
        line-height: 1.5;
        margin-bottom: 1rem;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .statement-content p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .statement-visual {
        margin-top: 2rem;
        border-radius: 10px;
        overflow: hidden;
    }

    /* サービス */
    .services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding: 0 1rem;
    }

    .service-card {
        border-radius: 15px;
        margin: 0;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .service-content {
        padding: 1.5rem;
    }

    .service-content h3 {
        font-size: 1.2rem;
        margin-bottom: 0.3rem;
    }

    .service-content h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .service-content p {
        font-size: 0.9rem;
        line-height: 1.6;
    }

    .service-features {
        font-size: 0.85rem;
        margin: 1rem 0;
    }

    .btn-service {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }

    /* 実績 */
    .achievements {
        padding: 3rem 1rem;
    }

    .achievement-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .achievement-item {
        padding: 1.5rem 0.5rem;
    }

    .achievement-number {
        font-size: 2.5rem;
    }

    .achievement-unit {
        font-size: 1.2rem;
    }

    .achievement-label {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }

    /* CTA */
    .cta {
        padding: 3rem 1rem;
    }

    .cta-content {
        text-align: center;
    }

    .cta-content h2 {
        font-size: 1.5rem;
        line-height: 1.4;
        margin-bottom: 1rem;
    }

    .cta-content p {
        font-size: 0.95rem;
        margin-bottom: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .cta-buttons .btn-secondary {
        width: 90%;
        max-width: 280px;
        padding: 1rem;
        font-size: 0.95rem;
    }

    .cta-buttons .btn-secondary strong {
        display: block;
        margin-top: 0.3rem;
        font-size: 1.1rem;
    }

    /* フッター */
    .footer {
        padding: 2rem 0;
    }

    .footer-content {
        padding: 0 1rem;
    }

    .footer-logo img {
        height: 40px;
        margin-bottom: 1rem;
    }

    .footer-contact {
        font-size: 0.85rem;
        line-height: 1.6;
        margin-bottom: 2rem;
    }

    .footer-nav {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .footer-nav-column {
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 1rem;
    }

    .footer-nav-column:last-child {
        border-bottom: none;
    }

    .footer-nav-column h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }

    .footer-nav-column ul li {
        margin-bottom: 0.5rem;
    }

    .footer-nav-column a {
        font-size: 0.85rem;
    }

    .footer-bottom {
        padding: 1.5rem 1rem;
        font-size: 0.75rem;
    }
}

/* スモールモバイル (480px以下) */
@media screen and (max-width: 480px) {
    html, body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    .container {
        padding: 0 15px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-container {
        padding: 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    .logo img {
        height: 35px;
    }

    /* ヒーロー動画 - スマホ縦向き */
    .hero-video-bg video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
    }

    /* ページヒーロー */
    .page-hero {
        padding: 80px 0 40px;
    }

    .page-hero h1 {
        font-size: 1.8rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
        margin-top: 0.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
    }

    .philosophy-card {
        padding: 1.5rem;
    }

    .philosophy-card h3 {
        font-size: 1.3rem;
    }

    /* SDGsセクション */
    .sdgs-section {
        padding: 3rem 1rem;
    }

    .sdgs-section p {
        font-size: 0.95rem;
        line-height: 1.7;
    }

    .sdgs-section img {
        height: 60px;
    }

    .card-icon {
        width: 60px;
        height: 60px;
    }

    .service-content {
        padding: 1.5rem;
    }

    .service-content h3 {
        font-size: 1.2rem;
    }

    .achievement-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .achievement-number {
        font-size: 2.5rem;
    }

    /* メンバーページ */
    .ceo-section .container {
        padding: 2rem 1rem;
    }

    .ceo-content {
        flex-direction: column;
        gap: 2rem;
    }

    .ceo-image-wrapper {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .ceo-text h2 {
        font-size: 1.5rem;
    }

    .ceo-text .ceo-name {
        font-size: 1.2rem;
    }

    .ceo-message {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .team-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .team-member {
        padding: 1rem;
    }

    .member-image {
        width: 120px;
        height: 120px;
    }

    .member-info h3 {
        font-size: 1rem;
    }

    .member-info .position {
        font-size: 0.85rem;
    }

    .member-info .message {
        font-size: 0.85rem;
        line-height: 1.6;
    }

    /* 事業内容ページ */
    .service-detail {
        padding: 2rem 1rem;
    }

    .service-detail-header h2 {
        font-size: 1.5rem;
    }

    .service-detail-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .detail-card {
        padding: 1.5rem;
    }

    .detail-card h3 {
        font-size: 1.1rem;
    }

    .detail-card p {
        font-size: 0.85rem;
    }

    .detail-features li {
        font-size: 0.85rem;
        padding: 0.5rem 0;
    }

    /* 会社概要ページ */
    .company-overview {
        padding: 2rem 1rem;
    }

    .company-table {
        font-size: 0.85rem;
    }

    .company-table th,
    .company-table td {
        padding: 0.8rem 0.5rem;
        display: block;
        width: 100%;
        text-align: left;
    }

    .company-table th {
        background: #f5f5f5;
        margin-top: 0.5rem;
    }

    /* 採用情報ページ */
    .job-listings {
        padding: 2rem 1rem;
    }

    .job-card {
        padding: 1.5rem;
    }

    .job-card h3 {
        font-size: 1.2rem;
    }

    .job-meta {
        flex-direction: column;
        gap: 0.5rem;
        font-size: 0.85rem;
    }

    .job-description h4 {
        font-size: 1rem;
    }

    .job-description p,
    .job-description ul {
        font-size: 0.85rem;
    }

    .btn-apply {
        width: 100%;
        padding: 1rem;
    }

    .footer-content {
        padding: 0 1rem;
    }
}

/* ランドスケープモード対応 */
@media screen and (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        margin-bottom: 1.5rem;
    }

    .scroll-indicator {
        display: none;
    }
}

/* プリント用スタイル */
@media print {
    .header {
        position: static;
        box-shadow: none;
    }

    .hamburger {
        display: none;
    }

    .hero-video-bg {
        display: none;
    }

    .hero {
        min-height: auto;
        background: var(--gradient-dark);
    }

    .scroll-indicator {
        display: none;
    }

    .btn-primary, .btn-secondary {
        border: 1px solid currentColor;
    }

    section {
        page-break-inside: avoid;
    }
}

/* 高解像度ディスプレイ対応 */
@media screen and (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }

    .hero-title {
        font-size: 6rem;
    }

    .hero-subtitle {
        font-size: 1.8rem;
    }

    .section-title {
        font-size: 3.5rem;
    }

    .section-subtitle {
        font-size: 1.3rem;
    }

    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ダークモード対応（システム設定に従う） */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-light: #1F2937;
        --text-dark: #F9FAFB;
        --text-gray: #9CA3AF;
    }

    .header {
        background: rgba(31, 41, 55, 0.95);
    }

    .header.scrolled {
        background: rgba(31, 41, 55, 0.98);
    }

    .philosophy-card {
        background: #374151;
    }

    .service-card {
        background: #374151;
    }

    .philosophy-preview {
        background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    }

    .services {
        background: #111827;
    }
}

/* アクセシビリティ向上 */
@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;
    }

    .hero-video-bg video {
        display: none;
    }

    .hero {
        background: var(--gradient-dark);
    }
}

/* タッチデバイス向け最適化 */
@media (hover: none) and (pointer: coarse) {
    .nav-link:hover::after {
        width: 0;
    }

    .philosophy-card:hover {
        transform: none;
    }

    .service-card:hover {
        transform: none;
    }

    .service-overlay {
        opacity: 0.8;
    }

    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
}

/* IE11対応 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    .hero-video-bg {
        display: none;
    }

    .hero {
        background: var(--gradient-dark);
    }

    .header {
        background: white;
    }

    .philosophy-cards {
        display: flex;
        flex-wrap: wrap;
    }

    .philosophy-card {
        flex: 0 0 calc(33.333% - 2rem);
        margin: 1rem;
    }

    .services-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .service-card {
        flex: 0 0 calc(33.333% - 2rem);
        margin: 1rem;
    }
}