:root {
  --primary-color: #6366f1;
  --secondary-color: #10b981;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: rgba(255, 255, 255, 0.8);
  --bg-secondary: rgba(255, 255, 255, 0.6);
  --bg-tertiary: rgba(255, 255, 255, 0.4);
  --bg-blur: rgba(255, 255, 255, 0.25);
  --border-color: rgba(255, 255, 255, 0.18);
  --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", Tahoma, Geneva, Verdana, Segoe UI, sans-serif;
}

::selection {
  color: black;
  background-color: yellow;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  width: 100%;
  font-size: 16px;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: var(--text-primary);
  transition: var(--transition);
  overflow-x: hidden;
  width: 100%;
  position: relative;
  min-height: 100vh;
}

/* NAVBAR RESPONSIVENESS  */
.navbar {
  position: fixed;
  top: 0;
  height: 70px;
  left: 0;
  width: 100%;
  padding: 20px 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: var(--bg-blur);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 3rem);
}

.logo {
  max-width: 140px;
  width: clamp(100px, 12vw, 140px);
}

.logo img {
  position: relative;
  bottom: 10px;
  left: 0;
  user-select: none;
  -webkit-user-drag: none;
  width: 100%;
  height: auto;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(1rem, 2vw, 2rem);
}

.nav-links li {
  position: relative;
  left: 400px;
  bottom: 10px;
  margin: 0;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
  font-size: 1rem;
  white-space: nowrap;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary-color);
  transition: var(--transition);
}

.nav-links a:hover::after {
  width: 100%;
}

/*  PORTFOLIO SECTION RESPONSIVENESS  */
.portfolio-section {
  padding: clamp(3rem, 6vw, 5rem) clamp(1rem, 3vw, 2rem);
  max-width: 1400px;
  margin: 70px auto 0;
  position: relative;
  width: 100%;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 4rem);
  position: relative;
  padding: 0 1rem;
}

.section-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
  line-height: 1.2;
}

.section-subtitle {
  font-size: clamp(0.9rem, 1.2vw, 1.1rem);
  color: var(--text-secondary);
  max-width: min(700px, 90vw);
  margin: clamp(1rem, 2vw, 2rem) auto 0;
  line-height: 1.6;
}

/* Filter Buttons Responsive */
.filter-btn {
  padding: clamp(0.6rem, 1.2vw, 0.75rem) clamp(1.2rem, 2.5vw, 1.8rem);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-secondary);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  z-index: 1;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  margin: 0.3rem;
}

.filter-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--secondary-color)
  );
  transition: var(--transition);
  z-index: -1;
}

.filter-btn:hover::before,
.filter-btn.active::before {
  left: 0;
}

.filter-btn:hover,
.filter-btn.active {
  color: white;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
  border-color: transparent;
}

/* Portfolio Grid Responsive */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem);
  padding: 0 clamp(0.5rem, 1vw, 1rem);
}

.portfolio-item {
  background: var(--bg-primary);
  border-radius: clamp(15px, 2vw, 20px);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  position: relative;
  transform-style: preserve-3d;
  perspective: 1000px;
  width: 100%;
}

.portfolio-item:hover {
  transform: translateY(-15px) rotateX(5deg);
  box-shadow: 0 25px 50px rgba(31, 38, 135, 0.3);
}

.portfolio-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(99, 102, 241, 0.1),
    rgba(16, 185, 129, 0.1)
  );
  opacity: 0;
  transition: var(--transition);
  z-index: 1;
}

.portfolio-item:hover::before {
  opacity: 1;
}

.portfolio-img-container {
  position: relative;
  overflow: hidden;
  height: clamp(200px, 25vw, 240px);
  cursor: pointer;
}

.portfolio-img-container a.glightbox {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.portfolio-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: var(--transition);
}

.portfolio-item:hover .portfolio-img {
  transform: scale(1.1);
}

.portfolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  padding: clamp(1rem, 1.5vw, 1.5rem);
  opacity: 0;
  transition: var(--transition);
  z-index: 2;
  pointer-events: none;
}

.portfolio-img-container:hover .portfolio-overlay {
  opacity: 1;
}

.portfolio-view-btn {
  padding: clamp(0.5rem, 1vw, 0.7rem) clamp(1rem, 1.5vw, 1.5rem);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  transform: translateY(20px);
  border: 2px solid transparent;
  text-decoration: none;
  font-size: clamp(0.85rem, 1vw, 0.95rem);
}

.portfolio-item:hover .portfolio-view-btn {
  transform: translateY(0);
}

.portfolio-view-btn:hover {
  border: 2px solid var(--primary-color);
  background: transparent;
  transform: translateY(-3px);
  color: var(--primary-color);
}

.portfolio-content {
  padding: clamp(1.5rem, 2vw, 2rem);
  position: relative;
  z-index: 2;
}

.portfolio-category {
  display: inline-block;
  padding: clamp(0.3rem, 0.5vw, 0.4rem) clamp(0.8rem, 1vw, 1rem);
  background: var(--bg-secondary);
  color: var(--primary-color);
  border-radius: 50px;
  font-size: clamp(0.75rem, 0.9vw, 0.8rem);
  font-weight: 700;
  margin-bottom: clamp(0.8rem, 1vw, 1rem);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.portfolio-title {
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
  font-weight: 700;
  margin-bottom: clamp(0.8rem, 1vw, 1rem);
  color: var(--text-primary);
  line-height: 1.3;
}

.portfolio-description {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  line-height: 1.7;
  margin-bottom: clamp(1rem, 1.5vw, 1.5rem);
}

.portfolio-tags {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.3rem, 0.5vw, 0.5rem);
  margin-bottom: clamp(1.2rem, 1.8vw, 1.8rem);
}

.portfolio-tag {
  padding: clamp(0.3rem, 0.5vw, 0.4rem) clamp(0.7rem, 1vw, 0.9rem);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: clamp(0.75rem, 0.9vw, 0.8rem);
  font-weight: 600;
  transition: var(--transition);
}

.portfolio-tag:hover {
  background: var(--primary-color);
  cursor: default;
  color: white;
  transform: translateY(-2px);
}

.portfolio-links {
  display: flex;
  gap: clamp(0.5rem, 1vw, 1rem);
}

.introduction-gradient {
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.1rem);
  background-color: black;
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: clamp(0.3rem, 0.5vw, 0.5rem);
  padding: clamp(0.6rem, 1vw, 0.8rem) clamp(1rem, 1.5vw, 1.5rem);
  background: transparent;
  color: var(--text-primary);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.8rem, 0.9vw, 0.9rem);
  transition: var(--transition);
  border: 2px solid var(--primary-color);
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.portfolio-link:hover {
  background: var(--primary-color);
  color: white;
}

.portfolio-link.live {
  background: var(--primary-color);
  color: white;
  border: 2px solid transparent;
}

.portfolio-link.live:hover {
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  background-color: transparent;
}

/* BLOBS RESPONSIVENESS */
.floating-elements {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
  isolation: isolate;
}

.floating-element {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  filter: blur(50px);
  opacity: 0.18;
  box-shadow: 0 0 80px rgba(255, 255, 255, 0.15);
  transform: translateZ(0);
  animation: float 18s infinite ease-in-out;
}

.floating-element:nth-child(1) {
  width: clamp(80px, 10vw, 120px);
  height: clamp(80px, 10vw, 120px);
  top: 10%;
  left: 5%;
  animation-delay: 0s;
}

.floating-element:nth-child(2) {
  width: clamp(120px, 15vw, 180px);
  height: clamp(120px, 15vw, 180px);
  top: 60%;
  left: clamp(70%, 80vw, 80%);
  animation-delay: -6s;
}

.floating-element:nth-child(3) {
  width: clamp(60px, 8vw, 90px);
  height: clamp(60px, 8vw, 90px);
  top: 80%;
  left: 10%;
  animation-delay: -12s;
}

@keyframes float {
  0% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
  50% {
    transform: translateY(-30px) scale(1.1) rotate(180deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(360deg);
  }
}
/* Footer */
.footer {
  background: var(--bg-primary);
  padding: 30px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  width: 100%;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
}

.social-links a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.copyright {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
/* LIGHTBOX */
.lightbox-overlay {
  background: rgba(0, 0, 0, 0.9);
}

.lightbox-container {
  background: transparent;
}

.lightbox-image {
  border-radius: 10px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5);
}

/* MEDIA QUERIES */

/* Large Desktop Screens (1920px and above) */
@media (min-width: 1920px) {
  html {
    font-size: 18px;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  }
}

/* Tablet Landscape (992px to 1200px) */
@media (max-width: 1200px) and (min-width: 992px) {
  .nav-links {
    gap: 1.5rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

/* Tablet Portrait (768px to 992px) */
@media (max-width: 992px) and (min-width: 768px) {
  .nav-links {
    gap: 1.2rem;
  }

  .nav-links a {
    font-size: 0.9rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .portfolio-item:hover {
    transform: translateY(-10px) rotateX(3deg);
  }
}

/* Mobile Landscape (576px to 768px) */
@media (max-width: 768px) and (min-width: 576px) {
  .navbar {
    height: 60px;
    padding: 15px 0;
  }

  .portfolio-section {
    margin-top: 60px;
    padding: 2.5rem 1.5rem;
  }

  .nav-links {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 0.85rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }

  .portfolio-links {
    flex-direction: row;
  }
}

/* Mobile Portrait (up to 576px) */
@media (max-width: 576px) {
  .navbar {
    height: 60px;
    padding: 15px 0;
  }

  .nav-container {
    padding: 0 1rem;
  }

  .logo {
    max-width: 120px;
  }

  .nav-links {
    gap: 0.8rem;
  }

  .nav-links a {
    font-size: 0.8rem;
  }

  .portfolio-section {
    margin-top: 60px;
    padding: 2rem 1rem;
  }

  .section-title {
    font-size: 2rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
  }

  .filter-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.8rem;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .portfolio-item:hover {
    transform: translateY(-8px);
  }

  .portfolio-links {
    flex-direction: column;
  }

  .portfolio-link {
    width: 100%;
  }

  .floating-element {
    filter: blur(30px);
  }

  .floating-element:nth-child(1) {
    left: -20px;
  }

  .floating-element:nth-child(2) {
    left: 80%;
    width: 100px;
    height: 100px;
  }
}

/* Extra Small Devices (up to 400px) */
@media (max-width: 400px) {
  .nav-links {
    gap: 0.5rem;
  }

  .nav-links a {
    font-size: 0.75rem;
  }

  .logo {
    max-width: 100px;
  }

  .portfolio-section {
    padding: 1.5rem 0.75rem;
  }

  .section-title {
    font-size: 1.75rem;
  }

  .portfolio-content {
    padding: 1.25rem;
  }

  .portfolio-title {
    font-size: 1.1rem;
  }

  .portfolio-description {
    font-size: 0.8rem;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .portfolio-item:hover {
    transform: none;
  }

  .portfolio-item:active {
    transform: translateY(-5px);
  }

  .portfolio-view-btn,
  .portfolio-link {
    min-height: 44px; /* Minimum touch target size */
  }

  .nav-links a::after {
    display: none;
  }
}

/* Print Styles */
@media print {
  .navbar {
    position: static;
    background: white;
    border-bottom: 1px solid #ddd;
  }

  .portfolio-item {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .floating-elements,
  .portfolio-overlay,
  .portfolio-view-btn {
    display: none;
  }
}
