/* 全体のスタイル */
:root {
  /* ダークテーマ（デフォルト） */
  --background-color: #000000;
  --text-color: #ffffff;
  --header-background: rgba(0, 0, 0, 0.8);
  --menu-icon-color: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root {
    /* ライトテーマ */
    --background-color: #eeeeee;
    --text-color: #000000;
    --header-background: rgba(238, 238, 238, 0.8);
    --menu-icon-color: #000000;
  }
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.6;
}

/* ヘッダー */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--header-background);
  backdrop-filter: blur(10px);
  border-radius: 0 0 clamp(10px, 3vw, 20px) clamp(10px, 3vw, 20px);
  padding: clamp(0.5rem, 2vw, 1rem) clamp(1rem, 3vw, 2rem);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header > div:first-child {
  flex: 0 1 auto;
}

.header .profile-icon {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header .menu-toggle {
  flex: 0 1 auto;
  margin-left: auto;
}

/* ハンバーガーメニュー */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  width: clamp(1.5rem, 5vw, 2rem);
  height: clamp(1.5rem, 5vw, 2rem);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.menu-toggle span {
  width: 100%;
  height: clamp(0.2rem, 0.5vw, 0.25rem);
  background: var(--menu-icon-color);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: clamp(1px, 0.5vw, 2px) center;
}

.menu-toggle span:nth-child(1) {
  transform: rotate(0);
}

.menu-toggle span:nth-child(2) {
  opacity: 1;
}

.menu-toggle span:nth-child(3) {
  transform: rotate(0);
}

/* メニュー開いた時のアニメーション */
.menu-toggle.open span:nth-child(1) {
  transform: rotate(45deg);
}

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

.menu-toggle.open span:nth-child(3) {
  transform: rotate(-45deg);
}

/* ナビゲーションメニュー */
.nav-menu {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;
  background: var(--header-background);
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  clip-path: circle(0px at calc(100% - clamp(20px, 5vw, 50px)) clamp(20px, 5vw, 50px));
  -webkit-clip-path: circle(0px at calc(100% - clamp(20px, 5vw, 50px)) clamp(20px, 5vw, 50px));
  transition: all 0.5s ease-out;
  pointer-events: none;
}

.nav-menu.open {
  clip-path: circle(1500px at calc(100% - clamp(20px, 5vw, 50px)) clamp(20px, 5vw, 50px));
  -webkit-clip-path: circle(1500px at calc(100% - clamp(20px, 5vw, 50px)) clamp(20px, 5vw, 50px));
  pointer-events: all;
}

.nav-menu ul {
  list-style: none;
  text-align: center;
  padding: 0;
  margin: 0;
  width: 100%;
}

.nav-menu li {
  margin: clamp(1rem, 3vw, 2rem) 0;
}

.nav-menu a {
  text-decoration: none;
  font-size: clamp(1.5rem, 5vw, 2rem);
  color: var(--text-color);
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: #aaa;
}

/* プロフィールアイコン */
.profile-icon {
  width: clamp(30px, 8vw, 40px);
  height: clamp(30px, 8vw, 40px);
  border-radius: 50%;
  background-color: #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #333;
  cursor: pointer;
  font-size: clamp(0.8rem, 2vw, 1rem);
}

/* 画像用プロフィールアイコン */
img.profile-icon {
  object-fit: cover;
  border: none;
  background: none;
  padding: 0;
}

/* メインコンテンツ */
.main-content {
  max-width: 1200px;
  margin: clamp(1rem, 3vw, 2rem) auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* ブログ記事 */
.blog-post {
  margin-bottom: clamp(2rem, 5vw, 3rem);
  padding-bottom: clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid #ddd;
}

.blog-post:last-child {
  border-bottom: none;
}

.blog-post h2 {
  margin-top: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.blog-post .post-meta {
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: #aaa;
}

.blog-post p {
  line-height: 1.6;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

/* ポートフォリオセクション */
#hero h2 {
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  margin-bottom: clamp(0.5rem, 2vw, 1rem);
}

#hero p, #about p, #contact p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}

.work-item {
  margin-bottom: clamp(1.5rem, 4vw, 2rem);
}

.work-item h3 {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  margin-bottom: clamp(0.3rem, 1vw, 0.5rem);
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .header {
    padding: clamp(0.5rem, 3vw, 1rem);
  }
  
  .main-content {
    padding: 0 clamp(0.8rem, 3vw, 1rem);
  }
  
  .nav-menu a {
    font-size: clamp(1.3rem, 4vw, 1.5rem);
  }
}