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

:root {
  --bg:       #0a0e1a;
  --bg2:      #0f1623;
  --bg3:      #172033;
  --border:   #1e2d47;
  --text:     #e4eaf8;
  --text2:    #7a90b8;
  --accent:   #2979ff;
  --accent2:  #5b9aff;
  --card-bg:  #0f1623;
  --radius:   12px;
  --header-bg: rgba(10,14,26,0.88);
  --shadow:   0 4px 24px rgba(0,0,0,0.5);
}

:root[data-theme="light"] {
  --bg:       #f0f4ff;
  --bg2:      #ffffff;
  --bg3:      #e4ecff;
  --border:   #c5d3f0;
  --text:     #0d1a36;
  --text2:    #4a6080;
  --accent:   #1a6aff;
  --accent2:  #3d88ff;
  --card-bg:  #ffffff;
  --header-bg: rgba(240,244,255,0.88);
  --shadow:   0 4px 24px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent2); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 60px;
  transition: background 0.3s, border-color 0.3s;
}

.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.hamburger:hover { background: var(--bg3); }
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-size: 20px;
}
.icon-btn:hover { background: var(--bg3); color: var(--text); }

/* ① ナビリンク：白・太字 */
.header-nav {
  display: flex;
  gap: 0;
}
.header-nav a {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 7px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}
.header-nav a:hover { background: var(--bg3); text-decoration: none; }

.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }

.search-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: min(640px, calc(100% - 32px));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: translateY(-10px);
  transition: transform 0.25s;
}
.search-overlay.open .search-box { transform: translateY(0); }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.search-input-wrap .material-icons { color: var(--text2); font-size: 22px; flex-shrink: 0; }
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
}
.search-input-wrap input::placeholder { color: var(--text2); }
.search-close-btn {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
  transition: background 0.2s;
}
.search-close-btn:hover { background: var(--bg3); color: var(--text); }

.search-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
}
.tag-filter {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.tag-filter.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.search-results { overflow-y: auto; padding: 12px; }
.search-result-item {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: inherit;
}
.search-result-item:hover { background: var(--bg3); text-decoration: none; }
.search-result-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  background: var(--bg3);
  flex-shrink: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text2);
  font-size: 11px;
}
.search-result-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-weight: 600; font-size: 14px; margin-bottom: 3px; }
.search-result-date { font-size: 11px; color: var(--text2); margin-bottom: 4px; }
.search-result-desc { font-size: 12px; color: var(--text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.search-result-tags .tag { font-size: 10px; padding: 2px 7px; }
.search-empty { text-align: center; padding: 40px 20px; color: var(--text2); font-size: 14px; }

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; left: 0;
  width: 280px;
  height: 100%;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  z-index: 300;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s;
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  height: 60px;
}
.drawer-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}
.drawer-logo span { color: var(--accent2); }

.drawer-close {
  background: none;
  border: none;
  color: var(--text2);
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.drawer-close:hover { background: var(--bg3); color: var(--text); }

.drawer-nav {
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--text2);
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.drawer-nav a:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.drawer-nav .material-icons { font-size: 20px; }

.drawer-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text2);
  padding: 12px 16px 4px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

.drawer-accordion {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--text2);
  font-size: 15px;
  font-weight: 500;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, color 0.2s;
  text-align: left;
}
.drawer-accordion:hover { background: var(--bg3); color: var(--text); }
.drawer-accordion .material-icons { font-size: 20px; }
.drawer-chevron { margin-left: auto; font-size: 18px !important; transition: transform 0.25s; }
.drawer-accordion.open .drawer-chevron { transform: rotate(180deg); }

.drawer-panel {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 8px 4px 20px;
}
.drawer-panel.open { display: flex; }
.drawer-panel-item {
  display: block;
  padding: 8px 12px;
  border-radius: 7px;
  color: var(--text2);
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.drawer-panel-item:hover { background: var(--bg3); color: var(--text); text-decoration: none; }
.drawer-panel-item.active { color: var(--accent2); font-weight: 600; }

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 76px 24px 60px;
}

section { margin-bottom: 72px; }

h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.section-desc { color: var(--text2); font-size: 13px; margin-bottom: 28px; }

.hero {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 0;
}
.hero-top {
  display: flex;
  align-items: center;
  gap: 20px;
}
.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 6px;
}
.hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero h1 { font-size: 28px; font-weight: 700; }
.hero .role { color: var(--text2); font-size: 13px; }

.hero-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--text2); font-size: 13px; margin-top: 2px; }
.hero-meta span { display: flex; align-items: center; gap: 4px; }
.hero-meta .material-icons { font-size: 14px; color: var(--accent2); }

.hero-bio { color: var(--text2); font-size: 14px; line-height: 1.7; }

.links-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 13px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.link-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
}
.profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  transition: background 0.3s, border-color 0.3s;
}
.profile-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  letter-spacing: 0;
  text-transform: none;
}
.profile-card ul {
  list-style: disc;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.profile-card li {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.6;
}

.history-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  margin-right: 6px;
  margin-bottom: 2px;
  white-space: nowrap;
  vertical-align: middle;
}

/* ── GITHUB CARDS ── */
.github-profile-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.github-profile-top {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.github-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.github-username { font-size: 18px; font-weight: 700; color: var(--text); }
.github-handle { font-size: 13px; color: var(--text2); margin-top: 2px; }
.github-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.github-stat {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.github-stat .material-icons { font-size: 22px; color: var(--text2); }
.github-stat-label { font-size: 11px; color: var(--text2); }
.github-stat-value { font-size: 22px; font-weight: 700; color: var(--text); }

.github-commits-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 24px;
}
.github-commits-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.github-commits-sub { font-size: 12px; color: var(--text2); margin-bottom: 16px; }
.github-chart-wrap {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}
.github-commits-footer { display: flex; flex-direction: column; gap: 4px; }
.github-commits-footer span { font-size: 13px; color: var(--text2); }

/* ── SKILL ICON GRID ── */
.skill-category-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.skill-category-card h3 {
  font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 16px;
}
.skill-divider {
  border: none; border-top: 1px solid var(--border); margin-bottom: 24px;
}
.skill-icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 16px;
}
.skill-icon-item {
  display: flex; flex-direction: column;
  align-items: center; gap: 8px; text-align: center;
}
.skill-icon-item img { width: 52px; height: 52px; object-fit: contain; }
.skill-icon-name { font-size: 13px; color: var(--text2); }
.skill-icon-item .skill-bar {
  width: 60px; height: 4px; background: var(--bg3);
  border-radius: 2px; overflow: hidden;
}
.skill-icon-item .skill-fill {
  height: 100%; border-radius: 2px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 1s ease;
}
.skill-icon-pct { font-size: 13px; font-weight: 700; color: var(--text); }

.skill-category { margin-bottom: 28px; }
.skill-category h3 {
  font-size: 13px; font-weight: 600; color: var(--text2);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 14px;
}
.skill-list { display: flex; flex-direction: column; gap: 10px; }
.skill-item { display: flex; flex-direction: column; gap: 5px; }
.skill-header { display: flex; justify-content: space-between; font-size: 13px; }
.skill-name { color: var(--text); }
.skill-pct { color: var(--text2); }
.skill-bar { height: 6px; background: var(--bg3); border-radius: 3px; overflow: hidden; }
.skill-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px;
  width: 0;
  transition: width 1s ease;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.project-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, background 0.3s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card .thumb {
  width: 100%;
  height: 150px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.project-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-card .no-img { color: var(--text2); font-size: 12px; }
.project-card .info { padding: 16px; }
.project-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

.project-date {
  font-size: 11px;
  color: var(--text2);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.project-date .material-icons { font-size: 13px; }
.project-card p { color: var(--text2); font-size: 13px; margin-bottom: 12px; line-height: 1.6; }

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 12px; }
.tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--text2);
  border: 1px solid var(--border);
}

.project-card--link,
.article-card--link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.project-card--link:hover { text-decoration: none; }
.article-card--link:hover { text-decoration: none; }
.project-links a {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text2);
  transition: background 0.2s, color 0.2s;
}
.project-links a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }

.contact-list { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text2);
  font-size: 14px;
  transition: border-color 0.2s, color 0.2s, background 0.3s;
}
.contact-list a:hover { border-color: var(--accent2); color: var(--accent2); text-decoration: none; }

.donate-area { text-align: center; }

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: none;
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.article-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s, background 0.3s;
}
.article-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.article-card .thumb {
  width: 100%;
  height: 150px;
  background: var(--bg3);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .no-img { color: var(--text2); font-size: 12px; }
.article-card .info { padding: 16px; }
.article-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.article-card p { color: var(--text2); font-size: 13px; margin-bottom: 12px; line-height: 1.6; }
.article-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(167,139,250,0.15);
  color: var(--accent2);
  border: 1px solid rgba(167,139,250,0.3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.search-type-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  margin-right: 5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}
.search-type-project { background: rgba(124,106,247,0.15); color: var(--accent); border: 1px solid rgba(124,106,247,0.3); }
.search-type-article { background: rgba(167,139,250,0.15); color: var(--accent2); border: 1px solid rgba(167,139,250,0.3); }

/* ② 新フッター */
footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  transition: border-color 0.3s;
}
.footer-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.footer-sns {
  display: flex;
  gap: 20px;
}
.footer-sns a {
  color: var(--text2);
  transition: color 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
}
.footer-sns a:hover { color: var(--text); transform: translateY(-2px); text-decoration: none; }

.footer-right {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 16px;
  text-align: right;
}
.footer-copy {
  font-size: 14px;
  font-weight: 500;
  color: var(--text2);
}
.footer-powered {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.powered-label {
  font-size: 12px;
  color: var(--text2);
  font-weight: 400;
  letter-spacing: 0.02em;
}
.powered-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.03em;
}

@media (max-width: 640px) {
  .header-nav { display: none; }
}
@media (max-width: 500px) {
  .footer-inner { flex-direction: column; }
  .footer-right { text-align: left; }
  .footer-powered { justify-content: flex-start; }
}
