@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@300;400;500;600;700&display=swap');

:root {
  /* Vibrant Design System */
  --neon-blue: #00ffff;
  --electric-purple: #8b5cf6;
  --neon-green: #00ff88;
  --cyber-pink: #ff0080;
  --deep-space: #0a0a0f;
  --space-gray: #1a1a2e;
  --dark-surface: #16213e;
  --glass-surface: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --accent-glow: #00ffff80;

  /* Fitness Mode */
  --fitness-orange: #ff6b35;
  --fitness-red: #ff3030;
  --fitness-gold: #ffd700;
  --fitness-dark: #1a0f0a;
  --fitness-surface: #2a1a15;
}

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

/* Custom cursor */
body {
  font-family: 'Inter', sans-serif;
  background: var(--deep-space);
  color: var(--text-primary);
  overflow-x: hidden;
  cursor: none;
  position: relative;
}

/* Futuristic Custom Cursor */
.custom-cursor {
  position: fixed;
  width: 20px;
  height: 20px;
  background: var(--neon-blue);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  mix-blend-mode: difference;
  transition: transform 0.1s ease;
}

.cursor-trail {
  position: fixed;
  width: 4px;
  height: 4px;
  background: var(--electric-purple);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--deep-space);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple));
  border-radius: 4px;
}

/* Animated Loader */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--deep-space);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.8s ease;
}

.loader {
  position: relative;
  width: 120px;
  height: 120px;
}

.loader::before,
.loader::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 3px solid transparent;
  border-top: 3px solid var(--neon-blue);
  border-right: 3px solid var(--electric-purple);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.loader::after {
  width: 80%;
  height: 80%;
  top: 10%;
  left: 10%;
  border-top: 3px solid var(--cyber-pink);
  border-right: 3px solid var(--neon-green);
  animation: spin 1.5s linear infinite reverse;
}

.loader-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  color: var(--neon-blue);
  letter-spacing: 2px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Background Animation */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}

.bg-grid {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
      linear-gradient(var(--accent-glow) 1px, transparent 1px),
      linear-gradient(90deg, var(--accent-glow) 1px, transparent 1px);
  background-size: 100px 100px;
  opacity: 0.1;
  animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
  0% { transform: translate(0, 0); }
  100% { transform: translate(100px, 100px); }
}

.floating-elements {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.floating-element {
  position: absolute;
  border-radius: 50%;
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(180deg); }
}

/* Navigation */
.nav-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  backdrop-filter: blur(20px);
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 50px;
  padding: 10px 20px;
}

.nav-menu {
  display: flex;
  gap: 30px;
  list-style: none;
  align-items: center;
}

.nav-item a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 16px;
  border-radius: 25px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-item a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  transition: left 0.5s ease;
}

.nav-item a:hover::before {
  left: 100%;
}

.nav-item a:hover,
.nav-item a.active {
  color: var(--text-primary);
  background: var(--glass-surface);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 50px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 25px;
  padding: 8px 16px;
  font-size: 0.8rem;
  margin-bottom: 30px;
  backdrop-filter: blur(10px);
}

.status-dot {
  width: 8px;
  height: 8px;
  background: var(--neon-green);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 30px;
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple), var(--cyber-pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
}

.hero-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, var(--neon-blue), var(--electric-purple));
  border-radius: 2px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 600px;
}

.hero-cta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-size: 1rem;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple));
  color: var(--deep-space);
  box-shadow: 0 10px 30px rgba(0, 255, 255, 0.3);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid var(--accent-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0, 255, 255, 0.4);
}

/* Hero Visual */
.hero-visual {
  position: relative;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-image {
  width: 400px;
  height: 400px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  transform: perspective(1000px) rotateY(-15deg);
  transition: transform 0.5s ease;
  border: 2px solid var(--accent-glow);
}

.hero-image:hover {
  transform: perspective(1000px) rotateY(0deg);
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-image::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, var(--accent-glow), transparent);
  animation: scan 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes scan {
  0% { transform: translateX(-100%) translateY(-100%); }
  100% { transform: translateX(100%) translateY(100%); }
}

/* Mode Toggle */
.mode-toggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: var(--glass-surface);
  border: 2px solid var(--accent-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px var(--accent-glow);
}

.mode-toggle i {
  font-size: 1.5rem;
  color: var(--neon-blue);
}

/* Content Sections */
.section {
  padding: 100px 0;
  position: relative;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 50px;
}

.section-header {
  text-align: center;
  margin-bottom: 80px;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 40px;
  margin-top: 60px;
}

.project-card {
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(20px);
  transition: all 0.5s ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  transition: left 0.5s ease;
  opacity: 0.1;
}

.project-card:hover::before {
  left: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 255, 255, 0.2);
}

.project-image {
  width: 100%;
  height: 200px;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.project-desc {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.tech-tag {
  background: var(--dark-surface);
  color: var(--neon-blue);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 60px;
}

.skill-category {
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 20px;
  padding: 30px;
  backdrop-filter: blur(20px);
  text-align: center;
  transition: all 0.3s ease;
}

.skill-category:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 255, 255, 0.2);
}

.skill-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple));
  border-radius: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 1.5rem;
  color: var(--deep-space);
}

.skill-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.skill-item {
  background: var(--dark-surface);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 15px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.skill-item:hover {
  background: var(--neon-blue);
  color: var(--deep-space);
}

/* Contact Section */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 20px;
  padding: 40px;
  backdrop-filter: blur(20px);
}

.form-group {
  margin-bottom: 25px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 500;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 15px;
  background: var(--dark-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Footer */
.footer {
  background: var(--space-gray);
  padding: 60px 0 30px;
  text-align: center;
  border-top: 1px solid var(--accent-glow);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.social-link {
  width: 50px;
  height: 50px;
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-blue);
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.social-link:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Fitness Mode Styles */
body.fitness-mode {
  --neon-blue: var(--fitness-orange);
  --electric-purple: var(--fitness-red);
  --cyber-pink: var(--fitness-gold);
  --deep-space: var(--fitness-dark);
  --space-gray: var(--fitness-surface);
  --accent-glow: #ff6b3580;
}

body.fitness-mode .works-section,
body.fitness-mode .skills-section {
  display: none;
}

body.fitness-mode .progress-section {
  display: block;
}

.progress-section {
  display: none;
}

/* Transformation Styles */
.transformation-container {
  margin-bottom: 40px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.transformation-title {
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: var(--text-primary);
  font-weight: 600;
}

.transformation-images {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: center;
}

.image-container {
  flex: 1;
  min-width: 280px;
  text-align: center;
}

.image-container h4 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  color: var(--neon-blue);
}

.before-image, .after-image {
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  position: relative;
  transition: all 0.3s ease;
  height: 400px; /* 固定の高さを設定 */
  width: 100%;
}

.before-image:hover, .after-image:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
}

.before-image img, .after-image img {
  width: 100%;
  height: 400px; /* 固定の高さを設定 */
  object-fit: cover; /* 画像比率を維持しながら領域を埋める */
  object-position: center; /* 中央に配置 */
  display: block;
  transition: transform 0.5s ease;
}

.before-image:hover img, .after-image:hover img {
  transform: scale(1.05);
}

.transformation-caption {
  text-align: center;
  margin-top: 25px;
  color: var(--text-secondary);
  font-style: italic;
}

.progress-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
}

.stat-card {
  background: var(--glass-surface);
  border: 1px solid var(--accent-glow);
  border-radius: 20px;
  padding: 30px;
  text-align: center;
  backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(255, 107, 53, 0.3);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--neon-blue);
  margin-bottom: 10px;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 1rem;
}

.progress-bars {
  space-y: 25px;
}

.progress-item {
  margin-bottom: 25px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.progress-name {
  color: var(--text-primary);
  font-weight: 600;
}

.progress-percent {
  color: var(--neon-blue);
  font-weight: 600;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--dark-surface);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-blue), var(--electric-purple));
  border-radius: 4px;
  transition: width 2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
  }

  .nav-container {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
    margin: 20px;
    border-radius: 15px;
  }

  .nav-menu {
    flex-wrap: wrap;
    gap: 15px;
  }

  .projects-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    height: 400px;
  }

  .hero-image {
    width: 300px;
    height: 300px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 20px;
  }

  .hero-container {
    padding: 0 20px;
  }

  .mode-toggle {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
  }
}

/* Utility Classes */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

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

/* Screen shake animation */
@keyframes screenShake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.text-gradient {
  background: linear-gradient(45deg, var(--neon-blue), var(--electric-purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}