/* Font import moved to HTML for performance */

/* Property definitions for smooth gradient transitions */
@property --orb-c1 {
  syntax: "<color>";
  initial-value: #00f2ff;
  inherits: true;
}
@property --orb-c2 {
  syntax: "<color>";
  initial-value: #a855f7;
  inherits: true;
}
@property --orb-c3 {
  syntax: "<color>";
  initial-value: #ff00ff;
  inherits: true;
}

:root {
  /* Colors */
  --bg-color: #0a0a0f;
  --bg-secondary: #0d0d12;
  --accent-cyan: #00f2ff;
  --accent-purple: #a855f7;
  --accent-magenta: #ff00ff;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-blur: 20px;

  /* Dynamic Orb Colors (Defaults) */
  --orb-c1: #00f2ff;
  --orb-c2: #a855f7;
  --orb-c3: #ff00ff;

  /* Spacing & Sizes */
  --container-padding: 24px;
  --container-max-width: 1400px;
}

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

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow: hidden; /* Prevent all body scrolling */
  width: 100vw;
  height: 100vh; /* Fixed height to prevent vertical overflow */
}

/* Background Animation */

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
  transition: --orb-c1 1s ease, --orb-c2 1s ease, --orb-c3 1s ease;
}

.orb-1 {
  top: 50%;
  left: 20%;
  width: 900px;
  height: 900px;
  background: radial-gradient(
    circle,
    var(--orb-c1),
    var(--orb-c2),
    var(--orb-c3)
  );
  transform: translate(-50%, -50%);
  animation: orb-float 25s infinite alternate ease-in-out;
}

.orb-2 {
  top: 20%;
  right: 5%;
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--orb-c3), var(--orb-c2));
  transform: translate(50%, -50%);
  animation: orb-float-2 30s infinite alternate-reverse ease-in-out;
  opacity: 0.4;
}

/* Page Loader */
#loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(
    10,
    10,
    15,
    0.6
  ); /* Semi-transparent to blend with background orbs */
  backdrop-filter: blur(20px); /* Soft blur for depth */
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1s ease-out, visibility 1s ease-out;
}

#loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-orb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-cyan), var(--accent-purple));
  animation: pulse-loader 4s infinite cubic-bezier(0.4, 0, 0.2, 1); /* 4s deep breathing */
  filter: blur(20px); /* Base blur */
}

@keyframes pulse-loader {
  0% {
    transform: scale(1);
    opacity: 0.4;
    filter: blur(25px); /* Soft start */
  }
  50% {
    transform: scale(1.4);
    opacity: 0.8; /* Slightly less opaque to keep softness */
    filter: blur(15px); /* Never goes to 0 blur, keeps soft edges */
    box-shadow: 0 0 60px var(--accent-cyan), 0 0 100px rgba(0, 242, 255, 0.2);
  }
  100% {
    transform: scale(1);
    opacity: 0.4;
    filter: blur(25px); /* Soft end */
  }
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 2;
}

.loader-title {
  font-family: "Doto", sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 20px rgba(0, 242, 255, 0.5);
  text-align: center;
}

.loader-subtitle {
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
}

/* Utility Classes */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Projects Section */
#projects {
  height: 100vh; /* Takes full viewport */
  width: 100vw;
  position: relative;
  overflow: hidden;
  background-color: transparent;
  z-index: 1;
  opacity: 0; /* Hidden initially */
  transition: opacity 1.5s ease-out; /* Smooth fade in */
}

#projects.visible {
  opacity: 1;
}

#projects-container {
  display: flex;
  height: 100%;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: auto; /* Changed from smooth to auto for immediate response */
  /* scroll-snap-type removed to allow programmatic scrolling */
  scrollbar-width: none; /* Hide scrollbar Firefox */
}

#projects-container::-webkit-scrollbar {
  display: none; /* Hide scrollbar Chrome/Safari */
}

.project-section-wrapper {
  min-width: 100vw;
  height: 100%;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: var(--container-padding);
  overflow: hidden;
}

.project-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  max-height: 90vh;
  z-index: 2;
  position: relative;
}

.project-mockup {
  flex: 0 0 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mockup-container {
  position: relative;
  width: 300px;
  height: auto;
  aspect-ratio: 880 / 1832; /* Prevent collapse if image missing */
  transform: perspective(1000px) rotateY(-10deg);
  transition: transform 0.2s ease-out; /* Smooth, snappy response */
}

.project-section-wrapper:hover .mockup-container {
  transform: perspective(1000px) rotateY(0deg) scale(1.05);
}

.bezel-img {
  width: 100%;
  height: auto;
  position: relative;
  z-index: 2; /* Bezel behind for inner shadow/reflection effects? No, SVG is opaque. Bezel must be behind SCreen unless it has transparency. But user provided solid SVG. So Screen must be ON TOP. width/height/pos matched to hole. */
  z-index: 1; /* Moving bezel back */
  pointer-events: none;
  display: block;
}

.screen-img {
  position: absolute;
  top: 2.3%;
  left: 4.3%;
  width: 91.5%;
  height: 95.5%;
  object-fit: cover;
  z-index: 2; /* Moving screen front */
  border-radius: 46px; /* Matched to scaled curvature */
  background: #000; /* Fallback if screenshot missing */
}

.project-details {
  flex: 1;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.project-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(to right, #fff, rgba(255, 255, 255, 0.7));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.project-desc {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tech-stack {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.tech-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tech-svg {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: brightness(0) invert(1); /* Make icons white */
}

.tech-icon:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tech-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-item span:last-child {
  font-weight: 700;
  font-size: 16px;
}

.stats-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 80px;
}

.stat-item span:first-child {
  opacity: 0.6;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-item span:last-child {
  font-weight: 700;
  font-size: 16px;
}

.view-btn {
  align-self: flex-start;
  padding: 14px 40px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

.view-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.view-btn:hover {
  transform: translateY(-3px) scale(1.02);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3), 0 0 15px currentColor;
  color: #fff; /* Keep text white on hover */
}

.view-btn:hover::before {
  left: 100%;
}

.view-btn:active {
  transform: translateY(-1px) scale(0.98);
}

.bg-icon {
  position: absolute;
  right: -100px;
  top: 50%;
  transform: translateY(-50%) scale(0.8);
  width: 300px;
  height: 300px;
  opacity: 0;
  z-index: 1;
  transition: all 0.8s ease-out;
  pointer-events: none;
}

.project-section-wrapper.active .bg-icon {
  opacity: 0.1;
  transform: translateY(-50%) scale(1) rotate(15deg);
  right: -50px;
}

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);

  /* Liquid Glass Effect */
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05),
    inset 0 0 5px rgba(255, 255, 255, 0.1), 0 5px 15px rgba(0, 0, 0, 0.2);
}

.nav-prev {
  left: 5%;
}
.nav-next {
  right: 5%;
}

.nav-arrow svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.6));
}

.nav-arrow:hover {
  transform: translateY(-50%) scale(1.1);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: inset 0 0 30px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(255, 255, 255, 0.2);
}

.nav-arrow:active {
  transform: translateY(-50%) scale(0.95);
}

/* Desktop Media Queries */
@media (min-width: 768px) {
  .nav-arrow {
    width: 80px;
    height: 80px;
  }

  .project-card {
    flex-direction: row;
    align-items: center;
    max-width: var(--container-max-width);
    gap: 60px;
    padding: 0 40px;
  }

  .project-mockup {
    flex: 0 0 30%;
    height: 80%;
  }

  .mockup-container {
    width: 350px;
  }

  /* Removed old hover logic, handled in base class now or adjusted here if distinct */

  .project-details {
    flex: 0 0 60%;
    text-align: left;
    align-items: flex-start;
  }

  .project-title {
    font-size: 42px;
  }

  .project-desc {
    font-size: 18px;
  }

  .tech-icon {
    width: 50px;
    height: 50px;
    font-size: 14px;
  }

  .bg-icon {
    width: 500px;
    height: 500px;
    right: 0;
  }

  .project-section-wrapper.active .bg-icon {
    right: 5%;
  }
}

/* Animations */
/* Animations */
@keyframes orb-float {
  0% {
    transform: translate(-50%, -50%) translate(-30px, -30px) scale(0.9);
  }
  33% {
    transform: translate(-50%, -50%) translate(50px, -50px) scale(1.1);
  }
  66% {
    transform: translate(-50%, -50%) translate(-20px, 40px) scale(1);
  }
  100% {
    transform: translate(-50%, -50%) translate(-50px, -30px) scale(0.95);
  }
}

@keyframes orb-float-2 {
  0% {
    transform: translate(50%, -50%) translate(0, 0) scale(1);
  }
  33% {
    transform: translate(50%, -50%) translate(-40px, 40px) scale(1.1);
  }
  66% {
    transform: translate(50%, -50%) translate(20px, -60px) scale(0.9);
  }
  100% {
    transform: translate(50%, -50%) translate(0, 0) scale(1);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fade-in-up 0.8s ease-out forwards;
}

.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}
