/* ===== 変数定義 ===== */
:root {
  /* カラーパレット：エンジニアらしい知的でシャープな配色 */
  --primary-color: #2563eb;
  /* 深みのあるテックブルー */
  --primary-dark: #1e40af;
  --primary-light: #60a5fa;
  --text-color: #1f2937;
  /* ほぼ黒に近いダークグレー */
  --text-color-light: #4b5563;
  --background-color: #f3f4f6;
  /* 無機質なライトグレー */
  --white: #ffffff;
  --border-color: #e5e7eb;

  /* アクセント */
  --code-bg: #1e293b;
  /* ダークモード風背景 */
  --code-text: #e2e8f0;

  /* レイアウト */
  --section-padding: 80px 0;
  --border-radius: 8px;
  /* 丸みを抑えてシャープに */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  /* フォント */
  --font-main: 'Noto Sans JP', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  /* テック感のある等幅フォント */
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.7;
  letter-spacing: 0.02em;
  overflow-x: hidden;
  /* 背景にうっすらグリッドパターンを追加 */
  background-image: radial-gradient(#e5e7eb 1px, transparent 1px);
  background-size: 24px 24px;
}

/* 英数字を等幅フォントにするクラス */
.mono,
.label,
.skill-years,
.portfolio-time-badge,
.time,
.date {
  font-family: var(--font-mono);
}

.container {
  max-width: 1000px;
  /* 1100pxから少し狭めて中央に寄せる */
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== ヘッダー ===== */
.header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding: 16px 0;
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
  box-shadow: none;
  /* フラットに */
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 24px;
}

.site-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.site-title-main {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
  letter-spacing: 0.05em;
}

.site-title-sub {
  font-size: 0.85rem;
  color: var(--text-color-light);
  font-family: var(--font-mono);
  background: var(--border-color);
  padding: 2px 8px;
  border-radius: 4px;
}

.nav-menu ul {
  list-style: none;
  display: flex;
  gap: 32px;
}

.nav-menu ul li a {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
}

.nav-menu ul li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.nav-menu ul li a:hover {
  color: var(--primary-color);
}

.nav-menu ul li a:hover::after {
  width: 100%;
}

/* モバイルメニュートグルボタン */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 30px;
  height: 30px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
}

.mobile-menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--text-color);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

/* ===== ヒーローセクション ===== */
.hero-section {
  position: relative;
  background: var(--white);
  padding: 180px 0 120px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

/* グリッド背景演出 */
.hero-bg-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background-image: linear-gradient(var(--border-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-color) 1px, transparent 1px);
  background-size: 40px 40px;
  opacity: 0.4;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 60%, rgba(0, 0, 0, 0));
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-title {
  color: var(--text-color);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-color-light);
  margin-bottom: 2rem;
  line-height: 1.7;
  font-family: var(--font-mono);
  /* テック感を出す */
  background: #f8fafc;
  display: block;
  /* ブロック要素にして確実に下に配置 */
  padding: 14px 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
  /* テキストを中央揃え */
}

.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-color);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--border-radius);
  padding: 14px 40px;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  border: 1px solid transparent;
  margin-top: 1rem;
  /* サブテキストとの間隔を確保 */
}

.cta-button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* ===== セクション共通 ===== */
.section {
  padding: var(--section-padding);
}

.section-title {
  color: var(--text-color);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 中央寄せ */
  gap: 0.6em;
  font-size: 1.8rem;
  margin-bottom: 3rem;
  position: relative;
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 10px;
  /* 下線用の余白 */
}

.section-title::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  /* 中央下線 */
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-title i {
  color: var(--primary-color);
  font-size: 0.9em;
}

/* ===== プロフィールセクション ===== */
.about-content {
  max-width: 900px;
  /* コンテンツ幅を制限して中央寄せ */
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 40px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
  box-shadow: var(--shadow-sm);
}

.profile-image {
  flex-shrink: 0;
  width: 240px;
  height: 240px;
  border-radius: var(--border-radius);
  /* 円形ではなく角丸四角に */
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: var(--background-color);
}

.profile-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.profile-image:hover img {
  transform: scale(1.05);
}

.profile-info {
  flex-grow: 1;
}

.profile-list {
  list-style: none;
}

.profile-list li {
  margin-bottom: 1rem;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 0.5rem;
}

.profile-list li:last-child {
  border-bottom: none;
}

.label {
  display: inline-block;
  width: 120px;
  font-weight: 700;
  color: var(--text-color-light);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.profile-sublist {
  margin-top: 1rem;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.profile-sublist li {
  position: relative;
  padding: 12px 16px 12px 2em;
  font-size: 0.95rem;
  border: none;
  padding-bottom: 12px;
  margin-bottom: 0;
  background: #f8fafc;
  border-radius: 6px;
  line-height: 1.6;
  transition: background 0.2s;
}

.profile-sublist li:hover {
  background: #f1f5f9;
}

.profile-sublist li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-family: var(--font-mono);
  font-weight: bold;
}

.profile-message {
  margin-top: 2rem;
  background: #f8fafc;
  border-left: 4px solid var(--primary-color);
  padding: 1.5rem;
  font-style: normal;
  color: var(--text-color);
  font-size: 1rem;
}

/* ===== スキルセクション ===== */
.skills-content {
  max-width: 900px;
  /* コンテンツ幅を制限して中央寄せ */
  margin: 0 auto;
  display: grid;
  gap: 24px;
}

.skill-category {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.skill-category h3 {
  font-size: 1.2rem;
  color: var(--text-color);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
}

.skill-category h3 i {
  color: var(--primary-color);
}

.skills-list {
  list-style: none;
}

.skills-list li {
  margin-bottom: 12px;
  padding: 12px 16px;
  background: var(--background-color);
  border-radius: 4px;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  transition: transform 0.2s, background 0.2s;
}

.skills-list li::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  margin-right: 12px;
}

.skills-list li:hover {
  background: #e0f2fe;
  /* 薄いブルー */
  transform: translateX(4px);
  color: var(--primary-dark);
}

/* ===== 制作実績セクション ===== */
.tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 40px;
}

.tab {
  background: transparent;
  color: var(--text-color-light);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 8px 24px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab.active,
.tab:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* 3列固定 */
  gap: 32px;
}

.panel-inner {
  max-width: 960px;
  /* カードグリッドも中央に寄せる */
  margin: 0 auto 40px;
}

.category-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-color);
  border-left: 4px solid var(--primary-color);
  padding-left: 12px;
}

.portfolio-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  position: relative;
}

.portfolio-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.portfolio-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
}

.portfolio-time-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.portfolio-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.portfolio-content h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: var(--text-color);
}

.portfolio-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.tech-tag {
  background: #f1f5f9;
  color: var(--text-color-light);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
}

.portfolio-description {
  font-size: 0.95rem;
  color: var(--text-color-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.portfolio-link {
  display: block;
  text-align: center;
  background: #f9fafb;
  padding: 12px;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  border-top: 1px solid var(--border-color);
  transition: background 0.2s;
}

.portfolio-link:hover {
  background: #f3f4f6;
}

/* ===== お問い合わせセクション ===== */
.contact-content {
  max-width: 800px;
  margin: 0 auto;
  background: var(--white);
  padding: 40px;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-color);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.3s;
  background: #f9fafb;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--white);
}

.submit-button {
  width: 100%;
  padding: 14px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.submit-button:hover {
  background: var(--primary-dark);
}

.form-note {
  text-align: center;
  margin-top: 16px;
  color: var(--text-color-light);
  font-size: 0.9rem;
}

/* ===== フッター ===== */
.footer {
  background: #111827;
  /* ほぼ黒 */
  color: #9ca3af;
  padding: 40px 0;
  text-align: center;
  margin-top: 80px;
  opacity: 1;
  /* AOSのアニメーションが適用されないように明示的に設定 */
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

/* ===== レスポンシブ対応 ===== */
/* タブレットサイズ（1024px以下）: 2列 */
@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .hero-section {
    padding: 160px 0 100px;
  }

  .hero-title {
    font-size: 2.4rem;
  }

  .section {
    padding: 60px 0;
  }
}

/* タブレットサイズ（768px以下） */
@media (max-width: 768px) {

  /* ヘッダー */
  .mobile-menu-toggle {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    padding-top: 80px;
  }

  .nav-menu.active {
    right: 0;
  }

  .nav-menu ul {
    flex-direction: column;
    gap: 0;
    padding: 0 24px;
  }

  .nav-menu ul li {
    border-bottom: 1px solid var(--border-color);
  }

  .nav-menu ul li a {
    display: block;
    padding: 16px 0;
    font-size: 1rem;
  }

  .nav-menu ul li a::after {
    display: none;
  }

  .header-container {
    padding: 0 20px;
  }

  .site-title-main {
    font-size: 1.3rem;
  }

  .site-title-sub {
    font-size: 0.75rem;
  }

  /* ヒーローセクション */
  .hero-section {
    padding: 140px 0 80px;
  }

  .hero-title {
    font-size: 1.8rem;
    line-height: 1.5;
    margin-bottom: 1.2rem;
  }

  .hero-sub {
    font-size: 0.9rem;
    padding: 12px 16px;
    line-height: 1.6;
  }

  .cta-button {
    font-size: 0.95rem;
    padding: 12px 32px;
  }

  /* セクション */
  .section {
    padding: 50px 0;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 2rem;
  }

  /* プロフィールセクション */
  .about-content {
    flex-direction: column;
    padding: 24px;
    gap: 24px;
  }

  .profile-image {
    width: 160px;
    height: 160px;
    margin: 0 auto;
  }

  .profile-info {
    width: 100%;
  }

  .profile-list li {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .label {
    width: 100%;
    margin-bottom: 4px;
  }

  .profile-sublist {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* スキルセクション */
  .skills-content {
    gap: 20px;
  }

  .skill-category {
    padding: 20px;
  }

  .skill-category h3 {
    font-size: 1.1rem;
  }

  /* タブ */
  .tabs {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
  }

  .tab {
    font-size: 0.85rem;
    padding: 6px 16px;
  }

  /* カードグリッド */
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* お問い合わせセクション */
  .contact-content {
    padding: 24px 20px;
  }

  .form-group {
    margin-bottom: 20px;
  }

  .form-group label {
    font-size: 0.95rem;
  }

  .form-group input,
  .form-group textarea {
    font-size: 0.95rem;
    padding: 10px;
  }

  .submit-button {
    font-size: 1rem;
    padding: 12px;
  }

  /* コンテナ */
  .container {
    padding: 0 20px;
  }
}

/* スマートフォンサイズ（480px以下） */
@media (max-width: 480px) {
  .hero-section {
    padding: 120px 0 60px;
  }

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

  .hero-sub {
    font-size: 0.85rem;
    padding: 10px 14px;
  }

  .section {
    padding: 40px 0;
  }

  .section-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
  }

  .about-content {
    padding: 20px;
  }

  .profile-image {
    width: 140px;
    height: 140px;
  }

  .skill-category {
    padding: 16px;
  }

  .skill-category h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .skills-list li {
    font-size: 0.9rem;
    padding: 10px 12px;
  }

  .tabs {
    gap: 6px;
  }

  .tab {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .contact-content {
    padding: 20px 16px;
  }

  .container {
    padding: 0 16px;
  }

  .header-container {
    padding: 0 16px;
  }

  .site-title-main {
    font-size: 1.2rem;
  }

  .site-title-sub {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
}

/* フェードインアニメーション（AOS用） */
[data-aos] {
  opacity: 0;
  transition-duration: 800ms;
}

[data-aos].aos-animate {
  opacity: 1;
}

.view-more {
  text-align: center;
  margin-top: 40px;
}

.view-more-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--primary-color);
  padding: 10px 24px;
  border-radius: 20px;
  transition: all 0.2s;
}

.view-more-button:hover {
  background: var(--primary-color);
  color: white;
}

/* ===== Worksページ専用スタイル ===== */
.page-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-color);
  text-align: center;
  margin: 0 auto 1.5rem;
  padding-bottom: 1rem;
  position: relative;
  max-width: fit-content;
}

.page-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-color-light);
  font-size: 1rem;
  margin-bottom: 4rem;
  font-family: var(--font-mono);
}

#works-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Worksページのカテゴリタイトルを中央寄せ */
#works-container .category-title {
  text-align: center;
  border-left: none;
  border-bottom: 3px solid var(--primary-color);
  padding-left: 0;
  padding-bottom: 12px;
  margin-bottom: 2.5rem;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  position: relative;
}

#works-container .category-title::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: var(--primary-color);
}

/* Worksページのカードグリッドを中央寄せ */
#works-container .cards-grid {
  max-width: 1200px;
  margin: 0 auto;
}

/* Worksページのパネルインナーを調整 */
#works-container .panel-inner {
  max-width: 1200px;
  margin: 0 auto 60px;
  padding: 0;
}

/* Worksページのポートフォリオアイテムをよりスタイリッシュに */
#works-container .portfolio-item {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

#works-container .portfolio-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

#works-container .portfolio-item img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-bottom: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

#works-container .portfolio-item:hover img {
  transform: scale(1.05);
}

#works-container .portfolio-time-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  z-index: 2;
}

#works-container .portfolio-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

#works-container .portfolio-content h3 {
  font-size: 1.3rem;
  margin-bottom: 12px;
  color: var(--text-color);
  font-weight: 700;
  line-height: 1.4;
}

#works-container .portfolio-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

#works-container .tech-tag {
  background: #f1f5f9;
  color: var(--text-color-light);
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
  font-weight: 500;
}

#works-container .portfolio-description {
  font-size: 0.95rem;
  color: var(--text-color-light);
  margin-bottom: 20px;
  line-height: 1.7;
  flex-grow: 1;
}

#works-container .portfolio-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: #f9fafb;
  padding: 14px;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  border-top: 1px solid var(--border-color);
  transition: all 0.2s;
  font-size: 0.95rem;
}

#works-container .portfolio-link:hover {
  background: var(--primary-color);
  color: white;
}

#works-container .portfolio-link i {
  transition: transform 0.2s;
}

#works-container .portfolio-link:hover i {
  transform: translateX(4px);
}

/* Worksページのレスポンシブ対応 */
@media (max-width: 1024px) {
  #works-container .cards-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 1.6rem;
    margin-bottom: 1rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 2.5rem;
  }

  #works-container {
    padding: 0 20px;
  }

  #works-container .cards-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #works-container .category-title {
    font-size: 1.2rem;
    margin-bottom: 2rem;
  }

  #works-container .portfolio-content {
    padding: 20px;
  }

  #works-container .portfolio-content h3 {
    font-size: 1.1rem;
  }

  #works-container .panel-inner {
    margin-bottom: 50px;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.4rem;
  }

  .section-subtitle {
    font-size: 0.85rem;
    margin-bottom: 2rem;
  }

  #works-container {
    padding: 0 16px;
  }

  #works-container .category-title {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  #works-container .portfolio-content {
    padding: 16px;
  }

  #works-container .portfolio-content h3 {
    font-size: 1rem;
  }

  #works-container .portfolio-description {
    font-size: 0.9rem;
  }

  #works-container .tech-tag {
    font-size: 0.7rem;
    padding: 4px 8px;
  }
}

/* ===== チャットボタンとウィンドウ ===== */
.chat-toggle-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: pulse 2s infinite;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

@keyframes pulse {

  0%,
  100% {
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
  }

  50% {
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6);
  }
}

.chat-window {
  position: fixed;
  bottom: 0;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 48px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: white;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  transform: translateY(100%);
  pointer-events: none;
}

.chat-window-open {
  transform: translateY(0);
  pointer-events: auto;
}

.chat-window-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 16px 16px 0 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.chat-window-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.chat-window-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  position: relative;
  z-index: 0;
  min-height: 0;
}

.chat-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .chat-window {
    right: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    bottom: 0;
    transform: translateY(100%);
  }

  .chat-window-open {
    transform: translateY(0);
  }

  .chat-window-header {
    border-radius: 0;
    flex-shrink: 0;
    z-index: 1;
  }

  .chat-close-btn {
    z-index: 2;
    position: relative;
  }

  .chat-toggle-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .chat-toggle-btn {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
    font-size: 18px;
  }
}