/* Modern Portfolio Styles */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #f59e0b;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 2rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  transition: background 0.2s ease-out, padding 0.2s ease-out;
  box-shadow: var(--shadow-lg);
  will-change: background, padding;
}

header.scrolled {
  background: rgba(37, 99, 235, 0.95);
  backdrop-filter: blur(15px);
  padding: 0.1rem 0;
  transition: background 0.1s ease-out, backdrop-filter 0.2s ease-out, padding 0.15s ease-out;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  transition: transform 0.25s ease-out 0.05s;
  will-change: transform;
}

header.scrolled .header-content {
  transform: scale(0.85);
  transition: transform 0.15s ease-out;
}

.name {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  transition: all 0.3s ease;
  height: 2.5rem;
  line-height: 2.5rem;
  display: flex;
  align-items: center;
  min-height: 2.5rem;
}

#subtext {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0 0 0;
  font-weight: 400;
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(0);
  will-change: opacity, transform;
}

#subtext.hidden {
  opacity: 0;
  transform: translateY(-10px);
}

.social-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.icon {
  width: 32px;
  height: 32px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  border-radius: var(--radius-sm);
}

.icon:hover {
  transform: translateY(-2px);
  opacity: 0.8;
}

/* Main Content */
main {
  margin-top: 160px;
  min-height: calc(100vh - 160px);
}

/* Sections */
section {
  padding: 5rem 0;
  position: relative;
}

section:nth-child(even) {
  background-color: var(--bg-primary);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: 2px;
}

/* About Section */
#about {
  text-align: center;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 3rem;
  align-items: center;
  margin-top: 2rem;
}

.about-image {
  position: relative;
}

.about-image img {
  width: 100%;
  max-width: 300px;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  transition: transform 0.3s ease;
}

.about-image img:hover {
  transform: translateY(-5px);
}

.about-text {
  text-align: justify;
}

.about-text p {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Projects Section */
#projects {
  background: var(--bg-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.project-header {
  padding: 2rem 2rem 1rem 2rem;
}

.project-header h3 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.project-description {
  padding: 0 2rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.project-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem;
  justify-items: center;
  align-items: center;
}

.project-images img {
  max-height: 200px;
  max-width: 100%;
  width: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  object-fit: contain;
}

.project-images img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.project-features {
  padding: 0 2rem 2rem 2rem;
}

.project-features ul {
  list-style: none;
  padding: 0;
}

.project-features li {
  padding: 0.5rem 0;
  color: var(--text-secondary);
  position: relative;
  padding-left: 1.5rem;
}

.project-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

/* Contact Section */
#contact {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  text-align: center;
}

#contact h2 {
  color: white;
}

#contact p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

#contact a {
  color: white;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent-color);
}

#contact a:hover {
  color: var(--accent-color);
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.contact-links li {
  list-style: none;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  transition: all 0.3s ease;
  text-decoration: none;
}

.contact-links a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Footer */
footer {
  background: var(--text-primary);
  color: var(--text-light);
  text-align: center;
  padding: 2rem 0;
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }

  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.875rem; }
  h3 { font-size: 1.5rem; }

  .header-content {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 0 1rem;
  }

  .name {
    font-size: 1.75rem;
  }

  main {
    margin-top: 160px;
  }

  section {
    padding: 3rem 0;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .about-image img {
    max-width: 250px;
    height: 300px;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .project-card {
    margin: 0 1rem;
  }

  .project-images {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    padding: 1.5rem;
  }

  .project-images img {
    max-height: 150px;
    width: auto;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }
}

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

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }

  .header-content {
    padding: 0 0.5rem;
  }

  .name {
    font-size: 1.5rem;
  }

  section {
    padding: 2rem 0;
  }

  .project-header,
  .project-description,
  .project-images,
  .project-features {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }