/* --- Variables --- */
:root {
  --bg-color: #0f1110;   /* 限りなく黒に近い緑グレー */
  --card-bg: #161b18;  /* カード背景 */
  --text-main: #e2e8f0;  /* 白すぎない白 */
  --text-muted: #94a3b8;   /* 落ち着いたグレー */
  --accent-primary: #2f855a; /* キーカラー：暗めの緑 */
  --accent-hover: #38a169;   /* ホバー時：少し明るく */
  --accent-secondary: #22543d; /* もっと暗い緑 */
  --border-color: #27272a;
  
  --font-main: 'Inter', sans-serif;
  --font-code: 'JetBrains Mono', monospace;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-main);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }

/* --- Layout --- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --- Hero Section --- */
header {
  margin-bottom: 3rem;
}

h1 {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #fff, #a7f3d0);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.status-line {
  font-family: var(--font-code);
  color: var(--accent-primary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.status-dot {
  height: 10px;
  width: 10px;
  background-color: var(--accent-primary);
  border-radius: 50%;
  display: inline-block;
  margin-right: 12px;
  box-shadow: 0 0 8px var(--accent-primary);
}

.description {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
}

/* --- Links / Navigation --- */
.links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--border-color);
  background-color: var(--card-bg);
  color: var(--text-main);
}

.btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(47, 133, 90, 0.2);
}

.btn-primary {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #fff;
}

/* --- Footer --- */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}



/* --- Glitch Effect (Optional decoration) --- */
.flicker {
  text-shadow: 0 0 5px var(--glow-color), 0 0 10px var(--glow-color);
}

/* JSで付与する「発作」クラス */
.flicker-active {
  animation: rapid-flicker 0.1s infinite;
}

.blackout-active {
  opacity: 0.05 !important;
  animation: none;
}

@keyframes rapid-flicker {
  0% { opacity: 1; }
  50% { opacity: 0.1; }
  100% { opacity: 1; }
}



/* --- About Page Additions --- */
.back-link {
  display: inline-block;
  color: var(--accent-primary);
  font-weight: bold;
  margin-bottom: 0.5rem;
}
.back-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.content h2 {
  margin-bottom: 1rem;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.bio-section {
  margin-bottom: 3rem;
  font-size: 1.05rem;
  color: var(--text-muted);
}

.grid-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.card {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--accent-secondary);
}

.card h3 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--accent-primary);
  font-family: var(--font-code);
}

.card ul {
  list-style: none;
  padding: 0;
}

.card li {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card .small-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}



/* --- Skill Bars --- */
.skill-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.skill-item {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 名前とバーを左右に離す */
  margin-bottom: 0 !important; /* 上書き用のリセット */
}
.skill-item p {
  color: var(--text-main);
}

.skill-name {
  flex-shrink: 0; /* 名前が潰れないようにする */
  width: 120px;
  font-weight: 600;
  color: var(--text-main);
}

.skill-bar {
  flex-grow: 1; /* 残りのスペースいっぱいにバーを伸ばす */
  height: 6px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: 3px;

  /* アニメーション用（ページ読み込み時に伸びる） */
  width: 0; 
  animation: fillBar 1s ease-out forwards;
}

/* 読み込み時のアニメーション定義 */
@keyframes fillBar {
  from { width: 0; }
  to { width: var(--w); } /* JSなしの場合はHTMLのwidthが優先される */
}

/* バッジを並べるための上書き用クラス */
.skill-item.badges {
  justify-content: flex-start; /* 左寄せにする */
  gap: 10px; /* バッジ間の隙間を作る */
}

/* Etc. settings */
.about-etc li {
  color: var(--text-main);
}



/* --- Web Tools Section --- */

.tool-section {
  margin-top: 40px;
  padding: 20px;
  border-top: 1px dashed var(--accent-secondary);
}

.tool-section h2 {
  margin-bottom: 20px;
  font-size: 1.5em;
  border-left: 5px solid var(--accent-secondary);
  padding-left: 15px;
}

.tool-list {
  list-style: none;
  padding: 0;
  margin: 0;
  
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* 各ツールのカード */
.tool-item {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;

  transition: all 0.3s ease-out;
}

/* ホバー時のエフェクト：少し浮いて発光する */
.tool-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 15px var(--accent-secondary, 0.5);
}

/* ツール名のリンク */
.tool-item a {
  font-size: 1.2em;
  font-weight: bold;
  color: var(--accent-primary);
  text-decoration: none;
  margin-bottom: 10px;
  
  /* 右上に矢印アイコン的なものをCSSで擬似的に表現 */
  position: relative;
  display: inline-block;
}

.tool-item a::after {
  content: " >>"; /* ターミナルっぽい矢印 */
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.8em;
}

.tool-item:hover a::after {
  opacity: 1;
}

/* 説明文（リスト内のテキスト） */
.tool-item {
  color: #ccc; /* 真っ白より少しグレーにして見やすく */
  line-height: 1.6;
  font-size: 0.95em;
}