/* ============= 基本設定 ============= */
:root {
  --primary-color: #007ced;
  --bg-color: #222;
  --text-color: #e5e5e5;
  --accent-color: #333;
  --border-color: #e5e5e5;
  --wrapper-width: 1280px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  text-decoration: none;
  color: inherit;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

.wrapper {
  width: var(--wrapper-width);
  max-width: 95%;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============= ヘッダー ============= */
.site-header {
  background-color: var(--bg-color);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 15px 0;
  border-bottom: 1px solid #333;
}
.header-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.logo {
  display: flex;
  align-items: center;
}
.logo i {
  width: 45px;
  height: 45px;
  background-color: var(--primary-color);
  border-radius: 50%;
  color: #fff;
  font-size: 1.5rem;
  padding: 10px;
  margin-right: 5px;
  text-align: center;
}
.logo-text {
  font-size: 24px;
  font-weight: 500;
}
.main-nav {
  position: relative;
}
.togglebtn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
.togglebtn .bar {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  margin: 4px 0;
  transition: transform 0.3s, opacity 0.3s;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
.navlinks {
  list-style: none;
  display: flex;
  align-items: center;
}
.navlinks li {
  margin-left: 20px;
}
.navlinks li a:hover {
  color: var(--primary-color);
}

/* レスポンシブヘッダー */
@media (max-width: 930px) {
  .togglebtn {
    display: block;
  }
  .navlinks {
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 0; /* 固定位置 */
    width: 200px;
    background-color: var(--bg-color);
    padding: 20px 0;
    height: calc(100vh - 60px);
    box-shadow: -2px 0 5px rgba(0,0,0,0.5);
    transition: transform 0.5s;
    transform: translateX(120%); /* 画面外に隠す */
  }
  .navlinks.open {
    transform: translateX(0); /* メニューを表示 */
  }
  .togglebtn.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .togglebtn.active .bar:nth-child(2) {
    opacity: 0;
  }
  .togglebtn.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
}

/* ============= セクション毎の余白・背景色 ============= */
/* --- フラクタル／ガウス風オーバーレイ共通設定 --- */
.section-fractal {
  position: relative;
  overflow: hidden;
}
.section-fractal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  opacity: 0.05; /* 薄い装飾 */
  pointer-events: none;
  z-index: 0;
  animation: fractalAnim 12s infinite ease-in-out;
}

@keyframes fractalAnim {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 0.05;
  }
  50% {
    transform: scale(1.05) rotate(3deg);
    opacity: 0.08;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 0.05;
  }
}

/* ヒーローセクション（背景色・画像はお好みで変更） */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 60px 0;
  position: relative;
  z-index: 1; /* コンテンツを前面に */
  background-color: var(--bg-color);
}
.hero.section-fractal::before {
  background-image: url('images/bg2.jpg');
}

/* ギャラリーセクション */
        .gallery-section {
  padding: 20px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* レスポンシブ対応 */
  gap: 10px;
}

.gallery-item {
  width: 100%;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
}

/* Lightbox スタイリング */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
}

.close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 30px;
  color: white;
  cursor: pointer;
}

/* ポートフォリオセクション */
.portfolio-section {
  padding: 80px 0;
  background-color: #242424;
  position: relative;
  z-index: 1;
}
.portfolio-section.section-fractal::before {
  background-image: url('images/bg3.jpg');
}

/* 自己紹介セクション */
.about-section {
  padding: 80px 0;
  background-color: #1b1b1b;
  position: relative;
  z-index: 1;
}
.about-section.section-fractal::before {
  background-image: url('images/bg4.jpg');
}

/* お問い合わせセクション（HubSpotフォーム用上書き） */
#contact.contact-section {
  background-color: #cdcdcd;
  color: #111;
  padding-top: 60px;
  position: relative;
  z-index: 1;
}
#contact.contact-section.section-fractal::before {
  background-image: url('images/bg1.jpg');
}

/* ============= ヒーローコンテンツ ============= */
.hero-container {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}
.hero-text {
  max-width: 500px;
  text-align: center;
  margin-bottom: 30px;
}
.hero-text h1 {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 10px;
}
.hero-text h2 {
  font-size: 1.8rem;
  margin-bottom: 20px;
}
.btn-group {
  margin: 30px 0;
}
.btn {
  display: inline-block;
  background-color: var(--accent-color);
  color: #fff;
  padding: 12px 25px;
  margin: 0 5px;
  border: 2px solid var(--border-color);
  border-radius: 30px;
  transition: background-color 0.3s, border-color 0.3s;
}
.btn:hover,
.btn:focus {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.hero-pic {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  overflow: hidden;
  border: 15px solid #444;
  box-shadow: 5px 7px 25px rgba(0,0,0,0.5);
}
.hero-pic img {
  width: 100%;
  height: 100%;
  transition: transform 0.5s;
}
.hero-pic img:hover {
  transform: scale(1.2);
}

/* ============= ギャラリー ============= */
.photo-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.photo-item {
  overflow: hidden;
  border-radius: 10px;
}
.photo-item img {
  width: 100%;
  height: auto;
  transition: transform 0.3s;
}
.photo-item img:hover {
  transform: scale(1.05);
}

/* ============= ポートフォリオ ============= */
.portfolio-filter {
  text-align: center;
  margin-bottom: 40px;
}
.filter-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
}
.filter-btn.active,
.filter-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.portfolio-item {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
}
.portfolio-item img {
  width: 100%;
  display: block;
  transition: transform 0.3s;
}
.portfolio-item:hover img {
  transform: scale(1.05);
}
.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,124,237,0.7);
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 10px;
}
.portfolio-item:hover .portfolio-overlay {
  opacity: 1;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  padding: 40px 20px;
}
.modal-content {
  background-color: var(--bg-color);
  margin: auto;
  padding: 20px;
  border-radius: 10px;
  max-width: 600px;
  position: relative;
  text-align: center;
  color: var(--text-color);
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-color);
}
.modal-img {
  width: 100%;
  height: auto;
  margin-bottom: 20px;
}
.modal-title {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}
.modal-description {
  font-size: 1rem;
}

/* ============= 自己紹介 ============= */
.about-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}
.about-image {
  flex: 0 0 300px;
  margin: 20px;
}
.about-image img {
  width: 100%;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
.about-text {
  flex: 1;
  margin: 20px;
  font-size: 1rem;
  line-height: 1.8;
}
.about-text p {
  margin-bottom: 15px;
}
/* スマホ（例: 768px以下）の場合、上下に並ぶようにする */
@media (max-width: 768px) {
  .about-content {
    flex-direction: column;
    text-align: center;
  }
  .about-image,
  .about-text {
    margin: 10px 0;
  }
}
/* タブ付き詳細情報 */
.about-details {
  margin-top: 40px;
}
.tabs {
  text-align: center;
  margin-bottom: 20px;
}
.tab-btn {
  background-color: var(--accent-color);
  color: var(--text-color);
  border: 2px solid var(--border-color);
  padding: 10px 20px;
  margin: 0 5px;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s;
  font-size: 1rem;
}
.tab-btn.active,
.tab-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}
.tab-content {
  max-width: 800px;
  margin: 0 auto;
  background-color: var(--bg-color);
  padding: 30px;
  border-radius: 10px;
  color: var(--text-color);
}
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* タイムライン */
.timeline {
  list-style: none;
  border-left: 2px solid var(--primary-color);
  margin: 20px 0;
  padding-left: 20px;
}
.timeline li {
  margin-bottom: 20px;
  position: relative;
}
.timeline li::before {
  content: none;
}
.timeline .year {
  font-weight: bold;
  margin-bottom: 5px;
  color: var(--primary-color);
}

/* スキルリスト */
.skills-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0;
}
.skills-list li {
  margin: 10px 15px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.skills-list li i {
  color: var(--primary-color);
}

/* ============= お問い合わせ ============= */
#contactForm {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--bg-color);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}
.form-group {
  margin-bottom: 20px;
}
.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #444;
  border-radius: 5px;
  background-color: #222;
  color: var(--text-color);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #888;
}
.required {
  color: var(--primary-color);
}
.form-buttons {
  display: flex;
  justify-content: space-between;
}
.submit-btn {
  background-color: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background-color 0.3s;
}
.submit-btn:hover {
  background-color: #005bb5;
}
.reset-btn {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  padding: 10px 20px;
  transition: background-color 0.3s;
}
.reset-btn:hover {
  background-color: #555;
}

/* ============= Back To Top ============= */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background-color: var(--primary-color);
  color: #fff;
  padding: 10px 15px;
  border-radius: 5%;
  font-size: 1.2rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 1500;
}
.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* ============= フェードインアニメーション ============= */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}
