/* ------------------------------
   GLOBAL STYLES
--------------------------------*/
:root {
  --blue: #0071e3;
  --text: #eee;
  --bg: #0d1117;
  --bg-alt: #161b22;
  --border: #333;
  --shadow-color: rgba(255, 255, 255, 0.05);

  --bg-alt-r: 22;   /* R component of #161b22 */
  --bg-alt-g: 27;   /* G component of #161b22 */
  --bg-alt-b: 34;   /* B component of #161b22 */
}

body.dark {
  --text: #222;
  --bg: #fff;
  --bg-alt: #f6f7f8;
  --border: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.12);

  --bg-alt-r: 246;  /* R component of #f6f7f8 */
  --bg-alt-g: 247;  /* G component of #f6f7f8 */
  --bg-alt-b: 248;  /* B component of #f6f7f8 */
}

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

/* --- FIX FOR MOBILE TAP HIGHLIGHT (SAFARI/ANDROID) --- */

/* Targets anchor tags and buttons, which are most often the cause */
a, button {
    -webkit-tap-highlight-color: transparent; 
}

/* Also target the specific icon elements for maximum coverage */
#menuBtn,
.social-item i,
.toggle-social {
    -webkit-tap-highlight-color: transparent;
}

/* 1. Targets the close icon by its ID when it receives focus */
#closeBtn:focus {
    /* Removes the standard browser outline */
    outline: none !important;
    /* Removes any custom focus shadow */
    box-shadow: none !important;
}

/* 2. Targets the icon for Mobile Tap Highlight */
#closeBtn {
    /* Removes the blue overlay that appears on tap in mobile browsers (iOS/Android) */
    -webkit-tap-highlight-color: transparent;
}

/* 1. Targets the main clickable list item/container */
.theme-toggle:focus {
    outline: none !important;
    box-shadow: none !important;
}

/* 2. Targets the <i> icons inside the toggle (for general focus/tap highlight) */
.theme-toggle i:focus,
.theme-toggle i:active {
    outline: none !important;
    box-shadow: none !important;
}

/* 3. Removes the mobile tap highlight color on the clickable spans/icons */
.theme-toggle,
.theme-toggle span,
.theme-toggle i {
    -webkit-tap-highlight-color: transparent;
}


/* Ensure the universal outline/shadow removal is still present */
*:focus {
    outline: none !important;
    box-shadow: none !important;
}

@font-face {
  font-family: 'spincycle';
  src: url('../spin.ttf');
  font-weight: 50;
  font-style: normal;
  font-display: swap;
}

#meet {
  font-family: 'spincycle';
  color: var(--blue);
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: all 0.3s ease;
  overflow-x: hidden; /* Good for preventing horizontal scroll */
  overflow-y: scroll; /* Ensures vertical scroll is available */
}

/* ------------------------------
   LAYOUT
--------------------------------*/
.container {
  background: color-mix(in srgb, var(--bg-alt) 80%, transparent);
  padding: 10px 30px 15px 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px var(--shadow-color);
  border: 1px solid color-mix(in srgb, var(--border) 90%, transparent);
  margin: 20px 20px 30px;
}

.container1 {
  transform: translateZ(0);
  background: color-mix(in srgb, var(--bg-alt) 40%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(5px);
  padding: 10px 30px 15px 30px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 113, 227, 0.15);
  border: 1px solid color-mix(in srgb, var(--border) 40%, transparent);
  margin: 20px 40px 0px 40px;
}

/* ---------- Floating Social Box ---------- */

.floating-social {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transition: all .3s;
}

.floating-social.active {
  pointer-events: auto;
  opacity: 1;
}

.floating-wrapper {
    display: flex;
    align-items: center;
    /* Keeps the button centered in the wrapper when closed */
    justify-content: center; 
    
    /* CRITICAL: Makes the container shrink to fit its content */
    width: fit-content; 
    
    /* Background, border, and shadow properties are correct */
    background: color-mix(in srgb, var(--bg-alt) 40%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 113, 227, 0.2);
    
    /* Padding around the button in the closed state */
    padding: 10px 10px 10px 10px;
    border-radius: 25px;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
    transition: all 0.5s ease; 
}

/* 1. Target the individual social icon items */
.floating-wrapper .social-item {
    display: flex; /* Helps center the icon inside the button/link */
    align-items: center;
    justify-content: center;
    /* Optional: Add a transition to the item itself if you animate the entire link/button */
    transition: all 0.5s ease;
}

/* 2. Target the <i> element (the icon) */
.floating-wrapper i {
  /* CRITICAL: Define the transition on the normal state */
  transition: transform 0.5s ease; 
  /* Also add transition for color/other properties if you change them */
  /* transition: all 0.5s ease; */
}

/* 3. Define the animation action on the :hover state of the icon */
.floating-wrapper i:hover {
  /* Example 1: Enlarge the icon by 1.2 times its size */
  /*transform: scale(1.2) rotate(5deg);
  
  /* Example 2: Change the color on hover */
 /* color: #0077b5; /* LinkedIn Blue example */
}

/* OPTIONAL: If you want the animation on hovering over the parent link/button */
.floating-wrapper .social-item:hover i {
    transform: scale(1.2) /*rotate(5deg)*/;
    color: #005bbd;
}

/* Open state: Must override justify-content and add spacing */
.floating-wrapper.open {
    /* Align icons to the start when open, or keep them centered */
    justify-content: flex-start; 
    
    /* Set the gap between the visible social icons */
    gap: 30px; 
    
    /* Padding remains consistent */
    padding: 10px 20px; 
}


/* Open state: Expands the container and adds spacing */
.floating-wrapper.open {
    /* Set the gap between the visible social icons */
    gap: 30px; 
    
    /* You can adjust padding here if you want it different when open */
    padding: 10px 15px; 
}

/* Social Icon Items (Base State) */
.social-item {
    color: var(--blue); /* Use your CSS variable */
    font-size: 1.3rem;
    
    /* Ensure no margins conflict with the wrapper's gap property */
    margin: 0; 
    
    /* Base transition for the appearance/disappearance animation */
    transition: transform 0.5s ease, opacity 0.5s ease;
}

/* 1. Initial State (Icons are hidden by default) */
.social-item.hidden {
    opacity: 0;
    /* Position off-screen/small scale for animation start */
    transform: translateX(10px) ; 
    pointer-events: none; /* Prevents hidden icons from blocking clicks */
    margin-left: -35px;
}

/* 2. Show Animation State (Applied by JS when open) */
.social-item.show {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto; /* Allows clicks when visible */
}

/* Toggle Button */
.toggle-social {
    border: none;
    background: none;
    color: #0071e3;
    font-size: 1.4rem;
    
    /* CRITICAL FIX: Remove margin-left when closed, let gap handle spacing when open */
    padding: 0;
    margin: 0;
    line-height: 1; 
    
    cursor: pointer;
    transition: transform 0.3s ease;
}

.toggle-social:hover {
    /*transform: scale(1.2);*/
}

.floating-wrapper.open .toggle-social {
    /* Rotates the button 45 degrees (making the plus sign look like an 'X') */
    transform: rotate(45deg);
}

#theme-switch {
  /* --- 1. Basic Element Reset --- */
  background-color: transparent;
  border: none;
  padding: 0;
  margin: 0;
  outline: none !important;
  box-shadow: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-size: 1.1rem;
  color: var(--blue);
  cursor: pointer;
}

#theme-switch:focus,
#theme-switch:active,
#theme-switch:hover {
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

#theme-switch i {
    border: none;
    box-shadow: none;
    outline: none;
}

#theme-switch i:last-child {
  display: none;
}

.dark #theme-switch i:first-child {
  display: none;
}

.dark #theme-switch i:last-child {
  display: block;
}

header {
  background: color-mix(in srgb, var(--bg-alt) 0%, transparent);
  transform: translateZ(0);
  position: sticky;
  top: 15px;
  z-index: 100;
}

.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--blue);
  padding: 6px 12px;
}

nav ul {
  position: fixed;
  top: 13px;
  right: 50px;
}

.hrow {
  display: none;
  background-color: var(--border);
  border: 0px;
  height: 1.5px;
  margin-top: -20px;
  margin-bottom: -15px;
}

.hrowLast {
  display: none;
  background-color: var(--border);
  border: 0px;
  height: 1.5px;
  margin-top: -20px;
  margin-bottom: 0px;
}

nav ul li {
  display: inline-block;
  list-style: none;
  margin: 10px 20px;
}

nav ul li a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--blue);
}

nav ul li a.active {
  font-weight: bold;
}

.theme-toggle {
  cursor: pointer;
  font-size: 20px;
  user-select: none;
  margin-right: 20px;
  margin-top: 10px;
  margin-left: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
}

.theme-toggle span {
  display: none;
}

body.light #sunIcon {
  display: none;
}

body.light #moonIcon {
  display: inline;
}

body.dark #sunIcon {
  display: inline;
}

body.dark #moonIcon {
  display: none;
}

.theme-toggle .toggle-text {
  text-decoration: none;
  cursor: text;
  margin-right: 10px;
  margin-top: 2px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  display: inline-block;
}

/* ------------------------------
     HERO SECTION
--------------------------------*/
.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 40px 30px;
  flex-wrap: wrap;
}

.hero-text {
  flex: 1;
  min-width: 280px;
  margin-top: -50px;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  margin-bottom: 10px;
  margin-top: 2px;
}

.hero h2 {
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  font-weight: 400;
  color: var(--blue);
  margin-top: -20px;
}

.hero p {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  margin: 25px 0;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap; /* prevents wrapping */
  gap: 20px;
  margin-top: 25px;
}

.hero-buttons a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 24px;
  min-width: 150px;
  text-align: center;
}

.hero-image img {
  width: 450px;
  margin-top: 30px;
  margin-bottom: -30px;
}

/* ------------------------------
      BUTTONS
--------------------------------*/
.btn-primary,
.btn-outline {
  display: inline-block;
  padding: 10px 10px;
  border-radius: 6px;
  text-decoration: none;
  transition: 0.3s;
  font-weight: 500;
  margin-top: 20px;
}

.btn-primary {
  background: var(--blue);
  border: 2px solid var(--blue);
  color: #fff;
}

.btn-primary:hover {
  background: #005bbd;
  border: 2px solid #005bbd;
}

.btn-outline {
  border: 2px solid var(--blue);
  color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue);
  color: #fff;
}

/* ------------------------------
       SECTIONS
--------------------------------*/
section {
  padding: 40px 0;
}

section h2,
section h1 {
  text-align: center;
  margin-bottom: 15px;
  margin-top: 40px;
}

.subtitle {
  text-align: center;
  color: var(--blue);
  margin-bottom: 40px;
}

.about p {
  margin-bottom: 20px;
}

/* ------------------------------
          PROJ
--------------------------------*/
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  margin-bottom: 25px;
}

.link-card {
  background: color-mix(in srgb, var(--border) 20%, transparent);
  border: 2px solid color-mix(in srgb, var(--border) 30%, transparent);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s;
  margin-top: -25px;
  margin-bottom: 10px;
}

.link-card h3 {
  margin: 0;
  margin-right: auto; /* Pushes the icon to the right */
}

/* Correctly targets the icon element inside the project card */
.link-card .fa-circle-arrow-up {
  font-size: 1.3rem;
  flex-shrink: 0;
  margin-left: 10px;
  color: var(--blue);
  background: color-mix(in srgb, var(--border) 2%, transparent);
}

.link-card .fa-circle-arrow-up:hover {
   transition: 0.3s ease;
   transform: scale(1.2) rotate(45deg);
   color: #005bbd; 
}

.link-info {
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

/* ------------------------------
        PROJECTS
--------------------------------*/
/*.projects.container {
  max-width: 1200px; /* give grid enough room 
  margin: 0 auto;
  padding: 40px 20px;
}*/

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  width: 100%;
  margin-bottom: 25px;
}


.project-card {
  background: color-mix(in srgb, var(--border) 20%, transparent);
  border: 2px solid color-mix(in srgb, var(--border) 30%, transparent);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s;
}

.project-card:hover {
  transform: translateY(-5px);
}

.project-info {
  padding: 20px;
}

.project-card .btn-primary {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  width: fit-content;
}

/* Correctly targets the icon element inside the project card */
.project-card .fa-solid {
  /* Set the size to match the original image size */
  width: 100%;
  height: 165px;
  /* Center the icon visually */
  display: flex;
  justify-content: center;
  align-items: center;
  /* Make the icon itself large enough to be prominent */
  font-size: 3.5rem; /* Adjust this size to your liking */
  background: color-mix(in srgb, var(--border) 2%, transparent); /* Optional: Use a solid background if needed */
}


/* ------------------------------
      RESUME PAGE
--------------------------------*/

/* Styling for the paragraph container */
.scroll-down {
    /* Centers the element horizontally on the viewport */
    position: fixed;
    top: 90%; /* Starts the top edge at the middle of the viewport */
    left: 50%; /* Starts the left edge at the middle of the viewport */
    transform: translate(-50%, -50%); /* Shifts the element back by half its own width/height to truly center it */
    z-index: 1000; /* Ensures it stays above other content */
    padding: 10px 20px;
    color: var(--text); /* Optional: Text color */
    border-radius: 5px;
    font-size: 1.2em;
    text-align: center;
    transition: opacity 0.3s ease-out; /* For the smooth fade-out effect */
    display: none;
}

/* Animation for the icon (i element) */
.scroll-down i {
    display: inline-block; /* Required for the transform/animation to work correctly */
    margin-left: 5px; /* Spacing between text and icon */
    /* Define the animation */
    animation: up-down 1.5s infinite ease-in-out;
}

/* Keyframes for the up and down movement animation */
@keyframes up-down {
    0% {
        transform: translateY(0); /* Start position */
    }
    50% {
        transform: translateY(-5px); /* Move up 5 pixels */
    }
    100% {
        transform: translateY(0); /* Return to start position, creating a loop */
    }
}

/* Class to apply when the page is scrolled, which hides the element */
.scroll-down.hidden {
    opacity: 0; /* Fades the element out */
    pointer-events: none; /* Prevents interaction after it's hidden */
}



.timeline {
  list-style: none;
  margin-top: 10px;
}

.timeline li {
  margin-bottom: 15px;
}

.result li {
  list-style: none;
  margin-bottom: 3px;
  margin-left: 25px;
}

.skills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skills span {
  background: rgba(0, 113, 227, 0.15);
  border: 1px solid rgba(0, 113, 227, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
}

.languages {
  max-width: 500px;
  margin: -20px auto;
  margin-left: 20px;
  padding: 25px 30px;
  background: color-mix(in srgb, var(--bg-alt) 0%, transparent);
  border-radius: 16px;
}

/*.languages h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 20px;
  text-align: left;
}*/

.language {
  margin-bottom: 18px;
}

.language span {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.bar {
  background: rgba(0, 113, 227, 0.15);
  height: 10px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

/* Existing CSS for .fill */
.fill {
  background: #0071e3;
  height: 100%;
  border-radius: 10px;
  transition: width 1.6s ease;
  
  /* CORRECTED: Remove !important */
  width: 0; 
}

/* 2. Add a new class to trigger the animation */
.fill.animate {
    /* This class will be added by JS to trigger the actual width */
    /* The final width will be read from the data attribute in JS */
}

.cv-actions {
    display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  width: fit-content;
  margin-bottom: 25px;
}

.cv-actions a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  min-width: 160px;
  padding: 12px 24px;
}

.cv-actions1 {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px; /* space between buttons */
  margin-top: -50px;
  flex-wrap: wrap;
}

.cv-actions1 a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: auto;
  min-width: 160px;
  padding: 12px 24px;
}

.download-btn i {
    color: #0071e3;
    transition: color 0.3s ease;
}

.download-btn:hover i {
    color: #fff;   /* icon becomes white on hover */
}

.cv-actions1 .btn-primary {
  color: #fff;
}


/* ------------------------------
      CONTACT PAGE
--------------------------------*/

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
}

.contact-info a {
  color: var(--blue);
}

.contact-info p {
  font-size: 18px;
  margin: 35px 20px;
  margin-bottom: 15px;
}

.contact-info ul {
  margin-left: 90px;
}

.contact-info .social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap; /* prevents wrapping */
  gap: 10px;
  margin-top: 25px;
}

.contact-info .social-links a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 10px;
  min-width: 130px;
  text-align: center;
}

/* --- 5. Social Icon Row --- */
.soc-link {
    display: flex;
    gap: 25px;
    justify-content: flex-start; /* Align icons to the left */
    flex-wrap: wrap; /* Ensure responsiveness */
    justify-content: center;
    align-items: center;
    margin-top: 45px;
}

.soc-link a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 45px;
    height: 45px;
    border-radius: 50%; /* Perfect circle */
    background-color: var(--color-light);
    color: var(--blue);
    font-size: 1.5rem;
    text-decoration: none;
    transition: background-color var(--transition-duration), transform var(--transition-duration), box-shadow var(--transition-duration);
}

.soc-link a:hover {
    background-color: var(--color-primary);
    color: var(--blue);
    transform: translateY(-3px); /* Subtle lift effect */
    box-shadow: 0 4px 10px rgba(0, 38, 77, 0.3);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 15px;
  background: var(--bg-alt);
  color: var(--text);
}

.contact-form label {
  font-weight: 500;
}

.contact-form .btn-primary {
  cursor: pointer;
  margin-bottom: 20px;
}

.social-links {
  gap: 15px;
  flex-wrap: wrap;
}

.social-links a {
  margin-right: 10px;
  margin-bottom: 0px;
}

.social-links .btn-primary {
  color: #fff;
}

/*.get-in-touch {
  background: color-mix(in srgb, var(--border) 18%, transparent);
  border: 2px solid color-mix(in srgb, var(--border) 24%, transparent);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s;
}*/

form .btn-primary {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Style for the countdown message box */
/*#formMessage {
  display: none;
  text-align: center;
  background-color: rgba(0, 113, 227, 0.15);
  color: #0071e3;
  border: 1px solid rgba(0, 113, 227, 0.4);
  font-size: 16px;
  font-weight: 500;
  margin-top: 15px;
  padding: 10px 15px;
  border-radius: 8px;
  transition: opacity 0.6s ease;
  animation: fadeIn 0.3s ease-in;
}*/

/* --- Loading Animation Styles --- */

/* FIX: Ensure #formMessage is initially hidden, but set up for alignment. 
   We keep the display:none; style in the HTML and use JS to set display:flex.
*/
/* --- Loading Animation Styles (Updated) --- */

/* --- Loading Animation Styles (Horizontal Fade Pulse) --- */

/* --- Loading Animation Styles (FINAL) --- */

/* --- Loading Animation Styles (CORRECTED FINAL) --- */

#formMessage {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /*background-color: rgba(0, 113, 227, 0.05);
  color: var(--blue);
  border: 1px solid rgba(0, 113, 227, 0.4);*/
  font-size: 1.1rem;
  font-weight: 500;
  margin-top: 15px;
  padding: 15px 20px;
  border-radius: 8px;
  transition: opacity 0.6s ease;
  animation: fadeIn 0.3s ease-in;
  width: 100%;
  box-sizing: border-box;
}

/* Loading bar background */
.loading-bar {
  width: 90%;
  height: 8px;
  background: rgba(0, 113, 227, 0.15);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 10px;
  position: relative;
}

/* Blue progress fill */
.loading-fill {
  width: 0%;
  height: 100%;
  background: var(--blue);
  border-radius: 5px;
  animation: loadingProgress 4.5s linear infinite;
}

/* Loading bar animation */
@keyframes loadingProgress {
  0% { width: 0%; }
  35% { width: 40%; }
  50% { width: 60%; }
  80% { width: 90%; }
  100% { width: 100%; }
}

/* Optional fade-out animation for smoother exit */
.fade-out {
  opacity: 0;
  transition: opacity 0.6s ease;
}

____________________

/* Fade-in animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Optional fade-out class */
.fade-out {
  opacity: 0;
}


/* ------------------------------
      THANK YOU PAGE
--------------------------------*/
.thankyou-box {
  text-align: center;
  margin-top: 80px;
}

.checkmark {
  font-size: 3rem;
  color: var(--blue);
  animation: pop 0.6s ease;
}

@keyframes pop {
  0% {
    transform: scale(0);
  }
  80% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* ------------------------------
       PRELOADER
--------------------------------*/
#preloader {
  position: fixed;
  background: var(--bg);
  width: 100%;
  height: 100%;
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 0;
}

.loader {
  border: 4px solid #ddd;
  border-top: 4px solid var(--blue);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 0.8s linear infinite;
}

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

/* ------------------------------
         FOOTER
--------------------------------*/
footer {
  text-align: center;
  padding: 20px;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.blue {
  /* 1. Define the gradient (Required) */
  background: linear-gradient(90deg, #0071e3 0%, #0066ce 50%, #138df2 100%);
  /* You can use any valid gradient here */
  
  /* 2. Clip the background to the text (The Magic Step) */
  -webkit-background-clip: text; /* For Chrome, Safari, and newer browsers */
  background-clip: text;
  
  /* 3. Make the text transparent so the background shows through */
  -webkit-text-fill-color: transparent; /* For Chrome, Safari, and newer browsers */
  text-fill-color: transparent; /* Standard property */
}

/* ------------------------------
    SCROLL ANIMATION ADDITIONS
--------------------------------*/

/* 1. Initial State: Hidden and slightly offset downwards */
/* 1. Initial State: Hidden and slightly offset */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px); /* Starts 30px below its final position */
    transition: 
        opacity 0.8s ease-out, /* Slightly faster transition for better feel */
        transform 0.8s ease-out; 
    
    /* ** NEW: Add a delay to the transition **
    This makes the element stay on screen a bit longer before fading out 
    when you scroll past it.
    */
    transition-delay: 0.1s; 
}

/* 2. Final State: Visible and at its final position */
.animate-on-scroll.in-view {
    opacity: 1;
    transform: translateY(0);
    
    /* ** IMPORTANT: Reset the delay to 0s for the IN-VIEW state **
    We want the fade-in to be immediate when scrolled to.
    */
    transition-delay: 0s; 
}


/* ------------------------------
      RESPONSIVE (FIXED)
--------------------------------*/

/* Hide all menu icons by default, except the bars icon */
nav .fa-xmark{
  display: none;
  font-size: 22px;
}

.container1 .fa-bars{
  display: none;
  margin-left: auto;
}



/* Desktop Styles for Theme Toggle */
.theme-toggle,
nav ul li .theme-toggle {
  display: inline-flex;
}
#hobbies {
  margin-left: 20%;
}


/* Mobile Styles */
@media (max-width: 777px) {

  html, body {
  width: 100%;
  overflow-x: hidden;   /* Prevents horizontal scroll */
  overflow-y: auto;     /* Allows vertical scroll */
  scroll-behavior: smooth;
}

  header {
    margin-top: -15px;
    position: fixed;
    width: 100%;
    z-index: 10;
  }

  #hero-con {
    margin-top: 120px;
  }

  .hero {
    padding: 30px 0px;
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .hero-text {
    width: 100%;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    margin-top: 0px;
  }

  .hero p {
    margin-top: -5px;
  }


  .hero-image img {
    max-width: 300px;
    margin-top: 20px;
  }

  .hero-buttons {
    flex-wrap: wrap; /* allow wrapping if screen is really tiny */
    gap: 8px;
    margin-top: -20px;
    margin-right: 10px;
    margin-left: 10px;
  }

  .hero-buttons a {
    flex: 1;
    min-width: 130px;
  }

  .scroll-down {
    display: block;
  }

  .link-card {
    width: 100%;
  }

  .hrow {
    display: block;
  }

  .hrowLast {
    display: block;
  }

  /*nav .fa-bars {
    margin-left: 20px;
    display: block;
    cursor: pointer;
  }

  nav ul.open .fa-xmark {
    display: block !important;
    cursor: pointer;
  }
  

  nav ul {
    Sliding menu setup
    background: rgba(var(--bg-alt-r), var(--bg-alt-g), var(--bg-alt-b), 0.45);
    -webkit-backdrop-filter: blur(50px);
    backdrop-filter: blur(50px);
    transform: translateZ(0);
    position: fixed;
    top: 0;
    right: -350px; 
    width: 250px;
    height: 100vh;
    padding: 50px 20px;
    z-index: 10;
    transition: right 0.8s;
    border-radius: 10px;
    border: none;
    box-shadow: -4px 0 20px var(--shadow-color);
  }

  nav ul.open {
    right: 0;
  }
  nav ul li {
    display: block;
    margin: 25px 0; 
    text-align: left;
  }*/

  .container1 .fa-bars{
    display: block;
    cursor: pointer;
    font-size: 20px;
  }


  .mobile-bar {
    position: fixed;
    display: block;
    width: 250px;
    height: 320px;
    left: 2500px;
    background: color-mix(in srgb, var(--bg-alt) 40%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transform: translateZ(0);
    text-align: center;
    padding: 50px 20px;
    transition: right 0.8s;
    border-radius: 20px;
    border: none;
    box-shadow: -4px 0 20px rgba(0, 113, 227, 0.1);
    z-index: 1000;
  }

  nav .fa-bars {
    left: 20px;
    display: block;
    cursor: pointer;
  }

  ul .fa-xmark {
    margin-top: -280px;
    margin-left: 180px;
    display: block;
    cursor: pointer;
  }

  nav ul.open {
    /*left: 120px;
    top: 120px;*/
     position: fixed;
    top: 350%;
    left: 50%;
    transform: translate(-50%, -50%);
  }
  nav ul li {
    display: block;
    margin: 25px 0; 
    text-align: center;
  }

  .get-in-touch ul {
    margin-left: 35px;
  }

  .cv-actions1 {
    flex-wrap: wrap; /* allow wrapping if screen is really tiny */
    gap: 8px;
    margin-top: -20px;
    margin-right: 5px;
    margin-left: 5px;
  }

  .cv-actions1 a {
    flex: 1;
    min-width: 130px;
  }

  .contact-info .social-links {
    gap: 0px;
    min-width: 120px;
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 0px;
  }

  .contact-form h2 {
    margin-top: -20px;
  }

  /* Keep width: fit-content, but adjust padding */
    .floating-wrapper {
        padding: 10px 14px;
    }

    .social-item {
        font-size: 1.2rem;
    }

    .social-item.hidden {
    margin-left: -33px;
}

.resume1 {
  margin-top: 120px;
}

#hobbies h2 {
  margin-top: -15px;
}
#hobbies {
  margin-left: 10%;
}

.contact-form h2 {
  margin-top: 10px;
}

.contact-info h2 {
  margin-top: -20px;
}
.languages {
  margin-top: 15px;
  margin-left: 20px;
}
.side {
  margin-left: -25px;
}
.side1 {
  margin-left: -40px;
}

.side2 {
  margin-left: 50%;
}

.languages h2 {
  margin-top: 10px;
}

.projects1 {
  margin-top: 120px;
}

.contact1 {
  margin-top: 120px;
}

}  

