/* JMA Solutions Landing Page - Main Stylesheet */

/* ========== Import Design System ========== */
@import './tokens.css';
@import './base.css';
@import './components.css';
@import './sections.css';

/* ========== Critical Performance Optimizations ========== */
/* Font Loading Optimization */
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/notosansjp/v52/O4ZMFGj5hxF27qVlyp-0V4xOy-jdKZjCLn5A.woff2') format('woff2');
  unicode-range: U+3041-3096, U+30A1-30FA, U+4E00-9FAF;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/notosansjp/v52/O4ZNFGj5hxF27qVlyp-0V4xOx_kzKocyNn9AydQ.woff2') format('woff2');
  unicode-range: U+3041-3096, U+30A1-30FA, U+4E00-9FAF;
}

@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('https://fonts.gstatic.com/s/notosansjp/v52/O4ZNFGj5hxF27qVlyp-0V4xOx-UyKocyNn9AydQ.woff2') format('woff2');
  unicode-range: U+3041-3096, U+30A1-30FA, U+4E00-9FAF;
}

/* ========== Page-Specific Styles ========== */
body {
  scroll-behavior: smooth;
}

/* Loading Animation */
.loading {
  opacity: 0;
  animation: fadeIn 0.6s ease-out forwards;
}

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

/* Enhanced Section Animations */
@media (prefers-reduced-motion: no-preference) {
  .reason-item,
  .program-type,
  .case-study,
  .hero-headline,
  .hero-text h2,
  .hero-cta {
    opacity: 0;
    transform: translateY(30px);
    animation: slideInUp 0.8s ease-out forwards;
  }

  .hero-headline {
    animation-delay: 0.2s;
  }

  .hero-text h2 {
    animation-delay: 0.3s;
  }

  .hero-cta {
    animation-delay: 0.4s;
  }

  .reason-item:nth-child(1) { animation-delay: 0.1s; }
  .reason-item:nth-child(2) { animation-delay: 0.2s; }
  .reason-item:nth-child(3) { animation-delay: 0.3s; }

  .tab-pane .program-type { animation-delay: 0.1s; }

  .case-study:nth-child(1) { animation-delay: 0.1s; }
  .case-study:nth-child(2) { animation-delay: 0.3s; }
  .case-study:nth-child(3) { animation-delay: 0.5s; }
  .case-study:nth-child(4) { animation-delay: 0.7s; }

  /* Floating animation for decorative elements */
  .hero-decorative-circles::before,
  .hero-decorative-circles::after {
    animation: float 6s ease-in-out infinite;
  }

  .hero-decorative-circles::after {
    animation-delay: 3s;
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== Print Styles ========== */
@media print {
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }

  .cta-button,
  .skip-link {
    display: none !important;
  }

  h1, h2, h3 {
    page-break-after: avoid;
  }

  img {
    max-width: 100% !important;
  }

  .case-study,
  .reason-item,
  .program-type {
    page-break-inside: avoid;
  }
}

/* ========== High Contrast Mode Support ========== */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #0000FF;
    --color-secondary: #800080;
    --color-text-primary: #000000;
    --color-text-secondary: #000000;
    --border-width: 2px;
  }

  .cta-button {
    border-width: var(--border-width-4);
  }

  .card,
  .reason-item,
  .program-type {
    border-width: var(--border-width-2);
    border-color: var(--color-gray-900);
  }
}

/* ========== Development Helpers ========== */
/* Remove in production */
.debug-grid * {
  outline: 1px solid rgba(255, 0, 0, 0.2);
}

.debug-spacing * {
  background: rgba(0, 255, 0, 0.1);
}

/* ========== Critical Above-the-Fold CSS ========== */
/* This should be inlined in production for performance */
.site-header,
.hero-section {
  /* Critical styles are already defined above */
}

/* ========== Browser-Specific Fixes ========== */
/* Safari iOS Fix */
@supports (-webkit-touch-callout: none) {
  .hero-content {
    min-height: 100vh;
    min-height: -webkit-fill-available;
  }
}

/* Firefox Scrollbar Styling */
@-moz-document url-prefix() {
  body {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-gray-200);
  }
}

/* Webkit Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-gray-200);
}

::-webkit-scrollbar-thumb {
  background: var(--color-primary);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary-dark);
}