/* ==========================================================================
   HeroSection Module - React Design Implementation
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700&family=Lato:wght@400;700&display=swap');

/* ==========================================================================
   アニメーション定義
   ========================================================================== */

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

@keyframes glow {
  0% {
    box-shadow: 0 0 20px rgba(5, 83, 221, 0);
  }
  50% {
    box-shadow: 0 0 30px rgba(5, 83, 221, 0.3);
  }
  100% {
    box-shadow: 0 0 20px rgba(5, 83, 221, 0);
  }
}

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

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

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

@keyframes perspective3D {
  0% {
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateZ(0px);
  }
  50% {
    transform: perspective(1200px) rotateX(2deg) rotateY(2deg) translateZ(15px);
  }
  100% {
    transform: perspective(1200px) rotateX(0deg) rotateY(0deg) translateZ(0px);
  }
}

/* ==========================================================================
   ベーススタイル
   ========================================================================== */
.hero-section-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 130px 40px;
  box-sizing: border-box;
  background-color: #ffffff;
  overflow: hidden;
  animation: fadeInUp 0.8s ease-out 0s;
}

.hero-section-container {
  width: 100%;
  max-width: 1280px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-section-row {
  width: 100%;
  display: inline-flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 60px;
  animation: fadeInUp 1s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.2s backwards;
}

/* ==========================================================================
   左側コンテンツエリア
   ========================================================================== */
.hero-section-content {
  flex: 1 1 0;
  max-width: 645.20px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 40px;
  animation: fadeInLeft 0.9s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.3s backwards;
}

/* ==========================================================================
   ヘッダーセクション（COMPANY）
   ========================================================================== */
.hero-section-header {
  max-width: 645.20px;
  padding-bottom: 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 16px;
  animation: fadeInUp 0.8s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.4s backwards;
}

.hero-company-label {
  width: auto;
  height: auto;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 0.7s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.5s forwards;
}

.hero-company-text {
  color: #0553DD;
  font-size: 44.8px;
  font-family: Lato;
  font-weight: 700;
  line-height: 53.76px;
  letter-spacing: 0.9px;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  position: relative;
}

.hero-company-text:hover {
  transform: translateY(-4px);
  text-shadow: 0 8px 16px rgba(5, 83, 221, 0.2);
}

.hero-divider {
  width: 70px;
  height: 1px;
  background-color: #0553DD;
  opacity: 0;
  animation: slideInDown 0.7s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.6s forwards;
  transform-origin: left;
  transition: all 0.3s ease;
}

.hero-section-header:hover .hero-divider {
  width: 100px;
  background: linear-gradient(90deg, #0553DD 0%, rgba(5, 83, 221, 0.3) 100%);
}

/* ==========================================================================
   本文セクション
   ========================================================================== */
.hero-section-body {
  max-width: 645.20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 24px;
  animation: fadeInUp 0.8s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.6s backwards;
}

.hero-main-title {
  width: auto;
  height: auto;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.65s forwards;
}

.hero-main-title span {
  color: #000000;
  font-size: 36.8px;
  font-family: 'Noto Sans JP';
  font-weight: 700;
  line-height: 58.88px;
  letter-spacing: 1.1px;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.5s cubic-bezier(0.35, 0.46, 0.64, 0.88);
}

.hero-main-title:hover span {
  color: #0553DD;
  transform: translateX(8px);
}

.hero-description {
  width: 100%;
  max-width: 645px;
  height: auto;
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.7s forwards;
}

.hero-description span {
  color: #000000;
  font-size: 16px;
  font-family: 'Noto Sans JP';
  font-weight: 400;
  line-height: 28.8px;
  letter-spacing: 0.48px;
  word-wrap: break-word;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  white-space: normal;
  word-break: break-word;
}

.hero-description:hover span {
  color: #0553DD;
}

/* ==========================================================================
   ボタンスタイル
   ========================================================================== */
.hero-button-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border-radius: 1px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  opacity: 1;
  animation: fadeInUp 0.8s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.75s forwards;
  position: relative;
}

.hero-button-wrapper::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: radial-gradient(circle, rgba(5, 83, 221, 0.1), transparent);
  border-radius: 30px;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: -1;
}

.hero-button-wrapper:hover::before {
  opacity: 1;
  animation: glow 2s ease-in-out infinite;
}

.hero-button-icon {
  width: 60px;
  height: 60px;
  background-color: #0553DD;
  border-radius: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: all 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  box-shadow: 0 4px 12px rgba(5, 83, 221, 0.2);
}

.hero-button-icon .material-icons {
  color: white;
  font-size: 24px;
  font-weight: 400;
  line-height: 24px;
  text-align: center;
  transition: transform 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
}

.hero-button-wrapper:hover .hero-button-icon {
  background-color: #043ba8;
  transform: translateX(6px) scale(1.08);
  box-shadow: 0 8px 24px rgba(5, 83, 221, 0.35);
}

.hero-button-wrapper:hover .hero-button-icon .material-icons {
  transform: translateX(4px);
}

.hero-button-text {
  color: #000000;
  font-size: 16px;
  font-family: 'Noto Sans JP';
  font-weight: 700;
  line-height: 27.2px;
  letter-spacing: 0.48px;
  word-wrap: break-word;
  padding-left: 10px;
  min-width: 115px;
  white-space: nowrap;
  transition: all 0.4s cubic-bezier(0.35, 0.46, 0.64, 0.88);
}

.hero-button-wrapper:hover .hero-button-text {
  color: #0553DD;
  transform: translateX(4px);
}

/* ==========================================================================
   右側画像エリア
   ========================================================================== */
.hero-section-image {
  width: 534.80px;
  max-width: 534.80px;
  height: auto;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  border-radius: 12px;
  flex-shrink: 0;
  opacity: 1;
  animation: fadeInRight 1s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.5s forwards;
  transform-style: preserve-3d;
  perspective: 1200px;
}

.hero-image {
  width: 100%;
  height: 600px;
  max-width: 534.8px;
  display: block;
  border-radius: 12px;
  object-fit: cover;
  transition: all 0.6s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 0 20px 60px rgba(5, 83, 221, 0.15);
  animation: imageFloat 4s ease-in-out 1.5s infinite;
  transform-style: preserve-3d;
  will-change: transform, filter, box-shadow;
}

.hero-section-image:hover .hero-image {
  transform: scale(1.04) translateY(-4px);
  box-shadow: 0 20px 50px rgba(5, 83, 221, 0.2);
}

/* ==========================================================================
   レスポンシブ対応 - タブレット
   ========================================================================== */
@media (max-width: 1024px) {
  .hero-section-wrapper {
    padding: 40px 20px;
  }

  .hero-section-row {
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
  }

  .hero-section-content {
    flex: 0 1 100%;
    max-width: 100%;
  }

  .hero-section-image {
    width: 100%;
    max-width: 534.8px;
    margin: 0 auto;
    animation: fadeInUp 1s cubic-bezier(0.35, 0.46, 0.64, 0.88) 0.5s backwards;
  }
}

@media (max-width: 768px) {
  .hero-section-wrapper {
    padding: 30px 16px;
  }

  .hero-section-row {
    gap: 24px;
  }

  .hero-section-content {
    gap: 24px;
  }

  .hero-company-text {
    font-size: 32px;
    line-height: 38px;
  }

  .hero-main-title span {
    font-size: 24px;
    line-height: 36px;
  }

  .hero-description span {
    font-size: 14px;
    line-height: 24px;
  }

  .hero-button-text {
    font-size: 14px;
    line-height: 24px;
  }

  .hero-button-icon {
    width: 48px;
    height: 48px;
    border-radius: 24px;
  }

  .hero-button-icon .material-icons {
    font-size: 20px;
  }

  .hero-section-image {
    max-width: 100%;
  }

  .hero-image {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-section-wrapper {
    padding: 20px 12px;
  }

  .hero-section-row {
    gap: 16px;
  }

  .hero-section-content {
    gap: 16px;
  }

  .hero-company-text {
    font-size: 28px;
    line-height: 32px;
  }

  .hero-main-title span {
    font-size: 20px;
    line-height: 28px;
  }

  .hero-description span {
    font-size: 13px;
    line-height: 22px;
  }

  .hero-button-wrapper {
    gap: 8px;
  }

  .hero-button-icon {
    width: 44px;
    height: 44px;
    border-radius: 22px;
  }

  .hero-button-icon .material-icons {
    font-size: 18px;
  }

  .hero-button-text {
    font-size: 13px;
    line-height: 22px;
    min-width: auto;
  }
}

/* ==========================================================================
   アクセシビリティ
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .hero-section-wrapper,
  .hero-section-row,
  .hero-section-content,
  .hero-section-header,
  .hero-company-label,
  .hero-divider,
  .hero-section-body,
  .hero-main-title,
  .hero-description,
  .hero-button-wrapper,
  .hero-section-image,
  .hero-image,
  .hero-company-text,
  .hero-main-title span,
  .hero-description span,
  .hero-button-icon,
  .hero-button-text {
    animation: none !important;
    transition: none !important;
  }
}

@media (prefers-color-scheme: dark) {
  .hero-section-wrapper {
    background-color: #1a1a1a;
  }

  .hero-image {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  }

  .hero-section-image:hover .hero-image {
    box-shadow: 0 20px 50px rgba(5, 83, 221, 0.3);
  }
}

  .fg-hero-subtitle {
    color: #cccccc;
  }

  .fg-hero-image-wrapper {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
  }
}

/* ==========================================================================
   スクロール時のアニメーション定義
   ========================================================================== */

@keyframes subtle-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.95;
  }
  100% {
    opacity: 1;
  }
}

@keyframes gradient-shift {
  0% {
    filter: brightness(1) saturate(1);
  }
  50% {
    filter: brightness(1.05) saturate(1.1);
  }
  100% {
    filter: brightness(1) saturate(1);
  }
}

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

@keyframes scale-breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

@keyframes glow-subtle {
  0% {
    box-shadow: 0 10px 40px rgba(5, 83, 221, 0.1);
  }
  50% {
    box-shadow: 0 10px 50px rgba(5, 83, 221, 0.2);
  }
  100% {
    box-shadow: 0 10px 40px rgba(5, 83, 221, 0.1);
  }
}

/* ==========================================================================
   スクロール状態別スタイル
   ========================================================================== */

.hero-section-wrapper.hero-is-visible {
  /* スクロール可視時の継続アニメーション */
}

.hero-section-wrapper.hero-is-visible .hero-section-image {
  animation: smooth-float 4s ease-in-out infinite !important;
}

.hero-section-wrapper.hero-is-visible .hero-image {
  animation: glow-subtle 4s ease-in-out infinite !important;
}

.hero-section-wrapper.hero-is-visible .hero-company-text {
  animation: scale-breathe 5s ease-in-out infinite 0.5s !important;
}

.hero-section-wrapper.hero-is-visible .hero-button-wrapper {
  animation: gradient-shift 6s ease-in-out infinite 1s !important;
}

.hero-section-wrapper.hero-is-hidden {
  /* スクロール脱出時のアニメーション */
  opacity: var(--scroll-opacity, 0.3);
  transform: scale(var(--scroll-scale, 0.95));
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.hero-section-wrapper.hero-is-hidden .hero-main-title span {
  opacity: var(--scroll-opacity, 0.3);
}

.hero-section-wrapper.hero-is-hidden .hero-description span {
  opacity: var(--scroll-opacity, 0.3);
}

/* ==========================================================================
   画像のサブトルアニメーション最適化
   ========================================================================== */

.hero-image {
  will-change: transform, box-shadow;
  transition: transform 0.6s cubic-bezier(0.35, 0.46, 0.64, 0.88);
}

.hero-button-icon {
  will-change: background-color, transform;
}

.hero-company-text {
  will-change: transform;
}

/* ==========================================================================
   3D エフェクト強化
   ========================================================================== */

.hero-section-image {
  position: relative;
}

.hero-image {
  position: relative;
  z-index: 1;
}

.hero-section-image::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: -12px;
  bottom: -12px;
  background: linear-gradient(135deg, rgba(5, 83, 221, 0.1) 0%, rgba(5, 83, 221, 0.05) 100%);
  border-radius: 12px;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.35, 0.46, 0.64, 0.88);
  filter: blur(8px);
}

.hero-section-image:hover::before {
  opacity: 1;
}

.hero-section-image:hover .hero-image {
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 30px 80px rgba(5, 83, 221, 0.25),
    inset 0 0 40px rgba(255, 255, 255, 0.1);
}

/* マウスホバー時の立体効果 */
.hero-section-wrapper:hover .hero-section-image {
  transform: scale(1.02) translateY(-4px);
  filter: drop-shadow(0 30px 60px rgba(5, 83, 221, 0.2));
}
