/* Variables */
:root {
  color-scheme: dark;
  --color-bg: #0c0d0f;
  --color-surface: #141518;
  --color-elevated: #1a1c1f;
  --color-divider: rgba(255, 255, 255, 0.08);
  --color-text: #f2f4f6;
  --color-muted: rgba(242, 244, 246, 0.64);
  --color-accent: #32b566;
  --color-accent-bg: rgba(50, 181, 102, 0.15);
  --font-sans: "Helvetica Neue", "Segoe UI", "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
}

/* 接続情報アナウンスバー */
.connection-announcement {
  position: relative; /* static から relative に変更 */
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  height: 28px; /* 固定の高さを設定 */
  overflow: hidden; /* はみ出た内容を隠す */
  box-sizing: border-box; /* ボックスサイズを明示的に設定 */
}

/* IPv4の場合の背景色 */
.connection-announcement--ipv4 {
  background-color: rgba(74, 111, 160, 0.15); /* 青色の薄い背景 */
  border-bottom: 1px solid #4a6fa0;
}

/* IPv6の場合の背景色 */
.connection-announcement--ipv6 {
  background-color: rgba(230, 126, 34, 0.15); /* オレンジ色の薄い背景 */
  border-bottom: 1px solid #e67e22;
}

.connection-announcement__container {
  width: 100%;
  margin: 0;
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box; /* ボックスサイズを明示的に設定 */
}

.connection-announcement__info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 12px;
  white-space: nowrap; /* テキストの折り返しを防止 */
  overflow: hidden;
  text-overflow: ellipsis; /* はみ出たテキストを省略記号で表示 */
  padding: 0 8px; /* 最小限のパディングを追加 */
  box-sizing: border-box; /* ボックスサイズを明示的に設定 */
}

.connection-announcement__info i {
  color: var(--color-text); /* 白色に変更 */
  font-size: 0.8rem;
}

.connection-announcement__type {
  padding: 1px 4px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--color-bg);
}

/* IPv4は青色 */
.connection-announcement__type--ipv4 {
  background-color: #4a6fa0; /* 青色 */
}

/* IPv6はオレンジ色 */
.connection-announcement__type--ipv6 {
  background-color: #e67e22; /* オレンジ色 */
}

.connection-announcement__ip {
  font-family: "Source Code Pro", Consolas, Monaco, "Courier New", monospace;
  font-weight: 500;
}

@media (max-width: 600px) {
  .connection-announcement {
    height: auto; /* 高さを自動調整に変更 */
    min-height: 28px; /* 最小の高さを設定 */
  }
  
  .connection-announcement__container {
    padding: 4px 0; /* 上下のパディングを追加 */
  }
  
  .connection-announcement__info {
    justify-content: flex-start;
    flex-wrap: wrap; /* 必要に応じて折り返し */
    padding: 0 12px; /* パディングを少し増やす */
  }
}

/* Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--color-bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  line-height: 1.6;
  width: 100%; /* 幅を100%に設定 */
  overflow-x: hidden; /* 横方向のスクロールを防止 */
}

.page {
  width: min(1400px, 100%);
  display: grid;
  gap: clamp(48px, 6vw, 84px);
  margin-top: clamp(40px, 6vw, 72px);
  padding: 0 clamp(20px, 6vw, 64px);
  box-sizing: border-box; /* ボックスサイズを明示的に設定 */
}

/* Hero Section */
.hero {
  display: grid;
  gap: clamp(16px, 4vw, 28px);
  padding: clamp(28px, 5vw, 46px);
  background-color: var(--color-surface);
  border: 1px solid var(--color-divider);
}

.hero__visual {
  position: relative;
  background-color: var(--color-elevated);
  aspect-ratio: 5 / 2;
  overflow: hidden;
}

/* スマホ表示でのバナーの縦横比調整 */
@media (max-width: 480px) {
  .hero__visual {
    aspect-ratio: 4 / 2; /* スマホ表示では少し高さを確保 */
  }
}

.hero__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 13, 15, 0.3), rgba(12, 13, 15, 0.6));
}

.hero__banner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(0.55) brightness(0.55);
}

.hero__avatar {
  position: absolute;
  left: 50%;
  bottom: clamp(16px, 5vw, 26px);
  transform: translateX(-50%);
  width: clamp(96px, 16vw, 128px);
  height: clamp(96px, 16vw, 128px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  object-fit: cover;
  background-color: var(--color-elevated);
  z-index: 1;
}

/* スマホ表示でのアイコンサイズと位置の調整 */
@media (max-width: 480px) {
  .hero__avatar {
    width: clamp(80px, 12vw, 96px);
    height: clamp(80px, 12vw, 96px);
    bottom: clamp(10px, 3vw, 16px);
  }
}

.hero__body {
  display: grid;
  gap: 10px;
  padding-top: clamp(20px, 6vw, 32px);
  text-align: center;
}

.hero__kicker {
  margin: 0;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.hero__title {
  margin: 0;
  font-size: clamp(32px, 5.5vw, 52px);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.hero__statement {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.12rem);
  color: var(--color-muted);
}

.hero__meta {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.92rem;
  color: rgba(242, 244, 246, 0.78);
}

.network-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.network-info i {
  color: var(--color-accent);
  font-size: 0.9rem;
}

.hero__links {
  margin-top: clamp(10px, 2vw, 16px);
  display: flex;
  justify-content: center;
  gap: 12px;
}

.hero__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background-color: var(--color-elevated);
  border: 1px solid var(--color-divider);
  color: var(--color-text);
  font-size: 1.2rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.hero__link:hover,
.hero__link:focus {
  background-color: rgba(50, 181, 102, 0.18);
  transform: translateY(-2px);
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Section Styles */
.section {
  display: grid;
  gap: clamp(20px, 3.6vw, 30px);
}

.section__title {
  margin: 0;
  font-size: clamp(22px, 4vw, 28px);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

/* Skills Section */
.skills-grid {
  display: grid;
  gap: clamp(20px, 4vw, 28px);
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.skills-card {
  position: relative;
  padding: 28px clamp(20px, 4vw, 30px) 26px;
  background-color: var(--color-surface);
  border: 1px solid var(--color-divider);
  display: grid;
  gap: 16px;
}

.skills-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, rgba(50, 181, 102, 0.85), rgba(50, 181, 102, 0.3));
}

.skills-card__heading {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-divider);
  padding-bottom: 10px;
  font-weight: 600;
}

.skills-card ul {
  margin: 0;
  padding-left: 0;
  list-style-type: none;
  display: grid;
  gap: 12px;
  color: var(--color-muted);
}

.skills-card li {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.skill-name {
  color: var(--color-text);
  font-weight: 500;
  position: relative;
  padding-left: 1rem;
}

.skill-name::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background-color: var(--color-accent);
  border-radius: 50%;
}

.skill-detail {
  font-size: 0.88rem;
  color: var(--color-muted);
  display: block;
  padding-left: 1rem;
  line-height: 1.4;
}

/* PC向けのスタイル調整 */
@media (min-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .skills-card {
    min-height: 450px;
    display: flex;
    flex-direction: column;
  }
  
  .skills-card ul {
    padding-left: 0.5rem;
    flex-grow: 1;
    align-content: start;
  }
  
  .skills-card li {
    margin-bottom: 10px;
  }
  
  .skill-name {
    font-size: 0.95rem;
  }
  
  .skill-detail {
    font-size: 0.85rem;
    padding-left: 1.2rem;
  }
  
  /* ツール・OSS部分の調整 */
  .skills-card:nth-child(3) ul {
    padding-top: 0;
  }
  
  .skills-card:nth-child(3) li {
    margin-bottom: 16px;
  }
}

/* 特定の画面サイズでのカード高さ調整 */
@media (min-width: 992px) {
  .skills-card {
    min-height: 420px;
  }
}

/* Timeline Components */
.timeline {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--color-divider);
}

.timeline__item {
  display: grid;
  gap: 6px;
  padding: clamp(12px, 2vw, 18px) 0;
  border-bottom: 1px solid var(--color-divider);
}

.timeline__period {
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
}

.timeline__content h3 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.03em;
}

.timeline__content p {
  margin: 0;
  color: var(--color-muted);
}

.timeline__content a {
  color: #6495ED; /* コーンフラワーブルーに変更 - 年表示との区別をつけやすくするため */
  font-size: 0.9rem;
}

/* Activities Timeline Variant */
.timeline--activities .timeline__item {
  gap: 8px;
}

.timeline--activities .timeline__content h3 {
  font-size: 1.02rem;
}

/* Timeline Item Types and Overlap Indicators */
.timeline__item {
  position: relative;
  border-left: 4px solid transparent;
  padding-left: 16px;
  margin-left: -2px;
}

/* 社会人時代と学生時代の区別 */
.timeline__item--work {
  border-left-color: #4a6fa0; /* 落ち着いた青系 - 社会人時代（正社員） */
}

.timeline__item--contract,
.timeline__item--intern,
.timeline__item--education {
  border-left-color: #5a8a70; /* 落ち着いた緑系 - 学生・インターン・アルバイト */
}

/* 学生の背景色を他と同じにする */

/* 卒業の仕切り */
.timeline__item--divider {
  padding: 6px 0;
  border-left-color: #888;
}

.timeline__content--divider {
  text-align: center;
}

.timeline__content--divider p {
  font-size: 0.8rem;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.timeline__content--divider p::before,
.timeline__content--divider p::after {
  content: "";
  height: 1px;
  background-color: rgba(255, 255, 255, 0.3);
  flex-grow: 1;
}

.timeline__content--divider p::before {
  margin-right: 15px;
}

.timeline__content--divider p::after {
  margin-left: 15px;
}

/* ホバー効果 */
.timeline__item {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline__item:hover {
  transform: translateX(3px);
  background-color: rgba(255, 255, 255, 0.03);
}

/* Links */
a {
  color: #6495ED; /* コーンフラワーブルーに変更 - 年表示との区別をつけやすくするため */
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

/* Terminal Styles */
.terminal {
  background-color: #0c0c0c;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  font-family: "Source Code Pro", Consolas, Monaco, "Courier New", monospace;
  margin: 0 auto;
  overflow: hidden;
  width: 100%; /* 幅を100%に変更 */
}

.terminal__header {
  background: linear-gradient(to bottom, #3a3a3a, #2a2a2a);
  padding: 8px 12px;
  display: flex;
  align-items: center;
}

.terminal__button {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  background-color: #ff5f56;
}

.terminal__button:nth-child(2) {
  background-color: #ffbd2e;
}

.terminal__button:nth-child(3) {
  background-color: #27c93f;
}

.terminal__title {
  color: #ddd;
  font-size: 0.8rem;
  margin-left: auto;
  margin-right: auto;
}

.terminal__body {
  padding: 16px;
  color: #f0f0f0;
  line-height: 1.5;
}

.terminal__line {
  display: flex;
  margin-bottom: 4px;
}

.terminal__prompt {
  color: #4a6fa0; /* Juniper青に近い色 */
  margin-right: 8px;
  font-weight: 600;
}

.terminal__command {
  color: #f0f0f0;
}

.terminal__output {
  color: #cccccc;
  margin-bottom: 16px;
  padding-left: 16px;
  line-height: 1.6;
}

.terminal__output p {
  margin: 4px 0;
  display: block;
  font-family: "Source Code Pro", Consolas, Monaco, "Courier New", monospace;
}

.terminal__indent {
  padding-left: 20px;
  color: #a0a0a0;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.blink {
  animation: blink 1s step-end infinite;
}

/* Footer Styles */
.footer {
  width: 100%;
  background-color: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  margin-top: clamp(48px, 6vw, 84px);
  padding: clamp(24px, 4vw, 32px) 0;
}

.footer__container {
  width: min(960px, 100%);
  margin: 0 auto;
  padding: 0 clamp(20px, 6vw, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.footer__copyright {
  text-align: center;
  color: var(--color-muted);
  font-size: 0.9rem;
}

.footer__links {
  display: flex;
  gap: 16px;
}

.footer__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background-color: var(--color-elevated);
  border: 1px solid var(--color-divider);
  color: var(--color-text);
  font-size: 1rem;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.footer__links a:hover,
.footer__links a:focus {
  background-color: rgba(50, 181, 102, 0.18);
  transform: translateY(-2px);
}

@media (min-width: 600px) {
  .footer__container {
    flex-direction: row;
    justify-content: space-between;
  }
}

/* Responsive Adjustments */
@media (max-width: 720px) {
  body {
    padding: 0; /* パディングを削除 */
  }

  .hero__body {
    padding-top: clamp(24px, 9vw, 36px);
  }

  .hero__links {
    gap: 10px;
  }
  
  .terminal__body {
    padding: 12px;
    font-size: 0.9rem;
  }
  
  .terminal__output {
    padding-left: 12px;
  }
}

