* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-drag: none;
}

body {
  cursor: url("../../cursors/default-cursor.png"), auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-family: "Georgia", serif;
  background-color: #f5f5f5;
  color: #333;
  padding: 20px;
  animation: fade 1s;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

html,
body {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  overflow-x: hidden;
}

a,
button {
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
}

#paper-b {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -100;
  opacity: 0.5;
  filter: blur(2px);
  overflow: hidden;
}

#grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.2;
  z-index: 1000;
  filter: blur(1px);
  overflow: hidden;
}

#paper-b,
#grain {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw; /* ✅ clamp width to viewport */
  max-height: 100vh; /* ✅ clamp height to viewport */
  overflow: hidden;
  box-sizing: border-box;
  pointer-events: none;
}

#logo-png {
  width: 6rem;
  z-index: 1001;
  margin-right: -0.5rem;
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
}

#logo-png:hover {
  animation: rotate 1s infinite forwards linear;
}

#logo-png:active {
  cursor: url("../../cursors/clicked-cursor.png");
}

.header-container {
  position: fixed;
  top: 2rem;
  left: 2rem;
  right: 2rem;
  display: flex;
  align-items: center;
  justify-content: start;
  gap: 2rem;
  z-index: 2000;
}

/* Menu Button - Positioned in the top-right corner */
.menu-toggle {
  padding: 1.9rem 2rem 1rem 0;
  background: none;
  color: rgb(48, 48, 48);
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  font-size: 2rem;
  border: none;
  z-index: 2000;
  transition: transform 0.3s ease-in-out;
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
}

.menu-toggle:hover {
  color: white;
}

.menu-toggle:active {
  color: white;
  cursor: url("../../cursors/clicked-cursor.png"), default;
}

#dropdown-title a {
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  font-size: 3.3rem;
  color: #333;
  text-align: center;
  margin-bottom: 2rem;
  margin-top: 2rem;
  transition: transform 0.6s ease-in-out;
  background: none;
  padding: none;
  line-height: 4rem;
}

#dropdown-title a:hover {
  transform: rotate(-2deg);
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
}

#dropdown-title a:active {
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
}

/* Fullscreen overlay when menu is open */
.dropdown-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.197); /* Dark overlay */
  backdrop-filter: blur(7px); /* Blur effect */
  display: none; /* Initially hidden */
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease-in-out;
}

/* Dropdown container */
.dropdown-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: url("../../photos-regular/paper.jpg") no-repeat center center /
    cover;
  position: relative;
  padding: 30px;
  border-radius: 20px;
  width: 95%;
  max-width: 38rem;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 1s ease-in-out;
}

/* Add a crumpled texture effect like the home page */
.dropdown-menu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../../photos-regular/grain.png"); /* Match home-style.css */
  opacity: 0.1;
  z-index: -1;
  border-radius: 20px;
  overflow: hidden;
}

/* Add plant shadow effect */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../../photos-regular/plant-shadow-left.jpg") no-repeat center
    center / cover;
  opacity: 0.3;
  z-index: -1;
  border-radius: 20px;
  overflow: hidden;
}

/* Show dropdown when active */
.dropdown-overlay.active {
  display: flex;
}

/* Animate dropdown entrance */
.dropdown-overlay.active .dropdown-menu {
  animation: slideIn 0.6s ease-out forwards;
}

.dropdown-overlay.closing .dropdown-menu {
  animation: slideOut 0.8s ease-in forwards;
}

@keyframes slideIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Slide Out */
@keyframes slideOut {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* Options styling */
.options a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 15px 20px;
  margin: 1.5rem 5rem 1rem 0;
  text-decoration: none;
  color: #333;
  background-color: white;
  border-radius: 50px;
  transition: background-color 0.3s ease;
  font-size: 1.5rem;
  font-family: "brandon-grotesque", sans-serif;
  font-weight: 400;
  font-style: normal;
}

.options a span {
  margin-left: 4rem;
  margin-right: 4rem;
  text-align: center;
}

.options a img {
  /* Add this */
  width: 2rem; /* Adjust size as needed */
  height: 2rem;
  margin-top: 0.3rem; /* Keeps spacing balanced */
}

.options a:hover {
  background-color: rgba(89, 89, 89, 0.397);
}

.options a:active {
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
}

.container {
  text-align: center;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  justify-content: center;
}

h1 {
  font-size: 3rem;
  color: #333;
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  margin-bottom: 3rem;
  cursor: url("../../cursors/camera-cursor.png"), default;
  line-height: 4rem;
}

.torn-paper {
  position: relative;
  display: inline-block;
  padding: 1rem 5rem 0.5rem 4.3rem;
  background: white;
  font-size: 3rem;
  font-family: "rafaella-shadow", sans-serif;
  font-weight: 700;
  color: #333;
  text-align: center;
  z-index: 1;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  transition: transform 0.6s ease-in-out;
  cursor: url("../../cursors/camera-cursor.png"), default;
}

.torn-paper:hover {
  transform: rotate(-2deg);
}

.torn-paper:active {
  color: white;
  background-color: rgb(0, 0, 0);
  cursor: url("../../cursors/camrecorder-cursor.png"), default;
}

/* Add a subtle crumpled paper texture */
.torn-paper::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("../images/crumpled-paper-texture.jpg"); /* Replace with your actual texture */
  opacity: 0.1;
  z-index: -1;
  pointer-events: none;
}

.portrait-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 30px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 20px;
  scroll-snap-type: x mandatory;
  width: 100%;
  max-width: 100vw; /* max width of viewport */
  transform: translateX(100vw);
  animation: fadeSlideIn 1.5s ease-out forwards;
}

@keyframes fadeSlideIn {
  0% {
    transform: translateX(100vw);
  }
  100% {
    transform: translateY(0);
  }
}

.portrait-item {
  width: 300px;
  height: 420px;
  object-fit: cover;
  border-radius: 10px;
  flex: 0 0 auto;
  box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s, box-shadow 0.3s;
}

.portrait-item:hover {
  transform: scale(1.05);
  box-shadow: none;
}

.portrait-item:active {
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
  transform: scale(1.03);
}

.portrait-grid::-webkit-scrollbar {
  display: none;
}

.header-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 5rem 1rem 5rem;
  background-color: rgb(247, 247, 247);
  border-radius: 10px;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.6s ease-in-out;
  overflow: hidden;
}

.header-right:hover {
  transform: rotate(1deg);
}

.ready-text {
  font-family: "rafaella-shadow", sans-serif;
  font-size: 1.4rem !important;
  color: #333;
  text-align: center;
  line-height: 2rem;
  padding: 0;
}

.top-right-container {
  display: flex;
  gap: 1.3rem;
  align-items: center;
}

.top-right-btn {
  padding: 0.4rem 2rem;
  height: 2.6rem;
  font-size: 0.8rem !important;
  font-family: "brandon-grotesque", sans-serif;
  font-weight: 500;
  border: none;
  border-radius: 50px;
  background-color: #ffffff;
  color: rgb(0, 0, 0);
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
}

.top-right-btn:hover {
  background-color: #555;
  transform: translateY(-2px);
  box-shadow: none;
}

.top-right-btn:active {
  background-color: #222;
  transform: translateY(0);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
}

.arrow-icon {
  width: 55px; /* adjust size as needed */
  height: auto;
  background-color: rgb(247, 247, 247);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.arrow-icon:active {
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.arrow-container {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  gap: 4rem;
  margin-top: 2rem;
  position: relative;
}

.scroll-btn {
  padding: 1rem;
  border: none;
  background-color: transparent;
  cursor: pointer;
  transition: transform 0.2s;
}

.scroll-btn:hover {
  animation: pulse-button 1s infinite linear;
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
  transition: transform 0.5s;
}

.scroll-btn:active {
  animation: pulse-button 0.5s infinite linear;
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
}

@keyframes pulse-button {
  0% {
    transform: translateX(0px);
  }
  10% {
    transform: translateX(1.5px);
  }
  90% {
    transform: translateX(-1px);
  }
  100% {
    transform: translateX(0px);
  }
}

body.pulse-cursor {
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
  animation: pulseCursor 0.6s infinite;
}

@media (max-width: 768px) {
  .portrait-grid {
    flex-direction: column;
    overflow: visible; /* let body handle scroll */
    scroll-snap-type: y mandatory;
  }

  .portrait-item {
    scroll-snap-align: start;
  }

  .scroll-btn {
    display: none; /* hide scroll buttons */
  }
}

.lightbox-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(122, 122, 122, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: 20px;
  transition: backdrop-filter 0.3s ease, background 0.3s ease;
  overflow: hidden;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-img {
  height: 100%;
  object-fit: contain; /* 🖼️ ensures it keeps its natural aspect ratio */
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
  z-index: 9999;
  overflow: hidden;
}

/* Close button */
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 3rem;
  color: white;
  cursor: pointer;
  z-index: 10000;
  transition: transform 0.2s ease;
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
  overflow: hidden;
}

.lightbox-close:hover {
  transform: scale(1.2);
}

.lightbox-close:active {
  cursor: url("../../cursors/clicked-cursor.png"), pointer;
}

.lightbox-loader {
  position: absolute;
  width: 60px;
  height: 60px;
  border: 3px solid rgba(207, 228, 255, 0.4);
  border-top-color: #9ba6d4;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 10000;
  /* center it */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none; /* hidden by default */
}

.lightbox-loader.active {
  display: block;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Optional: fade-in image when loaded */
.lightbox-img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-img.loaded {
  opacity: 1;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Footer Styling */
footer {
  background: none;
  color: #444;
  text-align: center;
  padding: 15px;
  font-family: "brandon-grotesque", sans-serif;
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  cursor: url("../../cursors/pointer-cursor.png"), pointer;
}

.footer-links a {
  text-decoration: none;
  color: #555;
  font-weight: bold;
  transition: color 0.3s;
  padding-top: 2rem;
}

.footer-links a:hover {
  color: black;
}

@keyframes rotate {
  0% {
    transform: rotateZ(0deg);
  }
  100% {
    transform: rotateZ(360deg);
  }
}

@keyframes fallOff {
  0% {
    transform: translateY(0) rotateY(0deg) scale(1); /* Ensure reset */
  }
  50% {
    transform: translateY(-2vh);
  }
  100% {
    transform: translateY(100vh); /* Fall without spin */
  }
}

@keyframes swipeRight {
  0% {
    transform: translateX(0) rotateY(0deg) scale(1); /* Ensure reset */
  }
  50% {
    transform: translateX(-2vw);
  }
  100% {
    transform: translateX(100vw); /* Swipe without spin */
  }
}

/* Apply animations when triggered */
.fall-animation {
  animation: fallOff 1.3s ease-in-out forwards;
  will-change: transform, opacity;
}

.swipe-animation {
  animation: swipeRight 1s ease-in-out forwards;
  will-change: transform, opacity;
}

@media (max-width: 768px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (max-width: 1024px) {
  .dropdown-overlay.active + .header-container {
    visibility: hidden; /* Hide but keep space */
    opacity: 0; /* Make it invisible */
    pointer-events: none; /* Prevent interaction */
  }

  .dropdown-overlay:not(.active) + .header-container {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .close-menu {
    display: inline;
    position: absolute;
    top: 0rem;
    right: 1.9rem;
    font-size: 3rem;
    color: black;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2000;
    font-family: "brandon-grotesque", sans-serif;
    font-weight: 400;
    font-style: normal;
    cursor: url("../../cursors/pointer-cursor.png"), pointer;
    padding: 1rem;
  }

  .close-menu:hover {
    color: white;
  }

  .close-menu:active {
    cursor: url("../../cursors/clicked-cursor.png"), pointer;
  }

  #logo-png {
    margin-right: auto;
    margin-left: 1.5rem;
  }

  .menu-toggle {
    padding: 1.7rem 1.5rem 1rem 0;
  }

  .options a {
    width: 100%;
    margin: none;
  }

  .options a span {
    margin: 0;
  }

  .portfolio-grid {
    display: flex;
    flex-direction: column; /* Stack portfolio items in a column */
    align-items: center;
  }

  .flip-card-back p {
    font-size: 2.2rem;
  }

  .view-project-btn {
    font-size: 1.1rem;
    padding: 0.5rem 2rem 0.5rem 2rem;
  }

  .options a {
    font-size: 1.2rem;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
    margin-top: 0.7rem;
  }

  #dropdown-title a {
    font-size: 2.8rem;
    line-height: 3rem;
    white-space: inherit;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  #logo-png {
    width: 5rem; /* Further reduce logo size only for small screens */
  }

  .menu-toggle {
    font-size: 1.5rem;
    padding: 1rem;
  }
}

@media (max-width: 1024px) {
  /* Ensure the entire page scrolls properly */
  body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    overflow-y: auto;
    padding-bottom: 50px;
  }

  .lightbox-img {
    width: 100%;
    height: auto;
  }

  /* Fix header spacing so it doesn't overlap */
  .header-container {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  /* Ensure the title doesn't get squished */
  h1 {
    font-size: 1.7rem !important;
    text-align: center;
    width: 90%;
    line-height: 8vw;
  }

  /* Fix menu placement */
  .menu-toggle {
    position: relative;
    font-size: 1.5rem;
    padding-right: 1.5rem;
  }

  /* Ensure the container expands naturally */
  .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
  }

  /* Stack portfolio items properly */
  .portfolio-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    overflow: visible;
    padding: 0;
  }

  /* Prevent polaroids from getting squished */
  .portfolio-item {
    width: 60%;
    height: 28rem;
    padding: 0 0 1rem 0;
  }

  .portfolio-caption {
    font-size: 1.4rem;
  }

  .flip-card-front,
  .flip-card-back {
    padding: 2.5rem 0.2rem 2rem 0.2rem;
  }

  /* Ensure footer positions correctly */
  footer {
    position: relative;
    margin-top: 4rem;
    text-align: center;
    margin-bottom: -4rem;
  }
}

@media (min-width: 1025px) {
  .close-menu {
    display: none; /* Hide close button on desktops */
  }

  .header-container {
    display: flex !important; /* Force it to reappear */
    visibility: visible !important;
    opacity: 1 !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  .portrait-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    scroll-snap-type: none !important; /* ✅ fully disable snap */
  }

  .scroll-btn {
    display: none;
  }

  h1.torn-paper {
    font-size: 2rem;
    padding: 1rem 2rem;
  }

  .lightbox-img {
    width: 90%;
    max-height: 80vh;
  }

  .header-right {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translate(-50%, 0); /* ✅ ADD THIS (was missing) */
    width: 95%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 999;
    padding: 0.8rem;
    text-align: center;
    transition: transform 0.3s ease;
  }

  .header-right:hover {
    transform: translate(-50%, 0);
  }

  .header-right.hidden {
    transform: translate(-50%, 100%);
    pointer-events: none;
    transition: transform 0.3s ease;
  }

  .header-right.start-hidden {
    transform: translate(-50%, 100%);
    pointer-events: none;
  }

  .ready-text {
    font-family: "rafaella-shadow", sans-serif;
    font-size: 1.7rem;
    color: #333;
    text-align: center;
  }

  .top-right-btn {
    width: 11rem;
    font-size: 0.9rem;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .header-container {
    justify-content: space-between !important;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
