/* ===== CSS変数定義 ===== */
:root {
  /* ライトモード - パステルかわいい系 */
  --bg-gradient: linear-gradient(135deg, #fef7f7 0%, #f0f8ff 30%, #fff0f5 70%, #f5f0ff 100%);
  --accent-gradient: linear-gradient(135deg, #ffb3d1 0%, #ff9fc7 50%, #ffa8cc 100%);
  --secondary-gradient: linear-gradient(135deg, #b3e5fc 0%, #e1bee7 100%);
  --card-bg: rgba(255, 255, 255, 0.8);
  --card-border: rgba(255, 192, 203, 0.3);
  --text-primary: #5a4a5a;
  --text-secondary: #8b7d8b;
  --shadow-soft: 0 8px 25px rgba(255, 182, 193, 0.2);
  --shadow-medium: 0 15px 35px rgba(255, 182, 193, 0.25);
  --decoration-color: #ffb3d1;
}

/* ===== ダークモード用CSS変数 ===== */
body.dark-mode {
  /* ダークモード - 落ち着いたかわいい系 */
  --bg-gradient: linear-gradient(135deg, #2a2438 0%, #1e1a2e 30%, #2d1b36 70%, #1a1625 100%);
  --accent-gradient: linear-gradient(135deg, #ff9fc7 0%, #ffa8cc 50%, #ffb3d1 100%);
  --secondary-gradient: linear-gradient(135deg, #9c88d4 0%, #d4a5d9 100%);
  --card-bg: rgba(255, 255, 255, 0.1);
  --card-border: rgba(255, 192, 203, 0.2);
  --text-primary: #f0e6f0;
  --text-secondary: #c8b5c8;
  --shadow-soft: 0 8px 25px rgba(0, 0, 0, 0.3);
  --shadow-medium: 0 15px 35px rgba(0, 0, 0, 0.4);
  --decoration-color: #ff9fc7;
}

/* ===== 基本リセット ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== ボディスタイル（メインのテーマ適用） ===== */
body {
  font-family: 'M PLUS Rounded 1c', 'Klee One', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  transition: all 0.5s ease-in-out; /* テーマ切替時のスムーズなアニメーション */
  overflow-x: hidden;
}

/* ===== 背景装飾エフェクト ===== */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 182, 193, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, rgba(221, 160, 221, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 50% 90%, rgba(173, 216, 230, 0.3) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* ===== 浮遊する装飾アニメーション ===== */
body::after {
  content: '✨ ⭐ 💫 ✨ ⭐ 💫 ✨ ⭐ 💫 ✨';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-size: 1.2rem;
  opacity: 0.1;
  pointer-events: none;
  z-index: -1;
  animation: float 20s infinite linear;
  white-space: nowrap;
  overflow: hidden;
}

@keyframes float {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== メインコンテナ ===== */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* ===== コンテナの装飾要素 ===== */
.container::before {
  content: '🎀';
  position: absolute;
  top: 5%;
  left: 10%;
  font-size: 2rem;
  opacity: 0.3;
  animation: bounce 3s infinite ease-in-out;
}

.container::after {
  content: '🌸';
  position: absolute;
  bottom: 10%;
  right: 15%;
  font-size: 2rem;
  opacity: 0.3;
  animation: bounce 3s infinite ease-in-out 1.5s;
}

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

/* ===== ヘッダーセクション ===== */
header {
  text-align: center;
  padding: 2rem 0;
  position: relative;
}

/* ===== プロフィールセクション ===== */
.profile-section {
  backdrop-filter: blur(20px);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 50px;
  padding: 3rem 2rem;
  box-shadow: var(--shadow-medium);
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* ===== プロフィールセクションの装飾 ===== */
.profile-section::before {
  content: '💖';
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: twinkle 2s infinite ease-in-out;
}

.profile-section::after {
  content: '🌟';
  position: absolute;
  bottom: 20px;
  left: 30px;
  font-size: 1.5rem;
  opacity: 0.4;
  animation: twinkle 2s infinite ease-in-out 1s;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.1); }
}

/* ===== プロフィールセクションホバーエフェクト ===== */
.profile-section:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-medium);
}

/* ===== プロフィール画像 ===== */
.profile-image {
  position: relative;
  display: inline-block;
  margin-bottom: 2rem;
}

.profile-image::before {
  content: '';
  position: absolute;
  top: -15px;
  left: -15px;
  right: -15px;
  bottom: -15px;
  background: var(--accent-gradient);
  border-radius: 50%;
  z-index: -1;
  animation: breathing 4s infinite ease-in-out;
}

@keyframes breathing {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
}

.profile-image img {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.8);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile-image:hover img {
  transform: scale(1.08) rotate(-3deg);
}

/* ===== プロフィールタイトル ===== */
.profile-title {
  font-family: 'Klee One', 'M PLUS Rounded 1c', cursive;
  font-size: 2.8rem;
  font-weight: 600;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  position: relative;
}

.profile-title::after {
  content: '✨';
  position: absolute;
  top: -10px;
  right: -20px;
  font-size: 1.5rem;
  animation: sparkle 2s infinite ease-in-out;
}

@keyframes sparkle {
  0%, 100% { opacity: 0.5; transform: rotate(0deg) scale(1); }
  50% { opacity: 1; transform: rotate(180deg) scale(1.2); }
}

/* ===== プロフィール説明 ===== */
.profile-description {
  font-size: 1.3rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
}

/* ===== テーマ切替ボタン ===== */
.mode-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(15px);
  border: 2px solid var(--card-border);
  color: var(--text-secondary);
  padding: 0.8rem 1.3rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 500;
  font-size: 0.85rem;
  z-index: 1000;
  opacity: 0.8;
}

.mode-toggle:hover {
  color: var(--text-primary);
  opacity: 1;
  transform: translateY(-3px) scale(1.05) rotate(5deg);
  box-shadow: var(--shadow-soft);
}

/* ===== SNSリンクコンテナ ===== */
.sns-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* ===== 個別SNSリンク ===== */
.sns-link {
  display: block;
  padding: 2rem 2.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 2px solid var(--card-border);
  border-radius: 40px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  font-weight: 500;
}

/* ===== SNSリンクホバーエフェクト（背景グラデーション） ===== */
.sns-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--secondary-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  z-index: -1;
  opacity: 0.3;
}

.sns-link:hover::before {
  transform: scaleX(1);
}

.sns-link:hover {
  transform: translateY(-8px) scale(1.03) rotate(-1deg);
  box-shadow: var(--shadow-medium);
  color: var(--text-primary);
}

/* ===== SNSリンクタイトル ===== */
.sns-link-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  font-family: 'Klee One', 'M PLUS Rounded 1c', cursive;
}

/* ===== SNSリンク説明 ===== */
.sns-link-description {
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ===== フッター ===== */
footer {
  text-align: center;
  padding: 2.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  backdrop-filter: blur(15px);
  background: var(--card-bg);
  border: 2px solid var(--card-border);
  border-radius: 40px;
  margin-top: 2rem;
  position: relative;
}

/* ===== フッター装飾 ===== */
footer::before {
  content: '🎈';
  position: absolute;
  top: 15px;
  left: 20px;
  font-size: 1.2rem;
  opacity: 0.4;
  animation: sway 3s infinite ease-in-out;
}

footer::after {
  content: '🎉';
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.2rem;
  opacity: 0.4;
  animation: sway 3s infinite ease-in-out 1.5s;
}

@keyframes sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

/* ===== レスポンシブデザイン（スマホ対応） ===== */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .profile-section {
    padding: 2.5rem 2rem;
    border-radius: 35px;
  }

  .profile-title {
    font-size: 2.2rem;
  }

  .profile-image img {
    width: 150px;
    height: 150px;
  }

  .mode-toggle {
    top: 1rem;
    right: 1rem;
    padding: 0.7rem 1.1rem;
    font-size: 0.8rem;
  }

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

  .sns-link {
    padding: 1.8rem 2rem;
    border-radius: 30px;
  }
}

/* ===== ページロード時のフェードインアニメーション ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.profile-section, .sns-link, footer {
  animation: fadeInUp 0.8s ease-out backwards;
}

/* ===== 段階的なアニメーション遅延 ===== */
.sns-link:nth-child(1) { animation-delay: 0.2s; }
.sns-link:nth-child(2) { animation-delay: 0.4s; }
.sns-link:nth-child(3) { animation-delay: 0.6s; }
.sns-link:nth-child(4) { animation-delay: 0.8s; }
footer { animation-delay: 1s; }

/* ===== 装飾用ドットパターン ===== */
.decoration-dots {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(circle at 25% 25%, var(--decoration-color) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, var(--decoration-color) 1px, transparent 1px);
  background-size: 40px 40px, 60px 60px;
  opacity: 0.1;
  pointer-events: none;
  z-index: -1;
}
