:root {
  --bg-color: #050505;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --accent-color: #00f7ff;
  --accent-hover: #00c3cc;
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  overflow-x: hidden;
  cursor: none; /* Hide default cursor for custom glow */
}

h1, h2, h3, .logo {
  font-family: 'Space Grotesk', sans-serif;
}

/* Custom Cursor */
#cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 247, 255, 0.15) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 9999;
  transition: width 0.3s, height 0.3s, background 0.3s;
}

/* Three.js Background */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
}

/* Glassmorphism Utilities */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.highlight {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

.section-title {
  font-size: 3rem;
  margin-bottom: 3rem;
  text-align: center;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 5%;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 100;
  background: linear-gradient(to bottom, rgba(5,5,5,0.9), transparent);
}

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.logo span {
  color: var(--accent-color);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 8px var(--accent-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
}

/* Hero Section */
.hero {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 80px;
  text-align: center;
}

.hero-content {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
}

.hero-role {
  font-size: 1.4rem;
  color: var(--text-secondary);
  margin: 0.75rem auto 1.25rem;
  font-weight: 500;
}

.glitch-text {
  font-size: 7rem;
  line-height: 1.05;
  margin-bottom: 1rem;
  font-weight: 700;
}

.about {
  padding: 100px 0;
}

.about-text {
  font-size: 1.15rem;
  color: #d8d8d8;
  line-height: 1.8;
  margin-bottom: 1.35rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.keyword {
  color: #00f7ff;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 247, 255, 0.25);
}

.about-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 3rem;
}

.about-text-container {
  flex: 1;
  min-width: 320px;
  max-width: 700px;
}

.about-image {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: 1.5rem;
  gap: 1.5rem;
}

.about-image .popout-wrapper {
  margin-top: 1rem;
}

.about-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 520px;
}

.about-stat-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  padding: 1.35rem 1.5rem;
  text-align: left;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.about-stat-card .stat-title {
  display: block;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.about-stat-card .stat-subtitle {
  display: block;
  color: var(--text-secondary);
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 1.8rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.description {
  font-size: 1.1rem;
  color: #c0c0c0;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
  max-width: 500px;
}

.hero-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  align-items: center;
}

.hero-socials .resume-btn-container {
  flex-basis: 100%;
  display: flex;
  justify-content: center;
  order: 10;
  margin-top: 1rem;
}

.hero-socials .resume-btn {
  padding: 0.5rem 1.2rem;
  font-size: 0.85rem;
  border-radius: 25px;
  width: fit-content;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-socials a:not(.resume-btn) {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1.5rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.hero-socials a:not(.resume-btn):hover {
  background: rgba(0, 247, 255, 0.1);
  color: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 15px rgba(0, 247, 255, 0.4);
  transform: translateY(-5px);
}

.hero-socials a i,
.contact-item i {
  transition: color 0.3s ease;
}

.icon-github {
  color: #ffffff;
}

.icon-linkedin {
  color: #0A66C2;
}

.icon-instagram {
  color: #E4405F;
}

.icon-email {
  color: #D44638;
}

.hero-socials a:hover .icon-github {
  color: var(--accent-color);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.popout-wrapper {
  position: relative;
  width: 360px;
  height: 420px;
  animation: float 6s ease-in-out infinite;
  margin-top: 30px;
}

.circle-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  background: var(--glass-bg);
  box-shadow: 
    0 0 30px rgba(0, 247, 255, 0.4),
    inset 0 0 20px rgba(0, 247, 255, 0.15),
    inset 0 0 0 2px var(--accent-color),
    0 0 0 4px rgba(0, 247, 255, 0.2);
  border: 2px solid var(--accent-color);
  z-index: 1;
}

.circle-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  z-index: 2;
}

.circle-container .img-base,
.popout-wrapper .img-popout {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.popout-wrapper .img-popout {
  z-index: 3;
  clip-path: none;
}

/* About Section */
.about {
  padding: 100px 0;
  display: flex;
  justify-content: flex-start;
}

.about-card {
  max-width: 800px;
  margin-left: 0;
  padding: 2.5rem;
  overflow: visible;
  word-wrap: break-word;
}

/* Skills Section */
.skills {
  padding: 100px 0;
}

.skills-container {
  display: grid;
  gap: 2rem;
}

.skills-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 1.75rem;
  justify-content: center;
  align-items: flex-start;
}

.skills-row .skill-category {
  flex: 1 1 0;
  min-width: 0;
  max-width: 550px;
}

.soft-skills-row {
  display: grid;
  gap: 1.75rem;
}

.skill-category {
  padding: 2rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

@media (max-width: 1100px) {
  .skills-row {
    flex-direction: column;
    align-items: center;
  }

  .skills-row .skill-category {
    flex: 1 1 100%;
    max-width: 500px;
  }

  .skill-grid.two-column-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }
}

@media (max-width: 760px) {
  .skills-row {
    flex-direction: column;
    align-items: stretch;
  }

  .skills-row .skill-category {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .skill-grid.two-column-grid {
    grid-template-columns: 1fr;
  }
}

.skill-category:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 40px rgba(0, 247, 255, 0.15);
  border-color: rgba(0, 247, 255, 0.3);
}

.tool-subsection {
  margin-top: 2rem;
}

.tool-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.skill-category h3 {
  font-size: 1.8rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.skill-category h3 i {
  color: var(--accent-color);
}

.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: start;
  width: 100%;
}

.skill-grid.two-column-grid {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, auto);
  grid-auto-flow: column;
  justify-items: stretch;
  align-items: stretch;
}

.skill-grid.two-column-grid .skill-item {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s;
}

.skill-grid.two-column-grid .skill-item span {
  flex: 1;
  min-width: 0;
  white-space: normal;
}

.skill-item {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255,255,255,0.05);
  transition: all 0.3s;
}

.soft-skills-row .skill-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.soft-skills-row .skill-item span {
  word-break: break-word;
  hyphens: auto;
  min-width: 0;
}

.skill-item i {
  font-size: 2rem;
  color: var(--accent-color);
  transition: color 0.3s;
}

.skill-item span {
  font-weight: 500;
  font-size: 1rem;
  text-align: left;
  min-width: 0;
  overflow-wrap: break-word;
}

.skill-item:hover {
  background: rgba(0, 247, 255, 0.05);
  border-color: var(--accent-color);
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.2);
}

.skill-item:hover i {
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--accent-color);
}

/* About Section */
.about {
  padding: 100px 0;
  display: flex;
  justify-content: flex-start;
}

.about-card {
  max-width: 800px;
  margin-left: 0;
  padding: 2.5rem;
  overflow: visible;
  word-wrap: break-word;
}

/* Tools Section */
.tools {
  padding: 100px 0;
}

.tools-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.tool-pill {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tool-pill:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 20px rgba(0, 247, 255, 0.15);
}

.tool-pill i {
  font-size: 1.5rem;
}

/* Experience Section */
.experience {
  padding: 100px 0;
}

.experience-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.experience-card {
  padding: 2.5rem;
  border-left: 4px solid var(--accent-color);
  transition: all 0.3s ease;
}

.experience-card:hover {
  transform: translateX(10px);
  box-shadow: 0 10px 30px rgba(0, 247, 255, 0.1);
}

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.exp-header h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.exp-date {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.9rem;
}

.exp-company {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.exp-description {
  color: #c0c0c0;
  line-height: 1.6;
}

/* Achievements Section */
.achievements {
  padding: 100px 0;
}

.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.achievement-card {
  padding: 2rem;
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  transition: all 0.3s ease;
}

.achievement-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-color);
  box-shadow: 0 10px 30px rgba(0, 247, 255, 0.15);
}

.achievement-card i {
  font-size: 2.5rem;
  margin-top: 0.2rem;
}

.ach-content h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
}

.ach-content p {
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Projects Section */
.projects {
  padding: 100px 0;
}

.projects-grid {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 2rem 2rem;
  width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-color) var(--glass-bg);
}

.projects-grid::-webkit-scrollbar {
  height: 8px;
}

.projects-grid::-webkit-scrollbar-track {
  background: var(--glass-bg);
  border-radius: 4px;
}

.projects-grid::-webkit-scrollbar-thumb {
  background: var(--accent-color);
  border-radius: 4px;
}

.scroll-indicator {
  text-align: right;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.6; transform: translateX(0); }
  50% { opacity: 1; transform: translateX(-5px); }
  100% { opacity: 0.6; transform: translateX(0); }
}

.project-card {
  min-width: 320px;
  max-width: 380px;
  flex: 0 0 360px;
  scroll-snap-align: start;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  border-color: rgba(0, 247, 255, 0.4);
  box-shadow: 0 15px 40px rgba(0, 247, 255, 0.2);
}

.project-image {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
  border-bottom: 1px solid var(--glass-border);
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

/* Image Comparison Slider */
.image-comparison {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.image-comparison img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* We don't want the images in the slider to scale on hover, it breaks the clip-path visually */
.project-card:hover .image-comparison img {
  transform: none;
}

.image-comparison .img-after {
  clip-path: polygon(50% 0, 100% 0, 100% 100%, 50% 100%);
}

.image-comparison .slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0; /* hidden but clickable */
  z-index: 10;
  cursor: ew-resize;
  margin: 0;
  padding: 0;
}

.image-comparison .slider-line {
  position: absolute;
  top: 0;
  left: 50%;
  width: 2px;
  height: 100%;
  background: var(--accent-color);
  z-index: 5;
  transform: translateX(-50%);
  pointer-events: none;
}

.image-comparison .slider-button {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  background: var(--bg-color);
  border: 2px solid var(--accent-color);
  border-radius: 50%;
  color: var(--accent-color);
  display: flex;
  justify-content: center;
  align-items: center;
  transform: translate(-50%, -50%);
  z-index: 5;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
  font-size: 0.8rem;
}

.image-comparison .project-overlay {
  z-index: 20; /* Ensure overlay is above the slider when hovered */
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.project-card:hover .project-overlay {
  opacity: 1;
}

.overlay-buttons {
  display: flex;
  gap: 1rem;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  pointer-events: auto;
}

.project-card:hover .overlay-buttons {
  transform: translateY(0);
}

.btn {
  padding: 0.8rem 1.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-color);
}

.btn-primary:hover {
  background: var(--accent-color);
  box-shadow: 0 0 15px var(--accent-color);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--text-primary);
}

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: inset 0 0 10px rgba(0, 247, 255, 0.3);
}

.project-info {
  padding: 2rem;
}

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

.project-info p {
  color: var(--text-secondary);
  line-height: 1.5;
  font-size: 1rem;
}

/* Contact Section */
.contact {
  padding: 100px 0 150px;
}

.contact-card {
  max-width: 800px;
  margin: 0 auto;
  padding: 4rem;
  text-align: center;
}

.contact-card p {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 3rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: var(--text-secondary);
  transition: all 0.3s;
}

.contact-item i {
  font-size: 3rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  transition: all 0.3s;
}

.contact-item span {
  font-size: 1.1rem;
  font-weight: 500;
}

.contact-item:hover {
  color: var(--accent-color);
}

.contact-item:hover i {
  background: rgba(0, 247, 255, 0.1);
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: 0 0 20px rgba(0, 247, 255, 0.3);
  transform: translateY(-5px);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.5);
}

/* Animations */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scroll Reveal Classes */
.hidden {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.show {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 120px;
  }
  
  .hero-socials {
    justify-content: center;
  }
  
  .description {
    margin: 0 auto 2.5rem;
  }
  
  .skills-container {
    grid-template-columns: 1fr;
  }
  
  .glitch-text {
    font-size: 3.5rem;
  }
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
  }
  
  .glitch-text {
    font-size: 2.5rem;
  }
  
  .contact-links {
    flex-direction: column;
    gap: 2rem;
  }
  
  .image-wrapper {
    width: 250px;
    height: 250px;
  }
}

@media (max-width: 1100px) {
  .projects-grid {
    gap: 1.5rem;
  }

  .project-card {
    flex: 0 0 320px;
    max-width: 320px;
  }
}

@media (max-width: 760px) {
  .projects-grid {
    flex-wrap: wrap;
    overflow-x: hidden;
    justify-content: center;
  }

  .project-card {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: auto;
  }

  .project-image {
    height: 220px;
  }
}
