/* ==================== VARIABLES & RESET ==================== */

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #14b8a6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --dark: #111827;
  --dark-light: #334155;
  --light: #f8fafc;
  --gray: #64748b;
  --gray-light: #e2e8f0;
  --border-radius: 0.9rem;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.15);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 32rem),
    linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  color: var(--dark);
  line-height: 1.6;
  min-height: 100vh;
}

:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.55);
  outline-offset: 3px;
}

/* ==================== UTILITIES ==================== */

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eyebrow {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
  animation: fadeInUp 0.6s ease-out;
}

.section-title {
  font-size: 3.5rem;
  font-weight: 900;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray);
  font-weight: 500;
}

/* ==================== BUTTONS ==================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
  background: white;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
  transform: translateY(-3px);
}

/* ==================== NAVIGATION ==================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(248, 250, 252, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.navbar .container {
  padding: 1rem 0;
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.5rem;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.logo-text h1 {
  font-size: 1.2rem;
  margin-bottom: 0.2rem;
  color: var(--dark);
}

.logo-text p {
  font-size: 0.85rem;
  color: var(--gray);
}

.nav-menu {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  flex: 1;
  justify-content: center;
}

.nav-link {
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--gray);
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
}

.nav-link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
  opacity: 1;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  transform: translateY(-2px);
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 0.4rem;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.75);
}

.hamburger span {
  width: 1.5rem;
  height: 0.2rem;
  background: var(--dark);
  border-radius: 0.1rem;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(0.6rem) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-0.6rem) rotate(-45deg);
}

/* ==================== HERO SECTION ==================== */

.hero {
  margin-top: 5rem;
  padding: 4rem 0;
  position: relative;
  overflow: hidden;
}

.hero-stars {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 184, 166, 0.08) 1px, transparent 1px);
  background-repeat: repeat;
  background-size: 42px 42px;
  opacity: 0.7;
  z-index: 0;
  animation: twinkle 5s ease-in-out infinite;
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

.hero .container {
  position: relative;
  z-index: 1;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-text {
  animation: slideInLeft 0.8s ease-out;
}

.hero-title {
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.5rem;
  color: var(--dark);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--gray);
  margin-bottom: 2rem;
  line-height: 1.8;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-image {
  position: relative;
  animation: floatUp 1s ease-out;
}

.hero-img {
  width: 100%;
  border-radius: calc(var(--border-radius) + 0.25rem);
  box-shadow: var(--shadow-lg);
  transition: transform 0.3s ease;
}

.hero-image:hover .hero-img {
  transform: scale(1.02);
}

.floating-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 0.8rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  animation: float 6s ease-in-out infinite;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 10;
}

.floating-card i {
  font-size: 2rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.floating-card p {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--dark);
}

.card-1 {
  top: -20px;
  left: 20px;
  animation-delay: 0s;
}

.card-2 {
  top: 50%;
  right: 30px;
  animation-delay: 2s;
  transform: translateY(-50%);
}

.card-3 {
  bottom: 30px;
  left: 40px;
  animation-delay: 4s;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-30px); }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-3rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes floatUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== ABOUT SECTION ==================== */

.about {
  padding: 5rem 0;
}

.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-text {
  animation: slideInLeft 0.8s ease-out;
}

.about-paragraph {
  font-size: 1.1rem;
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 2rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.skill-item h4 {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--dark);
  font-weight: 700;
}

.skill-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
  color: var(--primary);
  border-radius: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.3);
  transition: all 0.3s ease;
}

.tag:hover {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  transform: translateY(-2px);
}

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(3rem);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.stat-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  padding: 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 3rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.5rem;
}

.stat-text {
  color: var(--gray);
  font-weight: 600;
}

/* ==================== PROJECTS SECTION ==================== */

.projects {
  padding: 5rem 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.project-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.empty-projects {
  grid-column: 1 / -1;
  padding: 2rem;
  border: 1px dashed rgba(37, 99, 235, 0.28);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.72);
  color: var(--gray);
  text-align: center;
  font-weight: 700;
}

.project-card:nth-child(1) { animation-delay: 0s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.2s; }
.project-card:nth-child(4) { animation-delay: 0.3s; }
.project-card:nth-child(5) { animation-delay: 0.4s; }
.project-card:nth-child(6) { animation-delay: 0.5s; }

.project-card:hover {
  transform: translateY(-12px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
}

.project-image {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(236, 72, 153, 0.1) 100%);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1) rotate(1deg);
}

.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(30, 41, 59, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.project-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  background: white;
  color: var(--primary);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  cursor: pointer;
}

.project-link:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.15);
}

.project-info {
  padding: 1.5rem;
}

.project-info h3 {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.project-info p {
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.project-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tech-tag {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(236, 72, 153, 0.15) 100%);
  color: var(--primary);
  border-radius: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.2);
}

body.modal-open {
  overflow: hidden;
}

.project-modal,
.project-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(12px);
}

.project-lightbox {
  z-index: 2100;
}

.project-modal-dialog,
.project-lightbox-dialog {
  position: relative;
  width: min(860px, 100%);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--border-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lg);
}

.project-modal-content {
  padding: 2rem;
}

.project-modal-title {
  margin: 0 3rem 0.85rem 0;
  color: var(--dark);
  font-size: clamp(1.4rem, 3vw, 2rem);
  line-height: 1.2;
}

.project-modal-description {
  color: var(--gray);
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.project-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.project-modal-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.project-modal-gallery > img,
.project-modal-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--gray-light);
  border-radius: 0.75rem;
  background: #f8fafc;
  overflow: hidden;
}

.project-modal-image {
  padding: 0;
  cursor: zoom-in;
}

.project-modal-image img,
.project-lightbox-dialog img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-modal-image img {
  object-fit: cover;
  transition: transform 0.25s ease;
}

.project-modal-image:hover img {
  transform: scale(1.04);
}

.modal-close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--dark);
  color: white;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.modal-close-button:hover {
  background: var(--primary);
  transform: scale(1.05);
}

.project-lightbox-dialog {
  width: min(1100px, 100%);
  padding: 1rem;
  background: #0f172a;
}

.project-lightbox-dialog img {
  max-height: 82vh;
  border-radius: 0.6rem;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== CONTACT SECTION ==================== */

.contact {
  padding: 5rem 0;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
}

.contact-form {
  animation: slideInLeft 0.8s ease-out;
}

.form-group {
  margin-bottom: 1.5rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--gray-light);
  border-radius: 0.75rem;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  color: var(--dark);
  transition: all 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--gray);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contact-info {
  animation: slideInRight 0.8s ease-out;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.contact-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--border-radius);
  padding: 2rem;
  transition: all 0.3s ease;
  flex: 0 1 250px;
}

.contact-card:hover {
  transform: translateY(-8px);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.contact-icon {
  width: 3.5rem;
  height: 3.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  margin-bottom: 1rem;
}

.contact-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.contact-card p {
  color: var(--gray);
}

.contact-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.contact-card a:hover {
  color: var(--accent);
}

.contact-info h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--dark);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.social-icon:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
}

/* ==================== FOOTER ==================== */

.footer {
  background: rgba(30, 41, 59, 0.95);
  color: white;
  padding: 2rem 0;
  margin-top: 5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

/* ==================== RESPONSIVE ==================== */

@media (max-width: 1024px) {
  .hero-content,
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
  }

  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-title {
    font-size: 2.5rem;
  }

  .hero-title {
    font-size: 3rem;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(248, 250, 252, 0.95);
    backdrop-filter: blur(10px);
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-menu.active {
    max-height: 500px;
  }

  .hamburger {
    display: flex;
  }

  .hero-title,
  .section-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .about-stats,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }

  .hero-buttons {
    flex-direction: column;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .container {
    width: 95%;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }

  .floating-card {
    display: none;
  }

  .nav-wrapper {
    flex-wrap: wrap;
  }

  .nav-menu {
    order: 3;
  }
}
