/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Mathematical and Clean */
  --primary-color: #2563eb;
  --primary-dark: #1e40af;
  --secondary-color: #7c3aed;
  --accent-color: #06b6d4;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-light: #9ca3af;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --border-color: #e5e7eb;
  --shadow-light: rgba(0, 0, 0, 0.05);
  --shadow-medium: rgba(0, 0, 0, 0.1);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-math: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Hiragino Sans', 'Yu Gothic UI', 'Meiryo', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  font-size: 16px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header and Hero Section */
header {
  background: var(--gradient-primary);
  color: white;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 2rem 0;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(1deg); }
}

.hero-content {
  text-align: center;
  z-index: 2;
  position: relative;
  animation: fadeInUp 1s ease-out;
  margin-bottom: 2rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  margin-bottom: 2rem;
  opacity: 0.9;
  font-weight: 300;
  letter-spacing: 0.05em;
}

.hero-description {
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  opacity: 0.95;
  line-height: 1.8;
}

.hero-description a {
  color: #fef3c7;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease;
}

.hero-description a:hover {
  color: #fcd34d;
}

/* Search Styles */
.search {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  animation: fadeInUp 1s ease-out 0.3s both;
}

.search-square {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  z-index: 1;
}

.search-square:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.05);
}

.search-square i {
  color: white;
  font-size: 1.1rem;
  opacity: 0.8;
}

.search-input {
  width: 100%;
  height: 50px;
  padding: 0 1rem 0 4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 25px;
  color: white;
  font-size: 1rem;
  font-weight: 400;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  outline: none;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

.search-input:focus {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
  transform: scale(1.02);
}

.search-input:focus + .search-square,
.search-input:hover + .search-square {
  background: rgba(255, 255, 255, 0.25);
}

/* Main Content */
main {
  padding: 4rem 0;
  background: var(--bg-secondary);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin: 0 auto 4rem auto;
  max-width: 1200px;
  padding: 0 20px;
}

.skills-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 4px 6px var(--shadow-light);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.skills-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--gradient-math);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.skills-card:hover::before {
  transform: scaleX(1);
}

.skills-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px var(--shadow-medium);
  border-color: var(--accent-color);
}

.skills-card h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
  font-weight: 600;
}

.skills-card p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.skills-card a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.skills-card a:hover {
  border-bottom-color: var(--accent-color);
}

/* Projects Section */
.projects {
  background: white;
  margin: 2rem 20px 0;
  padding: 3rem;
  border-radius: 20px;
  box-shadow: 0 8px 32px var(--shadow-light);
  border: 1px solid var(--border-color);
}

.projects h2 {
  color: var(--primary-color);
  font-size: 2rem;
  margin-bottom: 2rem;
  position: relative;
  padding-bottom: 1rem;
}

.projects h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

.projects h3 {
  color: var(--secondary-color);
  font-size: 1.4rem;
  margin: 2rem 0 1rem;
  font-weight: 600;
}

.projects p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1rem;
}

.projects a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid var(--accent-color);
  transition: all 0.3s ease;
}

.projects a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.projects code {
  background: var(--bg-tertiary);
  padding: 0.2em 0.6em;
  border-radius: 6px;
  font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
  font-size: 0.9em;
  color: var(--secondary-color);
  font-weight: 600;
}

/* Footer */
footer {
  background: var(--text-primary);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

.section-title, .link-title {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  color: #f9fafb;
  font-weight: 600;
}

.link-title {
  margin-top: 3rem;
}

.social-link ul, .page-link ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer-hr {
  margin: 20px 0;
}

.highlight {
  position: relative;
}

.highlight a {
  color: #d1d5db;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: block;
  font-weight: 500;
}

.highlight a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.copyright {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #374151;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .hero-description {
    font-size: 1rem;
  }
  
  .search {
    max-width: 400px;
  }
  
  .search-input {
    height: 45px;
    font-size: 0.95rem;
  }
  
  .search-square {
    width: 45px;
    height: 45px;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .skills-card {
    padding: 1.5rem;
  }
  
  .projects {
    margin: 2rem 10px 0;
    padding: 2rem;
  }
  
  .social-link ul, .page-link ul {
    flex-direction: column;
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }
  
  .hero-title {
    font-size: 2rem;
  }
  
  .search {
    max-width: 320px;
  }
  
  .search-input {
    height: 42px;
    font-size: 0.9rem;
    padding: 0 0.8rem 0 3.5rem;
  }
  
  .search-square {
    width: 42px;
    height: 42px;
  }
  
  .skills-card {
    padding: 1.25rem;
  }
  
  .projects {
    margin: 1rem 5px 0;
    padding: 1.5rem;
  }
}

/* Animation for skill cards */
.skills-card {
  animation: slideInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.skills-card:nth-child(1) { animation-delay: 0.1s; }
.skills-card:nth-child(2) { animation-delay: 0.2s; }
.skills-card:nth-child(3) { animation-delay: 0.3s; }
.skills-card:nth-child(4) { animation-delay: 0.4s; }
.skills-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}