:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --surface: #1e293b;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: #334155;
    --accent: #60a5fa;
    --accent-soft: #1e3a5f;
  }
}

/* ---------- 言語切り替え ---------- */
html[data-lang="ja"] [lang="en"]:not(html),
html[data-lang="en"] [lang="ja"]:not(html) {
  display: none !important;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

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

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

h1, h2, h3 { line-height: 1.3; margin: 0; }

.container {
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
}

.logo { font-weight: 700; color: var(--text); }
.logo:hover { text-decoration: none; }

.nav {
  display: flex;
  gap: 16px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav a { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.nav a:hover { color: var(--text); text-decoration: none; }

.lang-toggle {
  flex-shrink: 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: pointer;
}
.lang-toggle:hover { border-color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 32px;
  padding-top: 72px;
  padding-bottom: 48px;
}

.avatar {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.hero h1 { font-size: 2.25rem; }
.tagline { margin: 4px 0 12px; color: var(--accent); font-weight: 600; }
.bio { margin: 0 0 16px; color: var(--muted); }

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.social a {
  display: inline-block;
  padding: 4px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.9rem;
}
.social a:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- Sections ---------- */
.section { padding-top: 48px; padding-bottom: 16px; }
.section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.section h3 { font-size: 1rem; }

/* Skills */
.skill-groups { display: grid; gap: 20px; }
.skill-group h3 { color: var(--muted); font-size: 0.9rem; margin-bottom: 8px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.tags li {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 0.875rem;
}
.tags.small li { font-size: 0.75rem; padding: 1px 8px; }

/* Career */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.timeline li:last-child { border-bottom: none; }
.timeline time { color: var(--muted); font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.timeline p { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; }

/* Works */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card p { margin: 0; color: var(--muted); font-size: 0.925rem; flex-grow: 1; }

/* Contact */
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li {
  display: flex;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list .label { width: 80px; color: var(--muted); flex-shrink: 0; }
.contact-list a { overflow-wrap: anywhere; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 64px;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  text-align: center;
}

/* ---------- 404 ---------- */
.notfound {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}
.notfound h1 { font-size: 4rem; color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .nav { display: none; }
  .lang-toggle { margin-left: auto; }
  .hero { flex-direction: column; text-align: center; padding-top: 48px; gap: 20px; }
  .social { justify-content: center; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; }
}
