/* ================================================
   UniGain - プロフェッショナルレスポンシブデザインシステム
   Web制作会社として最高品質のレスポンシブデザイン
   ================================================ */

/* ================================================
   1. ベーススタイルの最適化
   ================================================ */

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
}

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

/* ================================================
   2. コンテナシステム
   ================================================ */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ================================================
   3. デスクトップ（1400px以上）- XLサイズ
   ================================================ */
@media (min-width: 1400px) {
  .container {
    max-width: 1320px;
    padding: 0 2.5rem;
  }

  .hero {
    min-height: 90vh;
  }

  .hero-content h1 {
    font-size: 4.5rem;
    line-height: 1.15;
  }

  .hero-tagline {
    font-size: 1.75rem;
  }

  .hero-description {
    font-size: 1.25rem;
    max-width: 700px;
  }

  .section {
    padding: 8rem 0;
  }

  .section h2 {
    font-size: 3rem;
  }

  .btn {
    padding: 1.125rem 2.75rem;
    font-size: 1.125rem;
  }
}

/* ================================================
   4. デスクトップ（1200px〜1399px）- Lサイズ
   ================================================ */
@media (min-width: 1200px) and (max-width: 1399px) {
  .container {
    max-width: 1140px;
    padding: 0 2rem;
  }

  .hero {
    min-height: 85vh;
  }

  .hero-content h1 {
    font-size: 4rem;
  }

  .hero-tagline {
    font-size: 1.5rem;
  }

  .section {
    padding: 7rem 0;
  }

  .section h2 {
    font-size: 2.75rem;
  }
}

/* ================================================
   5. タブレット横向き（992px〜1199px）- Mサイズ
   ================================================ */
@media (min-width: 992px) and (max-width: 1199px) {
  .container {
    max-width: 960px;
    padding: 0 2rem;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-content h1 {
    font-size: 3.25rem;
  }

  .hero-tagline {
    font-size: 1.35rem;
  }

  .hero-description {
    font-size: 1.1rem;
  }

  .section {
    padding: 6rem 0;
  }

  .section h2 {
    font-size: 2.5rem;
  }

  /* ナビゲーション */
  .nav {
    gap: 1.5rem;
  }

  .nav-link {
    font-size: 0.95rem;
  }

  /* グリッドレイアウト */
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

/* ================================================
   6. タブレット縦向き（768px〜991px）- Sサイズ
   ================================================ */
@media (min-width: 768px) and (max-width: 991px) {
  .container {
    max-width: 720px;
    padding: 0 1.75rem;
  }

  .hero {
    min-height: 60vh;
  }

  .hero-content {
    padding: 3rem 1.5rem;
  }

  .hero-content h1 {
    font-size: 2.75rem;
    margin-bottom: 1rem;
  }

  .hero-tagline {
    font-size: 1.25rem;
  }

  .hero-description {
    font-size: 1rem;
    max-width: 600px;
  }

  .hero-accent-line {
    width: 70px;
    height: 3px;
  }

  .section {
    padding: 5rem 0;
  }

  .section h2 {
    font-size: 2.25rem;
    margin-bottom: 1.25rem;
  }

  .section-tagline {
    font-size: 0.95rem;
  }

  /* ヘッダー */
  .header {
    padding: 1.25rem 0;
  }

  .logo {
    font-size: 1.35rem;
  }

  .logo-icon {
    width: 40px;
    height: 40px;
    font-size: 1.35rem;
  }

  /* ボタン */
  .btn {
    padding: 0.875rem 2rem;
    font-size: 0.95rem;
  }

  /* グリッド */
  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  /* カード */
  .card {
    padding: 2rem;
  }

  /* フッター */
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem;
  }
}

/* ================================================
   7. モバイル（576px〜767px）- XSサイズ
   ================================================ */
@media (min-width: 576px) and (max-width: 767px) {
  .container {
    max-width: 540px;
    padding: 0 1.5rem;
  }

  .hero {
    min-height: 55vh;
  }

  .hero-content {
    padding: 2.5rem 1.25rem;
  }

  .hero-content h1 {
    font-size: 2.25rem;
    margin-bottom: 0.875rem;
  }

  .hero-tagline {
    font-size: 1.15rem;
  }

  .hero-description {
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .section {
    padding: 4rem 0;
  }

  .section h2 {
    font-size: 2rem;
  }

  /* ヘッダー */
  .header {
    padding: 1rem 0;
  }

  .logo {
    font-size: 1.25rem;
  }

  .logo-icon {
    width: 38px;
    height: 38px;
  }

  /* ナビゲーション - モバイルメニュー */
  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    flex-direction: column;
    padding: 5rem 2rem;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .nav.active {
    right: 0;
  }

  .nav-link {
    width: 100%;
    padding: 1rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 1.05rem;
  }

  .mobile-menu-toggle {
    display: block;
    font-size: 1.75rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1000;
  }

  /* ボタン */
  .btn {
    padding: 0.875rem 1.75rem;
    font-size: 0.95rem;
  }

  /* グリッド */
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  /* カード */
  .card {
    padding: 1.75rem;
  }

  /* フッター */
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* ================================================
   8. 小型モバイル（〜575px）- XXSサイズ
   ================================================ */
@media (max-width: 575px) {
  .container {
    padding: 0 1.25rem;
  }

  .hero {
    min-height: 50vh;
  }

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

  .hero-content h1 {
    font-size: 1.875rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

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

  .hero-accent-line {
    width: 50px;
    height: 2.5px;
    margin: 1rem auto;
  }

  .hero-description {
    font-size: 0.875rem;
    line-height: 1.65;
  }

  .section {
    padding: 3.5rem 0;
  }

  .section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }

  .section-tagline {
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
  }

  /* ヘッダー */
  .header {
    padding: 0.875rem 0;
  }

  .header-container {
    padding: 0 1.25rem;
  }

  .logo {
    font-size: 1.15rem;
  }

  .logo-icon {
    width: 35px;
    height: 35px;
    font-size: 1.15rem;
  }

  /* ナビゲーション */
  .nav {
    width: 100%;
    right: -100%;
  }

  .mobile-menu-toggle {
    font-size: 1.5rem;
  }

  /* ボタン */
  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    border-radius: 10px;
  }

  .btn-primary {
    width: 100%;
  }

  /* グリッド */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  /* カード */
  .card {
    padding: 1.5rem;
    border-radius: 16px;
  }

  .card h3 {
    font-size: 1.25rem;
  }

  .card p {
    font-size: 0.9rem;
  }

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

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

  .footer h3,
  .footer h4 {
    font-size: 1.15rem;
  }

  .footer p,
  .footer a {
    font-size: 0.875rem;
  }

  .footer-social {
    justify-content: center;
  }

  .social-link {
    width: 40px;
    height: 40px;
    font-size: 1.15rem;
  }
}

/* ================================================
   9. 極小デバイス（〜374px）
   ================================================ */
@media (max-width: 374px) {
  .container {
    padding: 0 1rem;
  }

  .hero-content h1 {
    font-size: 1.625rem;
  }

  .hero-tagline {
    font-size: 0.95rem;
  }

  .hero-description {
    font-size: 0.8125rem;
  }

  .section h2 {
    font-size: 1.5rem;
  }

  .logo {
    font-size: 1.05rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
  }

  .card {
    padding: 1.25rem;
  }
}

/* ================================================
   10. ランドスケープモード（横向き）
   ================================================ */
@media (max-height: 600px) and (orientation: landscape) {
  .hero {
    min-height: 75vh;
  }

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

  .hero-content h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
  }

  .hero-description {
    font-size: 0.875rem;
    margin-bottom: 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  .btn {
    padding: 0.625rem 1.5rem;
  }
}

/* ================================================
   11. タッチデバイス最適化
   ================================================ */
@media (hover: none) and (pointer: coarse) {
  /* タップターゲットサイズの最適化 */
  .btn,
  .nav-link,
  .card,
  a {
    min-height: 44px;
  }

  /* iOS zoom prevention */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* タッチフィードバック */
  .btn:active {
    transform: scale(0.98);
  }

  /* タップハイライトの最適化 */
  * {
    -webkit-tap-highlight-color: rgba(23, 160, 206, 0.2);
  }

  /* スクロールの最適化 */
  body {
    -webkit-overflow-scrolling: touch;
  }
}

/* ================================================
   12. ハイDPIディスプレイ（Retina等）
   ================================================ */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
  /* 高解像度用の微調整 */
  body {
    font-weight: 400;
    -webkit-font-smoothing: subpixel-antialiased;
  }

  .logo-icon,
  .social-link {
    border-width: 0.5px;
  }
}

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

  .hero::before,
  .hero::after {
    animation: none;
  }
}

/* ================================================
   14. ハイコントラストモード
   ================================================ */
@media (prefers-contrast: high) {
  .btn {
    border-width: 3px;
  }

  .card {
    border-width: 2px;
  }

  a:focus,
  button:focus,
  input:focus,
  textarea:focus {
    outline: 3px solid #17a0ce;
    outline-offset: 2px;
  }
}

/* ================================================
   15. ダークモード対応（将来の拡張用）
   ================================================ */
@media (prefers-color-scheme: dark) {
  /* 必要に応じてダークモードスタイルを実装 */
  /* 
  body {
    background: #0D1824;
    color: #f8fafc;
  }
  */
}

/* ================================================
   16. プリント最適化
   ================================================ */
@media print {
  /* ページ余白の最適化 */
  @page {
    margin: 2cm;
  }

  /* 不要な要素を非表示 */
  .header,
  .hero,
  .footer,
  .btn,
  .mobile-menu-toggle {
    display: none !important;
  }

  /* 背景の削除 */
  body {
    background: white;
    color: black;
  }

  /* リンクの表示最適化 */
  a[href]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
  }

  /* ページブレークの最適化 */
  .section,
  .card {
    page-break-inside: avoid;
  }
}

/* ================================================
   17. ユーティリティクラス
   ================================================ */

/* 表示/非表示 */
.hide-mobile {
  display: none;
}

@media (min-width: 768px) {
  .hide-mobile {
    display: block;
  }
  
  .hide-desktop {
    display: none;
  }
}

/* スペーシング調整 */
@media (max-width: 767px) {
  .mb-mobile-2 {
    margin-bottom: 2rem !important;
  }

  .mt-mobile-2 {
    margin-top: 2rem !important;
  }

  .px-mobile-1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* テキスト配置 */
@media (max-width: 767px) {
  .text-center-mobile {
    text-align: center !important;
  }
}

/* ================================================
   18. パフォーマンス最適化
   ================================================ */

/* GPU アクセラレーション */
.hero,
.card,
.btn {
  transform: translateZ(0);
  will-change: transform;
}

/* 画像の遅延読み込み対応 */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* スムーズスクロール最適化 */
@supports (scroll-behavior: smooth) {
  html {
    scroll-behavior: smooth;
  }
}
