 :root {
   --base-white: #ffffff;
   --main-pink: #FFD1DC;
   --soft-pink: #FFF0F3;
   --deep-brown: #4E342E;
   --accent-pink: #FF85A1;
 }

 * {
   box-sizing: border-box;
   scroll-behavior: smooth;
 }

 body {
   background-color: var(--base-white);
   color: var(--deep-brown);
   font-family: 'Quicksand', sans-serif;
   margin: 0;
   padding: 0;
   overflow-x: hidden;
 }

 h1,
 h2,
 .handwritten {
   font-family: 'Playwrite DE SAS', cursive;
 }

 /* --- Navigation --- */
 nav {
   position: fixed;
   top: 0;
   width: 100%;
   padding: 20px;
   background: rgba(255, 255, 255, 0.8);
   backdrop-filter: blur(10px);
   z-index: 1000;
   display: flex;
   justify-content: center;
   gap: 30px;
   border-bottom: 1px solid var(--soft-pink);
 }

 nav a {
   text-decoration: none;
   color: var(--deep-brown);
   font-weight: 600;
   font-size: 1.1rem;
   transition: 0.3s;
 }

 nav a:hover {
   color: var(--accent-pink);
   letter-spacing: 1px;
 }

 /* --- Hero Section --- */
 .hero {
   height: 100vh;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: center;
   background: radial-gradient(circle, var(--soft-pink) 0%, var(--base-white) 70%);
   text-align: center;
 }

 .hero-img {
   width: 180px;
   height: 180px;
   background: var(--main-pink);
   border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%;
   animation: morph 6s ease-in-out infinite;
   display: flex;
   align-items: center;
   justify-content: center;
   overflow: hidden;
   margin-bottom: 20px;
   border: 4px solid white;
 }

 @keyframes morph {
   0% {
     border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%;
   }

   50% {
     border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%;
   }

   100% {
     border-radius: 40% 60% 70% 30% / 40% 50% 60% 70%;
   }
 }

 .hero h1 {
   font-size: 4rem;
   margin: 0;
   color: var(--deep-brown);
 }

 /* --- Layout Containers --- */
 section {
   padding: 100px 20px;
   max-width: 1000px;
   margin: 0 auto;
 }

 .section-title {
   font-size: 3.5rem;
   text-align: center;
   margin-bottom: 50px;
   color: var(--accent-pink);
 }

 /* Horizontal scrolling projects */
 .project-grid {
   display: flex;
   gap: 50px;
   overflow-x: auto;
   overflow-y: hidden;
   padding: 20px 50px 40px 50px;
   scrollbar-width: none;
 }


 /* Container for the grid and hover triggers */
 .scroll-container {
   position: relative;
   width: 100%;
   display: flex;
   align-items: center;
 }

 .scroll-container::before,
 .scroll-container::after {
   content: "";
   position: absolute;
   top: 0;
   width: 50px;
   height: 100%;
   z-index: 5;
   pointer-events: none;
 }

 .scroll-container::before {
   left: 0;
   background: linear-gradient(to right, var(--base-white), transparent);
 }

 .scroll-container::after {
   right: 0;
   background: linear-gradient(to left, var(--base-white), transparent);
 }

 .project-grid .card {
   flex: 0 0 auto;
   width: min(440px, 85vw);
   /* card width */
   scroll-snap-align: start;
   /* optional snap */
 }

 .card {
   background: white;
   border-radius: 30px;
   padding: 25px;
   border: 1px solid var(--soft-pink);
   box-shadow: 0 10px 20px rgba(255, 183, 197, 0.2);
   transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
 }

 .card:hover {
   transform: scale(1.05);
   box-shadow: 0 5px 10px rgba(255, 183, 197, 0.4);
 }


 /* Invisible areas on the sides */
 .hover-zone {
   position: absolute;
   top: 0;
   height: 100%;
   width: 80px;
   /* How wide the hover area is */
   z-index: 10;
   display: flex;
   align-items: center;
   justify-content: center;
   cursor: pointer;
   transition: 0.3s;
 }

 .left {
   left: 0;
 }

 .right {
   right: 0;
 }

 /* The Arrow Icons */
 .arrow {
   font-size: 3rem;
   color: var(--accent-pink);
   opacity: 0;
   /* Hidden by default */
   transition: 0.3s;
   pointer-events: none;
   /* Mouse ignores the text itself */
 }

 /* Show arrows and a slight glow on hover */
 .hover-zone:hover .arrow {
   opacity: 1;
 }

 .hover-zone:hover {
   background: linear-gradient(to right, rgba(255, 209, 220, 0.2), transparent);
 }

 .right:hover {
   background: linear-gradient(to left, rgba(255, 209, 220, 0.2), transparent);
 }

 .hover-zone:active .arrow {
   transform: scale(0.8);
   /* Shrinks the arrow slightly when clicked */
   color: var(--main-pink);
 }

 .scroll-container {
   position: relative;
   width: 100%;
   /* Ensure the container doesn't cut off shadows */
   padding: 0 10px;
 }

 .image-box {
   width: 100%;
   height: 220px;
   background: var(--soft-pink);
   border-radius: 20px;
   display: flex;
   align-items: center;
   justify-content: center;
   margin-bottom: 20px;
   color: var(--accent-pink);
   font-family: 'Playwrite DE SAS', cursive;
   font-size: 1.5rem;
   border: 2px dashed var(--main-pink);
 }

 /* --- Skills Bubble --- */
 .skill-list {
   display: flex;
   flex-wrap: wrap;
   justify-content: center;
   gap: 15px;
 }

 .skill {
   background: white;
   padding: 12px 25px;
   border-radius: 50px;
   border: 2px solid var(--main-pink);
   color: var(--deep-brown);
   font-weight: 600;
   transition: 0.3s;
 }

 .skill:hover {
   background: var(--accent-pink);
   color: white;
   transform: translateY(-5px);
 }

 .project-img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   /* fills the box nicely */
   border-radius: 18px;
   /* matches the rounded look */
   display: block;
 }

 .image-box:has(img) {
   border: none;
   background: none;
   color: transparent;
 }

 /* Modal (background) */
 .modal {
   display: none;
   /* Controlled by flex/none in JS */
   position: fixed;
   z-index: 2000;
   left: 0;
   top: 0;
   width: 100%;
   height: 100%;
   background-color: rgba(62, 39, 35, 0);
   /* Start transparent */
   cursor: zoom-out;
   transition: background-color 0.4s ease;
   align-items: center;
   justify-content: center;
 }


 /* Modal Content (The Image or Video) */
 .modal-content {
   max-width: 85%;
   max-height: 85%;
   border-radius: 20px;
   border: 5px solid white;
   box-shadow: 0 10px 50px var(--main-pink);
   background: black;

   /* Animation Start State */
   transform: scale(0.7);
   opacity: 0;
   transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
 }

 /* State when the image is sliding out to the left (Next) */
 .slide-out-left {
   transform: translateX(-100px) !important;
   opacity: 0 !important;
 }

 /* State when the image is sliding out to the right (Prev) */
 .slide-out-right {
   transform: translateX(100px) !important;
   opacity: 0 !important;
 }

 /* State when zoomed in */
 .modal.open .modal-content {
   transform: scale(1);
   opacity: 1;
 }

 /* Zoom Icon Overlay on Hover */
 .image-box {
   position: relative;
   cursor: zoom-in;
 }

 .image-box::after {
   content: "Click to Zoom";
   font-family: 'Quicksand', sans-serif;
   position: absolute;
   background: rgba(255, 133, 161, 0.8);
   color: white;
   padding: 5px 15px;
   border-radius: 20px;
   font-size: 0.8rem;
   font-weight: bold;
   opacity: 0;
   transition: 0.3s;
 }

 .image-box:hover::after {
   opacity: 1;
 }

 .image-box:hover img {
   filter: brightness(0.8);
   /* Dims the project image to make the text readable */
 }

 .image-box img {
   transition: transform 0.5s ease, filter 0.5s ease;
 }

 .modal-overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: -1;
   cursor: zoom-out;
 }

 .modal::before {
   content: "Press ESC or Click outside to close";
   position: absolute;
   top: 30px;
   right: 30px;
   color: white;
   font-family: 'Quicksand', sans-serif;
   font-size: 0.9rem;
   background: var(--accent-pink);
   padding: 8px 15px;
   border-radius: 50px;
   opacity: 0;
   transition: 0.3s ease;
   pointer-events: none;
   z-index: 3001;
 }

 .modal.open::before {
   opacity: 1;
 }

 .modal-content {
   cursor: default;
 }

 .modal-close-overlay {
   position: absolute;
   top: 0;
   left: 0;
   width: 100%;
   height: 100%;
   z-index: -1;
 }

 .nav-btn {
   background: white;
   color: var(--accent-pink);
   border: none;
   font-size: 3rem;
   width: 60px;
   height: 60px;
   border-radius: 50%;
   cursor: pointer;
   z-index: 3000;
   display: none;
   /* Controlled by JS */
   align-items: center;
   /* Vertical center */
   justify-content: center;
   /* Horizontal center */
   line-height: 0;
   /* Forces the font to ignore its default height */
   padding-bottom: 5px;
   /* Nudges the arrow down into the visual center */
   margin: 1rem;
   transition: 0.3s;
   box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
 }

 .nav-btn:hover {
   background: var(--accent-pink);
   color: white;
   transform: scale(1.1);
 }

 #galleryCounter {
   position: absolute;
   bottom: 20px;
   left: 50%;
   transform: translateX(-50%);
   background: var(--accent-pink);
   color: white;
   padding: 5px 15px;
   border-radius: 20px;
   font-size: 0.9rem;
   z-index: 3005;
 }

 .close-btn {
   display: none;
 }

 .modal.open {
   background-color: #402a3aae;
 }

 .modal:not(.open) .close-btn,
 .modal:not(.open) #galleryCounter,
 .modal:not(.open) .nav-btn {
   opacity: 0 !important;
   display: none !important;
   transition: none !important;
 }

 footer {
   text-align: center;
   padding: 60px;
   font-family: 'Quicksand', sans-serif;
   font-size: 1.3rem;

   background: linear-gradient(to bottom,
       rgba(255, 255, 255, 0) 0%,
       var(--soft-pink) 20%);
 }

 @media (max-width: 600px) {
   .scroll-container {
     padding: 0;
     overflow: hidden;
   }

   .scroll-container::before,
   .scroll-container::after {
     display: none;
   }

   .hero h1 {
     font-size: 3rem;
   }

   .section-title {
     margin-top: 1rem;
     font-size: 2.5rem;
   }

   .project-grid {
     display: block;
     overflow-x: hidden;
     /* Force horizontal scroll to stop */
     padding: 0;
     width: 100%;
   }

   .project-grid .card {
     width: 100%;
     margin: 0 0 30px 0;
     border-radius: 0;
     box-shadow: none;
     border-color: var(--main-pink);
     border-width: 1px;
     border-left: none;
     border-right: none;
     border-bottom: none;
     flex: none;
   }

   .card {
     box-shadow: none;
     transform: none;
   }

   .card:hover {
     box-shadow: none;
     transform: none;
   }

   .hover-zone {
     display: none;
   }

   .nav-btn {
     position: relative;
     margin: 0 0;
   }

   #prevBtn {
     left: 0;
     border-radius: 0 50px 50px 0;
     justify-content: flex-end;
     padding-right: 10px;
     box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
   }

   #nextBtn {
     right: 0;
     border-radius: 50px 0 0 50px;
     justify-content: flex-start;
     padding-left: 10px;
     box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
   }

   .image-box {
     pointer-events: none;
     border-radius: 0;
     margin-left: -20px;
     margin-right: -20px;
     width: calc(100% + 40px);
   }

   .image-box::after {
     display: none;
   }

   .image-box:hover img {
     filter: none !important;
     transform: none !important;
   }

   .modal {
     overflow: hidden !important;
     display: none;
     align-items: center;
     justify-content: center;
     position: fixed;
     touch-action: none;
   }

   .modal-content {
     position: relative;
     transition: transform 0.4s ease, opacity 0.4s ease;
   }

   .modal::before {
     content: none;
   }

   body.modal-open {
     overflow: hidden;
   }

   .close-btn {
     display: block !important;
     position: absolute;
     top: 20px;
     right: 20px;
     background: white;
     border: none;
     border-radius: 50%;
     width: 40px;
     height: 40px;
     color: var(--accent-pink);
     font-size: 30px;
     z-index: 3010;
   }
 }