/* ===== Skills Page 専用スタイル（修正後完全版） ===== */

/* ===== ファーストビュー（Skills） ===== */
.hero-skills {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-skills__background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-skills__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: heroImageZoom 25s ease-in-out infinite;
}

.hero-skills__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(111, 165, 199, 0.8) 0%,
    rgba(168, 216, 185, 0.7) 100%
  );
  z-index: -1;
}

.hero-skills__content {
  text-align: center;
  color: var(--color-white);
  max-width: 900px;
  padding: 0 20px;
  animation: heroContentSlide 1.2s ease-out;
}

.hero-skills__title {
  margin-bottom: 2.5rem;
}

.hero-skills__title-main {
  display: block;
  font-family: var(--font-japanese);
  font-size: 3.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--color-white), var(--color-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleGlow 4s ease-in-out infinite;
}

.hero-skills__title-sub {
  display: block;
  font-family: var(--font-japanese);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 3px;
  color: rgba(255, 255, 255, 0.9);
}

.hero-skills__description {
  font-size: 1.3rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
  margin-bottom: 3rem;
  font-family: var(--font-japanese);
}

/* スクロールボタン */
.hero-skills__scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

/* ===== 技術スタックセクション ===== */
.tech-stack {
  padding: 8rem 0;
  background: var(--color-white);
  position: relative;
  overflow: hidden;
}

.tech-stack::before {
  content: "";
  position: absolute;
  top: -30%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(111, 165, 199, 0.08) 0%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: 0;
}

.tech-stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 3rem;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

.tech-card {
  background: var(--color-background);
  padding: 3rem 2.5rem;
  border-radius: 20px;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(111, 165, 199, 0.1);
  position: relative;
  overflow: hidden;
}

.tech-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(111, 165, 199, 0.1),
    transparent
  );
  transition: left 0.8s;
}

.tech-card:hover::before {
  left: 100%;
}

.tech-card:hover {
  transform: translateY(-15px) scale(1.03);
  box-shadow: 0 25px 50px rgba(111, 165, 199, 0.2);
  border-color: var(--color-primary);
  animation: techCardFloat 3s ease-in-out infinite;
}

.tech-card__icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 2rem;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(111, 165, 199, 0.3);
}

.tech-card:hover .tech-card__icon {
  transform: scale(1.1) rotate(10deg);
  box-shadow: 0 15px 40px rgba(111, 165, 199, 0.4);
}

.tech-card__title {
  font-family: var(--font-primary);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.tech-card__description {
  color: #666;
  line-height: 1.8;
  margin-bottom: 2.5rem;
  font-size: 1rem;
}

.tech-card__level {
  text-align: left;
}

.tech-card__level-text {
  font-family: var(--font-japanese);
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 0.5rem;
  display: block;
}

.tech-card__level-bar {
  width: 100%;
  height: 8px;
  background: rgba(111, 165, 199, 0.2);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.tech-card__level-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
  width: 0%;
  transition: width 2s ease-out 0.5s;
  position: relative;
}

.tech-card__level-fill::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 6px;
  height: 100%;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 0 4px 4px 0;
  animation: levelShine 2s ease-in-out infinite;
}

/* ===== サービス領域セクション ===== */
.service-areas {
  padding: 8rem 0;
  background: var(--color-background);
  position: relative;
  overflow: hidden;
}

.service-areas::before {
  content: "";
  position: absolute;
  top: 20%;
  left: -15%;
  width: 800px;
  height: 800px;
  background: radial-gradient(
    circle,
    rgba(168, 216, 185, 0.06) 0%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: 0;
}

.service-areas__content {
  display: flex;
  flex-direction: column;
  gap: 5rem;
  position: relative;
  z-index: 1;
}

.service-area {
  background: var(--color-white);
  padding: 4rem 3rem;
  border-radius: 25px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.service-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(168, 216, 185, 0.08),
    transparent
  );
  transition: left 0.8s;
}

.service-area:hover::before {
  left: 100%;
}

.service-area:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.service-area__header {
  display: flex;
  align-items: flex-start;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.service-area__icon {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 30px rgba(111, 165, 199, 0.3);
}

.service-area:hover .service-area__icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 15px 40px rgba(111, 165, 199, 0.4);
}

.service-area__title-group {
  flex: 1;
}

.service-area__title {
  font-family: var(--font-primary);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.service-area__subtitle {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.8;
}

.service-area__features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.service-feature {
  display: block;
  padding: 1.5rem 2rem;
  background: rgba(111, 165, 199, 0.05);
  border-radius: 15px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 4px solid transparent;
  text-align: center;
}

.service-feature:hover {
  transform: translateY(-5px);
  border-left-color: var(--color-primary);
  box-shadow: 0 8px 25px rgba(111, 165, 199, 0.15);
  background: rgba(111, 165, 199, 0.08);
}

.service-feature__text {
  font-family: var(--font-japanese);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-text);
  display: block;
}

/* ===== 開発フローセクション ===== */
.development-flow {
  padding: 8rem 0;
  background: var(--color-white);
  position: relative;
  overflow: hidden;
}

.development-flow::before {
  content: "";
  position: absolute;
  bottom: -20%;
  right: -15%;
  width: 700px;
  height: 700px;
  background: radial-gradient(
    circle,
    rgba(111, 165, 199, 0.05) 0%,
    transparent 70%
  );
  border-radius: 50%;
  z-index: 0;
}

.flow-steps {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.flow-step {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 4rem;
  align-items: stretch;
  margin-bottom: 8rem;
  min-height: 500px;
}

.flow-step:last-child {
  margin-bottom: 0;
}

.flow-step--reverse {
  grid-template-columns: 55% 45%;
}

.flow-step--reverse .flow-step__image {
  order: 2;
}

.flow-step--reverse .flow-step__content {
  order: 1;
}

.flow-step__image {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
  min-height: 400px;
}

.flow-step__image:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
}

.flow-step__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.flow-step__image:hover img {
  transform: scale(1.1);
}

.flow-step__number {
  position: absolute;
  top: 30px;
  right: 30px;
  width: 80px;
  height: 80px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-family: var(--font-primary);
  font-size: 2rem;
  font-weight: 700;
  box-shadow: 0 15px 40px rgba(111, 165, 199, 0.4);
  z-index: 10;
  animation: flowNumberPulse 4s ease-in-out infinite;
}

.flow-step--reverse .flow-step__number {
  right: auto;
  left: 30px;
}

.flow-step__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 2rem;
  background: rgba(111, 165, 199, 0.03);
  border-radius: 15px;
  border-left: 5px solid var(--color-primary);
}

.flow-step__title {
  font-family: var(--font-japanese);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1.5rem;
  position: relative;
}

.flow-step__title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  border-radius: 2px;
}

.flow-step__description {
  font-size: 1.1rem;
  color: #666;
  line-height: 1.8;
  margin-bottom: 0;
}

/* フロー接続線 */
.flow-timeline {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 3px;
  transform: translateX(-50%);
  z-index: 0;
}

.flow-timeline__line {
  width: 100%;
  height: 80%;
  background: linear-gradient(
    180deg,
    var(--color-primary) 0%,
    var(--color-accent) 50%,
    var(--color-primary) 100%
  );
  border-radius: 2px;
  opacity: 0.4;
  margin-top: 10%;
}

/* ===== お問い合わせCTA セクション ===== */
.contact-cta {
  padding: 6rem 0;
  background: linear-gradient(
    135deg,
    var(--color-primary),
    var(--color-accent)
  );
  color: var(--color-white);
  position: relative;
  overflow: hidden;
}

.contact-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="15" cy="15" r="1" fill="white" opacity="0.1"/><circle cx="85" cy="35" r="1" fill="white" opacity="0.08"/><circle cx="45" cy="85" r="1" fill="white" opacity="0.12"/><circle cx="70" cy="20" r="1" fill="white" opacity="0.06"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  z-index: 0;
}

.contact-cta .section-title {
  color: var(--color-white);
  margin-bottom: 1rem;
}

.contact-cta .section-subtitle {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 3rem;
}

.contact-cta .section-title::after {
  background: var(--color-white);
}

.contact-cta__buttons {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.contact-cta .btn--primary {
  background: var(--color-white);
  color: var(--color-primary);
  border-color: var(--color-white);
}

.contact-cta .btn--primary:hover {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.contact-cta .btn--secondary {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.contact-cta .btn--secondary:hover {
  background: var(--color-white);
  color: var(--color-primary);
}

/* ===== アニメーション用クラス ===== */
.fade-in-up {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

.slide-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== ナビゲーション項目のフォーカス時の四角線を除去 ===== */
.nav__link:focus,
.nav__menu-link:focus,
button:focus,
a:focus {
  outline: none !important;
  box-shadow: none !important;
}

/* フォーカス時の代替スタイル（アクセシビリティ対応） */
.nav__link:focus-visible,
.nav__menu-link:focus-visible {
  color: var(--color-primary);
  text-shadow: 0 0 8px rgba(111, 165, 199, 0.5);
}

button:focus-visible,
.btn:focus-visible {
  box-shadow: 0 0 0 3px rgba(111, 165, 199, 0.3) !important;
  outline: none !important;
}

/* ===== 高級感を演出するアニメーション ===== */
@keyframes techCardFloat {
  0%,
  100% {
    transform: translateY(-15px) scale(1.03);
  }
  50% {
    transform: translateY(-20px) scale(1.03);
  }
}

@keyframes flowNumberPulse {
  0%,
  100% {
    box-shadow: 0 15px 40px rgba(111, 165, 199, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 20px 60px rgba(111, 165, 199, 0.6);
    transform: scale(1.05);
  }
}

@keyframes levelShine {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes heroImageZoom {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes heroContentSlide {
  0% {
    opacity: 0;
    transform: translateY(60px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes titleGlow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3);
  }
}

/* ===== レスポンシブデザイン ===== */
@media (max-width: 1024px) {
  .service-area__header {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .service-area__icon {
    width: 100px;
    height: 100px;
  }

  .service-area__features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .flow-step {
    grid-template-columns: 1fr !important;
    gap: 3rem;
    text-align: center;
    min-height: auto;
  }

  .flow-step--reverse .flow-step__image {
    order: 1;
  }

  .flow-step--reverse .flow-step__content {
    order: 2;
  }

  .flow-step__image {
    min-height: 300px;
  }

  .flow-step__number {
    top: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    font-size: 1.8rem;
  }

  .flow-step--reverse .flow-step__number {
    right: 20px;
    left: auto;
  }

  .flow-step__content {
    padding: 2rem 1.5rem;
  }

  .flow-timeline {
    display: none;
  }
}

@media (max-width: 768px) {
  /* ヒーローセクション */
  .hero-skills__title-main {
    font-size: 2.8rem;
  }

  .hero-skills__title-sub {
    font-size: 1.1rem;
    letter-spacing: 2px;
  }

  .hero-skills__description {
    font-size: 1.1rem;
  }

  /* セクション調整 */
  .tech-stack,
  .service-areas,
  .development-flow {
    padding: 6rem 0;
  }

  .contact-cta {
    padding: 4rem 0;
  }

  /* 技術カード */
  .tech-stack__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .tech-card {
    padding: 2.5rem 2rem;
  }

  .tech-card__icon {
    width: 80px;
    height: 80px;
  }

  /* サービス領域 */
  .service-area {
    padding: 3rem 2rem;
  }

  .service-area__title {
    font-size: 1.8rem;
  }

  /* 開発フロー */
  .flow-steps {
    padding: 0 1rem;
  }

  .flow-step {
    margin-bottom: 5rem;
  }

  .flow-step__image {
    min-height: 250px;
  }

  .flow-step__number {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    top: 15px;
    right: 15px;
  }

  .flow-step--reverse .flow-step__number {
    right: 15px;
    left: auto;
  }

  .flow-step__title {
    font-size: 1.8rem;
  }

  .flow-step__content {
    padding: 1.5rem;
  }

  /* ボタン調整 */
  .contact-cta__buttons {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  /* 全体的な余白調整 */
  .container {
    padding: 0 15px;
  }

  /* ヒーローセクション */
  .hero-skills__title-main {
    font-size: 2.2rem;
  }

  .hero-skills__title-sub {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .hero-skills__description {
    font-size: 1rem;
  }

  .hero-skills__scroll {
    bottom: 20px;
  }

  /* セクション調整 */
  .tech-stack,
  .service-areas,
  .development-flow {
    padding: 4rem 0;
  }

  .contact-cta {
    padding: 3rem 0;
  }

  /* 技術カード */
  .tech-card {
    padding: 2rem 1.5rem;
  }

  .tech-card__icon {
    width: 70px;
    height: 70px;
  }

  .tech-card__title {
    font-size: 1.5rem;
  }

  /* サービス領域 */
  .service-area {
    padding: 2.5rem 1.5rem;
  }

  .service-area__icon {
    width: 80px;
    height: 80px;
  }

  .service-area__title {
    font-size: 1.6rem;
  }

  .service-feature {
    padding: 1.2rem 1.5rem;
    text-align: center;
  }

  .service-feature:hover {
    transform: translateY(-5px);
  }

  /* 開発フロー */
  .flow-steps {
    padding: 0;
  }

  .flow-step {
    margin-bottom: 4rem;
  }

  .flow-step__image {
    min-height: 200px;
  }

  .flow-step__number {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    top: 10px;
    right: 10px;
  }

  .flow-step--reverse .flow-step__number {
    right: 10px;
    left: auto;
  }

  .flow-step__title {
    font-size: 1.5rem;
  }

  .flow-step__content {
    padding: 1.2rem;
    border-left-width: 3px;
  }

  /* セクションタイトル */
  .section-title {
    font-size: 2rem;
  }
}

/* ===== アクセシビリティ対応 ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .tech-card:hover,
  .service-area:hover,
  .service-feature:hover {
    animation: none;
  }
}

/* ===== プリント用スタイル ===== */
@media print {
  .hero-skills {
    height: auto;
    padding: 2rem 0;
  }

  .hero-skills__content {
    color: #000;
  }

  .hero-skills__title-main {
    -webkit-text-fill-color: #000;
  }

  .tech-stack,
  .service-areas,
  .development-flow,
  .contact-cta {
    page-break-inside: avoid;
    padding: 2rem 0;
  }

  .contact-cta {
    background: #f5f5f5;
    color: #000;
  }

  .flow-step {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .flow-step__number {
    display: none;
  }
}

/* ===== 高解像度ディスプレイ対応 ===== */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .hero-skills__image,
  .tech-card__icon,
  .service-area__icon {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}
