body {
    min-height: 100vh;
    margin: 0;
    overflow-y: auto;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #f2fefe;
    transition: background 0.1s ease-out;
    background-image: linear-gradient(45deg, #ffffff, #f2fefe); /* Initial gradient */
    animation: moveGradient 10s ease infinite; /* Animated background gradient */
}

main {
    padding-left: 30px;
    padding-right: 30px;
    scroll-behavior: smooth; /* Smooth scrolling */
}


header {
    background-color: rgba(242, 254, 254, 0.95);
    position: relative;
    z-index: 10;
    padding-left: 30px;
    padding-right: 30px;
    scroll-behavior: smooth;
}


h1, h2, h3, h4, h5, h6, p {
    font-family: 'fenwick', sans-serif;
    margin: 0;
}

h1 {    
    font-size: 64px;
    font-weight: 700;
}

h2 {
    font-size: 28px;
    font-weight: 400;
}

h3 {    
    font-size: 20px;
    font-weight: 300;
}

h4 {    
    font-size: 24px;
    font-weight: 700;
}

h5 {
    font-size: 16px;
    font-weight: 300;
    margin: 0;
    pointer-events: auto; /* Allow interaction on the text */
}

h6 {    
    font-size: 13px;
    font-weight: 300;
}

p { 
    font-size: 12px;
    font-weight: 300;
}

a {
    text-decoration: none; /* Removes underline from links */
}



/* Fullscreen Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, #BBF9FF, #f2fefe, #d8f3f3);
    background-size: 300% 300%;
    animation: moveGradient 8s infinite ease-in-out;
    z-index: 9999;
    transition: opacity 1s ease-out, transform 0.8s ease-out;
}

/* Gradient Animation */
@keyframes moveGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Logo */
.loading-logo {
    width: 120px;
    height: 120px;
    opacity: 0.9;
    animation: fadeIn 1.5s ease-in-out infinite alternate;
}

/* Logo Fade Animation */
@keyframes fadeIn {
    0% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Fade Out Effect */
.hide {
    opacity: 0;
    transform: translateY(-100%);
    pointer-events: none;
}

/*nav Bar*/
.navlogo {
    height: 50px;
    display: inline-block;
    background-color: transparent;
}

/* Sticky Navbar */
.navbar {
    backdrop-filter: blur(8px);
    width: 100%;
    padding-top: 20px;
    padding-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
    position: sticky;
    top: 0;
    z-index: 1000;
    
}

.navbar:before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 2px;
    background-color: #070A11;
    z-index: -1;
}

/* Animations */
.nav-link {
    font-size: 1.25rem;
    color:  #070A11;
    text-decoration: none;
    font-weight: 400;
}


/* About link underline effect */
#about-link {
    position: relative;
    text-decoration: none;
    display: inline-block;
}

#about-link::after {
    content: "";
    position: absolute;
    left: 10%; /* Starts slightly from the left */
    bottom: -3px; /* Adjusts the spacing below the text */
    width: 0;
    height: 2px;
    background-color:  #070A11;
    transition: width 0.3s ease-in-out, left 0.3s ease-in-out;
}

#about-link:hover::after {
    width: 100%; /* Expands fully */
    left: 0; /* Moves back to align with text */
}






/*background hover*/
#toggle-bg {
  position: fixed;
  top: 50%;
  right: -40px;
  transform: translateY(-50%);
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background-color: #070A11; /* nav button bg color */
  color: #fff;               /* nav button text color */
  border: 2px solid #1A1F2A; /* nav button border color */
  font-size: 0.75rem;

  font-family: 'fenwick', sans-serif;
  font-weight: 600;
  cursor: pointer;
  z-index: 1000;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  line-height: 1.1;
  padding-left: 20px;
  padding-right: 10px;
  
  transition: all 0.3s ease;
  overflow: hidden;
}

/* Normal light mode toggle button with haze */
body.light-mode #toggle-bg {
  background-color: rgba(164, 195, 200, 0.7); /* semi-transparent blue */
  backdrop-filter: blur(10px); /* haze effect */
  color: #000;
  border: 2px solid rgba(179, 229, 252, 0.6);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* When toggle overlaps footer in light mode, remove haze and use solid color */
body.light-mode #toggle-bg.over-footer {
  background-color: #A4C3C8;  /* solid soft blue */
  backdrop-filter: none;      /* remove haze */
  color: #070A11;             /* darker text for contrast */
  border: 2px solid rgba(179, 229, 252, 0.6);
}


body.light-mode #toggle-bg:hover {
  background-color: #D3FBFF;  /* lighter blue on hover */
  color: #070A11;             /* dark text on hover */
}


/* Dark mode border override */
body:not(.light-mode) #toggle-bg {
  border: 2px solid rgba(179, 229, 252, 0.6); /* soft blue, matches light mode border */
}

/* Mobile adjustments */
@media (max-width: 768px) {
  #toggle-bg {
    width: 90px;
    height: 90px;
    font-size: 0.65rem;
    padding-left: 15px;
    padding-right: 8px;
    right: -25px;
  }
}

#toggle-bg:hover {
  right: -20px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.toggle-button {
    background-color: #A4C3C8;
    color:  #070A11;
    border: none;
    padding: 10px 20px;
    font-family: 'fenwick', sans-serif;
    font-size: 14px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    z-index: 10000;
    box-shadow: 0 0 10px rgba(0,0,0,0.2);
    transition: background 0.3s ease, color 0.3s ease;
}

.toggle-button:hover {
    background-color: #D3FBFF;
    color: #070A11;
}

a:hover, .toggle-button:hover {
    transform: scale(1.05);
    transition: all 0.3s ease;
}

.light-mode {
    background: linear-gradient(45deg, #ffffff, #e6f7f7);
    color:  #070A11;
}

/* Default: main content visible */
#main-content {
  position: relative;
  transition: filter 0.3s ease;
}

body.dark-mode #main-content {
  position: relative;
  overflow: hidden;
  mask-image: radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y), transparent 0%, rgba(0, 0, 0, 0.99) 100%);
  -webkit-mask-image: radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y), transparent 0%, rgba(0, 0, 0, 0.99) 100%);
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  transition: mask-image 0.1s ease, -webkit-mask-image 0.1s ease;
}


/* The spotlight circle is created by a radial-gradient mask */
body.dark-mode.spotlight {
  mask-image: radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y), rgba(0,0,0,1) 0%, transparent 80%);
  -webkit-mask-image: radial-gradient(circle 150px at var(--mouse-x) var(--mouse-y), rgba(0,0,0,1) 0%, transparent 80%);
}


body.dark-mode .project-image {
  -webkit-mask-image: radial-gradient(
    circle var(--mask-radius, 300px) at var(--mouse-x, 50%) var(--mouse-y, 50%),
    white 0%,
    transparent 100%
  );
  mask-image: radial-gradient(
    circle var(--mask-radius, 300px) at var(--mouse-x, 50%) var(--mouse-y, 50%),
    white 0%,
    transparent 100%
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  transition: mask-image 0.2s ease, -webkit-mask-image 0.2s ease;
}

body.light-mode .project-image {
  -webkit-mask-image: none;
  mask-image: none;
}


/* Show images normally in light mode */
body:not(.dark-mode) .project-image {
  -webkit-mask-image: none;
  mask-image: none;
}











/*First section */

.text-large {    
    padding-top: 50px;
    padding-bottom: 10rem;
    max-width: 1100px;
}

.text-medium-container {
    display: flex;
    justify-content: center;
    padding-left: 50%; /* Adjust if needed */
    padding-bottom: 10rem;
    position: relative; /* Create a stacking context for this container */
}

.text-medium {
    color: black; 
    word-wrap: break-word;
    pointer-events: auto; /* Ensure mouse events pass through */
    position: relative; /* Ensure it’s on its layer */
}



.text-large, .text-small, .text-medium-container {
    position: relative; /* Ensure text elements do not block gradient */
    z-index: 1; /* Place the text above the background gradient */
}


.text-small {   
    box-sizing: border-box;
    border-top: 2px solid black; /* Line below the nav */
    padding-top: 10px;
    padding-bottom: 50px;
}







/*Project titles*/

.project-title {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    color: black;
    padding-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}

.divider {
    width: 100%;
    padding-bottom: 40px;
    box-sizing: border-box;
}

.project-title h3, .project-title h2 {
    margin: 0;
}

.project-title h2 {
    text-align: right;
}


.homeimg {
    max-width: 50rem; /* Sets the maximum width of the container */
    max-height: 30rem; /* Sets the maximum height of the container */
    width: 100%; /* Ensures container scales responsively */
    margin: 0 auto; /* Centers the container */
    overflow: hidden; /* Crops any overflowed parts of the image */
    padding-bottom: 10px; /* Adds space between image and bottom border */
    border-bottom: 1px solid black; /* Bottom border for each image container */
}

.homeimg img {
    width: 100%; /* Makes the image fill the container width */
    height: auto; /* Allows image to scale naturally */
    object-fit: cover; /* Crops the image to fit within the container */
    display: block; /* Removes any extra space below the image */
    transition: height 0.3s ease, opacity 0.3s ease; /* Smooth fade-in/out effect */
    opacity: 1; /* Fully visible by default */
}

/* Responsive project styling */
.project {
    display: flex;
    flex-direction: column; /* Stacks items vertically */
    gap: 2rem; /* Adds spacing between project items */
}








/*footer*/
footer {
    background-color: #000000;
    color: white; /* Ensures all text inside the footer is white */
    margin: 0;
    padding-left: 30px;
    padding-right: 30px;
    padding-top: 4rem;
}

.footer {
    padding-bottom: 20rem; /* Adds 30rem space at the bottom of the .footer class */
    font-family: 'fenwick', sans-serif;
    font-size: 48px;
    font-weight: 700;
}

.linkdin {  
    padding-bottom: 20px;
    transition: text-shadow 0.3s ease, color 0.3s ease; /* Smooth transition for glow effect */
}

.lindkin :hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 
    0 0 20px rgba(255, 255, 255, 0.6), 
    0 0 30px rgba(255, 255, 255, 0.4); /* Create a glowing effect */
    color: #f2fefe; /* Optional: Slightly change text color for more emphasis */
}

.email {    
    padding-bottom: 3rem;
    transition: text-shadow 0.3s ease, color 0.3s ease; /* Smooth transition for glow effect */
}

footer a {
    color: white; /* Ensures links are white */
    text-decoration: none; /* Remove default underline */
    transition: text-shadow 0.3s ease, color 0.3s ease; /* Smooth transition for glow effect */
}   

footer a:hover {
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 
                 0 0 20px rgba(255, 255, 255, 0.6), 
                 0 0 30px rgba(255, 255, 255, 0.4); /* Create a glowing effect */
    color: #f2fefe; /* Optional: Slightly change text color for more emphasis */
}


/* Parent container to center the .ed element */
.center-container {
    display: flex; /* Enables Flexbox */
    justify-content: center; /* Centers horizontally */
    align-items: center; /* Centers vertically */
    text-align: center; /* Centers text within the container */
}

/* Styling for the .ed element */
.ed {    
    font-family: 'fenwick', sans-serif;
    font-weight: 300;
    font-size: 12px;
    color: #ccdede71;
    max-width: 85rem;
    margin: 0 auto; /* Ensures proper alignment */
    padding-bottom: 2rem;
}








@media (min-width: 1097px) {  /* Adjusts for mobile */

    .about{ 
        font-size:24px;
    }
}


@media (max-width: 1097px) {  /* Adjusts for mobile */

    .about{ 
        font-size:18px;
    }
}



/* Media query for desktop view */
@media screen and (min-width: 769px) {

    h1 {    
        font-size: 128px;
        font-weight: 700;
    }
    
    h2 {
        font-size: 64px;
        font-weight: 700;
    }
    
    h3 {    
        font-size: 48px;
        font-weight: 300;
    }
    
    h4 {    
        font-size: 36px;
        font-weight: 700;
    }
    
    h5 {    
        font-size: 32px;
        font-weight: 300;
    }
    
    h6 {    
        font-size: 20px;
        font-weight: 400;
    }
    
    p { 
        font-size: 24px;
        font-weight: 400;
    }

/*text-medium*/
    .text-medium-container {
        padding-right: 0; /* Remove extra padding on smaller screens */
        justify-content: center; /* Center-aligns text on small screens */
    }

/* Keep projects aligned to the right with a max width */
.project {
    max-width: 769px; /* Limit width */
    margin-left: auto; /* Pushes it to the right */
    margin-right: 0;
    width: 100%; /* Ensures it doesn’t exceed max-width */
    margin-bottom: 3rem;
}

/* Container for title and image */
.homeimg {
    width: 100%; /* Ensures it fits within the 769px max width */
    overflow: hidden;
    position: relative;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Title remains in place */
.project-title {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1rem;
    color: rgb(0, 0, 0);
    width: 100%;
}

/* Image container starts collapsed */
.project-image {
    width: 100%;
    height: 0; /* Starts hidden */
    overflow: hidden;
    transition: height 1.0s ease-in-out;
}

/* Ensure the middle section of the image is visible */
.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center; /* Focuses on the middle section */
    display: block;
}

/* On hover, expand the image */
.homeimg:hover .project-image {
    height: 650px; /* Expand smoothly */
}



    

    .num {  
        padding-right: 10rem;
    }
    
    /*Footer*/
    .linkdin h4.footerh4, .email h4.footerh4 {     
        font-size: 24px;
        font-weight: 700;
        margin: 0;
        color: rgb(255, 255, 255);
    }

    .linkdin {  
        padding-bottom: 20px;
    }
    
    .linkdin p.footerp, .email p.footerp {   
        font-size: 12px;
        font-weight: 300;
        margin: 0;
        color: rgb(255, 255, 255);
    }
}
