/* ===== CSS カスタムプロパティ（ダーク既定） ===== */
:root {
  --bg:       #0f0f13;
  --bg-elev:  #1a1a24;
  --fg:       #e8e8f0;
  --muted:    #8888a8;
  --border:   #2a2a3a;
  --card:     #1e1e2e;

  --accent:   #6366f1;
  --accent-2: #ec4899;
  --accent-3: #06b6d4;

  --gradient-hero: linear-gradient(135deg, var(--accent), var(--accent-2) 50%, var(--accent-3));
  --shadow-glow:   0 8px 32px -8px color-mix(in srgb, var(--accent) 40%, transparent);

  --header-h: 64px;
  --radius:   16px;
  --font:     -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

[data-theme="light"] {
  --bg:       #f5f5fa;
  --bg-elev:  #ffffff;
  --fg:       #1a1a2e;
  --muted:    #60608a;
  --border:   #dddde8;
  --card:     #ffffff;

  --accent:   #4f52d9;
  --accent-2: #d63384;
  --accent-3: #0891b2;

  --shadow-glow: 0 8px 32px -8px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ===== リセット・ベース ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a   { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ===== スキップリンク ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: 9999;
  font-weight: 700;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ===== 背景 blob ===== */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
}
.blob-1 { width: 480px; height: 480px; background: var(--accent);   top: -120px; left: -120px; }
.blob-2 { width: 400px; height: 400px; background: var(--accent-2); bottom: 10%; right: -100px; }
.blob-3 { width: 320px; height: 320px; background: var(--accent-3); top: 50%;    left: 40%; }

/* ===== ヘッダー ===== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg-elev) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.logo {
  font-weight: 800;
  font-size: 1.25rem;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  flex-shrink: 0;
}

.nav-list {
  display: flex;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}
.nav-list a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s, background 0.2s;
}
.nav-list a:hover {
  color: var(--fg);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  text-decoration: none;
}

.header-controls {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.header-controls button {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid var(--border);
  color: var(--fg);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.header-controls button:hover {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border-color: var(--accent);
}

/* ===== セクション共通 ===== */
section {
  position: relative;
  z-index: 1;
  scroll-margin-top: var(--header-h);
}
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: fit-content;
}
.section-underline {
  display: block;
  width: 64px;
  height: 4px;
  border-radius: 9999px;
  background: var(--gradient-hero);
}

/* ===== Hero ===== */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: var(--header-h);
}
.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 3rem;
}
.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: var(--shadow-glow);
  flex-shrink: 0;
}
.hero-text { flex: 1; }

#hero h1 {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 900;
  line-height: 1.15;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.75rem;
}
.hero-headline {
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== ボタン ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}
.btn-primary {
  background: var(--gradient-hero);
  color: #fff;
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}
.btn-outline:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transform: translateY(-2px);
  text-decoration: none;
}
.btn-sm { padding: 0.4rem 1rem; font-size: 0.85rem; }

/* ===== About ===== */
.about-body {
  max-width: 720px;
  font-size: 1.05rem;
}
.about-body p + p { margin-top: 1rem; }

/* ===== Skills ===== */
.skills-group { margin-bottom: 2rem; }
.skills-group h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.9rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge-accent {
  background: color-mix(in srgb, var(--accent)   15%, transparent);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent)   30%, transparent);
}
.badge-accent2 {
  background: color-mix(in srgb, var(--accent-2) 15%, transparent);
  color: var(--accent-2);
  border-color: color-mix(in srgb, var(--accent-2) 30%, transparent);
}
.badge-accent3 {
  background: color-mix(in srgb, var(--accent-3) 15%, transparent);
  color: var(--accent-3);
  border-color: color-mix(in srgb, var(--accent-3) 30%, transparent);
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
}
.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
  border-color: var(--accent);
}
.card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.card-title { font-size: 1.1rem; font-weight: 700; }
.card-desc  { color: var(--muted); font-size: 0.9rem; flex: 1; }
.card-tech  { margin-top: auto; }
.card-links {
  padding: 1rem 1.5rem;
  display: flex;
  gap: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ===== Experience タイムライン ===== */
.timeline {
  position: relative;
  padding-left: 2rem;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: var(--gradient-hero);
  border-radius: 9999px;
}
.timeline-item {
  position: relative;
  padding: 0 0 2rem 1.5rem;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 0.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-year {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  padding: 0.15rem 0.6rem;
  border-radius: 9999px;
  margin-bottom: 0.35rem;
}
.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.timeline-content strong { font-size: 1rem; }
.timeline-org { color: var(--muted); font-size: 0.9rem; }

/* ===== Contact ===== */
.contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-weight: 500;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.contact-list a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  text-decoration: none;
}

/* ===== Footer ===== */
.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--accent); }

/* ===== reveal アニメーション ===== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease-out, transform 0.2s ease-out;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== prefers-reduced-motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .blob { display: none; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn, .project-card, .contact-list a, .nav-list a, .header-controls button {
    transition: none;
  }
}

/* ===== モバイル対応 ===== */
@media (max-width: 768px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    padding: 3rem 1.5rem;
  }
  .hero-cta { justify-content: center; }

  .nav-list {
    gap: 0;
  }
  .nav-list a {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  .header-controls button {
    padding: 0.35rem 0.5rem;
    font-size: 0.8rem;
  }

  .section-inner { padding: 3.5rem 1rem; }

  .contact-list { flex-direction: column; }
  .contact-list a { justify-content: center; }
}
