/*
  Custom styles for Sai Shashank Yerra’s data science portfolio.
  Inspired by minimal dark/light portfolio themes. Uses CSS variables for
  easy customisation. Mobile‑first responsive design with smooth
  transitions and accessible colours.
*/

/* Root variables for colours and sizing */
:root {
  --primary-color: #7366ff;
  --secondary-color: #5646e5;
  --dark-bg: #0f0f23;
  --light-bg: #f7f7fc;
  --text-light: #f0f0fa;
  --text-dark: #2d2d2d;
  --transition-speed: 0.3s;

  /* Additional colours for accents and overlays */
  --overlay-gradient: linear-gradient(180deg, rgba(15, 15, 35, 0.7) 0%, rgba(15, 15, 35, 0.95) 100%);
  --cursor-color: rgba(115, 102, 255, 0.8);
  --cursor-follower-color: rgba(115, 102, 255, 0.25);
}

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

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-light);
  background-color: var(--dark-bg);
  overflow-x: hidden;
  cursor: none; /* hide default cursor so we can replace with custom */
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}
a:hover {
  color: var(--secondary-color);
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.2;
}

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

.section {
  padding: 100px 0; /* increased vertical spacing for better breathing room */
  scroll-margin-top: 80px; /* offset anchor scroll for fixed header */
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-speed), color var(--transition-speed), transform var(--transition-speed);
}
.btn-primary {
  background-color: var(--primary-color);
  color: #fff;
  border: 2px solid transparent; 
}
.btn-primary:hover {
  background-color: var(--secondary-color);
  color: #fff;
}
.btn-secondary {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}
.btn-secondary:hover {
  background-color: var(--primary-color);
  color: #fff;
}

/* Header */
header {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(15, 15, 35, 0.8);
  backdrop-filter: blur(10px);
  transition: background-color var(--transition-speed);
}
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}
.logo a {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}
nav ul {
  display: flex;
  list-style: none;
  gap: 30px;
}
nav ul li a {
  color: var(--text-light);
  font-weight: 500;
  transition: color var(--transition-speed);
}
nav ul li a:hover {
  color: var(--primary-color);
}
nav ul li a.active {
  color: var(--primary-color);
}

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: var(--text-light);
  cursor: pointer;
}

/* Hero */
.hero {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  color: #fff;
}

/* Abstract blurred shapes behind the hero content */
.hero .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.7;
  z-index: -3;
  animation: blob-move 20s infinite alternate ease-in-out;
}
.hero .blob1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle at center, rgba(115, 102, 255, 0.8) 0%, rgba(86, 70, 229, 0.4) 60%, transparent 100%);
  top: -100px;
  left: -150px;
  animation-delay: 0s;
}
.hero .blob2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle at center, rgba(86, 70, 229, 0.8) 0%, rgba(115, 102, 255, 0.5) 60%, transparent 100%);
  bottom: -50px;
  right: -120px;
  animation-delay: 5s;
}
@keyframes blob-move {
  0% {
    transform: translate(0, 0) scale(1);
  }
  100% {
    transform: translate(30px, -30px) scale(1.2);
  }
}
/* New hero background configuration */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
  /* fallback static background image for older browsers */
  background-image: url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-gradient);
  z-index: -1;
}
.hero-content {
  max-width: 800px;
  padding: 0 20px;
  z-index: 1;
}

/* Custom styling for the certifications hero section to make text dark on light background */
.cert-hero {
  color: var(--text-dark);
}
.cert-hero .hero-overlay {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(247, 247, 252, 0.95) 100%);
  z-index: -1;
}
.cert-hero .hero-content .btn-primary {
  color: #fff;
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
}
.hero .subtitle {
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 500;
}
.hero .description {
  font-size: 1.2rem;
  margin-bottom: 35px;
  line-height: 1.6;
}

/* Scroll indicator with bouncing line */
.scroll-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  width: 20px;
  overflow: hidden;
}
.scroll-indicator .scroll-line {
  display: block;
  width: 2px;
  height: 20px;
  border-radius: 2px;
  background-color: var(--primary-color);
  animation: scroll-bounce 2s infinite;
}
@keyframes scroll-bounce {
  0% { transform: translateY(-10px); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* Custom cursor styles */
.cursor, .cursor-follower {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  z-index: 10000;
}
.cursor {
  width: 8px;
  height: 8px;
  background-color: var(--cursor-color);
  will-change: transform;
}
.cursor-follower {
  width: 40px;
  height: 40px;
  background-color: var(--cursor-follower-color);
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* About */
.about {
  background: linear-gradient(180deg, #f7f7fc 0%, #f0f0fa 100%);
  color: var(--text-dark);
}
.about h2 {
  margin-bottom: 40px;
  text-align: center;
  color: var(--primary-color);
}
.about-content {
  display: flex;
  flex-direction: row;
  /* Align image and text at the top rather than centering vertically */
  align-items: flex-start;
  gap: 40px;
}
.about-text {
  font-size: 1rem;
  line-height: 1.7;
  max-width: 900px;
  margin: 0 auto;
  flex: 1;
  /* Improve readability by justifying the paragraphs */
  text-align: justify;
}

/* About image styling */
.about-image {
  flex: 0 0 300px;
}
.about-image img {
  width: 100%;
  height: auto;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Skills */
.skills {
  background-color: var(--dark-bg);
  color: var(--text-light);
}
.skills h2 {
  /* Reduce the distance between the Skills heading and the skills grid */
  margin-bottom: 10px;
  text-align: center;
  color: var(--primary-color);
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 30px;
  /* Center items horizontally inside the grid */
  justify-content: center;
}
.skill {
  padding: 25px;
  text-align: center;
  border-radius: 12px;
  background-color: rgba(255, 255, 255, 0.05);
  transition: transform var(--transition-speed), background-color var(--transition-speed);
}
.skill:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.08);
}
.skill i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}
.skill h3 {
  font-size: 0.95rem;
  font-weight: 500;
}

/* Projects */
.projects {
  background: linear-gradient(180deg, #f7f7fc 0%, #f3f1fa 100%);
  color: var(--text-dark);
}
.projects h2 {
  margin-bottom: 40px;
  text-align: center;
  color: var(--primary-color);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}
.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
}
/* Tilt and lift effect */
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Wrapper for image and overlay */
.project-card .project-image {
  position: relative;
  overflow: hidden;
}
.project-card .project-image img {
  width: 100%;
  /* Reduce image height to make project cards less tall */
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
  position: relative;
  z-index: 0;
}
.project-card:hover .project-image img {
  transform: scale(1.1);
}
/* Hidden overlay shown on hover */
.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 15, 35, 0.9);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}
.project-card:hover .project-overlay {
  opacity: 1;
}
/* Summary below image */
.project-summary {
  padding: 20px;
  padding-bottom: 30px; /* reduce bottom padding to shrink card height while maintaining space */
  background-color: #fafaff;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  /* allow card height to grow based on content instead of fixed height */
  /* Reduce minimum height so project cards don’t feel oversized */
  min-height: 260px;
  height: auto;
}
.project-summary h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--dark-bg);
}
.project-summary p {
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.6;
  flex: 1;
}
.project-summary .btn {
  align-self: flex-start;
  margin-top: auto; /* push the button to the bottom of the card */
}

/* Contact */
.contact {
  background-color: var(--dark-bg);
  color: var(--text-light);
  text-align: center;
}
.contact h2 {
  margin-bottom: 30px;
  color: var(--primary-color);
}
.contact-info p {
  margin-bottom: 10px;
  font-size: 1rem;
}
.contact-info i {
  margin-right: 8px;
  color: var(--primary-color);
}
.contact-info .social-links {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 20px;
}
.contact-info .social-links a {
  font-size: 1.5rem;
  color: var(--primary-color);
  transition: color var(--transition-speed);
}
.contact-info .social-links a:hover {
  color: var(--secondary-color);
}

/* Footer */
footer {
  background-color: var(--dark-bg);
  color: var(--text-light);
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.85rem;
}

/* Certifications section */
.certifications {
  /* Use a soft lavender gradient to differentiate this section from projects */
  background: linear-gradient(180deg, #f4f0ff 0%, #ece4fc 100%);
  color: var(--text-dark);
}
.certifications h2 {
  margin-bottom: 40px;
  text-align: center;
  color: var(--primary-color);
}
/* Certification cards are styled similarly to project cards, but use a distinct colour palette and interactive overlay */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}
.cert-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  background-color: #ffffff;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  display: flex;
  flex-direction: column;
}
/* Lift card on hover */
.cert-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}
/* Certification image wrapper */
.cert-card .cert-image {
  position: relative;
  overflow: hidden;
}
.cert-card .cert-image img {
  width: 100%;
  /* Match the project card height reduction */
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
  position: relative;
  z-index: 0;
}
/* Zoom image on hover */
.cert-card:hover .cert-image img {
  transform: scale(1.1);
}
/* Overlay for certificate details */
.cert-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(115, 102, 255, 0.9);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}
.cert-card:hover .cert-overlay {
  opacity: 1;
}
/* Summary below the image */
.cert-summary {
  padding: 20px;
  padding-bottom: 30px;
  /* Use a pale lavender background to distinguish certification cards from project cards */
  background-color: #f4f0ff;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  /* Give certificate summaries a bit more height so the details breathe and the bottom padding provides space */
  /* Shorten certification card summary to reduce overall card height */
  min-height: 230px;
  height: auto;
}
.cert-summary h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  color: var(--dark-bg);
}
.cert-summary p {
  font-size: 0.95rem;
  margin-bottom: 8px;
  line-height: 1.6;
}
.cert-summary .cert-date {
  margin-top: auto;
  font-size: 0.9rem;
  color: var(--secondary-color);
}


/* Responsive styles */
@media (max-width: 768px) {
  nav ul {
    position: absolute;
    top: 60px;
    right: 20px;
    background-color: rgba(15, 15, 35, 0.95);
    flex-direction: column;
    width: 200px;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    display: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
  }
  nav ul.open {
    display: flex;
  }
  nav ul li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  nav ul li a {
    display: block;
    padding: 15px 20px;
  }
  .menu-toggle {
    display: block;
  }
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .hero h1 {
    font-size: 2.2rem;
  }
  .hero .subtitle {
    font-size: 1.2rem;
  }
  .hero .description {
    font-size: 1rem;
  }
  /* Stack about section columns on small screens */
  .about-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .about-image {
    width: 100%;
    margin-bottom: 20px;
  }
}