/*===============
  global styles
===============*/

* {
    padding: 0;
    margin: 0;
    border: 0;
    outline: 0;
    background-color: inherit;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    box-shadow: none;
    box-sizing: border-box;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  body {
    font-family: "Poppins", sans-serif;
    line-height: 1.5;
    color: var(--clr-fg);
    background-color: var(--clr-bg);
  }
  
  .light {
    --clr-bg: #fcfcfc;
    --clr-bg-alt: #fff;
    --clr-fg: #555;
    --clr-fg-alt: #444;
    --clr-primary: #2978b5;
    --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
  }
  
  .dark {
    --clr-bg: #151024;
    --clr-bg-alt: #2a2f4c;
    --clr-fg: #bdbddd;
    --clr-fg-alt: #cdcdff;
    --clr-primary: #90a0d9;
    --shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
      rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
  }

  ::-moz-selection {
    background: var(--clr-primary);
    color: var(--clr-bg);
  }
  
  ::-webkit-selection,
  ::selection {
    background: var(--clr-primary);
    color: var(--clr-bg);
  }
  
  h1,
  h2,
  h3,
  h4 {
    line-height: 1.2;
    color: var(--clr-fg-alt);
  }
  
  h1 {
    font-size: 4rem;
    text-align: center;
    font-weight: bold;
    white-space: nowrap; /* Prevents line break on large screens */
  }
  
  h2 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1.5rem;
  }
  
  h4 {
    font-size: 1.3rem;
  }
  
  ul {
    list-style-type: none;
  }
  
  a {
    text-decoration: none;
  }
  
  button {
    cursor: pointer;
  }
  
  @media (max-width: 768px) {
    h1 {
      font-size: 2.6rem;
      text-align: center;
      display: flex;
      flex-direction: column; /* Moves "Hi, I am" and "Naveen Kumar" to separate lines */
    }
  }
  
  /*===================
    buttons and links
  ===================*/
  
  .link {
    color: var(--clr-primary);
    padding: 0 0 0.3em 0;
    position: relative;
  }
  
  .link:hover {
    color: var(--clr-primary);
  }
  
  .link::before {
    content: "";
    display: inline;
    width: 0%;
    height: 0.2em;
    position: absolute;
    bottom: 0;
    background-color: var(--clr-primary);
    transition: width 0.2s ease-in;
  }
  
  .link:hover::before,
  .link:focus::before {
    width: 100%;
  }
  
  .link--nav {
    color: var(--clr-fg);
    text-transform: lowercase;
    font-weight: 500;
  }
  
  .link--icon {
    color: var(--clr-fg);
    font-size: 1.5rem;
  }
  
  .btn {
    display: block;
    padding: 0.8em 1.4em;
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: lowercase;
    transition: transform 0.2s ease-in-out;
  }
  
  .btn--outline {
    color: var(--clr-primary);
    border: 2px solid var(--clr-primary);
    position: relative;
    overflow: hidden;
    z-index: 1;
  }

  .btn--outline {
    text-transform: capitalize;
  }
  
  .btn--outline:focus,
  .btn--outline:hover {
    color: var(--clr-bg);
  }
  
  .btn--outline:before {
    content: "";
    position: absolute;
    background-color: var(--clr-primary);
    right: 100%;
    bottom: 0;
    left: 0;
    top: 0;
    z-index: -1;
    transition: right 0.2s ease-in-out;
  }
  
  .btn--outline:hover::before,
  .btn--outline:focus::before {
    right: 0;
  }
  
  .btn--plain {
    text-transform: initial;
    background-color: var(--clr-bg-alt);
    box-shadow: rgba(0, 0, 0, 0.15) 0px 3px 3px 0px;
    border: 0;
  }
  
  .btn--plain:hover {
    transform: translateY(-4px);
  }
  
  .btn--icon {
    padding: 0;
    font-size: 1.2rem;
  }
  
  .btn--icon:hover,
  .btn--icon:focus {
    color: var(--clr-primary);
  }
  
  .btn--icon:active {
    transform: translateY(-5px);
  }

  .fullscreen-btn {
    position: absolute;
    background: transparent;
    border: none;
    cursor: pointer;
    padding-right: 12px;
    color: var(--clr-primary);
    font-size: 0.7rem;
    transition: transform 0.2s ease-in-out;
  }

  .fullscreen-btn i {
    font-size: 1.2rem; /* Adjust icon size */
    color: var(--clr-primary);
  }

  /* Hover and Focus Effects */
  .fullscreen-btn:hover,
  .fullscreen-btn:focus {
      color: var(--clr-primary);
  }

  /* Active (Click) Effect */
  .fullscreen-btn:active {
      transform: scale(0.95);
  }

  /* Mobile adjustments */
  @media (max-width: 768px) {
      .fullscreen-btn {
        display: none !important;
    }
  }
  
  /*========
    layout
  ========*/
  
  .center {
    display: flex;
    align-items: center;
  }
  
  .header {
    height: 8em;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
    justify-content: space-between;
  }
  
  main {
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
  }
  
  .section {
    margin-top: 5em;
  }
  
  .section__title {
    text-align: center;
    margin-bottom: 1em;
    text-transform: uppercase;
  }
  
  .nav__list {
    margin-right: 1.5em;
    display: flex;
  }
  
  .nav__list-item {
    margin-left: 1.5em;
  }
  
  .nav__hamburger {
    display: none;
    width: 1em;
  }

  .nav__list-item a {
    text-transform: capitalize;
  }
  
  .about {
    flex-direction: column;
    margin-top: 3em;
  }
  
  .about__name {
    color: var(--clr-primary);
  }
  
  .about__role {
    margin-top: 1.2em;
  }
  
  .about__desc {
    font-size: 1rem;
    max-width: 1000px;
    width: 80%; /* Make it responsive */
    text-align: justify; /* Align text properly */
  }
  
  .about__desc,
  .about__contact {
    margin-top: 2.4em;
  }
  
  .about .link--icon {
    margin-right: 0.8em;
  }
  
  .about .btn--outline {
    margin-right: 1em;
  }

  .timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  /* Duration */
  .education__duration {
    font-size: 15px;
    color: var(--clr-fg-alt);
    margin-top: 3px;
    padding-top: 5px;
  }

  /* CGPA Alignment */
  .cgpa {
    text-align: left;
    font-weight: bold;
    margin-top: 10px;
    padding-right: 20px;
    font-size: 16px;
    min-width: 80px; /* Ensures some width so it doesn't wrap */
  }
  
  .projects__grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(18em, 1fr));
    grid-gap: 2em;
  }
  
  .project-card {
    padding: 2em;
    margin: 0 auto;
    text-align: center;
    box-shadow: var(--shadow);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out, filter 0.8s ease-out;
    
    opacity: 0; /* Initially hidden */
    transform: translateY(20px) scale(0.95); /* Start lower & slightly smaller */
    filter: blur(8px); /* More blur effect */
    
    will-change: transform, opacity; /* Performance optimization */
  }
  
  .project-card.show {
    opacity: 1;
    transform: translateY(0) scale(1); /* Smooth appear */
    filter: blur(0); /* Remove blur */
  }
  
  .project-card:hover {
    transform: translateY(-7px) scale(1.05);
  }
  
  .project__description {
    margin-top: 1em;
  }
  
  .project__stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 1.2em 0;
  }
  
  .project__stack-item {
    margin: 0.5em;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--clr-fg-alt);
  }
  
  .project-card .link--icon {
    margin-left: 0.5em;
  }  
  
  .skills__list {
    max-width: 600px; /* Adjusted for 5 items per row */
    width: 95%;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .skills__list-item {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
    color: var(--clr-primary);
    border: 2px solid var(--clr-primary);
    background-color: transparent;
    border-radius: 8px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: color 0.3s ease-in-out, transform 0.2s ease-in-out;
    min-width: 110px;
    z-index: 1;
  }
  
  /* Background Fill Animation (like btn--outline) */
  .skills__list-item::before {
    content: "";
    position: absolute;
    background-color: var(--clr-primary);
    right: 100%;
    bottom: 0;
    left: 0;
    top: 0;
    z-index: -1;
    transition: right 0.2s ease-in-out;
  }
  
  .skills__list-item:hover::before,
  .skills__list-item:focus::before {
    right: 0;
  }
  
  .skills__list-item:hover,
  .skills__list-item:focus {
    color: var(--clr-bg); /* Match hover effect from btn--outline */
    transform: scale(1.05);
  }
  
  /* Fade-in animation on load */
  .skills__list-item {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeIn 0.5s ease-in-out forwards;
  }
  
  @keyframes fadeIn {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }  
  
  .contact {
    display: flex;
    flex-direction: column;
    align-items: center;  /* Centers content horizontally */
    margin-bottom: 0px;
    padding-bottom: 0px;
  }

  .contact__info {
    font-size: 1rem;
    margin-top: 30px;
    justify-content: center;
  }

  .contact__info a {
    text-decoration: none;
    color: var(--clr-primary);
    font-weight: 500;
  }

  .contact__info a:hover {
    text-decoration: underline;
  }
  
  .footer {
    padding: 2rem;
    margin-top: 4em;
    text-align: center;
    margin-top: 50px; /* Reduce space above the footer */
    padding-top: 7px; /* Adjust padding */
  }

  .footer__text {
    font-size: 1rem;
    font-weight: bold;
  }

  .footer__copyright {
    font-size: 1rem;
    margin-top: 7px; /* Adjust space between lines */
    opacity: 0.9;
    text-align: center;
  }
  
  .footer__link {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--clr-fg);
  }

  .programmer-png {
    width: 27px;  /* Adjust size as needed */
    height: auto;
    vertical-align: middle;  /* Aligns with text */
    margin-left: 3px;
  }
  
  .scroll-top {
    display: none;
    position: fixed;
    bottom: 1em;
    right: 2em;
    background-color: transparent;
    font-size: 1.8rem;
    transition: transform 0.2s ease-in-out;
  }

  .fullscreen-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: white;
    z-index: 999;
  }  

  /* Circular Profile Image */
  .profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    transition: transform 0.3s ease-in-out;
  }

  /* Hover Tilt Effect */
  .profile-img:hover {
    transform: rotateY(10deg) rotateX(10deg);
  }

  .snow-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -100;
  }
  
  /* Snow Fall Effect */
  .snowflake {
    position: absolute;
    top: -10px;
    width: 5px;
    height: 5px;
    background-color: white;
    opacity: 0.8;
    border-radius: 50%;
    animation: fall linear infinite;
  }
  
  @keyframes fall {
    to {
      transform: translateY(100vh);
    }
  }

  /* Typewriter Cursor */
  #typing-text::after {
    content: "|";
    display: inline-block;
    margin-left: 5px;
    animation: blink 0.7s infinite;
  }

  @keyframes blink {
    50% {
      opacity: 0;
    }
  }
  
  @media (max-width: 768px) {
    .header {
      height: 6em;
    }
  
    .section {
      margin-top: 4em;
    }
  
    .nav__list {
      flex-direction: column;
      padding: 4em 0;
      position: absolute;
      right: 0;
      left: 0;
      top: 5em;
      background-color: var(--clr-bg);
      width: 0;
      overflow: hidden;
      transition: width 0.2s ease-in-out;
    }
  
    .display-nav-list {
      width: 100%;
    }
  
    .nav__list-item {
      margin: 0.5em 0;
    }
  
    .nav__hamburger {
      display: flex;
      margin-left: 0.8em;
    }
  
    .about {
      align-items: flex-start;
      margin-top: 2em;
    }
  
    .footer {
      padding: 2em;
      margin-top: 3em;
    }
  
    .scroll-container {
      display: none;
    }
  }

  .timeline {
    position: relative;
    margin: 2em auto;
    max-width: 800px;
  }
  
  .timeline-item {
    align-items: center;
    background: var(--clr-bg-alt);
    padding: 1.5em;
    margin: 1em 0;
    border-left: 4px solid var(--clr-primary);
    box-shadow: var(--shadow);
    flex-wrap: wrap; /* Allows wrapping for smaller screens */
  }
  
  .timeline-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--clr-primary);
    flex: 1; /* Takes available space */
  }
  
  .timeline-date {
    font-size: 1rem;
    font-style: italic;
    color: var(--clr-fg-alt);
  }  

  @media (max-width: 768px) {
    .profile-img {
      width: 100px;
      height: 100px;
    }
  
    .about {
      align-items: center;
      flex-direction: column;
      text-align: center;
    }
  
    .about__desc {
      font-size: 0.9rem;
    }
  }

  @media (max-width: 768px) {
    .snowflake {
      width: 3px;
      height: 3px;
      opacity: 0.8;
    }
  }

  @media (max-width: 768px) {
    .project-card {
      opacity: 0; /* Fully visible on mobile */
      transform: translateY(30px) scale(0.95); /* Slightly more movement on mobile */
      filter: blur(10px); 
      transition: opacity 0.6s ease-out, transform 0.6s ease-out, filter 0.6s ease-out;
    }
  
    .project-card.show {
      opacity: 1;
      transform: translateY(0) scale(1);
      filter: blur(0);
    }
  
    .project-card:hover {
      transform: scale(1.03); /* Subtle scaling effect */
    }
  }