/* === Base Reset === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  background-color: #1b1b1e;
  color: #ffffff;
  line-height: 1.6;
  cursor: none;
}

.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  background-color: #D72638;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.15s ease, height 0.15s ease, transform 0.08s ease-out;
  opacity: 1;
  animation: cursorPulse 2s infinite ease-in-out;
  box-shadow: 0 0 10px #D72638;
}

@keyframes cursorPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
}

body.cursor-hidden .custom-cursor {
  opacity: 0;
}

/* Cursor hover effect on clickable elements */
a:hover,
button:hover,
.cta-btn:hover {
  cursor: none;
}

a:hover ~ .custom-cursor,
button:hover ~ .custom-cursor {
  width: 20px;
  height: 20px;
}

/* === Preloader === */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #1b1b1e;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

.loader-logo {
  font-size: 2rem;
  color: #ffffff;
  font-weight: 700;
  animation: pulseLogo 1.2s infinite ease-in-out;
}

.loader-text {
  font-size: 1rem;
  color: #aaaaaa;
  margin-top: 10px;
  font-style: italic;
}

@keyframes pulseLogo {
  0%, 100% {
    transform: scale(1);
    color: #ffffff;
  }
  50% {
    transform: scale(1.1);
    color: #D72638;
  }
}

body.loaded #preloader {
  opacity: 0;
  pointer-events: none;
}

.progress-bar {
  width: 80%;
  margin-top: 30px;
  height: 12px;
  position: relative;
}

.progress-track {
  background: #2b2b2e;
  border-radius: 20px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: #D72638;
  width: 0%;
  height: 100%;
  border-radius: 20px;
  animation: fillBar 3s linear forwards;
}

@keyframes fillBar {
  0% { width: 0%; }
  100% { width: 100%; }
}

.pixel-grid,
.hero-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(20, 1fr);
  grid-template-rows: repeat(12, 1fr);
  gap: 2px;
  z-index: 1;
  pointer-events: none;
}

.pixel-grid div,
.hero-grid div {
  background-color: #2b2b2e;
  opacity: 0;
  animation: heroPixelPulse 4s infinite ease-in-out;
}

.hero.scrolled {
  background-color: #0f0f11;
  transition: background-color 0.5s ease;
}

@keyframes heroPixelPulse {
  0%, 100% {
    opacity: 0.08;
    transform: scale(1);
  }
  50% {
    opacity: 0.2;
    transform: scale(1.05);
  }
}

@keyframes pixelBlink {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
  100% {
    opacity: 0.15;
    transform: scale(1);
  }
}

.loader {
  position: relative;
  z-index: 2;
}

/* === Container === */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* === Navbar (Desktop) === */
.navbar {
  position: sticky;
  top: 0;
  width: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  z-index: 999;
  padding: 15px 0;
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.navbar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: #D72638;
  opacity: 0.5;
}

/* === Logo Styling with Red Swipe and Underline === */
.logo {
  font-weight: 700;
  font-size: 1.5rem;
  position: relative;
  display: inline-block;
  color: #ffffff;
  background: linear-gradient(to right, #D72638 50%, #ffffff 50%);
  background-size: 200% 100%;
  background-position: 100% 0;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: background-position 0.4s ease;
}

.logo:hover {
  background-position: 0 0;
}

/* Underline effect */
.logo::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: #D72638;
  transition: width 0.4s ease;
}

.logo:hover::after {
  width: 100%;
}

/* === Navigation Links === */
.navbar nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
}

.navbar nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.navbar nav a:hover {
  color: #D72638;
}

/* === CTA Button (Top Nav & Hero) === */
.cta-btn,
.hero-btn {
  background-color: #D72638;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  border: none;
  transition: background 0.3s ease, color 0.3s ease, font-weight 0.2s, border 0.3s ease;
  position: relative;
  overflow: hidden;
}

.cta-btn:hover,
.hero-btn:hover {
  background-color: #ffffff;
  color: #D72638;
  font-weight: 700;
}

.ripple {
  position: absolute;
  width: 100px;
  height: 100px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
  z-index: 1;
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* === Hero Section === */
.hero {
  position: relative;
  padding: 100px 0 60px;
  text-align: center;
  background: #121214;
  overflow: hidden;
}

.hero .container {
  position: relative;
  z-index: 2;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 10px;
  color: #ffffff;
}

.hero p {
  font-size: 1.2rem;
  color: #cccccc;
  margin-bottom: 30px;
}

/* === Portfolio Section === */
.portfolio {
  padding: 80px 0;
}

.portfolio h2 {
  font-size: 2.2rem;
  text-align: center;
  margin-bottom: 40px;
}

.portfolio-grid {
  display: grid;
  gap: 30px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.project-card {
  background: #252529;
  border-radius: 10px;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.6s ease;
}

.project-card.appear {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 0 15px #D72638;
}

.project-card:hover h3 {
  color: #D72638;
}

.project-card img {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 15px;
}

.project-card h3 {
  margin-bottom: 5px;
  font-size: 1.2rem;
  color: #ffffff;
  transition: color 0.3s ease;
}

.project-card p {
  font-size: 0.95rem;
  color: #aaaaaa;
}

/* === About Section === */
.about {
  padding: 80px 0;
  background: #1f1f22;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 20px;
}

.about p {
  margin-bottom: 20px;
  color: #dddddd;
}

.about ul {
  list-style: none;
}

.about li {
  margin-bottom: 10px;
  font-size: 1rem;
}

/* === Contact Section === */
.contact {
  padding: 80px 0;
  text-align: center;
  background: #121214;
}

.contact h2 {
  font-size: 2rem;
  margin-bottom: 10px;
}

.contact p {
  color: #cccccc;
  margin-bottom: 20px;
}

/* === Footer === */
.footer {
  padding: 20px 0;
  text-align: center;
  font-size: 0.9rem;
  color: #777;
  background: #1b1b1e;
}

/* === Mobile Bottom Nav === */
.mobile-nav {
  display: none;
}

@media screen and (max-width: 768px) {
  .navbar {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #121214;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    z-index: 999;
    border-top: none;
    box-shadow: none;
  }

  .mobile-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #D72638;
    opacity: 0.7;
  }

  .mobile-nav .nav-link {
    color: #ffffff;
    text-align: center;
    font-size: 0.75rem;
    text-decoration: none;
    flex-direction: column;
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .mobile-nav .icon{
    width: 24px;
    height: 24px;
    fill: none;
  }

  .mobile-nav .nav-link:hover {
    color: #D72638;
  }
}

.nav-link:hover .icon {
  stroke: #D72638;
}
