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

:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f7f8;
  --color-text: #1a1a1a;
  --color-text-muted: #6b6b6f;
  --color-border: #e5e5e7;
  --color-accent: #1a1a1a;

  --font-en: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-jp: 'Geist', -apple-system, BlinkMacSystemFont, 'Hiragino Kaku Gothic ProN',
    'Hiragino Sans', 'Yu Gothic', Meiryo, sans-serif;

  --header-height: 72px;
  --section-padding: clamp(4rem, 10vw, 8rem);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-jp);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.logo {
  font-family: var(--font-en);
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--color-text);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-text);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Sections (shared) ---------- */
main {
  padding-top: var(--header-height);
}

.section {
  padding: var(--section-padding) 0;
  border-bottom: 1px solid var(--color-border);
  scroll-margin-top: var(--header-height);
}

.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-en);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.section-placeholder {
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.section-text {
  font-size: 1.05rem;
}

/* ---------- Skills ---------- */
.skills-block {
  margin-bottom: 3rem;
}

.skills-block:last-child {
  margin-bottom: 0;
}

.skills-subtitle {
  font-family: var(--font-en);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.25rem;
}

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

.language-bars {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.language-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.language-name {
  font-weight: 500;
}

.language-percent {
  font-family: var(--font-en);
  color: var(--color-text-muted);
  font-size: 0.85rem;
}

.language-bar-track {
  width: 100%;
  height: 8px;
  background-color: var(--color-bg-alt);
  border-radius: 4px;
  overflow: hidden;
}

.language-bar-fill {
  height: 100%;
  background-color: var(--color-accent);
  border-radius: 4px;
  width: 0;
  transition: width 0.8s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.stat-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.75rem 1rem;
  text-align: center;
}

.stat-number {
  font-family: var(--font-en);
  font-size: 2rem;
  font-weight: 700;
}

.stat-label {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.skill-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}

.skill-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  text-align: center;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: var(--header-height);
}

.hero-name {
  font-family: var(--font-en);
  font-size: clamp(3rem, 10vw, 6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.hero-title {
  margin-top: 1rem;
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--color-text-muted);
}

.social-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.social-icons a:hover {
  color: var(--color-text);
  border-color: var(--color-text);
  transform: translateY(-2px);
}

/* ---------- Fade-in animation ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 2.5rem 0;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  background-color: var(--color-bg-alt);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-150%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links a {
    display: block;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 1rem;
  }

  .nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

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

  .nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}
