/* all pages */
html, body {
  cursor: none;
  backdrop-filter: none; 
}

body {
  font-family: 'Montserrat', sans-serif;
  background-image: url('/img/pinkswirl.png');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
  background-color: #f6f6f6; /* fallback */
  color: #333;
  margin: 0;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cursor-circle {
  position: fixed;
  top: 0;
  left: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  background: rgba(128, 0, 128, 0.3); /* Purple with transparency */
  backdrop-filter: invert(1) grayscale(1) brightness(1); /* Inverts colors under the cursor */
  transform: translate(-50%, -50%);
  z-index: 9999;
}

.modal-cursor {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  background-color: #470f55;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  display: none;
  pointer-events: none;
  background-image: linear-gradient(to bottom right, #5d3cb8, #e25dcc);
}



.cursor-circle.hovering {
  transform: translate(-50%, -50%) scale(1.5);
  border-color: #470f55;
}



.social-section {
  position: absolute;
  top: 20px;
  right: 30px;
  text-align: center;
  z-index: 10000;
}


.social-icons a {
  z-index: 10001;
  margin: 0 5px;
  color: #470f55;
  font-size: 1.2rem;
  transition: color 0.3s;
    cursor: none;
}

.social-icons a:hover {
  color: #fff;
}


/* main page */
.typewriter-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 140px;
}

/* name heading */
h1 {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(2rem, 8vw, 6.5rem);
  letter-spacing: 1px;
  font-weight: 1000; 
  color: #470f55;
  text-align: center;
  width: 100%;
  user-select: none;
}

/* typewriter style */
.typewriter {
  white-space: nowrap;
  overflow: hidden;
  border-right: 2px solid #333;
  padding-right: 16px;
  margin: 0 auto 20px;
  opacity: 0;
  width: 0;
  font-size: clamp(2rem, 8vw, 6.5rem);
  font-weight: 1000;
  color: #470f55;
  animation-fill-mode: forwards;
}

.typewriter-wrapper {
  width: 100%;
  text-align: center;
  padding: 0 20px;
  box-sizing: border-box;
}

/* desktop animation */
.desktop-name {
  margin-top: 100px;
  animation:
    fadeIn 0s ease 1s forwards,
    typing 2.5s steps(11) 1s forwards,
    blink 0.75s step-end 3,
    hideCursor 0.3s ease 3.7s forwards;
}

/* hide mobile version by default */
.mobile-name {
  display: none;
}

/* mobile first name first */
.mobile-name .first {
  animation:
    fadeIn 0s ease 0.3s forwards,
    typing 2s steps(6) 0.3s forwards,
    blink 0.7s step-end 3,
    hideCursor 0.2s ease 2.7s forwards;
}

/* mobile last name second  */
.mobile-name .second {
  animation:
    fadeIn 0s ease 3s forwards,
    typing 2s steps(6) 3s forwards,
    blink 0.7s step-end 3,
    hideCursor 0.2s ease 5.4s forwards;
}

/* typewriter animation */
@keyframes fadeIn {
  to { opacity: 1; }
}
@keyframes typing {
  from { width: 0 }
  to { width: calc(var(--char-count) * 1ch + 0.2ch) }
}
@keyframes blink {
  50% { border-color: transparent }
}
@keyframes hideCursor {
  to { border-color: transparent }
}

/* links to projects + about me */
.main-links {
  margin-top: 0px;
  display: flex;
  flex-wrap: wrap; /* allows wrapping on smaller screens */
  gap: clamp(1rem, 5vw, 80px); /* responsive gap [gap between=80]*/
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none; 
}

.main-links.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.main-links a {
  cursor: none;
  position: relative;
  text-decoration: none;
  color: #470f55;
  font-weight: 600;
  font-size: clamp(1rem, 2.5vw, 1.2rem); /* responsive */
  transition: transform 0.3s ease, color 0.3s ease;
  padding: 8px 12px;
  user-select: none;
  -webkit-user-select: none; 
  -moz-user-select: none;    
  -ms-user-select: none;    
}

/* underline hover */
.main-links a::after {
  margin-left: 30px;
  content: '';
  position: absolute;
  left: 0;
  bottom: 2px;
  height: 2px;
  width: 0;
  background-color: #470f55;
  transition: width 0.6s ease; /* 0.3s = faster */
}

 /* bubble hover */
.main-links a:hover {
  transform: scale(1.1);
  color: #5a1570;
}

/* width of underline line */
.main-links a:hover::after {
  width: 80%;
}

/* show links after typewrite */
.reveal-links .main-links {
  opacity: 1;
  transform: translateY(0);
}

/* projects page */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0px;
}

.about-heading {
  letter-spacing: -10px; /* tighter spacing */
  margin-bottom: 0px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  justify-items: center;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  padding-top: 0px;
  margin-bottom: 80px;
}

.project-card {
  width: 100%;
  max-width: 280px; /* same size boxes on resize */
  height: 200px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
  justify-content: center;
  transition: transform 0.2s ease;
}

.project-img {
  width: 101%;
  height: 102%;
  object-fit: cover;          /* fills the box, cropping if needed */
  border-radius: 12px;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-img {
  opacity: 1;
}


.project-card:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 0, 40, 0.5); /* dark blur effect */
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10% ;
  z-index: 2000;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: rgba(255, 255, 255, 0.562);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 40px;
  text-align: center;
  max-width: 600px;
  width: 80vw;
  color: #470f55;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  position: relative;

  height: auto;
  max-height: 90vh; /* optional: prevent offscreen overflow */
}

.modal-content a {
  text-decoration: none;

}

.modal-close {
  position: absolute;
  top: 12px;
  right: 18px;
  font-size: 35px;
  cursor: none;
  color: #914bc2;
}

body.modal-open .projects {
  opacity: 0.2;
  pointer-events: none;
  filter: blur(3px);
}

.back-arrow {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  font-size: 28px;
  transition: transform 0.3s ease, color 0.3s ease;
}

.back-arrow a {
  cursor: none;
  color: #c9a2f1; /* light purple to match up-arrow */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s ease, color 0.3s ease;
}

.back-arrow a:hover {
  transform: scale(1.2);
  color: #914bc2; /* darker purple on hover */
}

.up-arrow {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  width: 48px;
  height: 48px;
  background-color: #c9a2f1; /* pastel purple */
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease, background-color 0.3s ease;
}

.up-arrow.visible {
  opacity: 1;
  pointer-events: auto;
}

.up-arrow:hover {
  background-color: #b388e2; /* slightly darker purple */
}

.up-arrow ion-icon {
  color: white;
  font-size: 20px;
}

/* about me page */
.container-about {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 20px;
}

.container-about p {
  margin-top: -50px;
  font-size: 1.2rem;
  color: #470f55;
  text-align: center;
  max-width: 600px;
  line-height: 1.5;
}

.inline-link {
  text-decoration: none;
  color: #470f55;
  font-weight: 600;
  transition: transform 0.01s ease-out, font-weight 0.01s ease-out;
  will-change: transform;
  cursor: none;
}

.inline-link:hover {
  font-weight: 700;
  transform: scale(1.05);
}

.glass-popup {
  position: fixed;
  top: 10%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 260px;              /* Set a fixed width */
  height: 35px;             /* Set a fixed height */
  padding: 20px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  color: #470f55;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  display: none;
}

.glass-popup p {
  margin: 10px 0;
  word-wrap: break-word;
}


.glass-popup a {
  cursor: none;
}

.glass-popup .close-popup {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 22px;
  color: #914bc2;
  cursor: none;
}


#contact-popup {
  position: static;
  display: none;
  margin-top: 50px;
  margin-left: calc(50% - 0px); /* shift right by 100px from center */
  margin-right: auto;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(15px);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  color: #470f55;
  width: max-content;
  max-width: 90vw;
  width: 250px;
  z-index: 1;
  min-height: 50px;
}



/* scroll bars  */
@supports (scrollbar-width: none) and (scrollbar-color: none) {  * {scrollbar-width: auto; scrollbar-color: auto; }}
/* chrome, safari */
@media screen and (-webkit-min-device-pixel-ratio:0) {::-webkit-scrollbar {width: 10px; background: transparent;} ::-webkit-scrollbar-thumb {background: rgba(122, 122, 122, 0.507); border-radius: 5px;}}
/* firefox */
@supports not (scrollbar-width: none) {* {scrollbar-width: thin; scrollbar-color: rgba(122, 122, 122, 0.507) transparent;}}
/* internet Explorer, edge */
*::-webkit-scrollbar {width: 0.5rem; background: transparent;} *::-webkit-scrollbar-thumb {background: rgba(122, 122, 122, 0.507); border-radius: 0.25rem; }

/* shrink to 2 projects if screen 1200 */
@media (max-width: 1200px) {
  .projects {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
    
    
  * {
    scrollbar-width: auto !important;
    scrollbar-color: auto !important;
  }

  ::-webkit-scrollbar {
    display: block !important;
    width: 8px;
    background: rgba(255, 255, 255, 0.2);
  }

  ::-webkit-scrollbar-thumb {
    background: rgba(108, 84, 134, 0.5);
    border-radius: 4px;
  }

  .social-icons a {
    font-size: 1.5rem;
  }
  

  /* main page */

  .main-links::-webkit-scrollbar {
    display: none;
  }
  
  .main-links {
    -ms-overflow-style: none;  /* IE/Edge */
    scrollbar-width: none;     /* Firefox */
  }

  .main-links {
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    flex-shrink: 1;
    overflow-x: auto;
  }

  .main-links a {
    font-size: 0.95rem;
    white-space: nowrap;
    padding: 6px 10px;
    flex: 0 0 auto;
  }

  h1 {
    font-weight: 800; 
  }
  .typewriter {
    font-size: 5rem !important;
  }

  /* hide desktop full name and show stacked */
  .desktop-name {
    display: none;
  }

  .mobile-name {
    display: block;
    text-align: center;
    gap: 10px;
  }

  .mobile-name .first,
  .mobile-name .second {
    animation: none !important;
    width: auto !important;
    border: none !important;
    opacity: 1 !important;
  }
  
    .main-links {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }
  
    .cursor-circle,
  .modal-cursor {
    display: none !important;
  }



  /* width of underline line */
.main-links a:hover::after {
  width: 75%;
}


  /* projects page */

  .modal-content {
    padding: 20px;
    font-size: 0.95rem;
    width: 90vw;
    max-width: 90vw;
    box-sizing: border-box;
  }
  
  .modal-content h2 {
    font-size: 1.4rem;
  }
  
  .modal-content p {
    font-size: 1rem;
    line-height: 1.4;
    max-height: 375px;
    overflow-y: auto;
  }
  
  #modal-link {
    margin-bottom: 20px!important;
    font-size: 1rem;
  }
  
  .modal-overlay {
    padding-top: 60px; /* reduce top padding for phones */
  }
  

  /* one project per page */

  .container {

    margin-bottom: 20px;
  }

  .projects {
    grid-template-columns: repeat(1, 1fr);
  }

  .project-card img {
    opacity: 1;
  }

  .about-heading {
    letter-spacing: -5px; 
    margin-bottom: 10px;
  }
  
  .projects {
    margin-bottom: 20px;
  }

  /* about me page */

  #contact-popup p {
    padding-top: 50px; /* Adjust as needed */
  }

  .container-about {
    overflow-x: hidden;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 0 20px; /* optional: keeps spacing on edges */
    margin-top: 30px;
  }
  
  .container-about h1{
    margin-bottom: 70px;
  }


  .container-about p {
    margin-top: -40px;
    max-width: 250px;
  }

  .inline-link {
    font-weight: bold;
  }
  
}
