.header {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 200px;
  color: #d5cf82;
  font-family: "Bungee Shade", sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  padding: 10px;
  letter-spacing: 0.05em;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.The {
  transform: translate(-20%, 15%) rotate(-2deg);
  font-size: 1.8rem;
  color: #e8e4a0;
  margin-bottom: -10px;
}
.React {
  transform: translate(4%, 20%) rotate(1deg);
  font-size: 3rem;
  color: #61dafb;
  margin-bottom: -15px;
}
.And {
  transform: translate(-25%, 0%) rotate(-1deg);
  font-size: 4rem;
  color: #d5cf82;
  margin-bottom: -10px;
}
.Ruby {
  transform: translate(8%, 10%) rotate(2deg);
  font-size: 2.8rem;
  color: #cc0000;
  margin-bottom: -10px;
}
.Developer {
  transform: translate(-2%, 0%) rotate(-1deg);
  font-size: 2.2rem;
  color: #d5cf82;
  margin-top: 10px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* Main container - sets up the 3D space for page flipping */
main {
  overflow-y: hidden;
  overflow-x: hidden;
  width: 100%;
  height: 100vh;
  perspective: 1000px; /* Creates 3D depth - higher values = less dramatic flip effect */
}
/* Page container - holds all pages and manages the flip animation */
[data-controller="home"] {
  transition: all 1.2s cubic-bezier(0.25, 0.1, 0.25, 1); /* Smooth easing for flip animation */
  position: relative;
  z-index: 5;
  width: 100vw;
  height: 100vh;
  display: flex;
  overflow: hidden;
  background: rgb(0, 0, 0);
  transform-style: preserve-3d; /* Critical: enables 3D transforms on child elements */
}
/* Common styles for all pages - they all stack on top of each other */
.home-page,
.about-page,
.contact-page,
.projects-page {
  width: 100vw;
  min-height: 100vh;
  background: rgb(0, 0, 0);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: all 1.2s cubic-bezier(0.25, 0.1, 0.25, 1); /* Same timing as container */
  position: absolute; /* All pages occupy the same space */
  top: 0;
  left: 0;
  backface-visibility: hidden; /* Hides the "back" of pages during rotation */
  transform-origin: left center; /* Pages flip from the left edge like a book */
}

/* Ensure consistent sizing for content sections */
.about-me,
.projects-me,
.contact-me {
  width: 100%;
  max-width: 800px;
  min-height: 600px;
  margin: 0 auto;
}
/* Initial page states - only the first page is visible */
.home-page {
  transform: rotateY(0deg); /* Front-facing (visible) */
  z-index: 1; /* Higher z-index makes it appear on top */
}
.about-page,
.contact-page,
.projects-page {
  transform: rotateY(180deg); /* Back-facing (hidden behind other pages) */
  z-index: 0; /* Lower z-index keeps them behind */
}
/* Shadow effect that appears during page flipping */
[data-controller="home"]::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.3) 0%,
    transparent 50%
  ); /* Shadow on left side */
  pointer-events: none; /* Doesn't interfere with mouse events */
  opacity: 0; /* Hidden by default */
  transition: opacity 1.2s cubic-bezier(0.25, 0.1, 0.25, 1); /* Fades in/out with flip */
  z-index: 10; /* Appears above all pages */
}
/* Shadow becomes visible when flipping class is added by JavaScript */
[data-controller="home"].flipping::before {
  opacity: 1;
}
html,
body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}
.body {
  background: black;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
.author {
  text-align: center;
}
.author-name {
  font-size: 2.5rem;
  color: white;
  font-family: "Bungee Shade", sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  transform: rotate(-1deg);
  text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.8);
}
.author-subtitle {
  font-size: 1.2rem;
  color: #e8e4a0;
  font-family: "Inter", sans-serif;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-align: center;
  margin-top: 10px;
  text-transform: uppercase;
  opacity: 0.9;
}
.about-me {
  color: white;
  text-align: center;
  max-width: 800px;
  min-height: 600px;
  padding: 40px;
  font-size: 1.2rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 2px solid white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.about-me-title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 2rem;
  color: #d5cf82;
  font-family: "Bungee Shade", cursive;
}
.about-me-text {
  font-size: 1.5rem;
  line-height: 1.8;
  color: white;
  font-family: "Inter", sans-serif;
}
/* About me buttons styling */
.about-me-button {
  display: inline-block;
  margin: 10px;
  padding: 12px 24px;
  font-size: 1.1rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  text-decoration: none;
  color: #000;
  background: linear-gradient(135deg, #d5cf82 0%, #e8e4a0 100%);
  border: 2px solid #d5cf82;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 4px 15px rgba(213, 207, 130, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.about-me-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(213, 207, 130, 0.4);
  background: linear-gradient(135deg, #e8e4a0 0%, #f0edb8 100%);
  border-color: #e8e4a0;
  text-decoration: none;
  color: #000;
}
.about-me-button:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(213, 207, 130, 0.5);
}
.about-me-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(213, 207, 130, 0.3);
}
/* Special styling for resume button */
.resume-button {
  background: linear-gradient(135deg, #61dafb 0%, #4fa8d1 100%);
  border-color: #61dafb;
  box-shadow: 0 4px 15px rgba(97, 218, 251, 0.3);
}
.resume-button:hover {
  background: linear-gradient(135deg, #4fa8d1 0%, #3d8bb8 100%);
  border-color: #4fa8d1;
  box-shadow: 0 6px 20px rgba(97, 218, 251, 0.4);
}
.about-me-buttons {
  padding-top: 20px;
}
/* Contact page content styling */
.projects-me-title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 2rem;
  color: #d5cf82;
  font-family: "Bungee Shade", cursive;
}
.projects-me-text {
  font-size: 1.5rem;
  line-height: 1.8;
  color: white;
  font-family: "Inter", sans-serif;
}
.projects-me-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}
/* Enhanced clickability for project link */
.projects-page a {
  text-decoration: none;
  color: inherit;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  display: block;
}

.projects-page a:hover {
  text-decoration: none;
  transform: scale(1.02);
  box-shadow: 0 8px 25px rgba(213, 207, 130, 0.3);
  border-color: #d5cf82;
}

/* Add click indicator to projects section */
.projects-me {
  color: white;
  text-align: center;
  max-width: 800px;
  min-height: 600px;
  padding: 40px;
  font-size: 1.2rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 2px solid white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
}

.projects-me::after {
  content: "Click to visit →";
  position: absolute;
  bottom: 15px;
  right: 20px;
  font-size: 0.9rem;
  color: #d5cf82;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.projects-me:hover::after {
  opacity: 1;
  transform: translateX(5px);
}

/* Hover effects for projects section */
.projects-me:hover {
  border-color: #d5cf82;
  box-shadow: 0 0 20px rgba(213, 207, 130, 0.2);
}
.contact-me {
  color: white;
  text-align: center;
  max-width: 800px;
  min-height: 600px;
  padding: 40px;
  font-size: 1.2rem;
  line-height: 1.6;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  border: 2px solid white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.contact-me-title {
  font-size: 3rem;
  font-weight: bold;
  margin-bottom: 2rem;
  color: #d5cf82;
  font-family: "Bungee Shade", cursive;
}
/* Modern contact form styling */
.contact-form {
  margin-top: 1.5rem;
  text-align: left;
}
.contact-form-item {
  position: relative;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
/* Modern input styling */
.contact-form-item input[type="text"],
.contact-form-item input[type="email"],
.contact-form-item textarea {
  width: 100%;
  padding: 15px 20px;
  font-size: 1.1rem;
  font-family: "Inter", sans-serif;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: white;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
/* Placeholder styling */
.contact-form-item input::placeholder,
.contact-form-item textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-family: "Inter", sans-serif;
}
/* Focus state - modern glow effect */
.contact-form-item input:focus,
.contact-form-item textarea:focus {
  outline: none;
  border-color: #d5cf82;
  box-shadow: 0 0 20px rgba(213, 207, 130, 0.4);
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}
/* Hover state */
.contact-form-item input:hover,
.contact-form-item textarea:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}
/* Textarea specific styling */
.contact-form-item textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
/* Modern submit button */
.contact-form-item input[type="submit"] {
  width: 100%;
  padding: 15px 30px;
  font-size: 1.2rem;
  font-family: "Bungee Shade", sans-serif;
  font-weight: 700;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #d5cf82 0%, #e8e4a0 100%);
  color: #000;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
  box-shadow: 0 4px 15px rgba(213, 207, 130, 0.3);
  text-transform: uppercase;
}
/* Submit button hover and focus states */
.contact-form-item input[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(213, 207, 130, 0.4);
  background: linear-gradient(135deg, #e8e4a0 0%, #f0edb8 100%);
}
.contact-form-item input[type="submit"]:focus {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(213, 207, 130, 0.5);
}
.contact-form-item input[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(213, 207, 130, 0.3);
}
/* Label styling */
.contact-form-item label {
  font-size: 1rem;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  color: #d5cf82;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Form validation styling */
.contact-form-item input:invalid,
.contact-form-item textarea:invalid {
  border-color: rgba(255, 100, 100, 0.5);
}
.contact-form-item input:valid,
.contact-form-item textarea:valid {
  border-color: white;
}
/* Loading state for submit button */
.contact-form-item input[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
/* Responsive adjustments */
@media (max-width: 768px) {
  .contact-form-item input[type="text"],
  .contact-form-item input[type="email"],
  .contact-form-item textarea {
    padding: 12px 16px;
    font-size: 1rem;
  }
  .contact-form-item input[type="submit"] {
    padding: 12px 24px;
    font-size: 1.1rem;
  }
}
/* Mobile Responsive Design */
@media (max-width: 768px) {
  /* Header adjustments for mobile */
  .header {
    font-size: 1.8rem;
    margin-bottom: 100px;
    padding: 5px;
    margin-top: -40px; /* Move header up on mobile */
  }
  .The {
    font-size: 1.4rem;
    transform: translate(-15%, 10%) rotate(-2deg);
  }
  .React {
    font-size: 2.2rem;
    transform: translate(2%, 15%) rotate(1deg);
  }
  .And {
    font-size: 2.8rem;
    transform: translate(-20%, 0%) rotate(-1deg);
  }
  .Ruby {
    font-size: 2rem;
    transform: translate(5%, 8%) rotate(2deg);
  }
  .Developer {
    font-size: 1.6rem;
    transform: translate(-1%, 0%) rotate(-1deg);
  }
  /* About me section mobile adjustments */
  .about-me {
    padding: 4px;
    margin: 1px;
    max-width: 95%;
    min-height: 150px; /* Even smaller height for mobile */
    margin-top: -3px; /* Reduced margin */
  }
  .about-me-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }
  .about-me-text {
    font-size: 0.65rem;
    line-height: 1.1;
    margin-bottom: 0.3rem;
  }
  /* Button container for mobile */
  .about-me-buttons {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    margin-top: 4px;
  }
  .about-me-button {
    width: 100%;
    padding: 5px 8px;
    font-size: 0.55rem;
    margin: 0;
    text-align: center;
  }
  /* Projects section mobile adjustments */
  .projects-me {
    padding: 4px;
    margin: 1px;
    max-width: 95%;
    min-height: 150px; /* Even smaller height for mobile */
    margin-top: -3px; /* Reduced margin */
  }
  .projects-me-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }
  .projects-me-text {
    font-size: 0.65rem;
    line-height: 1.1;
  }
  /* Contact section mobile adjustments */
  .contact-me {
    padding: 4px;
    margin: 1px;
    max-width: 95%;
    min-height: 150px; /* Even smaller height for mobile */
    margin-top: -3px; /* Reduced margin */
  }
  .contact-me-title {
    font-size: 1rem;
    margin-bottom: 0.3rem;
  }
  /* Author section mobile adjustments */
  .author-name {
    font-size: 2rem;
    margin-top: -20px; /* Move author name up on mobile */
  }
  .author-subtitle {
    font-size: 1rem;
    margin-top: 8px;
  }
}
/* Small mobile devices */
@media (max-width: 480px) {
  .header {
    font-size: 1.5rem;
    margin-bottom: 80px;
    margin-top: -60px; /* Move header up more on small mobile devices */
  }
  .The {
    font-size: 1.2rem;
  }
  .React {
    font-size: 1.8rem;
  }
  .And {
    font-size: 2.4rem;
  }
  .Ruby {
    font-size: 1.7rem;
  }
  .Developer {
    font-size: 1.4rem;
  }
  .about-me,
  .projects-me,
  .contact-me {
    padding: 15px;
    margin: 15px;
    min-height: 450px; /* Adjusted for small mobile */
    margin-top: -60px; /* Reduced from -80px to prevent cutoff */
  }
  .about-me-title,
  .projects-me-title,
  .contact-me-title {
    font-size: 1.8rem;
  }
  .about-me-text,
  .projects-me-text {
    font-size: 1.1rem;
  }
  .about-me-button {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  .author-name {
    font-size: 1.5rem;
  }
  .author-subtitle {
    font-size: 0.9rem;
  }
}
/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
  .header {
    margin-bottom: 60px;
  }
  .about-me,
  .projects-me,
  .contact-me {
    max-width: 80%;
    padding: 25px;
    min-height: 550px; /* Adjusted for landscape mobile */
  }
  .about-me-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  .about-me-button {
    width: auto;
    min-width: 120px;
  }
}
/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .about-me-button:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(213, 207, 130, 0.3);
  }
  .about-me-button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(213, 207, 130, 0.3);
  }
  .contact-form-item input[type="submit"]:hover {
    transform: none;
    box-shadow: 0 4px 15px rgba(213, 207, 130, 0.3);
  }
  .contact-form-item input[type="submit"]:active {
    transform: scale(0.98);
    box-shadow: 0 2px 10px rgba(213, 207, 130, 0.3);
  }
}
/* Mobile-specific improvements */
@media (max-width: 768px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Handle mobile viewport height issues */
  .about-page,
  .projects-page,
  .contact-page {
    padding-bottom: 100px; /* Add bottom padding to prevent URL bar cutoff */
  }
  /* Improve touch targets */
  .about-me-button,
  .contact-form-item input[type="submit"] {
    min-height: 44px; /* Apple's recommended minimum touch target size */
  }
  /* Better spacing for mobile */
  .about-me,
  .projects-me,
  .contact-me {
    margin: 15px 10px;
  }
  /* Improve form usability on mobile */
  .contact-form-item input[type="text"],
  .contact-form-item input[type="email"],
  .contact-form-item textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
  }
  /* Better mobile navigation */
  .about-me-buttons {
    margin-top: 25px;
  }

  /* Ensure contact form is fully visible on mobile */
  .contact-form {
    margin-bottom: 40px; /* Add bottom margin to prevent cutoff */
  }

  /* Adjust contact form items for mobile */
  .contact-form-item {
    margin-bottom: 1rem; /* Further reduce margin on mobile */
  }

  /* Ensure submit button doesn't get cut off */
  .contact-form-item input[type="submit"] {
    margin-bottom: 15px;
  }

  /* Compress form inputs on mobile */
  .contact-form-item input[type="text"],
  .contact-form-item input[type="email"],
  .contact-form-item textarea {
    padding: 3px 6px;
    font-size: 0.55rem;
  }

  /* Reduce textarea height on mobile */
  .contact-form-item textarea {
    min-height: 30px;
  }

  /* Smaller form labels on mobile */
  .contact-form-item label {
    font-size: 0.55rem;
    margin-bottom: 1px;
  }

  /* Smaller submit button on mobile */
  .contact-form-item input[type="submit"] {
    padding: 5px 10px;
    font-size: 0.65rem;
  }
}
/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .about-me-button,
  .contact-form-item input[type="submit"] {
    border-width: 1px; /* Thinner borders on high DPI displays */
  }
}
/* Browser compatibility fallbacks */
@supports not (backdrop-filter: blur(10px)) {
  .contact-form-item input[type="text"],
  .contact-form-item input[type="email"],
  .contact-form-item textarea {
    background: rgba(255, 255, 255, 0.15);
  }
}
@supports not (transform-style: preserve-3d) {
  /* Fallback for browsers that don't support 3D transforms */
  [data-controller="home"] {
    perspective: none;
  }
  .home-page,
  .about-page,
  .contact-page,
  .projects-page {
    position: relative;
    transform: none !important;
    backface-visibility: visible;
  }
  /* Simple fade transition for older browsers */
  [data-controller="home"] {
    transition: opacity 0.5s ease;
  }
}
/* Fallback for browsers that don't support CSS Grid */
@supports not (display: grid) {
  .contact-form-item {
    display: block;
  }
  .contact-form-item label {
    display: block;
    margin-bottom: 5px;
  }
}

/* Flash message styling */
.flash-notice,
.flash-alert {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 20px;
  border-radius: 8px;
  font-family: "Inter", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  z-index: 1000;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

.flash-notice {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  border: 2px solid #4CAF50;
}

.flash-alert {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
  color: white;
  border: 2px solid #f44336;
}

@keyframes slideIn {
  from {
    transform: translateX(-50%) translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* Auto-hide flash messages after 5 seconds */
.flash-notice,
.flash-alert {
  animation: slideIn 0.3s ease-out, fadeOut 0.3s ease-in 4.7s forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-100%);
  }
}


@media (min-width: 768px) {
  .scroll-indicator-desktop {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }

  .scroll-indicator-text {
    color: #d5cf82;
    font-family: "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    opacity: 0.4;
    transition: opacity 0.3s ease;
  }

  .scroll-indicator {
    color: #d5cf82;
    z-index: 1000;
    opacity: 0.4;
    transition: opacity 0.3s ease;
    /* Maintain position when hidden */
    visibility: visible;
    height: auto;
    width: auto;
  }

  .scroll-indicator.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

   .scroll-indicator svg {
     width: 80px;
     height: 80px;
     display: block;
   }
 }

 @media (max-width: 768px) {
   .scroll-indicator-mobile {
     position: fixed;
     bottom: 18vh;
     left: 50%;
     transform: translateX(-50%);
     z-index: 1000;
     display: flex;
     flex-direction: row;
     align-items: center;
     gap: 4px;
     padding-top: 10px;
   }

  .scroll-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #d5cf82;
    opacity: 0.3;
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .scroll-indicator-dot.active {
    opacity: 0.8;
    transform: scale(1.2);
  }

  .scroll-indicator-dot:hover {
    opacity: 0.6;
    transform: scale(1.1);
  }

  .page-container {
    flex-direction: column;
  }
}
